From b66a61addb6c8e66cb26fcf74b532d68891267e4 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 23 May 2018 22:23:28 +0200 Subject: Refactored code, many fixes and improvements in chat backend+frontend --- .../sprinkles/core/assets/SiteAssets/css/main.css | 1 - .../sprinkles/core/assets/SiteAssets/js/chat.js | 18 +- .../core/assets/SiteAssets/js/language.js | 36 - .../sprinkles/core/assets/SiteAssets/js/main.js | 18 +- .../core/assets/SiteAssets/js/openpgp.worker.js | 1 - .../php/Chatserver/src/ChatProcessor.php | 27 +- .../core/assets/SiteAssets/php/composer.json | 16 +- .../core/assets/SiteAssets/php/scripts.php | 2 + .../core/assets/SiteAssets/php/stylesheet.php | 2 + .../php/vendor/cboden/ratchet/composer.json | 70 +- .../php/vendor/cboden/ratchet/phpunit.xml.dist | 16 +- .../src/Ratchet/AbstractConnectionDecorator.php | 4 +- .../php/vendor/cboden/ratchet/src/Ratchet/App.php | 37 +- .../ratchet/src/Ratchet/ComponentInterface.php | 6 +- .../ratchet/src/Ratchet/ConnectionInterface.php | 4 +- .../src/Ratchet/Http/CloseResponseTrait.php | 7 +- .../ratchet/src/Ratchet/Http/HttpRequestParser.php | 9 +- .../cboden/ratchet/src/Ratchet/Http/HttpServer.php | 15 +- .../src/Ratchet/Http/HttpServerInterface.php | 11 +- .../src/Ratchet/Http/NoOpHttpServerController.php | 7 +- .../ratchet/src/Ratchet/Http/OriginCheck.php | 9 +- .../cboden/ratchet/src/Ratchet/Http/Router.php | 11 +- .../src/Ratchet/MessageComponentInterface.php | 4 +- .../ratchet/src/Ratchet/MessageInterface.php | 6 +- .../ratchet/src/Ratchet/Server/EchoServer.php | 5 +- .../ratchet/src/Ratchet/Server/FlashPolicy.php | 33 +- .../ratchet/src/Ratchet/Server/IoConnection.php | 5 +- .../cboden/ratchet/src/Ratchet/Server/IoServer.php | 33 +- .../ratchet/src/Ratchet/Server/IpBlackList.php | 7 +- .../Ratchet/Session/Serialize/HandlerInterface.php | 4 +- .../Ratchet/Session/Serialize/PhpBinaryHandler.php | 10 +- .../src/Ratchet/Session/Serialize/PhpHandler.php | 12 +- .../src/Ratchet/Session/SessionProvider.php | 71 +- .../Ratchet/Session/Storage/Proxy/VirtualProxy.php | 7 +- .../Session/Storage/VirtualSessionStorage.php | 27 +- .../cboden/ratchet/src/Ratchet/Wamp/Exception.php | 4 +- .../ratchet/src/Ratchet/Wamp/JsonException.php | 16 +- .../ratchet/src/Ratchet/Wamp/ServerProtocol.php | 39 +- .../cboden/ratchet/src/Ratchet/Wamp/Topic.php | 5 +- .../ratchet/src/Ratchet/Wamp/TopicManager.php | 5 +- .../ratchet/src/Ratchet/Wamp/WampConnection.php | 33 +- .../cboden/ratchet/src/Ratchet/Wamp/WampServer.php | 5 +- .../src/Ratchet/Wamp/WampServerInterface.php | 23 +- .../ratchet/src/Ratchet/WebSocket/ConnContext.php | 5 +- .../Ratchet/WebSocket/MessageCallableInterface.php | 5 +- .../WebSocket/MessageComponentInterface.php | 5 +- .../ratchet/src/Ratchet/WebSocket/WsConnection.php | 9 +- .../ratchet/src/Ratchet/WebSocket/WsServer.php | 52 +- .../src/Ratchet/WebSocket/WsServerInterface.php | 4 +- .../ratchet/tests/autobahn/bin/fuzzingserver.php | 30 +- .../ratchet/tests/autobahn/fuzzingclient-all.json | 52 +- .../tests/autobahn/fuzzingclient-profile.json | 37 +- .../tests/autobahn/fuzzingclient-quick.json | 28 +- .../php/vendor/cboden/ratchet/tests/bootstrap.php | 4 +- .../Ratchet/AbstractMessageComponentTestCase.php | 10 +- .../tests/helpers/Ratchet/Mock/Component.php | 7 +- .../tests/helpers/Ratchet/Mock/Connection.php | 11 +- .../helpers/Ratchet/Mock/ConnectionDecorator.php | 9 +- .../tests/helpers/Ratchet/Mock/WampComponent.php | 5 +- .../tests/helpers/Ratchet/NullComponent.php | 29 +- .../Ratchet/Wamp/Stub/WsWampServerInterface.php | 5 +- .../WebSocket/Stub/WsMessageComponentInterface.php | 5 +- .../tests/unit/AbstractConnectionDecoratorTest.php | 17 +- .../tests/unit/Http/HttpRequestParserTest.php | 16 +- .../ratchet/tests/unit/Http/HttpServerTest.php | 17 +- .../ratchet/tests/unit/Http/OriginCheckTest.php | 5 +- .../cboden/ratchet/tests/unit/Http/RouterTest.php | 25 +- .../ratchet/tests/unit/Server/EchoServerTest.php | 5 +- .../tests/unit/Server/FlashPolicyComponentTest.php | 87 +- .../ratchet/tests/unit/Server/IoConnectionTest.php | 5 +- .../ratchet/tests/unit/Server/IoServerTest.php | 13 +- .../tests/unit/Server/IpBlackListComponentTest.php | 20 +- .../unit/Session/Serialize/PhpHandlerTest.php | 17 +- .../tests/unit/Session/SessionComponentTest.php | 23 +- .../Storage/VirtualSessionStoragePDOTest.php | 7 +- .../ratchet/tests/unit/Wamp/ServerProtocolTest.php | 67 +- .../ratchet/tests/unit/Wamp/TopicManagerTest.php | 52 +- .../cboden/ratchet/tests/unit/Wamp/TopicTest.php | 48 +- .../ratchet/tests/unit/Wamp/WampConnectionTest.php | 18 +- .../ratchet/tests/unit/Wamp/WampServerTest.php | 13 +- .../SiteAssets/php/vendor/composer/ClassLoader.php | 154 +- .../php/vendor/composer/autoload_real.php | 17 +- .../php/vendor/composer/autoload_static.php | 261 +- .../SiteAssets/php/vendor/composer/installed.json | 2246 +++--- .../php/vendor/evenement/evenement/composer.json | 57 +- .../examples/benchmark-emit-no-arguments.php | 9 +- .../evenement/examples/benchmark-emit-once.php | 9 +- .../examples/benchmark-emit-one-argument.php | 9 +- .../evenement/examples/benchmark-emit.php | 9 +- .../examples/benchmark-remove-listener-once.php | 13 +- .../src/Evenement/EventEmitterInterface.php | 9 +- .../evenement/src/Evenement/EventEmitterTrait.php | 40 +- .../tests/Evenement/Tests/EventEmitterTest.php | 168 +- .../evenement/tests/Evenement/Tests/Listener.php | 18 +- .../evenement/tests/Evenement/Tests/functions.php | 3 +- .../php/vendor/guzzlehttp/psr7/composer.json | 78 +- .../vendor/guzzlehttp/psr7/src/AppendStream.php | 82 +- .../vendor/guzzlehttp/psr7/src/BufferStream.php | 59 +- .../vendor/guzzlehttp/psr7/src/CachingStream.php | 33 +- .../vendor/guzzlehttp/psr7/src/DroppingStream.php | 11 +- .../php/vendor/guzzlehttp/psr7/src/FnStream.php | 62 +- .../vendor/guzzlehttp/psr7/src/InflateStream.php | 7 +- .../vendor/guzzlehttp/psr7/src/LazyOpenStream.php | 9 +- .../php/vendor/guzzlehttp/psr7/src/LimitStream.php | 38 +- .../vendor/guzzlehttp/psr7/src/MessageTrait.php | 42 +- .../vendor/guzzlehttp/psr7/src/MultipartStream.php | 37 +- .../vendor/guzzlehttp/psr7/src/NoSeekStream.php | 9 +- .../php/vendor/guzzlehttp/psr7/src/PumpStream.php | 72 +- .../php/vendor/guzzlehttp/psr7/src/Request.php | 40 +- .../php/vendor/guzzlehttp/psr7/src/Response.php | 32 +- .../vendor/guzzlehttp/psr7/src/ServerRequest.php | 97 +- .../php/vendor/guzzlehttp/psr7/src/Stream.php | 113 +- .../guzzlehttp/psr7/src/StreamDecoratorTrait.php | 62 +- .../vendor/guzzlehttp/psr7/src/StreamWrapper.php | 68 +- .../vendor/guzzlehttp/psr7/src/UploadedFile.php | 79 +- .../php/vendor/guzzlehttp/psr7/src/Uri.php | 161 +- .../vendor/guzzlehttp/psr7/src/UriNormalizer.php | 32 +- .../php/vendor/guzzlehttp/psr7/src/UriResolver.php | 34 +- .../php/vendor/guzzlehttp/psr7/src/functions.php | 150 +- .../php/vendor/kriswallsmith/assetic/composer.json | 112 +- .../assetic/src/Assetic/Asset/AssetCache.php | 62 +- .../assetic/src/Assetic/Asset/AssetCollection.php | 99 +- .../src/Assetic/Asset/AssetCollectionInterface.php | 12 +- .../assetic/src/Assetic/Asset/AssetInterface.php | 4 +- .../assetic/src/Assetic/Asset/AssetReference.php | 67 +- .../assetic/src/Assetic/Asset/BaseAsset.php | 67 +- .../assetic/src/Assetic/Asset/FileAsset.php | 21 +- .../assetic/src/Assetic/Asset/GlobAsset.php | 44 +- .../assetic/src/Assetic/Asset/HttpAsset.php | 25 +- .../Iterator/AssetCollectionFilterIterator.php | 25 +- .../Asset/Iterator/AssetCollectionIterator.php | 45 +- .../assetic/src/Assetic/Asset/StringAsset.php | 16 +- .../assetic/src/Assetic/AssetManager.php | 17 +- .../assetic/src/Assetic/AssetWriter.php | 29 +- .../assetic/src/Assetic/Cache/ApcCache.php | 16 +- .../assetic/src/Assetic/Cache/ArrayCache.php | 14 +- .../assetic/src/Assetic/Cache/CacheInterface.php | 2 +- .../assetic/src/Assetic/Cache/ConfigCache.php | 38 +- .../assetic/src/Assetic/Cache/ExpiringCache.php | 27 +- .../assetic/src/Assetic/Cache/FilesystemCache.php | 37 +- .../src/Assetic/Exception/FilterException.php | 21 +- .../Assetic/Extension/Twig/AsseticExtension.php | 22 +- .../Extension/Twig/AsseticFilterFunction.php | 9 +- .../Extension/Twig/AsseticFilterInvoker.php | 21 +- .../Assetic/Extension/Twig/AsseticFilterNode.php | 3 +- .../src/Assetic/Extension/Twig/AsseticNode.php | 76 +- .../Assetic/Extension/Twig/AsseticTokenParser.php | 90 +- .../Assetic/Extension/Twig/TwigFormulaLoader.php | 27 +- .../src/Assetic/Extension/Twig/TwigResource.php | 14 +- .../src/Assetic/Extension/Twig/ValueContainer.php | 26 +- .../assetic/src/Assetic/Factory/AssetFactory.php | 118 +- .../src/Assetic/Factory/LazyAssetManager.php | 65 +- .../Factory/Loader/BasePhpFormulaLoader.php | 44 +- .../Assetic/Factory/Loader/CachedFormulaLoader.php | 14 +- .../Factory/Loader/FunctionCallsFormulaLoader.php | 8 +- .../Resource/CoalescingDirectoryResource.php | 34 +- .../Assetic/Factory/Resource/DirectoryResource.php | 40 +- .../src/Assetic/Factory/Resource/FileResource.php | 12 +- .../Assetic/Factory/Worker/CacheBustingWorker.php | 15 +- .../Assetic/Factory/Worker/EnsureFilterWorker.php | 14 +- .../src/Assetic/Factory/Worker/WorkerInterface.php | 4 +- .../src/Assetic/Filter/AutoprefixerFilter.php | 15 +- .../assetic/src/Assetic/Filter/BaseCssFilter.php | 12 +- .../assetic/src/Assetic/Filter/BaseNodeFilter.php | 12 +- .../src/Assetic/Filter/BaseProcessFilter.php | 11 +- .../assetic/src/Assetic/Filter/CallablesFilter.php | 18 +- .../assetic/src/Assetic/Filter/CleanCssFilter.php | 84 +- .../src/Assetic/Filter/CoffeeScriptFilter.php | 15 +- .../assetic/src/Assetic/Filter/CompassFilter.php | 109 +- .../src/Assetic/Filter/CssCacheBustingFilter.php | 12 +- .../assetic/src/Assetic/Filter/CssEmbedFilter.php | 43 +- .../assetic/src/Assetic/Filter/CssImportFilter.php | 36 +- .../assetic/src/Assetic/Filter/CssMinFilter.php | 23 +- .../src/Assetic/Filter/CssRewriteFilter.php | 30 +- .../assetic/src/Assetic/Filter/DartFilter.php | 21 +- .../Filter/DependencyExtractorInterface.php | 8 +- .../src/Assetic/Filter/EmberPrecompileFilter.php | 11 +- .../src/Assetic/Filter/FilterCollection.php | 26 +- .../Filter/GoogleClosure/BaseCompilerFilter.php | 30 +- .../Filter/GoogleClosure/CompilerApiFilter.php | 53 +- .../Filter/GoogleClosure/CompilerJarFilter.php | 29 +- .../assetic/src/Assetic/Filter/GssFilter.php | 49 +- .../src/Assetic/Filter/HandlebarsFilter.php | 21 +- .../assetic/src/Assetic/Filter/JSMinFilter.php | 6 +- .../assetic/src/Assetic/Filter/JSMinPlusFilter.php | 6 +- .../assetic/src/Assetic/Filter/JSqueezeFilter.php | 30 +- .../assetic/src/Assetic/Filter/JpegoptimFilter.php | 19 +- .../assetic/src/Assetic/Filter/JpegtranFilter.php | 23 +- .../assetic/src/Assetic/Filter/LessFilter.php | 35 +- .../assetic/src/Assetic/Filter/LessphpFilter.php | 46 +- .../Assetic/Filter/MinifyCssCompressorFilter.php | 6 +- .../assetic/src/Assetic/Filter/OptiPngFilter.php | 14 +- .../assetic/src/Assetic/Filter/PackagerFilter.php | 26 +- .../assetic/src/Assetic/Filter/PackerFilter.php | 23 +- .../src/Assetic/Filter/PhpCssEmbedFilter.php | 12 +- .../assetic/src/Assetic/Filter/PngoutFilter.php | 61 +- .../assetic/src/Assetic/Filter/ReactJsxFilter.php | 16 +- .../assetic/src/Assetic/Filter/RooleFilter.php | 16 +- .../src/Assetic/Filter/Sass/BaseSassFilter.php | 28 +- .../assetic/src/Assetic/Filter/Sass/SassFilter.php | 52 +- .../assetic/src/Assetic/Filter/Sass/ScssFilter.php | 5 +- .../assetic/src/Assetic/Filter/SassphpFilter.php | 23 +- .../assetic/src/Assetic/Filter/ScssphpFilter.php | 39 +- .../assetic/src/Assetic/Filter/SeparatorFilter.php | 9 +- .../assetic/src/Assetic/Filter/SprocketsFilter.php | 35 +- .../assetic/src/Assetic/Filter/StylusFilter.php | 24 +- .../src/Assetic/Filter/TypeScriptFilter.php | 11 +- .../assetic/src/Assetic/Filter/UglifyCssFilter.php | 20 +- .../assetic/src/Assetic/Filter/UglifyJs2Filter.php | 38 +- .../assetic/src/Assetic/Filter/UglifyJsFilter.php | 34 +- .../Assetic/Filter/Yui/BaseCompressorFilter.php | 30 +- .../src/Assetic/Filter/Yui/CssCompressorFilter.php | 3 +- .../src/Assetic/Filter/Yui/JsCompressorFilter.php | 12 +- .../assetic/src/Assetic/FilterManager.php | 15 +- .../assetic/src/Assetic/Util/CssUtils.php | 45 +- .../assetic/src/Assetic/Util/FilesystemUtils.php | 16 +- .../assetic/src/Assetic/Util/LessUtils.php | 4 +- .../assetic/src/Assetic/Util/TraversableString.php | 14 +- .../assetic/src/Assetic/Util/VarUtils.php | 19 +- .../vendor/kriswallsmith/assetic/src/functions.php | 31 +- .../vendor/lmammino/jsmin4assetic/composer.json | 50 +- .../vendor/lmammino/jsmin4assetic/src/JSMin.php | 604 +- .../src/JSMinUnterminatedCommentException.php | 3 +- .../src/JSMinUnterminatedRegExpException.php | 3 +- .../src/JSMinUnterminatedStringException.php | 3 +- .../php/vendor/matthiasmullie/minify/bin/minifycss | 3 +- .../php/vendor/matthiasmullie/minify/bin/minifyjs | 3 +- .../php/vendor/matthiasmullie/minify/composer.json | 78 +- .../php/vendor/matthiasmullie/minify/src/CSS.php | 103 +- .../vendor/matthiasmullie/minify/src/Exception.php | 1 + .../minify/src/Exceptions/BasicException.php | 1 + .../minify/src/Exceptions/FileImportException.php | 1 + .../minify/src/Exceptions/IOException.php | 1 + .../php/vendor/matthiasmullie/minify/src/JS.php | 94 +- .../vendor/matthiasmullie/minify/src/Minify.php | 88 +- .../matthiasmullie/path-converter/composer.json | 55 +- .../path-converter/src/Converter.php | 25 +- .../path-converter/src/NoConverter.php | 3 +- .../php/vendor/natxet/CssMin/composer.json | 53 +- .../php/vendor/natxet/CssMin/src/CssMin.php | 8377 ++++++++++---------- .../vendor/nubs/random-name-generator/build.php | 2 +- .../nubs/random-name-generator/composer.json | 59 +- .../src/AbstractGenerator.php | 4 +- .../vendor/nubs/random-name-generator/src/All.php | 13 +- .../random-name-generator/src/Alliteration.php | 12 +- .../nubs/random-name-generator/src/Generator.php | 1 + .../vendor/nubs/random-name-generator/src/Vgng.php | 27 +- .../nubs/random-name-generator/tests/AllTest.php | 10 +- .../tests/AlliterationTest.php | 10 +- .../nubs/random-name-generator/tests/VgngTest.php | 10 +- .../vendor/paragonie/random_compat/composer.json | 18 +- .../random_compat/lib/byte_safe_strings.php | 28 +- .../paragonie/random_compat/lib/cast_to_int.php | 25 +- .../paragonie/random_compat/lib/error_polyfill.php | 20 +- .../vendor/paragonie/random_compat/lib/random.php | 29 +- .../random_compat/lib/random_bytes_com_dotnet.php | 15 +- .../random_compat/lib/random_bytes_dev_urandom.php | 21 +- .../random_compat/lib/random_bytes_libsodium.php | 15 +- .../lib/random_bytes_libsodium_legacy.php | 17 +- .../random_compat/lib/random_bytes_mcrypt.php | 15 +- .../paragonie/random_compat/lib/random_int.php | 7 +- .../paragonie/random_compat/other/build_phar.php | 30 +- .../php/vendor/paragonie/random_compat/psalm.xml | 20 +- .../php/vendor/psr/http-message/composer.json | 53 +- .../psr/http-message/src/RequestInterface.php | 2 +- .../http-message/src/ServerRequestInterface.php | 2 +- .../psr/http-message/src/StreamInterface.php | 2 +- .../psr/http-message/src/UploadedFileInterface.php | 8 +- .../vendor/psr/http-message/src/UriInterface.php | 3 +- .../php/vendor/ratchet/rfc6455/composer.json | 64 +- .../php/vendor/ratchet/rfc6455/phpunit.xml.dist | 2 +- .../rfc6455/src/Handshake/ClientNegotiator.php | 17 +- .../rfc6455/src/Handshake/NegotiatorInterface.php | 5 +- .../rfc6455/src/Handshake/RequestVerifier.php | 17 +- .../rfc6455/src/Handshake/ResponseVerifier.php | 11 +- .../rfc6455/src/Handshake/ServerNegotiator.php | 57 +- .../rfc6455/src/Messaging/CloseFrameChecker.php | 4 +- .../rfc6455/src/Messaging/DataInterface.php | 4 +- .../vendor/ratchet/rfc6455/src/Messaging/Frame.php | 102 +- .../rfc6455/src/Messaging/FrameInterface.php | 4 +- .../ratchet/rfc6455/src/Messaging/Message.php | 6 +- .../rfc6455/src/Messaging/MessageBuffer.php | 39 +- .../rfc6455/src/Messaging/MessageInterface.php | 4 +- .../vendor/ratchet/rfc6455/tests/AbResultsTest.php | 4 +- .../ratchet/rfc6455/tests/ab/clientRunner.php | 39 +- .../ratchet/rfc6455/tests/ab/fuzzingclient.json | 32 +- .../ratchet/rfc6455/tests/ab/fuzzingserver.json | 22 +- .../ratchet/rfc6455/tests/ab/startServer.php | 11 +- .../tests/unit/Handshake/RequestVerifierTest.php | 134 +- .../tests/unit/Handshake/ResponseVerifierTest.php | 15 +- .../tests/unit/Handshake/ServerNegotiatorTest.php | 4 +- .../rfc6455/tests/unit/Messaging/FrameTest.php | 101 +- .../tests/unit/Messaging/MessageBufferTest.php | 6 +- .../rfc6455/tests/unit/Messaging/MessageTest.php | 23 +- .../php/vendor/react/cache/composer.json | 41 +- .../php/vendor/react/cache/src/ArrayCache.php | 9 +- .../vendor/react/cache/tests/ArrayCacheTest.php | 12 +- .../php/vendor/react/cache/tests/CallableStub.php | 3 +- .../php/vendor/react/cache/tests/TestCase.php | 12 +- .../SiteAssets/php/vendor/react/dns/composer.json | 51 +- .../php/vendor/react/dns/examples/03-cached.php | 6 +- .../react/dns/examples/04-query-a-and-aaaa.php | 2 +- .../php/vendor/react/dns/src/Config/Config.php | 15 +- .../react/dns/src/Config/FilesystemFactory.php | 12 +- .../php/vendor/react/dns/src/Config/HostsFile.php | 33 +- .../php/vendor/react/dns/src/Model/HeaderBag.php | 44 +- .../php/vendor/react/dns/src/Model/Message.php | 21 +- .../php/vendor/react/dns/src/Model/Record.php | 13 +- .../vendor/react/dns/src/Protocol/BinaryDumper.php | 11 +- .../php/vendor/react/dns/src/Protocol/Parser.php | 50 +- .../vendor/react/dns/src/Query/CachedExecutor.php | 12 +- .../php/vendor/react/dns/src/Query/Executor.php | 30 +- .../react/dns/src/Query/HostsFileExecutor.php | 27 +- .../php/vendor/react/dns/src/Query/Query.php | 3 +- .../php/vendor/react/dns/src/Query/RecordBag.php | 6 +- .../php/vendor/react/dns/src/Query/RecordCache.php | 23 +- .../vendor/react/dns/src/Query/RetryExecutor.php | 13 +- .../vendor/react/dns/src/Query/TimeoutExecutor.php | 8 +- .../php/vendor/react/dns/src/Resolver/Factory.php | 27 +- .../php/vendor/react/dns/src/Resolver/Resolver.php | 24 +- .../php/vendor/react/dns/tests/CallableStub.php | 3 +- .../vendor/react/dns/tests/Config/ConfigTest.php | 45 +- .../dns/tests/Config/FilesystemFactoryTest.php | 14 +- .../react/dns/tests/Config/HostsFileTest.php | 65 +- .../react/dns/tests/FunctionalResolverTest.php | 22 +- .../vendor/react/dns/tests/Model/MessageTest.php | 6 +- .../react/dns/tests/Protocol/BinaryDumperTest.php | 13 +- .../vendor/react/dns/tests/Protocol/ParserTest.php | 49 +- .../react/dns/tests/Query/CachedExecutorTest.php | 23 +- .../vendor/react/dns/tests/Query/ExecutorTest.php | 63 +- .../dns/tests/Query/HostsFileExecutorTest.php | 42 +- .../vendor/react/dns/tests/Query/RecordBagTest.php | 27 +- .../react/dns/tests/Query/RecordCacheTest.php | 50 +- .../react/dns/tests/Query/RetryExecutorTest.php | 53 +- .../react/dns/tests/Query/TimeoutExecutorTest.php | 15 +- .../react/dns/tests/Resolver/FactoryTest.php | 48 +- .../dns/tests/Resolver/ResolveAliasesTest.php | 11 +- .../react/dns/tests/Resolver/ResolverTest.php | 18 +- .../php/vendor/react/dns/tests/TestCase.php | 43 +- .../php/vendor/react/event-loop/composer.json | 39 +- .../react/event-loop/examples/11-consume-stdin.php | 4 +- .../react/event-loop/examples/12-generate-yes.php | 4 +- .../examples/13-http-client-blocking.php | 2 +- .../event-loop/examples/14-http-client-async.php | 8 +- .../react/event-loop/examples/21-http-server.php | 4 +- .../event-loop/examples/91-benchmark-ticks.php | 3 +- .../event-loop/examples/92-benchmark-timers.php | 3 +- .../event-loop/examples/95-benchmark-memory.php | 4 +- .../php/vendor/react/event-loop/src/ExtEvLoop.php | 57 +- .../vendor/react/event-loop/src/ExtEventLoop.php | 70 +- .../vendor/react/event-loop/src/ExtLibevLoop.php | 63 +- .../react/event-loop/src/ExtLibeventLoop.php | 70 +- .../php/vendor/react/event-loop/src/Factory.php | 11 +- .../vendor/react/event-loop/src/LoopInterface.php | 8 +- .../vendor/react/event-loop/src/SignalsHandler.php | 17 +- .../react/event-loop/src/StreamSelectLoop.php | 93 +- .../react/event-loop/src/Tick/FutureTickQueue.php | 12 +- .../vendor/react/event-loop/src/Timer/Timer.php | 22 +- .../vendor/react/event-loop/src/Timer/Timers.php | 33 +- .../react/event-loop/tests/AbstractLoopTest.php | 176 +- .../vendor/react/event-loop/tests/CallableStub.php | 3 +- .../react/event-loop/tests/ExtEvLoopTest.php | 3 +- .../react/event-loop/tests/ExtEventLoopTest.php | 26 +- .../react/event-loop/tests/ExtLibevLoopTest.php | 6 +- .../react/event-loop/tests/ExtLibeventLoopTest.php | 12 +- .../react/event-loop/tests/SignalsHandlerTest.php | 3 +- .../event-loop/tests/StreamSelectLoopTest.php | 46 +- .../php/vendor/react/event-loop/tests/TestCase.php | 15 +- .../event-loop/tests/Timer/AbstractTimerTest.php | 32 +- .../event-loop/tests/Timer/ExtEvTimerTest.php | 3 +- .../event-loop/tests/Timer/ExtEventTimerTest.php | 3 +- .../event-loop/tests/Timer/ExtLibevTimerTest.php | 3 +- .../tests/Timer/ExtLibeventTimerTest.php | 3 +- .../tests/Timer/StreamSelectTimerTest.php | 3 +- .../react/event-loop/tests/Timer/TimersTest.php | 5 +- .../php/vendor/react/promise-timer/composer.json | 61 +- .../react/promise-timer/src/TimeoutException.php | 6 +- .../vendor/react/promise-timer/src/functions.php | 19 +- .../react/promise-timer/tests/CallableStub.php | 3 +- .../promise-timer/tests/FunctionRejectTest.php | 15 +- .../promise-timer/tests/FunctionResolveTest.php | 21 +- .../promise-timer/tests/FunctionTimeoutTest.php | 75 +- .../vendor/react/promise-timer/tests/TestCase.php | 21 +- .../promise-timer/tests/TimeoutExceptionTest.php | 3 +- .../php/vendor/react/promise/composer.json | 55 +- .../vendor/react/promise/src/CancellationQueue.php | 15 +- .../php/vendor/react/promise/src/Deferred.php | 24 +- .../react/promise/src/ExtendedPromiseInterface.php | 2 +- .../vendor/react/promise/src/FulfilledPromise.php | 25 +- .../php/vendor/react/promise/src/LazyPromise.php | 26 +- .../php/vendor/react/promise/src/Promise.php | 73 +- .../vendor/react/promise/src/PromiseInterface.php | 2 +- .../vendor/react/promise/src/RejectedPromise.php | 29 +- .../promise/src/UnhandledRejectionException.php | 9 +- .../php/vendor/react/promise/src/functions.php | 47 +- .../vendor/react/promise/src/functions_include.php | 2 +- .../react/promise/tests/CancellationQueueTest.php | 21 +- .../vendor/react/promise/tests/DeferredTest.php | 12 +- .../react/promise/tests/FulfilledPromiseTest.php | 12 +- .../vendor/react/promise/tests/FunctionAllTest.php | 28 +- .../vendor/react/promise/tests/FunctionAnyTest.php | 51 +- .../promise/tests/FunctionCheckTypehintTest.php | 58 +- .../vendor/react/promise/tests/FunctionMapTest.php | 41 +- .../react/promise/tests/FunctionRaceTest.php | 46 +- .../react/promise/tests/FunctionReduceTest.php | 71 +- .../react/promise/tests/FunctionRejectTest.php | 9 +- .../react/promise/tests/FunctionResolveTest.php | 36 +- .../react/promise/tests/FunctionSomeTest.php | 61 +- .../vendor/react/promise/tests/LazyPromiseTest.php | 28 +- .../PromiseAdapter/CallbackPromiseAdapter.php | 18 +- .../PromiseAdapter/PromiseAdapterInterface.php | 4 + .../php/vendor/react/promise/tests/PromiseTest.php | 24 +- .../promise/tests/PromiseTest/CancelTestTrait.php | 50 +- .../promise/tests/PromiseTest/NotifyTestTrait.php | 45 +- .../PromiseTest/PromiseFulfilledTestTrait.php | 65 +- .../tests/PromiseTest/PromisePendingTestTrait.php | 30 +- .../tests/PromiseTest/PromiseRejectedTestTrait.php | 111 +- .../tests/PromiseTest/PromiseSettledTestTrait.php | 37 +- .../promise/tests/PromiseTest/RejectTestTrait.php | 92 +- .../promise/tests/PromiseTest/ResolveTestTrait.php | 56 +- .../react/promise/tests/RejectedPromiseTest.php | 12 +- .../react/promise/tests/Stub/CallableStub.php | 3 +- .../php/vendor/react/promise/tests/TestCase.php | 12 +- .../php/vendor/react/promise/tests/bootstrap.php | 4 +- .../tests/fixtures/SimpleFulfilledTestPromise.php | 3 +- .../tests/fixtures/SimpleFulfilledTestThenable.php | 3 +- .../tests/fixtures/SimpleRejectedTestPromise.php | 3 +- .../tests/fixtures/SimpleTestCancellable.php | 7 +- .../fixtures/SimpleTestCancellableThenable.php | 10 +- .../php/vendor/react/socket/composer.json | 58 +- .../react/socket/examples/02-chat-server.php | 2 +- .../react/socket/examples/11-http-client.php | 2 +- .../react/socket/examples/22-http-client.php | 2 +- .../react/socket/examples/91-benchmark-server.php | 4 +- .../socket/examples/99-generate-self-signed.php | 4 +- .../php/vendor/react/socket/src/Connection.php | 63 +- .../php/vendor/react/socket/src/Connector.php | 34 +- .../php/vendor/react/socket/src/DnsConnector.php | 15 +- .../vendor/react/socket/src/FixedUriConnector.php | 6 +- .../php/vendor/react/socket/src/LimitingServer.php | 49 +- .../vendor/react/socket/src/SecureConnector.php | 12 +- .../php/vendor/react/socket/src/SecureServer.php | 24 +- .../php/vendor/react/socket/src/Server.php | 17 +- .../vendor/react/socket/src/StreamEncryption.php | 30 +- .../php/vendor/react/socket/src/TcpConnector.php | 19 +- .../php/vendor/react/socket/src/TcpServer.php | 42 +- .../vendor/react/socket/src/TimeoutConnector.php | 6 +- .../php/vendor/react/socket/src/UnixConnector.php | 12 +- .../php/vendor/react/socket/src/UnixServer.php | 42 +- .../vendor/react/socket/tests/ConnectionTest.php | 10 +- .../vendor/react/socket/tests/ConnectorTest.php | 63 +- .../vendor/react/socket/tests/DnsConnectorTest.php | 41 +- .../react/socket/tests/FixedUriConnectorTest.php | 3 +- .../react/socket/tests/FunctionalConnectorTest.php | 3 +- .../socket/tests/FunctionalSecureServerTest.php | 90 +- .../react/socket/tests/FunctionalTcpServerTest.php | 69 +- .../vendor/react/socket/tests/IntegrationTest.php | 30 +- .../react/socket/tests/LimitingServerTest.php | 45 +- .../react/socket/tests/SecureConnectorTest.php | 31 +- .../react/socket/tests/SecureIntegrationTest.php | 41 +- .../vendor/react/socket/tests/SecureServerTest.php | 26 +- .../php/vendor/react/socket/tests/ServerTest.php | 37 +- .../react/socket/tests/Stub/CallableStub.php | 3 +- .../react/socket/tests/Stub/ConnectionStub.php | 36 +- .../vendor/react/socket/tests/Stub/ServerStub.php | 6 +- .../vendor/react/socket/tests/TcpConnectorTest.php | 54 +- .../vendor/react/socket/tests/TcpServerTest.php | 94 +- .../php/vendor/react/socket/tests/TestCase.php | 23 +- .../react/socket/tests/TimeoutConnectorTest.php | 26 +- .../react/socket/tests/UnixConnectorTest.php | 22 +- .../vendor/react/socket/tests/UnixServerTest.php | 80 +- .../php/vendor/react/stream/composer.json | 53 +- .../stream/examples/91-benchmark-throughput.php | 10 +- .../vendor/react/stream/src/CompositeStream.php | 31 +- .../react/stream/src/DuplexResourceStream.php | 79 +- .../react/stream/src/ReadableResourceStream.php | 50 +- .../php/vendor/react/stream/src/ThroughStream.php | 79 +- .../php/vendor/react/stream/src/Util.php | 10 +- .../react/stream/src/WritableResourceStream.php | 56 +- .../react/stream/src/WritableStreamInterface.php | 2 +- .../php/vendor/react/stream/tests/CallableStub.php | 3 +- .../react/stream/tests/CompositeStreamTest.php | 70 +- .../tests/DuplexResourceStreamIntegrationTest.php | 64 +- .../stream/tests/DuplexResourceStreamTest.php | 106 +- .../react/stream/tests/EnforceBlockingWrapper.php | 22 +- .../react/stream/tests/FunctionalInternetTest.php | 19 +- .../stream/tests/ReadableResourceStreamTest.php | 78 +- .../react/stream/tests/Stub/ReadableStreamStub.php | 36 +- .../php/vendor/react/stream/tests/TestCase.php | 15 +- .../react/stream/tests/ThroughStreamTest.php | 74 +- .../php/vendor/react/stream/tests/UtilTest.php | 74 +- .../stream/tests/WritableStreamResourceTest.php | 108 +- .../symfony/http-foundation/AcceptHeader.php | 40 +- .../symfony/http-foundation/AcceptHeaderItem.php | 61 +- .../symfony/http-foundation/ApacheRequest.php | 8 +- .../symfony/http-foundation/BinaryFileResponse.php | 126 +- .../php/vendor/symfony/http-foundation/Cookie.php | 114 +- .../http-foundation/ExpressionRequestMatcher.php | 20 +- .../File/Exception/AccessDeniedException.php | 3 +- .../File/Exception/FileNotFoundException.php | 3 +- .../File/Exception/UnexpectedTypeException.php | 3 +- .../vendor/symfony/http-foundation/File/File.php | 34 +- .../File/MimeType/ExtensionGuesser.php | 18 +- .../File/MimeType/FileBinaryMimeTypeGuesser.php | 9 +- .../File/MimeType/FileinfoMimeTypeGuesser.php | 9 +- .../File/MimeType/MimeTypeExtensionGuesser.php | 5 +- .../File/MimeType/MimeTypeGuesser.php | 23 +- .../vendor/symfony/http-foundation/File/Stream.php | 5 +- .../symfony/http-foundation/File/UploadedFile.php | 67 +- .../php/vendor/symfony/http-foundation/FileBag.php | 20 +- .../vendor/symfony/http-foundation/HeaderBag.php | 102 +- .../php/vendor/symfony/http-foundation/IpUtils.php | 50 +- .../symfony/http-foundation/JsonResponse.php | 57 +- .../symfony/http-foundation/ParameterBag.php | 83 +- .../symfony/http-foundation/RedirectResponse.php | 24 +- .../php/vendor/symfony/http-foundation/Request.php | 581 +- .../symfony/http-foundation/RequestMatcher.php | 63 +- .../symfony/http-foundation/RequestStack.php | 17 +- .../vendor/symfony/http-foundation/Response.php | 279 +- .../symfony/http-foundation/ResponseHeaderBag.php | 76 +- .../vendor/symfony/http-foundation/ServerBag.php | 24 +- .../Session/Attribute/AttributeBag.php | 44 +- .../Session/Attribute/AttributeBagInterface.php | 8 +- .../Session/Attribute/NamespacedAttributeBag.php | 45 +- .../Session/Flash/AutoExpireFlashBag.php | 49 +- .../http-foundation/Session/Flash/FlashBag.php | 47 +- .../Session/Flash/FlashBagInterface.php | 8 +- .../symfony/http-foundation/Session/Session.php | 90 +- .../http-foundation/Session/SessionBagProxy.php | 23 +- .../http-foundation/Session/SessionInterface.php | 16 +- .../Storage/Handler/AbstractSessionHandler.php | 41 +- .../Storage/Handler/MemcacheSessionHandler.php | 42 +- .../Storage/Handler/MemcachedSessionHandler.php | 42 +- .../Storage/Handler/MongoDbSessionHandler.php | 60 +- .../Storage/Handler/NativeFileSessionHandler.php | 7 +- .../Storage/Handler/NativeSessionHandler.php | 5 +- .../Session/Storage/Handler/NullSessionHandler.php | 33 +- .../Session/Storage/Handler/PdoSessionHandler.php | 165 +- .../Storage/Handler/StrictSessionHandler.php | 31 +- .../Storage/Handler/WriteCheckSessionHandler.php | 23 +- .../Session/Storage/MetadataBag.php | 39 +- .../Session/Storage/MockArraySessionStorage.php | 75 +- .../Session/Storage/MockFileSessionStorage.php | 41 +- .../Session/Storage/NativeSessionStorage.php | 102 +- .../Session/Storage/PhpBridgeSessionStorage.php | 15 +- .../Session/Storage/Proxy/AbstractProxy.php | 26 +- .../Session/Storage/Proxy/NativeProxy.php | 10 +- .../Session/Storage/Proxy/SessionHandlerProxy.php | 36 +- .../Session/Storage/SessionStorageInterface.php | 6 +- .../symfony/http-foundation/StreamedResponse.php | 47 +- .../http-foundation/Tests/AcceptHeaderItemTest.php | 23 +- .../http-foundation/Tests/AcceptHeaderTest.php | 35 +- .../http-foundation/Tests/ApacheRequestTest.php | 6 +- .../Tests/BinaryFileResponseTest.php | 126 +- .../symfony/http-foundation/Tests/CookieTest.php | 100 +- .../Tests/ExpressionRequestMatcherTest.php | 28 +- .../http-foundation/Tests/File/FakeFile.php | 19 +- .../http-foundation/Tests/File/FileTest.php | 78 +- .../Tests/File/MimeType/MimeTypeTest.php | 40 +- .../Tests/File/UploadedFileTest.php | 160 +- .../symfony/http-foundation/Tests/FileBagTest.php | 43 +- .../http-foundation/Tests/HeaderBagTest.php | 69 +- .../symfony/http-foundation/Tests/IpUtilsTest.php | 69 +- .../http-foundation/Tests/JsonResponseTest.php | 98 +- .../http-foundation/Tests/ParameterBagTest.php | 58 +- .../http-foundation/Tests/RedirectResponseTest.php | 31 +- .../http-foundation/Tests/RequestMatcherTest.php | 59 +- .../http-foundation/Tests/RequestStackTest.php | 9 +- .../symfony/http-foundation/Tests/RequestTest.php | 545 +- .../Tests/ResponseHeaderBagTest.php | 99 +- .../symfony/http-foundation/Tests/ResponseTest.php | 269 +- .../http-foundation/Tests/ResponseTestCase.php | 11 +- .../http-foundation/Tests/ServerBagTest.php | 60 +- .../Tests/Session/Attribute/AttributeBagTest.php | 68 +- .../Attribute/NamespacedAttributeBagTest.php | 79 +- .../Tests/Session/Flash/AutoExpireFlashBagTest.php | 59 +- .../Tests/Session/Flash/FlashBagTest.php | 44 +- .../http-foundation/Tests/Session/SessionTest.php | 80 +- .../Storage/Handler/AbstractSessionHandlerTest.php | 20 +- .../Session/Storage/Handler/Fixtures/common.inc | 54 +- .../Storage/Handler/Fixtures/empty_destroys.php | 4 +- .../Session/Storage/Handler/Fixtures/read_only.php | 4 +- .../Storage/Handler/Fixtures/regenerate.php | 10 +- .../Session/Storage/Handler/Fixtures/storage.php | 6 +- .../Storage/Handler/Fixtures/with_cookie.php | 4 +- .../Handler/Fixtures/with_cookie_and_session.php | 4 +- .../Storage/Handler/MemcacheSessionHandlerTest.php | 60 +- .../Handler/MemcachedSessionHandlerTest.php | 60 +- .../Storage/Handler/MongoDbSessionHandlerTest.php | 59 +- .../Handler/NativeFileSessionHandlerTest.php | 15 +- .../Storage/Handler/NativeSessionHandlerTest.php | 3 +- .../Storage/Handler/NullSessionHandlerTest.php | 12 +- .../Storage/Handler/PdoSessionHandlerTest.php | 96 +- .../Storage/Handler/StrictSessionHandlerTest.php | 67 +- .../Handler/WriteCheckSessionHandlerTest.php | 30 +- .../Tests/Session/Storage/MetadataBagTest.php | 35 +- .../Storage/MockArraySessionStorageTest.php | 39 +- .../Session/Storage/MockFileSessionStorageTest.php | 37 +- .../Session/Storage/NativeSessionStorageTest.php | 79 +- .../Storage/PhpBridgeSessionStorageTest.php | 21 +- .../Session/Storage/Proxy/AbstractProxyTest.php | 32 +- .../Session/Storage/Proxy/NativeProxyTest.php | 6 +- .../Storage/Proxy/SessionHandlerProxyTest.php | 42 +- .../http-foundation/Tests/StreamedResponseTest.php | 76 +- .../Tests/schema/http-status-codes.rng | 58 +- .../http-foundation/Tests/schema/iana-registry.rng | 478 +- .../vendor/symfony/http-foundation/composer.json | 68 +- .../symfony/http-foundation/phpunit.xml.dist | 2 +- .../vendor/symfony/polyfill-mbstring/Mbstring.php | 303 +- .../Resources/unidata/lowerCase.php | 2186 ++--- .../Resources/unidata/upperCase.php | 2202 ++--- .../vendor/symfony/polyfill-mbstring/bootstrap.php | 184 +- .../vendor/symfony/polyfill-mbstring/composer.json | 68 +- .../php/vendor/symfony/polyfill-php70/Php70.php | 20 +- .../vendor/symfony/polyfill-php70/bootstrap.php | 12 +- .../vendor/symfony/polyfill-php70/composer.json | 67 +- .../process/Exception/ProcessFailedException.php | 8 +- .../process/Exception/ProcessTimedOutException.php | 15 +- .../vendor/symfony/process/ExecutableFinder.php | 17 +- .../php/vendor/symfony/process/InputStream.php | 27 +- .../vendor/symfony/process/PhpExecutableFinder.php | 25 +- .../php/vendor/symfony/process/PhpProcess.php | 31 +- .../vendor/symfony/process/Pipes/AbstractPipes.php | 47 +- .../symfony/process/Pipes/PipesInterface.php | 4 +- .../php/vendor/symfony/process/Pipes/UnixPipes.php | 33 +- .../vendor/symfony/process/Pipes/WindowsPipes.php | 41 +- .../php/vendor/symfony/process/Process.php | 481 +- .../php/vendor/symfony/process/ProcessBuilder.php | 63 +- .../php/vendor/symfony/process/ProcessUtils.php | 32 +- .../symfony/process/Tests/ExecutableFinderTest.php | 39 +- .../symfony/process/Tests/NonStopableProcess.php | 11 +- .../process/Tests/PhpExecutableFinderTest.php | 19 +- .../symfony/process/Tests/PhpProcessTest.php | 8 +- .../Tests/PipeStdinInStdoutStdErrStreamSelect.php | 28 +- .../symfony/process/Tests/ProcessBuilderTest.php | 57 +- .../process/Tests/ProcessFailedExceptionTest.php | 19 +- .../vendor/symfony/process/Tests/ProcessTest.php | 476 +- .../symfony/process/Tests/ProcessUtilsTest.php | 6 +- .../symfony/process/Tests/SignalListener.php | 5 +- .../php/vendor/symfony/process/composer.json | 58 +- .../php/vendor/symfony/process/phpunit.xml.dist | 2 +- .../vendor/symfony/routing/Annotation/Route.php | 59 +- .../php/vendor/symfony/routing/CompiledRoute.php | 53 +- .../DependencyInjection/RoutingResolverPass.php | 8 +- .../Exception/MethodNotAllowedException.php | 6 +- .../routing/Generator/Dumper/GeneratorDumper.php | 6 +- .../Generator/Dumper/PhpGeneratorDumper.php | 11 +- .../symfony/routing/Generator/UrlGenerator.php | 78 +- .../routing/Generator/UrlGeneratorInterface.php | 6 +- .../routing/Loader/AnnotationClassLoader.php | 70 +- .../routing/Loader/AnnotationDirectoryLoader.php | 16 +- .../routing/Loader/AnnotationFileLoader.php | 36 +- .../symfony/routing/Loader/ClosureLoader.php | 10 +- .../Loader/Configurator/CollectionConfigurator.php | 19 +- .../Loader/Configurator/ImportConfigurator.php | 9 +- .../Loader/Configurator/RouteConfigurator.php | 3 +- .../Loader/Configurator/RoutingConfigurator.php | 9 +- .../Loader/Configurator/Traits/AddTrait.php | 10 +- .../Loader/Configurator/Traits/RouteTrait.php | 24 +- .../DependencyInjection/ServiceRouterLoader.php | 6 +- .../symfony/routing/Loader/DirectoryLoader.php | 12 +- .../symfony/routing/Loader/GlobFileLoader.php | 8 +- .../symfony/routing/Loader/ObjectRouteLoader.php | 13 +- .../symfony/routing/Loader/PhpFileLoader.php | 10 +- .../symfony/routing/Loader/XmlFileLoader.php | 82 +- .../symfony/routing/Loader/YamlFileLoader.php | 67 +- .../routing/Loader/schema/routing/routing-1.0.xsd | 274 +- .../routing/Matcher/Dumper/DumperCollection.php | 43 +- .../symfony/routing/Matcher/Dumper/DumperRoute.php | 13 +- .../routing/Matcher/Dumper/MatcherDumper.php | 6 +- .../routing/Matcher/Dumper/PhpMatcherDumper.php | 103 +- .../Matcher/Dumper/StaticPrefixCollection.php | 46 +- .../routing/Matcher/RedirectableUrlMatcher.php | 14 +- .../Matcher/RedirectableUrlMatcherInterface.php | 6 +- .../routing/Matcher/TraceableUrlMatcher.php | 20 +- .../vendor/symfony/routing/Matcher/UrlMatcher.php | 66 +- .../php/vendor/symfony/routing/RequestContext.php | 95 +- .../php/vendor/symfony/routing/Route.php | 174 +- .../php/vendor/symfony/routing/RouteCollection.php | 78 +- .../symfony/routing/RouteCollectionBuilder.php | 99 +- .../php/vendor/symfony/routing/RouteCompiler.php | 55 +- .../php/vendor/symfony/routing/Router.php | 97 +- .../symfony/routing/Tests/Annotation/RouteTest.php | 9 +- .../symfony/routing/Tests/CompiledRouteTest.php | 5 +- .../RoutingResolverPassTest.php | 3 +- .../Tests/Fixtures/AnnotatedClasses/BarClass.php | 3 +- .../Tests/Fixtures/AnnotatedClasses/BazClass.php | 3 +- .../Tests/Fixtures/AnnotatedClasses/FooTrait.php | 5 +- .../routing/Tests/Fixtures/CustomRouteCompiler.php | 3 +- .../routing/Tests/Fixtures/CustomXmlFileLoader.php | 7 +- .../AnonymousClassInTrait.php | 9 +- .../OtherAnnotatedClasses/VariadicClass.php | 3 +- .../Tests/Fixtures/RedirectableUrlMatcher.php | 3 +- .../Fixtures/controller/import__controller.xml | 4 +- .../Fixtures/controller/import_controller.xml | 6 +- .../controller/import_override_defaults.xml | 4 +- .../Fixtures/controller/override_defaults.xml | 4 +- .../routing/Tests/Fixtures/controller/routing.xml | 8 +- .../routing/Tests/Fixtures/dumper/url_matcher0.php | 6 +- .../routing/Tests/Fixtures/dumper/url_matcher1.php | 68 +- .../routing/Tests/Fixtures/dumper/url_matcher2.php | 84 +- .../routing/Tests/Fixtures/dumper/url_matcher3.php | 8 +- .../routing/Tests/Fixtures/dumper/url_matcher4.php | 6 +- .../routing/Tests/Fixtures/dumper/url_matcher5.php | 50 +- .../routing/Tests/Fixtures/dumper/url_matcher6.php | 34 +- .../routing/Tests/Fixtures/dumper/url_matcher7.php | 50 +- .../symfony/routing/Tests/Fixtures/glob/bar.xml | 2 +- .../symfony/routing/Tests/Fixtures/glob/baz.xml | 2 +- .../Tests/Fixtures/glob/import_multiple.xml | 2 +- .../routing/Tests/Fixtures/glob/import_single.xml | 2 +- .../routing/Tests/Fixtures/list_defaults.xml | 4 +- .../Tests/Fixtures/list_in_list_defaults.xml | 4 +- .../Tests/Fixtures/list_in_map_defaults.xml | 4 +- .../routing/Tests/Fixtures/list_null_values.xml | 16 +- .../routing/Tests/Fixtures/map_defaults.xml | 4 +- .../Tests/Fixtures/map_in_list_defaults.xml | 4 +- .../routing/Tests/Fixtures/map_in_map_defaults.xml | 4 +- .../routing/Tests/Fixtures/map_null_values.xml | 12 +- .../symfony/routing/Tests/Fixtures/missing_id.xml | 4 +- .../routing/Tests/Fixtures/missing_path.xml | 4 +- .../routing/Tests/Fixtures/namespaceprefix.xml | 4 +- .../symfony/routing/Tests/Fixtures/nonvalid.xml | 6 +- .../routing/Tests/Fixtures/nonvalidnode.xml | 4 +- .../routing/Tests/Fixtures/nonvalidroute.xml | 4 +- .../symfony/routing/Tests/Fixtures/null_values.xml | 8 +- .../symfony/routing/Tests/Fixtures/php_dsl.php | 6 +- .../routing/Tests/Fixtures/scalar_defaults.xml | 10 +- .../routing/Tests/Fixtures/validpattern.xml | 9 +- .../routing/Tests/Fixtures/validresource.xml | 4 +- .../Generator/Dumper/PhpGeneratorDumperTest.php | 38 +- .../routing/Tests/Generator/UrlGeneratorTest.php | 220 +- .../Tests/Loader/AbstractAnnotationLoaderTest.php | 12 +- .../Tests/Loader/AnnotationClassLoaderTest.php | 79 +- .../Tests/Loader/AnnotationDirectoryLoaderTest.php | 40 +- .../Tests/Loader/AnnotationFileLoaderTest.php | 33 +- .../routing/Tests/Loader/ClosureLoaderTest.php | 9 +- .../routing/Tests/Loader/DirectoryLoaderTest.php | 23 +- .../routing/Tests/Loader/GlobFileLoaderTest.php | 13 +- .../routing/Tests/Loader/ObjectRouteLoaderTest.php | 29 +- .../routing/Tests/Loader/PhpFileLoaderTest.php | 36 +- .../routing/Tests/Loader/XmlFileLoaderTest.php | 169 +- .../routing/Tests/Loader/YamlFileLoaderTest.php | 76 +- .../Matcher/DumpedRedirectableUrlMatcherTest.php | 10 +- .../routing/Tests/Matcher/DumpedUrlMatcherTest.php | 13 +- .../Tests/Matcher/Dumper/DumperCollectionTest.php | 3 +- .../Tests/Matcher/Dumper/PhpMatcherDumperTest.php | 60 +- .../Matcher/Dumper/StaticPrefixCollectionTest.php | 15 +- .../Tests/Matcher/RedirectableUrlMatcherTest.php | 38 +- .../Tests/Matcher/TraceableUrlMatcherTest.php | 12 +- .../routing/Tests/Matcher/UrlMatcherTest.php | 118 +- .../symfony/routing/Tests/RequestContextTest.php | 38 +- .../routing/Tests/RouteCollectionBuilderTest.php | 54 +- .../symfony/routing/Tests/RouteCollectionTest.php | 69 +- .../symfony/routing/Tests/RouteCompilerTest.php | 255 +- .../php/vendor/symfony/routing/Tests/RouteTest.php | 70 +- .../vendor/symfony/routing/Tests/RouterTest.php | 63 +- .../php/vendor/symfony/routing/composer.json | 109 +- .../php/vendor/symfony/routing/phpunit.xml.dist | 2 +- .../assets/font-starcraft/css/font-starcraft.css | 71 +- .../assets/font-starcraft/fonts/font-starcraft.svg | 60 +- .../assets/userfrosting/css/AdminLTE-skins-all.css | 1996 +++-- .../assets/userfrosting/css/tablesorter-reflow.css | 112 +- .../core/assets/userfrosting/css/uf-alerts.css | 6 +- .../core/assets/userfrosting/css/uf-collection.css | 2 +- .../core/assets/userfrosting/css/userfrosting.css | 48 +- .../core/assets/userfrosting/favicons/ieconfig.xml | 18 +- .../assets/userfrosting/favicons/manifest.json | 98 +- .../userfrosting/favicons/safari-pinned-tab.svg | 40 +- .../core/assets/userfrosting/js/AdminLTE-custom.js | 98 +- .../core/assets/userfrosting/js/AdminLTE.js | 1290 +-- .../core/assets/userfrosting/js/attrchange.js | 218 +- .../js/fortress-jqueryvalidation-methods.js | 28 +- .../assets/userfrosting/js/handlebars-helpers.js | 34 +- .../core/assets/userfrosting/js/query-string.js | 22 +- .../js/tablesorter/widget-sort2Hash.js | 504 +- .../core/assets/userfrosting/js/uf-captcha.js | 6 +- .../core/assets/userfrosting/js/uf-collection.js | 102 +- .../core/assets/userfrosting/js/uf-copy.js | 16 +- .../core/assets/userfrosting/js/uf-form.js | 70 +- .../core/assets/userfrosting/js/uf-init.js | 9 +- .../userfrosting/js/uf-jqueryvalidation-config.js | 10 +- .../core/assets/userfrosting/js/uf-modal.js | 162 +- .../core/assets/userfrosting/js/uf-table.js | 246 +- .../userfrosting/js/uf-tablesorter-parsers.js | 44 +- 784 files changed, 22353 insertions(+), 26030 deletions(-) delete mode 100644 main/app/sprinkles/core/assets/SiteAssets/js/language.js (limited to 'main/app/sprinkles/core/assets') diff --git a/main/app/sprinkles/core/assets/SiteAssets/css/main.css b/main/app/sprinkles/core/assets/SiteAssets/css/main.css index 880d33c..da6243e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/css/main.css +++ b/main/app/sprinkles/core/assets/SiteAssets/css/main.css @@ -220,7 +220,6 @@ hr.ChatHeaderDivider { align-self: center; } - /* main chat */ .SelectedReceiver { display: none; diff --git a/main/app/sprinkles/core/assets/SiteAssets/js/chat.js b/main/app/sprinkles/core/assets/SiteAssets/js/chat.js index ee30c04..d54cbe6 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/js/chat.js +++ b/main/app/sprinkles/core/assets/SiteAssets/js/chat.js @@ -24,6 +24,7 @@ function InitializeChatServer() { var ChatMessages = $("#ChatMessages"); var TypingIndicatorAnimationElement = "
"; + var WebSocketConnectTimerStart = performance.now(); // START CONNECTION EXECUTION TIMER const ChatSocket = new WebSocket('wss://marvinborner.ddnss.de:1337'); ChatSocket.onerror = function () { setTimeout(function () { @@ -33,14 +34,15 @@ function InitializeChatServer() { }; ChatSocket.onopen = function () { // CONNECTION SUCCESSFUL! - console.log("%c[CHATSOCKET LOGGER] Chat connection established!", "color: darkorange"); + var WebSocketConnectTimerEnd = performance.now(); // END CONNECTION EXECUTION TIMER + console.log("%c[CHATSOCKET LOGGER] Chat connection established! (Took " + +(WebSocketConnectTimerEnd - WebSocketConnectTimerStart) + " milliseconds)", "color: darkorange"); // START VERIFICATION ChatSocket.send(JSON.stringify({ ClientMessageType: "Verify", Cookie: document.cookie, UserID: current_user_id })); - console.log("%c[CHATSOCKET LOGGER] Started chat verification process...", "color: grey"); + console.log("%c[CHATSOCKET LOGGER] Started chat verification process...", "color: gray"); // GOT MESSAGE ChatSocket.onmessage = function (e) { // DECLARATIONS @@ -61,7 +63,6 @@ function InitializeChatServer() { LastMessage = $(".MessageWrapper.Normal:last .ChatMessage"); Username = MessageObject.Username; - // GET OWN PUBLIC KEY FIRST if (!(current_username in PublicKey)) { $.ajax({ @@ -91,7 +92,7 @@ function InitializeChatServer() { if (!ServerMessage) { // NO SERVER MESSAGE -> SENT BY USER // DECRYPT MESSAGE options = { - message: openpgp.message.readArmored("-----BEGIN PGP MESSAGE-----\r\nVersion: OpenPGP.js v3.0.9\r\nComment: https://openpgpjs.org\r\n\r\n" + Message + "\r\n\-----END PGP MESSAGE-----\r\n"), + message: openpgp.message.readArmored("-----BEGIN PGP MESSAGE-----\r\nVersion: OpenPGP.js v3.0.9\r\nComment: https://openpgpjs.org\r\n\r\n" + Message + "\r\n\-----END PGP MESSAGE-----\r\n"), // FORMAT MESSAGE publicKeys: openpgp.key.readArmored(PublicKey[Username]).keys, // FOR VERIFICATION privateKeys: [privKeyObj] }; @@ -150,24 +151,25 @@ function InitializeChatServer() { } else if (ServerMessageType === "TypingState") { // TYPE: SOMEBODY'S TYPING STATE CHANGED! if (State) { // IF 'SOMEBODY' STARTED TYPING if (WasHimself) { // IDENTIFY 'SOMEBODY' -> WAS HIMSELF -> NOT THAT IMPORTANT (USER KNOWS WHEN HE STARTS TYPING?) - console.log("%c[CHAT TYPING LOGGER] You started typing!", "color: grey"); + console.log("%c[CHAT TYPING LOGGER] You started typing!", "color: gray"); } else if (!WasHimself) { // IDENTIFY 'SOMEBODY' -> WAS OTHER USER -> SHOW TYPING ANIMATION ON RECEIVER'S SIDE ChatMessages.append("
" + TypingIndicatorAnimationElement + "
"); - console.log("%c[CHAT TYPING LOGGER] " + Username + " started typing!", "color: grey"); + console.log("%c[CHAT TYPING LOGGER] " + Username + " started typing!", "color: gray"); } } else if (!State) { // IF 'SOMEBODY' STOPPED TYPING if (WasHimself) { // IDENTIFY 'SOMEBODY' -> WAS HIMSELF -> NOT THAT IMPORTANT (USER KNOWS WHEN HE STOPS TYPING?) - console.log("%c[CHAT TYPING LOGGER] You stopped typing!", "color: grey"); + console.log("%c[CHAT TYPING LOGGER] You stopped typing!", "color: gray"); } else if (!WasHimself) { // IDENTIFY 'SOMEBODY' -> WAS OTHER USER -> REMOVE TYPING ANIMATION //TypingIndicatorMessage.fadeOut("fast"); TypingIndicatorMessage.remove(); - console.log("%c[CHAT TYPING LOGGER] " + Username + " stopped typing!", "color: grey"); + console.log("%c[CHAT TYPING LOGGER] " + Username + " stopped typing!", "color: gray"); } } } else if (ServerMessageType === "Verify") { // TYPE: SERVER CHECKED ACCESS -- MOSTLY HANDLED IN BACKEND if (Granted) { console.log("%c[CHATSOCKET LOGGER] Chat access granted!", "color: green"); } else if (!Granted) { + triggerErrorPopup("ChatNotAllowed"); console.log("%c[CHATSOCKET LOGGER] Chat access denied!", "color: red"); } } else if (ServerMessageType === "SetReceiver") { // TYPE: SERVER CHECKED ACCESS -- MOSTLY HANDLED IN BACKEND diff --git a/main/app/sprinkles/core/assets/SiteAssets/js/language.js b/main/app/sprinkles/core/assets/SiteAssets/js/language.js deleted file mode 100644 index ca1d41c..0000000 --- a/main/app/sprinkles/core/assets/SiteAssets/js/language.js +++ /dev/null @@ -1,36 +0,0 @@ -function Translate() { - //initialization - this.init = function (lng) { - this.attribute = 'data-lang'; - this.lng = lng; - }; - //translate - this.process = function () { - var _self = this; - var xrhFile = new XMLHttpRequest(); - //load content data - xrhFile.open("GET", "assets/languages/json/Translations.json", true); - xrhFile.onreadystatechange = function () { - if (xrhFile.readyState === 4) { - if (xrhFile.status === 200 || xrhFile.status === 0) { - var LngObject = JSON.parse(xrhFile.responseText); - var allDom = document.getElementsByTagName("*"); - for (var i = 0; i < allDom.length; i++) { - var elem = allDom[i]; - var key = elem.getAttribute(_self.attribute); - - if (key != null) { - //console.log("Language initialized with language pack: " + _self.lng); - elem.innerHTML = LngObject[_self.lng][key]; - } - } - } - } - }; - xrhFile.send(); - } -} - -$(document).ready(function () { - initiateLanguage(); -}); diff --git a/main/app/sprinkles/core/assets/SiteAssets/js/main.js b/main/app/sprinkles/core/assets/SiteAssets/js/main.js index ccb80d4..33716b5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/js/main.js +++ b/main/app/sprinkles/core/assets/SiteAssets/js/main.js @@ -20,14 +20,20 @@ var ExploreData = $("#ExploreData"); /** * POPUPS */ -function triggerErrorPopup() { +function triggerErrorPopup(ErrorCode) { + var ErrorMessage = "Unknown Error occurred!", ErrorInformationSite = "", AlsoLogInConsole = true; // WILL BE REWRITTEN (EXCEPT SOMETHING CRAZY HAPPENS) + switch (ErrorCode) { + case "ChatNotAllowed": + AlsoLogInConsole = false; + ErrorMessage = "Sorry, it seems like your account is not allowed to use our chat feature."; + break; + } + if (AlsoLogInConsole) console.error("Error: " + ErrorMessage); swal({ title: 'Error!', - text: 'Do you want to continue?', - footer: 'Why do I have this problem?', - type: 'error', - confirmButtonText: 'Yes', - cancelButtonText: 'No' + text: ErrorMessage, + footer: 'Why do I have this problem?', + type: 'error' }); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/js/openpgp.worker.js b/main/app/sprinkles/core/assets/SiteAssets/js/openpgp.worker.js index 1d0040f..e29f01a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/js/openpgp.worker.js +++ b/main/app/sprinkles/core/assets/SiteAssets/js/openpgp.worker.js @@ -1,4 +1,3 @@ - /*! OpenPGP.js v3.0.9 - 2018-04-30 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */ !function e(n, r, t) { function o(a, f) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/Chatserver/src/ChatProcessor.php b/main/app/sprinkles/core/assets/SiteAssets/php/Chatserver/src/ChatProcessor.php index 5463aec..30944c6 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/Chatserver/src/ChatProcessor.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/Chatserver/src/ChatProcessor.php @@ -113,15 +113,15 @@ class ChatProcessor implements MessageComponentInterface break; case "ChatMessage": // MESSAGE RECEIVED $ReceiversId = $this->ReceiversId[$conn->resourceId]; - if (isset($this->ResourceId[$ReceiversId])) { - $ReceiversResourceId = $this->ResourceId[$ReceiversId]; - $MessageObject = new \stdClass(); - $MessageObject->ServerMessage = FALSE; - $MessageObject->Username = $this->userInfo[$conn->resourceId]->user_name; - $MessageObject->Fullname = $this->userInfo[$conn->resourceId]->full_name; - $MessageObject->Avatar = $this->userInfo[$conn->resourceId]->avatar; - $MessageObject->Message = htmlspecialchars($data->Message); + $MessageObject = new \stdClass(); + $MessageObject->ServerMessage = FALSE; + $MessageObject->Username = $this->userInfo[$conn->resourceId]->user_name; + $MessageObject->Fullname = $this->userInfo[$conn->resourceId]->full_name; + $MessageObject->Avatar = $this->userInfo[$conn->resourceId]->avatar; + $MessageObject->Message = htmlspecialchars($data->Message); + if (isset($this->ResourceId[$ReceiversId])) { // USER IS ONLINE + $ReceiversResourceId = $this->ResourceId[$ReceiversId]; if ($data->EncryptedWithKeyOfUsername === $this->userInfo[$ReceiversResourceId]->user_name) { $MessageObject->WasHimself = FALSE; $MessageJson = json_encode($MessageObject, TRUE); @@ -147,7 +147,8 @@ class ChatProcessor implements MessageComponentInterface $MessageJson = json_encode($MessageObject, TRUE); $this->users[$conn->resourceId]->send($MessageJson); // SEND TO SENDER (FOR VERIFICATION) } - } else { // USER ISN'T ONLINE -> ONLY STORE IN DATABASE + } else { // USER ISN'T ONLINE -> ONLY STORE IN DATABASE AND SEND TO SENDER + // STORE IN DB $url = "https://beam-messenger.de/wormhole/" . file("/AccessToken.txt", FILE_IGNORE_NEW_LINES)["0"] . "/new/message/" . $this->userInfo[$conn->resourceId]->id . "/" . $this->ReceiversId[$conn->resourceId] . "/"; $data = array('message' => $data->Message); $options = array( @@ -161,6 +162,11 @@ class ChatProcessor implements MessageComponentInterface $result = file_get_contents($url, FALSE, $context); if ($result === FALSE) { /* Handle error */ } + + // SEND BACK FOR VERIFICATION + $MessageObject->WasHimself = TRUE; + $MessageJson = json_encode($MessageObject, TRUE); + $this->users[$conn->resourceId]->send($MessageJson); // SEND TO SENDER (FOR VERIFICATION) } break; case "GroupMessage": // GROUP MESSAGE RECEIVED -- RESERVED FOR LATER USE (CHANNEL BASED RIGHT NOW) @@ -227,7 +233,10 @@ class ChatProcessor implements MessageComponentInterface unset($this->verifiedUsers[$conn->resourceId]); unset($this->users[$conn->resourceId]); unset($this->channels[$conn->resourceId]); + unset($this->ResourceId[$conn->resourceId]); unset($this->userInfo[$conn->resourceId]); + unset($this->userID[$conn->resourceId]); + unset($this->ReceiversId[$conn->resourceId]); } public function onError(ConnectionInterface $conn, \Exception $e) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/composer.json index 8406940..edc9dea 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/composer.json @@ -1,11 +1,11 @@ { - "autoload": { - "psr-4": { - "Websocket\\": "Chatserver/src" - } - }, - "require": { - "cboden/ratchet": "^0.4.1", - "nubs/random-name-generator": "^2.1" + "autoload": { + "psr-4": { + "Websocket\\": "Chatserver/src" } + }, + "require": { + "cboden/ratchet": "^0.4.1", + "nubs/random-name-generator": "^2.1" + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/scripts.php b/main/app/sprinkles/core/assets/SiteAssets/php/scripts.php index 178940b..465f448 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/scripts.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/scripts.php @@ -1,6 +1,8 @@ add('assets/js/fontawesome.js'); $minifier->add('assets/js/modernizr.js'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/stylesheet.php b/main/app/sprinkles/core/assets/SiteAssets/php/stylesheet.php index 69a2636..d979f13 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/stylesheet.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/stylesheet.php @@ -1,6 +1,8 @@ add('assets/css/main.css'); echo $minifier->minify(); \ No newline at end of file diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/composer.json index 9529618..6570fbb 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/composer.json @@ -1,36 +1,42 @@ { - "name": "cboden/ratchet" - , "type": "library" - , "description": "PHP WebSocket library" - , "keywords": ["WebSockets", "Server", "Ratchet", "Sockets", "WebSocket"] - , "homepage": "http://socketo.me" - , "license": "MIT" - , "authors": [ - { - "name": "Chris Boden" - , "email": "cboden@gmail.com" - , "role": "Developer" - } - ] - , "support": { - "forum": "https://groups.google.com/forum/#!forum/ratchet-php" - , "issues": "https://github.com/ratchetphp/Ratchet/issues" - , "irc": "irc://irc.freenode.org/reactphp" + "name": "cboden/ratchet", + "type": "library", + "description": "PHP WebSocket library", + "keywords": [ + "WebSockets", + "Server", + "Ratchet", + "Sockets", + "WebSocket" + ], + "homepage": "http://socketo.me", + "license": "MIT", + "authors": [ + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "role": "Developer" } - , "autoload": { - "psr-4": { - "Ratchet\\": "src/Ratchet" - } - } - , "require": { - "php": ">=5.4.2" - , "ratchet/rfc6455": "^0.2" - , "react/socket": "^1.0 || ^0.8 || ^0.7 || ^0.6 || ^0.5" - , "guzzlehttp/psr7": "^1.0" - , "symfony/http-foundation": "^2.6|^3.0|^4.0" - , "symfony/routing": "^2.6|^3.0|^4.0" - } - , "require-dev": { - "phpunit/phpunit": "~4.8" + ], + "support": { + "forum": "https://groups.google.com/forum/#!forum/ratchet-php", + "issues": "https://github.com/ratchetphp/Ratchet/issues", + "irc": "irc://irc.freenode.org/reactphp" + }, + "autoload": { + "psr-4": { + "Ratchet\\": "src/Ratchet" } + }, + "require": { + "php": ">=5.4.2", + "ratchet/rfc6455": "^0.2", + "react/socket": "^1.0 || ^0.8 || ^0.7 || ^0.6 || ^0.5", + "guzzlehttp/psr7": "^1.0", + "symfony/http-foundation": "^2.6|^3.0|^4.0", + "symfony/routing": "^2.6|^3.0|^4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/phpunit.xml.dist b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/phpunit.xml.dist index 0cc5451..187b1f0 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/phpunit.xml.dist +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/phpunit.xml.dist @@ -1,13 +1,13 @@ diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/AbstractConnectionDecorator.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/AbstractConnectionDecorator.php index 9707951..ddb7c7b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/AbstractConnectionDecorator.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/AbstractConnectionDecorator.php @@ -1,4 +1,5 @@ routes = new RouteCollection; + $this->routes = new RouteCollection; $this->_server = new IoServer(new HttpServer(new Router(new UrlMatcher($this->routes, new RequestContext))), $socket, $loop); $policy = new FlashPolicy; @@ -93,26 +96,26 @@ class App { /** * Add an endpoint/application to the server - * @param string $path The URI the client will connect to + * @param string $path The URI the client will connect to * @param ComponentInterface $controller Your application to server for the route. If not specified, assumed to be for a WebSocket - * @param array $allowedOrigins An array of hosts allowed to connect (same host by default), ['*'] for any - * @param string $httpHost Override the $httpHost variable provided in the __construct + * @param array $allowedOrigins An array of hosts allowed to connect (same host by default), ['*'] for any + * @param string $httpHost Override the $httpHost variable provided in the __construct * @return ComponentInterface|WsServer */ - public function route($path, ComponentInterface $controller, array $allowedOrigins = array(), $httpHost = null) { + public function route($path, ComponentInterface $controller, array $allowedOrigins = array(), $httpHost = NULL) { if ($controller instanceof HttpServerInterface || $controller instanceof WsServer) { $decorated = $controller; - } elseif ($controller instanceof WampServerInterface) { + } else if ($controller instanceof WampServerInterface) { $decorated = new WsServer(new WampServer($controller)); $decorated->enableKeepAlive($this->_server->loop); - } elseif ($controller instanceof MessageComponentInterface) { + } else if ($controller instanceof MessageComponentInterface) { $decorated = new WsServer($controller); $decorated->enableKeepAlive($this->_server->loop); } else { $decorated = $controller; } - if ($httpHost === null) { + if ($httpHost === NULL) { $httpHost = $this->httpHost; } @@ -125,8 +128,8 @@ class App { } //allow origins in flash policy server - if(empty($this->flashServer) === false) { - foreach($allowedOrigins as $allowedOrgin) { + if (empty($this->flashServer) === FALSE) { + foreach ($allowedOrigins as $allowedOrgin) { $this->flashServer->app->addAllowedAccess($allowedOrgin, $this->port); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/ComponentInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/ComponentInterface.php index 37e41b1..31324c9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/ComponentInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/ComponentInterface.php @@ -1,11 +1,13 @@ _httpServer = $component; - $this->_reqParser = new HttpRequestParser; + $this->_reqParser = new HttpRequestParser; } /** * {@inheritdoc} */ public function onOpen(ConnectionInterface $conn) { - $conn->httpHeadersReceived = false; + $conn->httpHeadersReceived = FALSE; } /** * {@inheritdoc} */ public function onMessage(ConnectionInterface $from, $msg) { - if (true !== $from->httpHeadersReceived) { + if (TRUE !== $from->httpHeadersReceived) { try { - if (null === ($request = $this->_reqParser->onMessage($from, $msg))) { + if (NULL === ($request = $this->_reqParser->onMessage($from, $msg))) { return; } } catch (\OverflowException $oe) { return $this->close($from, 413); } - $from->httpHeadersReceived = true; + $from->httpHeadersReceived = TRUE; return $this->_httpServer->onOpen($from, $request); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Http/HttpServerInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Http/HttpServerInterface.php index 2c37c49..baacdb5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Http/HttpServerInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Http/HttpServerInterface.php @@ -1,14 +1,17 @@ _component = $component; @@ -31,7 +34,7 @@ class OriginCheck implements HttpServerInterface { /** * {@inheritdoc} */ - public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) { + public function onOpen(ConnectionInterface $conn, RequestInterface $request = NULL) { $header = (string)$request->getHeader('Origin')[0]; $origin = parse_url($header, PHP_URL_HOST) ?: $header; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Http/Router.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Http/Router.php index df7fe82..3d0dc3e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Http/Router.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Http/Router.php @@ -1,5 +1,7 @@ $value) { + foreach ($route as $key => $value) { if ((is_string($key)) && ('_' !== substr($key, 0, 1))) { $parameters[$key] = $value; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/MessageComponentInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/MessageComponentInterface.php index b4a92e2..90096c3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/MessageComponentInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/MessageComponentInterface.php @@ -1,5 +1,7 @@ validateDomain($domain)) { - throw new \UnexpectedValueException('Invalid domain'); + throw new \UnexpectedValueException('Invalid domain'); } if (!$this->validatePorts($ports)) { - throw new \UnexpectedValueException('Invalid Port'); + throw new \UnexpectedValueException('Invalid Port'); } - $this->_access[] = array($domain, $ports, (boolean)$secure); - $this->_cacheValid = false; + $this->_access[] = array($domain, $ports, (boolean)$secure); + $this->_cacheValid = FALSE; return $this; } - + /** * Removes all domains from the allowed access list. - * + * * @return \Ratchet\Server\FlashPolicy */ public function clearAllowedAccess() { - $this->_access = array(); - $this->_cacheValid = false; + $this->_access = array(); + $this->_cacheValid = FALSE; return $this; } @@ -99,7 +102,7 @@ class FlashPolicy implements MessageComponentInterface { } $this->_siteControl = $permittedCrossDomainPolicies; - $this->_cacheValid = false; + $this->_cacheValid = FALSE; return $this; } @@ -115,8 +118,8 @@ class FlashPolicy implements MessageComponentInterface { */ public function onMessage(ConnectionInterface $from, $msg) { if (!$this->_cacheValid) { - $this->_cache = $this->renderPolicy()->asXML(); - $this->_cacheValid = true; + $this->_cache = $this->renderPolicy()->asXML(); + $this->_cacheValid = TRUE; } $from->send($this->_cache . "\0"); @@ -161,7 +164,7 @@ class FlashPolicy implements MessageComponentInterface { $tmp = $policy->addChild('allow-access-from'); $tmp->addAttribute('domain', $access[0]); $tmp->addAttribute('to-ports', $access[1]); - $tmp->addAttribute('secure', ($access[2] === true) ? 'true' : 'false'); + $tmp->addAttribute('secure', ($access[2] === TRUE) ? 'true' : 'false'); } return $policy; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Server/IoConnection.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Server/IoConnection.php index 9f864bb..92d5b50 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Server/IoConnection.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Server/IoConnection.php @@ -1,12 +1,15 @@ loop = $loop; - $this->app = $app; + $this->app = $app; $this->socket = $socket; $socket->on('connection', array($this, 'handleConnect')); } /** - * @param \Ratchet\MessageComponentInterface $component The application that I/O will call when events are received - * @param int $port The port to server sockets on - * @param string $address The address to receive sockets on (0.0.0.0 means receive connections from any) + * @param \Ratchet\MessageComponentInterface $component The application that I/O will call when events are received + * @param int $port The port to server sockets on + * @param string $address The address to receive sockets on (0.0.0.0 means receive connections from any) * @return IoServer */ public static function factory(MessageComponentInterface $component, $port = 80, $address = '0.0.0.0') { - $loop = LoopFactory::create(); + $loop = LoopFactory::create(); $socket = new Reactor($address . ':' . $port, $loop); return new static($component, $socket, $loop); @@ -66,7 +69,7 @@ class IoServer { * @throws \RuntimeException If a loop was not previously specified */ public function run() { - if (null === $this->loop) { + if (NULL === $this->loop) { throw new \RuntimeException("A React Loop was not provided during instantiation"); } @@ -85,7 +88,7 @@ class IoServer { $uri = $conn->getRemoteAddress(); $conn->decor->remoteAddress = trim( - parse_url((strpos($uri, '://') === false ? 'tcp://' : '') . $uri, PHP_URL_HOST), + parse_url((strpos($uri, '://') === FALSE ? 'tcp://' : '') . $uri, PHP_URL_HOST), '[]' ); @@ -104,7 +107,7 @@ class IoServer { /** * Data has been received from React - * @param string $data + * @param string $data * @param \React\Socket\ConnectionInterface $conn */ public function handleData($data, $conn) { @@ -131,7 +134,7 @@ class IoServer { /** * An error has occurred, let the listening application know - * @param \Exception $e + * @param \Exception $e * @param \React\Socket\ConnectionInterface $conn */ public function handleError(\Exception $e, $conn) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Server/IpBlackList.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Server/IpBlackList.php index 9342254..4ddf88b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Server/IpBlackList.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Server/IpBlackList.php @@ -1,9 +1,12 @@ _blacklist[$ip] = true; + $this->_blacklist[$ip] = TRUE; return $this; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Session/Serialize/HandlerInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Session/Serialize/HandlerInterface.php index b83635f..42e4bed 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Session/Serialize/HandlerInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Session/Serialize/HandlerInterface.php @@ -1,7 +1,9 @@ _app = $app; + public function __construct(HttpServerInterface $app, \SessionHandlerInterface $handler, array $options = array(), HandlerInterface $serializer = NULL) { + $this->_app = $app; $this->_handler = $handler; - $this->_null = new NullSessionHandler; + $this->_null = new NullSessionHandler; ini_set('session.auto_start', 0); ini_set('session.cache_limiter', ''); @@ -55,7 +58,7 @@ class SessionProvider implements HttpServerInterface { $this->setOptions($options); - if (null === $serializer) { + if (NULL === $serializer) { $serialClass = __NAMESPACE__ . "\\Serialize\\{$this->toClassCase(ini_get('session.serialize_handler'))}Handler"; // awesome/terrible hack, eh? if (!class_exists($serialClass)) { throw new \RuntimeException('Unable to parse session serialize handler'); @@ -70,20 +73,20 @@ class SessionProvider implements HttpServerInterface { /** * {@inheritdoc} */ - public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) { + public function onOpen(ConnectionInterface $conn, RequestInterface $request = NULL) { $sessionName = ini_get('session.name'); - $id = array_reduce($request->getHeader('Cookie'), function($accumulator, $cookie) use ($sessionName) { + $id = array_reduce($request->getHeader('Cookie'), function ($accumulator, $cookie) use ($sessionName) { if ($accumulator) { return $accumulator; } $crumbs = $this->parseCookie($cookie); - return isset($crumbs['cookies'][$sessionName]) ? $crumbs['cookies'][$sessionName] : false; - }, false); + return isset($crumbs['cookies'][$sessionName]) ? $crumbs['cookies'][$sessionName] : FALSE; + }, FALSE); - if (null === $request || false === $id) { + if (NULL === $request || FALSE === $id) { $saveHandler = $this->_null; $id = ''; } else { @@ -164,39 +167,39 @@ class SessionProvider implements HttpServerInterface { * Taken from Guzzle3 */ private static $cookieParts = array( - 'domain' => 'Domain', - 'path' => 'Path', - 'max_age' => 'Max-Age', - 'expires' => 'Expires', - 'version' => 'Version', - 'secure' => 'Secure', - 'port' => 'Port', - 'discard' => 'Discard', - 'comment' => 'Comment', + 'domain' => 'Domain', + 'path' => 'Path', + 'max_age' => 'Max-Age', + 'expires' => 'Expires', + 'version' => 'Version', + 'secure' => 'Secure', + 'port' => 'Port', + 'discard' => 'Discard', + 'comment' => 'Comment', 'comment_url' => 'Comment-Url', - 'http_only' => 'HttpOnly' + 'http_only' => 'HttpOnly' ); /** * Taken from Guzzle3 */ - private function parseCookie($cookie, $host = null, $path = null, $decode = false) { + private function parseCookie($cookie, $host = NULL, $path = NULL, $decode = FALSE) { // Explode the cookie string using a series of semicolons $pieces = array_filter(array_map('trim', explode(';', $cookie))); // The name of the cookie (first kvp) must include an equal sign. if (empty($pieces) || !strpos($pieces[0], '=')) { - return false; + return FALSE; } // Create the default return array - $data = array_merge(array_fill_keys(array_keys(self::$cookieParts), null), array( - 'cookies' => array(), - 'data' => array(), - 'path' => $path ?: '/', - 'http_only' => false, - 'discard' => false, - 'domain' => $host + $data = array_merge(array_fill_keys(array_keys(self::$cookieParts), NULL), array( + 'cookies' => array(), + 'data' => array(), + 'path' => $path ?: '/', + 'http_only' => FALSE, + 'discard' => FALSE, + 'domain' => $host )); $foundNonCookies = 0; @@ -208,7 +211,7 @@ class SessionProvider implements HttpServerInterface { if (count($cookieParts) == 1) { // Can be a single value (e.g. secure, httpOnly) - $value = true; + $value = TRUE; } else { // Be sure to strip wrapping quotes $value = trim($cookieParts[1], " \n\r\t\0\x0B\""); @@ -235,7 +238,7 @@ class SessionProvider implements HttpServerInterface { // Calculate the expires date if (!$data['expires'] && $data['max_age']) { - $data['expires'] = time() + (int) $data['max_age']; + $data['expires'] = time() + (int)$data['max_age']; } return $data; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Session/Storage/Proxy/VirtualProxy.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Session/Storage/Proxy/VirtualProxy.php index b478d03..cd86d6f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Session/Storage/Proxy/VirtualProxy.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Session/Storage/Proxy/VirtualProxy.php @@ -1,8 +1,11 @@ saveHandlerName = 'user'; - $this->_sessionName = ini_get('session.name'); + $this->_sessionName = ini_get('session.name'); } /** diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Session/Storage/VirtualSessionStorage.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Session/Storage/VirtualSessionStorage.php index daa10bb..72e0c5a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Session/Storage/VirtualSessionStorage.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Session/Storage/VirtualSessionStorage.php @@ -1,25 +1,28 @@ setSaveHandler($handler); $this->saveHandler->setId($sessionId); $this->_serializer = $serializer; - $this->setMetadataBag(null); + $this->setMetadataBag(NULL); } /** @@ -27,7 +30,7 @@ class VirtualSessionStorage extends NativeSessionStorage { */ public function start() { if ($this->started && !$this->closed) { - return true; + return TRUE; } // You have to call Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler::open() to use @@ -36,22 +39,22 @@ class VirtualSessionStorage extends NativeSessionStorage { // framework in this case. This must not be the best choice, but it works. $this->saveHandler->open(session_save_path(), session_name()); - $rawData = $this->saveHandler->read($this->saveHandler->getId()); + $rawData = $this->saveHandler->read($this->saveHandler->getId()); $sessionData = $this->_serializer->unserialize($rawData); $this->loadSession($sessionData); if (!$this->saveHandler->isWrapper() && !$this->saveHandler->isSessionHandlerInterface()) { - $this->saveHandler->setActive(false); + $this->saveHandler->setActive(FALSE); } - return true; + return TRUE; } /** * {@inheritdoc} */ - public function regenerate($destroy = false, $lifetime = null) { + public function regenerate($destroy = FALSE, $lifetime = NULL) { // .. ? } @@ -65,16 +68,16 @@ class VirtualSessionStorage extends NativeSessionStorage { // $this->saveHandler->write($this->saveHandler->getId(), if (!$this->saveHandler->isWrapper() && !$this->getSaveHandler()->isSessionHandlerInterface()) { - $this->saveHandler->setActive(false); + $this->saveHandler->setActive(FALSE); } - $this->closed = true; + $this->closed = TRUE; } /** * {@inheritdoc} */ - public function setSaveHandler($saveHandler = null) { + public function setSaveHandler($saveHandler = NULL) { if (!($saveHandler instanceof \SessionHandlerInterface)) { throw new \InvalidArgumentException('Handler must be instance of SessionHandlerInterface'); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Wamp/Exception.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Wamp/Exception.php index 6c824da..e4cd25c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Wamp/Exception.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Wamp/Exception.php @@ -1,5 +1,7 @@ _decorating instanceof WsServerInterface) { - $subs = $this->_decorating->getSubProtocols(); + $subs = $this->_decorating->getSubProtocols(); $subs[] = 'wamp'; return $subs; @@ -85,7 +88,7 @@ class ServerProtocol implements MessageComponentInterface, WsServerInterface { public function onMessage(ConnectionInterface $from, $msg) { $from = $this->connections[$from]; - if (null === ($json = @json_decode($msg, true))) { + if (NULL === ($json = @json_decode($msg, TRUE))) { throw new JsonException; } @@ -100,11 +103,11 @@ class ServerProtocol implements MessageComponentInterface, WsServerInterface { switch ($json[0]) { case static::MSG_PREFIX: $from->WAMP->prefixes[$json[1]] = $json[2]; - break; + break; case static::MSG_CALL: array_shift($json); - $callID = array_shift($json); + $callID = array_shift($json); $procURI = array_shift($json); if (count($json) == 1 && is_array($json[0])) { @@ -112,20 +115,20 @@ class ServerProtocol implements MessageComponentInterface, WsServerInterface { } $this->_decorating->onCall($from, $callID, $from->getUri($procURI), $json); - break; + break; case static::MSG_SUBSCRIBE: $this->_decorating->onSubscribe($from, $from->getUri($json[1])); - break; + break; case static::MSG_UNSUBSCRIBE: $this->_decorating->onUnSubscribe($from, $from->getUri($json[1])); - break; + break; case static::MSG_PUBLISH: - $exclude = (array_key_exists(3, $json) ? $json[3] : null); + $exclude = (array_key_exists(3, $json) ? $json[3] : NULL); if (!is_array($exclude)) { - if (true === (boolean)$exclude) { + if (TRUE === (boolean)$exclude) { $exclude = [$from->WAMP->sessionId]; } else { $exclude = []; @@ -135,7 +138,7 @@ class ServerProtocol implements MessageComponentInterface, WsServerInterface { $eligible = (array_key_exists(4, $json) ? $json[4] : []); $this->_decorating->onPublish($from, $from->getUri($json[1]), $json[2], $exclude, $eligible); - break; + break; default: throw new Exception('Invalid WAMP message type'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Wamp/Topic.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Wamp/Topic.php index bca8f67..23ad561 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Wamp/Topic.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Wamp/Topic.php @@ -1,11 +1,14 @@ WAMP = new \StdClass; - $this->WAMP->sessionId = str_replace('.', '', uniqid(mt_rand(), true)); - $this->WAMP->prefixes = array(); + $this->WAMP = new \StdClass; + $this->WAMP->sessionId = str_replace('.', '', uniqid(mt_rand(), TRUE)); + $this->WAMP->prefixes = array(); $this->send(json_encode(array(WAMP::MSG_WELCOME, $this->WAMP->sessionId, 1, \Ratchet\VERSION))); } /** * Successfully respond to a call made by the client - * @param string $id The unique ID given by the client to respond to + * @param string $id The unique ID given by the client to respond to * @param array $data an object or array * @return WampConnection */ @@ -37,18 +40,18 @@ class WampConnection extends AbstractConnectionDecorator { * Respond with an error to a client call * @param string $id The unique ID given by the client to respond to * @param string $errorUri The URI given to identify the specific error - * @param string $desc A developer-oriented description of the error + * @param string $desc A developer-oriented description of the error * @param string $details An optional human readable detail message to send back * @return WampConnection */ - public function callError($id, $errorUri, $desc = '', $details = null) { + public function callError($id, $errorUri, $desc = '', $details = NULL) { if ($errorUri instanceof Topic) { $errorUri = (string)$errorUri; } $data = array(WAMP::MSG_CALL_ERROR, $id, $errorUri, $desc); - if (null !== $details) { + if (NULL !== $details) { $data[] = $details; } @@ -57,7 +60,7 @@ class WampConnection extends AbstractConnectionDecorator { /** * @param string $topic The topic to broadcast to - * @param mixed $msg Data to send with the event. Anything that is json'able + * @param mixed $msg Data to send with the event. Anything that is json'able * @return WampConnection */ public function event($topic, $msg) { @@ -83,12 +86,12 @@ class WampConnection extends AbstractConnectionDecorator { public function getUri($uri) { $curieSeperator = ':'; - if (preg_match('/http(s*)\:\/\//', $uri) == false) { - if (strpos($uri, $curieSeperator) !== false) { + if (preg_match('/http(s*)\:\/\//', $uri) == FALSE) { + if (strpos($uri, $curieSeperator) !== FALSE) { list($prefix, $action) = explode($curieSeperator, $uri); - - if(isset($this->WAMP->prefixes[$prefix]) === true){ - return $this->WAMP->prefixes[$prefix] . '#' . $action; + + if (isset($this->WAMP->prefixes[$prefix]) === TRUE) { + return $this->WAMP->prefixes[$prefix] . '#' . $action; } } } @@ -108,7 +111,7 @@ class WampConnection extends AbstractConnectionDecorator { /** * {@inheritdoc} */ - public function close($opt = null) { + public function close($opt = NULL) { $this->getConnection()->close($opt); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Wamp/WampServer.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Wamp/WampServer.php index 5d710aa..81bee9c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Wamp/WampServer.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/Wamp/WampServer.php @@ -1,5 +1,7 @@ send($code); } else { - $this->send(new Frame(pack('n', $code), true, Frame::OP_CLOSE)); + $this->send(new Frame(pack('n', $code), TRUE, Frame::OP_CLOSE)); } $this->getConnection()->close(); - $this->WebSocket->closing = true; + $this->WebSocket->closing = TRUE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServer.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServer.php index 8030604..6cb9e44 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServer.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServer.php @@ -1,5 +1,7 @@ msgCb = function(ConnectionInterface $conn, MessageInterface $msg) { + $this->msgCb = function (ConnectionInterface $conn, MessageInterface $msg) { $this->delegate->onMessage($conn, $msg); }; - } elseif ($component instanceof DataComponentInterface) { - $this->msgCb = function(ConnectionInterface $conn, MessageInterface $msg) { + } else if ($component instanceof DataComponentInterface) { + $this->msgCb = function (ConnectionInterface $conn, MessageInterface $msg) { $this->delegate->onMessage($conn, $msg->getPayload()); }; } else { @@ -82,21 +85,22 @@ class WsServer implements HttpServerInterface { throw new \DomainException('Bad encoding, unicode character ✓ did not match expected value. Ensure charset UTF-8 and check ini val mbstring.func_autoload'); } - $this->delegate = $component; + $this->delegate = $component; $this->connections = new \SplObjectStorage; - $this->closeFrameChecker = new CloseFrameChecker; + $this->closeFrameChecker = new CloseFrameChecker; $this->handshakeNegotiator = new ServerNegotiator(new RequestVerifier); - $this->handshakeNegotiator->setStrictSubProtocolCheck(true); + $this->handshakeNegotiator->setStrictSubProtocolCheck(TRUE); if ($component instanceof WsServerInterface) { $this->handshakeNegotiator->setSupportedSubProtocols($component->getSubProtocols()); } - $this->pongReceiver = function() {}; + $this->pongReceiver = function () { + }; $reusableUnderflowException = new \UnderflowException; - $this->ueFlowFactory = function() use ($reusableUnderflowException) { + $this->ueFlowFactory = function () use ($reusableUnderflowException) { return $reusableUnderflowException; }; } @@ -104,15 +108,15 @@ class WsServer implements HttpServerInterface { /** * {@inheritdoc} */ - public function onOpen(ConnectionInterface $conn, RequestInterface $request = null) { - if (null === $request) { + public function onOpen(ConnectionInterface $conn, RequestInterface $request = NULL) { + if (NULL === $request) { throw new \UnexpectedValueException('$request can not be null'); } $conn->httpRequest = $request; - $conn->WebSocket = new \StdClass; - $conn->WebSocket->closing = false; + $conn->WebSocket = new \StdClass; + $conn->WebSocket->closing = FALSE; $response = $this->handshakeNegotiator->handshake($request)->withHeader('X-Powered-By', \Ratchet\VERSION); @@ -126,14 +130,14 @@ class WsServer implements HttpServerInterface { $streamer = new MessageBuffer( $this->closeFrameChecker, - function(MessageInterface $msg) use ($wsConn) { + function (MessageInterface $msg) use ($wsConn) { $cb = $this->msgCb; $cb($wsConn, $msg); }, - function(FrameInterface $frame) use ($wsConn) { + function (FrameInterface $frame) use ($wsConn) { $this->onControlFrame($frame, $wsConn); }, - true, + TRUE, $this->ueFlowFactory ); @@ -182,12 +186,12 @@ class WsServer implements HttpServerInterface { $conn->close($frame); break; case Frame::OP_PING: - $conn->send(new Frame($frame->getPayload(), true, Frame::OP_PONG)); + $conn->send(new Frame($frame->getPayload(), TRUE, Frame::OP_PONG)); break; case Frame::OP_PONG: $pongReceiver = $this->pongReceiver; $pongReceiver($frame, $conn); - break; + break; } } @@ -196,30 +200,30 @@ class WsServer implements HttpServerInterface { } public function enableKeepAlive(LoopInterface $loop, $interval = 30) { - $lastPing = new Frame(uniqid(), true, Frame::OP_PING); + $lastPing = new Frame(uniqid(), TRUE, Frame::OP_PING); $pingedConnections = new \SplObjectStorage; $splClearer = new \SplObjectStorage; - $this->pongReceiver = function(FrameInterface $frame, $wsConn) use ($pingedConnections, &$lastPing) { + $this->pongReceiver = function (FrameInterface $frame, $wsConn) use ($pingedConnections, &$lastPing) { if ($frame->getPayload() === $lastPing->getPayload()) { $pingedConnections->detach($wsConn); } }; - $loop->addPeriodicTimer((int)$interval, function() use ($pingedConnections, &$lastPing, $splClearer) { + $loop->addPeriodicTimer((int)$interval, function () use ($pingedConnections, &$lastPing, $splClearer) { foreach ($pingedConnections as $wsConn) { $wsConn->close(); } $pingedConnections->removeAllExcept($splClearer); - $lastPing = new Frame(uniqid(), true, Frame::OP_PING); + $lastPing = new Frame(uniqid(), TRUE, Frame::OP_PING); foreach ($this->connections as $key => $conn) { - $wsConn = $this->connections[$conn]->connection; + $wsConn = $this->connections[$conn]->connection; $wsConn->send($lastPing); $pingedConnections->attach($wsConn); } }); - } + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServerInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServerInterface.php index 15d1f7b..f83b273 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServerInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/src/Ratchet/WebSocket/WsServerInterface.php @@ -1,10 +1,12 @@ send($msg); } @@ -18,19 +20,19 @@ class BinaryEcho implements \Ratchet\WebSocket\MessageComponentInterface { } } - $port = $argc > 1 ? $argv[1] : 8000; - $impl = sprintf('React\EventLoop\%sLoop', $argc > 2 ? $argv[2] : 'StreamSelect'); +$port = $argc > 1 ? $argv[1] : 8000; +$impl = sprintf('React\EventLoop\%sLoop', $argc > 2 ? $argv[2] : 'StreamSelect'); - $loop = new $impl; - $sock = new React\Socket\Server('0.0.0.0:' . $port, $loop); +$loop = new $impl; +$sock = new React\Socket\Server('0.0.0.0:' . $port, $loop); - $wsServer = new Ratchet\WebSocket\WsServer(new BinaryEcho); - // This is enabled to test https://github.com/ratchetphp/Ratchet/issues/430 - // The time is left at 10 minutes so that it will not try to every ping anything - // This causes the Ratchet server to crash on test 2.7 - $wsServer->enableKeepAlive($loop, 600); +$wsServer = new Ratchet\WebSocket\WsServer(new BinaryEcho); +// This is enabled to test https://github.com/ratchetphp/Ratchet/issues/430 +// The time is left at 10 minutes so that it will not try to every ping anything +// This causes the Ratchet server to crash on test 2.7 +$wsServer->enableKeepAlive($loop, 600); - $app = new Ratchet\Http\HttpServer($wsServer); +$app = new Ratchet\Http\HttpServer($wsServer); - $server = new Ratchet\Server\IoServer($app, $sock, $loop); - $server->run(); +$server = new Ratchet\Server\IoServer($app, $sock, $loop); +$server->run(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-all.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-all.json index 0494cf3..6a6c3c0 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-all.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-all.json @@ -1,15 +1,41 @@ { - "options": {"failByDrop": false} - , "outdir": "reports/ab" - - , "servers": [ - {"agent": "Ratchet/0.4 libevent", "url": "ws://localhost:8001", "options": {"version": 18}} - , {"agent": "Ratchet/0.4 libev", "url": "ws://localhost:8004", "options": {"version": 18}} - , {"agent": "Ratchet/0.4 streams", "url": "ws://localhost:8002", "options": {"version": 18}} - , {"agent": "AutobahnTestSuite/0.5.9", "url": "ws://localhost:8000", "options": {"version": 18}} - ] - - , "cases": ["*"] - , "exclude-cases": [] - , "exclude-agent-cases": {} + "options": { + "failByDrop": false + }, + "outdir": "reports/ab", + "servers": [ + { + "agent": "Ratchet/0.4 libevent", + "url": "ws://localhost:8001", + "options": { + "version": 18 + } + }, + { + "agent": "Ratchet/0.4 libev", + "url": "ws://localhost:8004", + "options": { + "version": 18 + } + }, + { + "agent": "Ratchet/0.4 streams", + "url": "ws://localhost:8002", + "options": { + "version": 18 + } + }, + { + "agent": "AutobahnTestSuite/0.5.9", + "url": "ws://localhost:8000", + "options": { + "version": 18 + } + } + ], + "cases": [ + "*" + ], + "exclude-cases": [], + "exclude-agent-cases": {} } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-profile.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-profile.json index e81a9fd..294762c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-profile.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-profile.json @@ -1,12 +1,29 @@ { - "options": {"failByDrop": false} - , "outdir": "reports/profile" - - , "servers": [ - {"agent": "Ratchet", "url": "ws://localhost:8000", "options": {"version": 18}} - ] - - , "cases": ["9.7.4"] - , "exclude-cases": ["1.2.*", "2.3", "2.4", "2.6", "9.2.*", "9.4.*", "9.6.*", "9.8.*"] - , "exclude-agent-cases": {} + "options": { + "failByDrop": false + }, + "outdir": "reports/profile", + "servers": [ + { + "agent": "Ratchet", + "url": "ws://localhost:8000", + "options": { + "version": 18 + } + } + ], + "cases": [ + "9.7.4" + ], + "exclude-cases": [ + "1.2.*", + "2.3", + "2.4", + "2.6", + "9.2.*", + "9.4.*", + "9.6.*", + "9.8.*" + ], + "exclude-agent-cases": {} } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-quick.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-quick.json index c92e805..79af1db 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-quick.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/autobahn/fuzzingclient-quick.json @@ -1,12 +1,20 @@ { - "options": {"failByDrop": false} - , "outdir": "reports/rfc" - - , "servers": [ - {"agent": "Ratchet", "url": "ws://localhost:8000", "options": {"version": 18}} - ] - - , "cases": ["*"] - , "exclude-cases": [] - , "exclude-agent-cases": {} + "options": { + "failByDrop": false + }, + "outdir": "reports/rfc", + "servers": [ + { + "agent": "Ratchet", + "url": "ws://localhost:8000", + "options": { + "version": 18 + } + } + ], + "cases": [ + "*" + ], + "exclude-cases": [], + "exclude-agent-cases": {} } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/bootstrap.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/bootstrap.php index 40791ba..681beba 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/bootstrap.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/bootstrap.php @@ -1,4 +1,4 @@ addPsr4('Ratchet\\', __DIR__ . '/helpers/Ratchet'); +$loader = require __DIR__ . '/../vendor/autoload.php'; +$loader->addPsr4('Ratchet\\', __DIR__ . '/helpers/Ratchet'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/AbstractMessageComponentTestCase.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/AbstractMessageComponentTestCase.php index 8c298e5..f66e465 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/AbstractMessageComponentTestCase.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/AbstractMessageComponentTestCase.php @@ -1,18 +1,22 @@ _app = $this->getMock($this->getComponentClassString()); - $decorator = $this->getDecoratorClassString(); + $this->_app = $this->getMock($this->getComponentClassString()); + $decorator = $this->getDecoratorClassString(); $this->_serv = new $decorator($this->_app); $this->_conn = $this->getMock('\Ratchet\ConnectionInterface'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Component.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Component.php index e152988..2475c63 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Component.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Component.php @@ -1,15 +1,18 @@ last[__FUNCTION__] = func_get_args(); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Connection.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Connection.php index 5918296..590c8ac 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Connection.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/Connection.php @@ -1,11 +1,14 @@ '' - , 'close' => false + 'send' => '' + , 'close' => FALSE ); public $remoteAddress = '127.0.0.1'; @@ -15,6 +18,6 @@ class Connection implements ConnectionInterface { } public function close() { - $this->last[__FUNCTION__] = true; + $this->last[__FUNCTION__] = TRUE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/ConnectionDecorator.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/ConnectionDecorator.php index 5570c07..9cbcc7a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/ConnectionDecorator.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/ConnectionDecorator.php @@ -1,11 +1,14 @@ '' - , 'end' => false + , 'end' => FALSE ); public function send($data) { @@ -15,7 +18,7 @@ class ConnectionDecorator extends AbstractConnectionDecorator { } public function close() { - $this->last[__FUNCTION__] = true; + $this->last[__FUNCTION__] = TRUE; $this->getConnection()->close(); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/WampComponent.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/WampComponent.php index cd526cb..c65044e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/WampComponent.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/helpers/Ratchet/Mock/WampComponent.php @@ -1,10 +1,13 @@ mock = $this->getMock('\Ratchet\ConnectionInterface'); - $this->l1 = new ConnectionDecorator($this->mock); - $this->l2 = new ConnectionDecorator($this->l1); + $this->l1 = new ConnectionDecorator($this->mock); + $this->l2 = new ConnectionDecorator($this->l1); } public function testGet() { @@ -84,9 +87,9 @@ class AbstractConnectionDecoratorTest extends \PHPUnit_Framework_TestCase { } public function testGetConnection() { - $class = new \ReflectionClass('\\Ratchet\\AbstractConnectionDecorator'); + $class = new \ReflectionClass('\\Ratchet\\AbstractConnectionDecorator'); $method = $class->getMethod('getConnection'); - $method->setAccessible(true); + $method->setAccessible(TRUE); $conn = $method->invokeArgs($this->l1, array()); @@ -94,9 +97,9 @@ class AbstractConnectionDecoratorTest extends \PHPUnit_Framework_TestCase { } public function testGetConnectionLevel2() { - $class = new \ReflectionClass('\\Ratchet\\AbstractConnectionDecorator'); + $class = new \ReflectionClass('\\Ratchet\\AbstractConnectionDecorator'); $method = $class->getMethod('getConnection'); - $method->setAccessible(true); + $method->setAccessible(TRUE); $conn = $method->invokeArgs($this->l2, array()); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Http/HttpRequestParserTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Http/HttpRequestParserTest.php index 6af8402..c200940 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Http/HttpRequestParserTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Http/HttpRequestParserTest.php @@ -1,10 +1,12 @@ _conn->httpHeadersReceived = true; + $this->_conn->httpHeadersReceived = TRUE; } public function getConnectionClassString() { @@ -26,14 +29,14 @@ class HttpServerTest extends AbstractMessageComponentTestCase { public function testOpen() { $headers = "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\n"; - $this->_conn->httpHeadersReceived = false; + $this->_conn->httpHeadersReceived = FALSE; $this->_app->expects($this->once())->method('onOpen')->with($this->isExpectedConnection()); $this->_serv->onMessage($this->_conn, $headers); } public function testOnMessageAfterHeaders() { $headers = "GET / HTTP/1.1\r\nHost: socketo.me\r\n\r\n"; - $this->_conn->httpHeadersReceived = false; + $this->_conn->httpHeadersReceived = FALSE; $this->_serv->onMessage($this->_conn, $headers); $message = "Hello World!"; @@ -43,19 +46,19 @@ class HttpServerTest extends AbstractMessageComponentTestCase { public function testBufferOverflow() { $this->_conn->expects($this->once())->method('close'); - $this->_conn->httpHeadersReceived = false; + $this->_conn->httpHeadersReceived = FALSE; $this->_serv->onMessage($this->_conn, str_repeat('a', 5000)); } public function testCloseIfNotEstablished() { - $this->_conn->httpHeadersReceived = false; + $this->_conn->httpHeadersReceived = FALSE; $this->_conn->expects($this->once())->method('close'); $this->_serv->onError($this->_conn, new \Exception('Whoops!')); } public function testBufferHeaders() { - $this->_conn->httpHeadersReceived = false; + $this->_conn->httpHeadersReceived = FALSE; $this->_app->expects($this->never())->method('onOpen'); $this->_app->expects($this->never())->method('onMessage'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Http/OriginCheckTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Http/OriginCheckTest.php index c1c4012..4694b91 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Http/OriginCheckTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Http/OriginCheckTest.php @@ -1,11 +1,14 @@ _conn = $this->getMock('\Ratchet\ConnectionInterface'); - $this->_uri = $this->getMock('Psr\Http\Message\UriInterface'); - $this->_req = $this->getMock('\Psr\Http\Message\RequestInterface'); + $this->_uri = $this->getMock('Psr\Http\Message\UriInterface'); + $this->_req = $this->getMock('\Psr\Http\Message\RequestInterface'); $this->_req ->expects($this->any()) ->method('getUri') @@ -31,13 +34,13 @@ class RouterTest extends \PHPUnit_Framework_TestCase { ->expects($this->any()) ->method('getContext') ->will($this->returnValue($this->getMock('Symfony\Component\Routing\RequestContext'))); - $this->_router = new Router($this->_matcher); + $this->_router = new Router($this->_matcher); $this->_uri->expects($this->any())->method('getPath')->will($this->returnValue('ws://doesnt.matter/')); - $this->_uri->expects($this->any())->method('withQuery')->with($this->callback(function($val) { + $this->_uri->expects($this->any())->method('withQuery')->with($this->callback(function ($val) { $this->setResult($val); - return true; + return TRUE; }))->will($this->returnSelf()); $this->_uri->expects($this->any())->method('getQuery')->will($this->returnCallback([$this, 'getResult'])); $this->_req->expects($this->any())->method('withUri')->will($this->returnSelf()); @@ -95,7 +98,7 @@ class RouterTest extends \PHPUnit_Framework_TestCase { } public function testControllerOnErrorBubbles() { - $e= new \Exception('One cannot be betrayed if one has no exceptions'); + $e = new \Exception('One cannot be betrayed if one has no exceptions'); $controller = $this->getMockBuilder('\Ratchet\WebSocket\WsServer')->disableOriginalConstructor()->getMock(); $controller->expects($this->once())->method('onError')->with($this->_conn, $e); @@ -126,17 +129,17 @@ class RouterTest extends \PHPUnit_Framework_TestCase { $this->returnValue(['_controller' => $controller, 'foo' => 'bar', 'baz' => 'qux']) ); - $conn = $this->getMock('Ratchet\Mock\Connection'); + $conn = $this->getMock('Ratchet\Mock\Connection'); $request = $this->getMock('Psr\Http\Message\RequestInterface'); $uri = new \GuzzleHttp\Psr7\Uri('ws://doesnt.matter/endpoint?hello=world&foo=nope'); - $request->expects($this->any())->method('getUri')->will($this->returnCallback(function() use (&$uri) { + $request->expects($this->any())->method('getUri')->will($this->returnCallback(function () use (&$uri) { return $uri; })); - $request->expects($this->any())->method('withUri')->with($this->callback(function($url) use (&$uri) { + $request->expects($this->any())->method('withUri')->with($this->callback(function ($url) use (&$uri) { $uri = $url; - return true; + return TRUE; }))->will($this->returnSelf()); $router = new Router($this->_matcher); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Server/EchoServerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Server/EchoServerTest.php index 47fb0e2..2e754bc 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Server/EchoServerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Server/EchoServerTest.php @@ -1,8 +1,11 @@ reactor = new Server(0, $loop); $uri = $this->reactor->getAddress(); - $this->port = parse_url((strpos($uri, '://') === false ? 'tcp://' : '') . $uri, PHP_URL_PORT); + $this->port = parse_url((strpos($uri, '://') === FALSE ? 'tcp://' : '') . $uri, PHP_URL_PORT); $this->server = new IoServer($this->app, $this->reactor, $loop); } @@ -43,7 +46,7 @@ class IoServerTest extends \PHPUnit_Framework_TestCase { $this->app->expects($this->once())->method('onMessage')->with( $this->isInstanceOf('\\Ratchet\\ConnectionInterface') - , $msg + , $msg ); $client = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); @@ -89,14 +92,14 @@ class IoServerTest extends \PHPUnit_Framework_TestCase { public function testNoLoopProvidedError() { $this->setExpectedException('RuntimeException'); - $io = new IoServer($this->app, $this->reactor); + $io = new IoServer($this->app, $this->reactor); $io->run(); } public function testOnErrorPassesException() { $conn = $this->getMock('\\React\\Socket\\ConnectionInterface'); $conn->decor = $this->getMock('\\Ratchet\\ConnectionInterface'); - $err = new \Exception("Nope"); + $err = new \Exception("Nope"); $this->app->expects($this->once())->method('onError')->with($conn->decor, $err); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Server/IpBlackListComponentTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Server/IpBlackListComponentTest.php index 90f4185..79533d0 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Server/IpBlackListComponentTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Server/IpBlackListComponentTest.php @@ -1,11 +1,14 @@ newConn(); - $msg = 'Hello not being blocked'; + $msg = 'Hello not being blocked'; $this->mock->expects($this->once())->method('onMessage')->with($conn, $msg); @@ -75,21 +78,20 @@ class IpBlackListTest extends \PHPUnit_Framework_TestCase { public function testAddAndRemoveWithFluentInterfaces() { $blockOne = '127.0.0.1'; $blockTwo = '192.168.1.1'; - $unblock = '75.119.207.140'; + $unblock = '75.119.207.140'; $this->blocker ->blockAddress($unblock) ->blockAddress($blockOne) ->unblockAddress($unblock) - ->blockAddress($blockTwo) - ; + ->blockAddress($blockTwo); $this->assertEquals(array($blockOne, $blockTwo), $this->blocker->getBlockedAddresses()); } public function testDecoratorPassesErrors() { $conn = $this->newConn(); - $e = new \Exception('I threw an error'); + $e = new \Exception('I threw an error'); $this->mock->expects($this->once())->method('onError')->with($conn, $e); @@ -99,9 +101,9 @@ class IpBlackListTest extends \PHPUnit_Framework_TestCase { public function addressProvider() { return array( array('127.0.0.1', '127.0.0.1') - , array('localhost', 'localhost') - , array('fe80::1%lo0', 'fe80::1%lo0') - , array('127.0.0.1', '127.0.0.1:6392') + , array('localhost', 'localhost') + , array('fe80::1%lo0', 'fe80::1%lo0') + , array('127.0.0.1', '127.0.0.1:6392') ); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Session/Serialize/PhpHandlerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Session/Serialize/PhpHandlerTest.php index 4acf5bc..a9e1211 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Session/Serialize/PhpHandlerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Session/Serialize/PhpHandlerTest.php @@ -1,11 +1,14 @@ array( - 'hello' => 'world' - , 'last' => 1332872102 - ) - , '_sf2_flashes' => array() + , array( + '_sf2_attributes' => array( + 'hello' => 'world' + , 'last' => 1332872102 ) + , '_sf2_flashes' => array() + ) ) ); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Session/SessionComponentTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Session/SessionComponentTest.php index ebfdde4..09a10f8 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Session/SessionComponentTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Session/SessionComponentTest.php @@ -1,5 +1,7 @@ markTestSkipped('Dependency of Symfony HttpFoundation failed'); @@ -38,7 +41,7 @@ class SessionProviderTest extends AbstractMessageComponentTestCase { public function classCaseProvider() { return array( array('php', 'Php') - , array('php_binary', 'PhpBinary') + , array('php_binary', 'PhpBinary') ); } @@ -48,7 +51,7 @@ class SessionProviderTest extends AbstractMessageComponentTestCase { public function testToClassCase($in, $out) { $ref = new \ReflectionClass('\\Ratchet\\Session\\SessionProvider'); $method = $ref->getMethod('toClassCase'); - $method->setAccessible(true); + $method->setAccessible(TRUE); $component = new SessionProvider($this->getMock($this->getComponentClassString()), $this->getMock('\SessionHandlerInterface')); $this->assertEquals($out, $method->invokeArgs($component, array($in))); @@ -65,11 +68,11 @@ class SessionProviderTest extends AbstractMessageComponentTestCase { $sessionId = md5('testSession'); $dbOptions = array( - 'db_table' => 'sessions' - , 'db_id_col' => 'sess_id' - , 'db_data_col' => 'sess_data' - , 'db_time_col' => 'sess_time' - , 'db_lifetime_col' => 'sess_lifetime' + 'db_table' => 'sessions' + , 'db_id_col' => 'sess_id' + , 'db_data_col' => 'sess_data' + , 'db_time_col' => 'sess_time' + , 'db_lifetime_col' => 'sess_lifetime' ); $pdo = new \PDO("sqlite::memory:"); @@ -79,7 +82,7 @@ class SessionProviderTest extends AbstractMessageComponentTestCase { $pdoHandler = new PdoSessionHandler($pdo, $dbOptions); $pdoHandler->write($sessionId, '_sf2_attributes|a:2:{s:5:"hello";s:5:"world";s:4:"last";i:1332872102;}_sf2_flashes|a:0:{}'); - $component = new SessionProvider($this->getMock($this->getComponentClassString()), $pdoHandler, array('auto_start' => 1)); + $component = new SessionProvider($this->getMock($this->getComponentClassString()), $pdoHandler, array('auto_start' => 1)); $connection = $this->getMock('Ratchet\\ConnectionInterface'); $headers = $this->getMock('Psr\Http\Message\RequestInterface'); @@ -94,7 +97,7 @@ class SessionProviderTest extends AbstractMessageComponentTestCase { $conn = $this->getMock('Ratchet\ConnectionInterface'); $headers = $this->getMock('Psr\Http\Message\Request', array('getCookie'), array('POST', '/', array())); - $headers->expects($this->once())->method('getCookie', array(ini_get('session.name')))->will($this->returnValue(null)); + $headers->expects($this->once())->method('getCookie', array(ini_get('session.name')))->will($this->returnValue(NULL)); return $conn; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Session/Storage/VirtualSessionStoragePDOTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Session/Storage/VirtualSessionStoragePDOTest.php index 2727484..c9711e9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Session/Storage/VirtualSessionStoragePDOTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Session/Storage/VirtualSessionStoragePDOTest.php @@ -1,11 +1,14 @@ setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $pdo->exec($schema); - $pdo = null; + $pdo = NULL; $sessionHandler = new PdoSessionHandler($dsn); $serializer = new PhpHandler(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/ServerProtocolTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/ServerProtocolTest.php index 8ff68c2..99f7a38 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/ServerProtocolTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/ServerProtocolTest.php @@ -1,5 +1,7 @@ _app = new TestComponent; + $this->_app = new TestComponent; $this->_comp = new ServerProtocol($this->_app); } @@ -25,10 +28,10 @@ class ServerProtocolTest extends \PHPUnit_Framework_TestCase { public function invalidMessageProvider() { return [ [0] - , [3] - , [4] - , [8] - , [9] + , [3] + , [4] + , [8] + , [9] ]; } @@ -49,7 +52,7 @@ class ServerProtocolTest extends \PHPUnit_Framework_TestCase { $this->_comp->onOpen($conn); $message = $conn->last['send']; - $json = json_decode($message); + $json = json_decode($message); $this->assertEquals(4, count($json)); $this->assertEquals(0, $json[0]); @@ -84,13 +87,13 @@ class ServerProtocolTest extends \PHPUnit_Framework_TestCase { public function callProvider() { return [ [2, 'a', 'b'] - , [2, ['a', 'b']] - , [1, 'one'] - , [3, 'one', 'two', 'three'] - , [3, ['un', 'deux', 'trois']] - , [2, 'hi', ['hello', 'world']] - , [2, ['hello', 'world'], 'hi'] - , [2, ['hello' => 'world', 'herp' => 'derp']] + , [2, ['a', 'b']] + , [1, 'one'] + , [3, 'one', 'two', 'three'] + , [3, ['un', 'deux', 'trois']] + , [2, 'hi', ['hello', 'world']] + , [2, ['hello', 'world'], 'hi'] + , [2, ['hello' => 'world', 'herp' => 'derp']] ]; } @@ -98,11 +101,11 @@ class ServerProtocolTest extends \PHPUnit_Framework_TestCase { * @dataProvider callProvider */ public function testCall() { - $args = func_get_args(); + $args = func_get_args(); $paramNum = array_shift($args); $uri = 'http://example.com/endpoint/' . rand(1, 100); - $id = uniqid('', false); + $id = uniqid('', FALSE); $clientMessage = array_merge(array(2, $id, $uri), $args); $conn = $this->newConn(); @@ -110,7 +113,7 @@ class ServerProtocolTest extends \PHPUnit_Framework_TestCase { $this->_comp->onOpen($conn); $this->_comp->onMessage($conn, json_encode($clientMessage)); - $this->assertEquals($id, $this->_app->last['onCall'][1]); + $this->assertEquals($id, $this->_app->last['onCall'][1]); $this->assertEquals($uri, $this->_app->last['onCall'][2]); $this->assertEquals($paramNum, count($this->_app->last['onCall'][3])); @@ -137,7 +140,7 @@ class ServerProtocolTest extends \PHPUnit_Framework_TestCase { $conn = $this->newConn(); $this->_comp->onOpen($conn); - $this->_comp->onMessage($conn, json_encode(array(7, 'topic', 'event', true))); + $this->_comp->onMessage($conn, json_encode(array(7, 'topic', 'event', TRUE))); $this->assertEquals($conn->WAMP->sessionId, $this->_app->last['onPublish'][3][0]); } @@ -145,11 +148,11 @@ class ServerProtocolTest extends \PHPUnit_Framework_TestCase { public function testPublishAndEligible() { $conn = $this->newConn(); - $buddy = uniqid('', false); - $friend = uniqid('', false); + $buddy = uniqid('', FALSE); + $friend = uniqid('', FALSE); $this->_comp->onOpen($conn); - $this->_comp->onMessage($conn, json_encode(array(7, 'topic', 'event', false, array($buddy, $friend)))); + $this->_comp->onMessage($conn, json_encode(array(7, 'topic', 'event', FALSE, array($buddy, $friend)))); $this->assertEquals(array(), $this->_app->last['onPublish'][3]); $this->assertEquals(2, count($this->_app->last['onPublish'][4])); @@ -158,7 +161,7 @@ class ServerProtocolTest extends \PHPUnit_Framework_TestCase { public function eventProvider() { return array( array('http://example.com', array('one', 'two')) - , array('curie', array(array('hello' => 'world', 'herp' => 'derp'))) + , array('curie', array(array('hello' => 'world', 'herp' => 'derp'))) ); } @@ -171,7 +174,7 @@ class ServerProtocolTest extends \PHPUnit_Framework_TestCase { $eventString = $conn->last['send']; - $this->assertSame(array(8, $topic, $payload), json_decode($eventString, true)); + $this->assertSame(array(8, $topic, $payload), json_decode($eventString, TRUE)); } public function testOnClosePropagation() { @@ -180,9 +183,9 @@ class ServerProtocolTest extends \PHPUnit_Framework_TestCase { $this->_comp->onOpen($conn); $this->_comp->onClose($conn); - $class = new \ReflectionClass('\\Ratchet\\Wamp\\WampConnection'); + $class = new \ReflectionClass('\\Ratchet\\Wamp\\WampConnection'); $method = $class->getMethod('getConnection'); - $method->setAccessible(true); + $method->setAccessible(TRUE); $check = $method->invokeArgs($this->_app->last['onClose'][0], array()); @@ -197,9 +200,9 @@ class ServerProtocolTest extends \PHPUnit_Framework_TestCase { $this->_comp->onOpen($conn); $this->_comp->onError($conn, $e); - $class = new \ReflectionClass('\\Ratchet\\Wamp\\WampConnection'); + $class = new \ReflectionClass('\\Ratchet\\Wamp\\WampConnection'); $method = $class->getMethod('getConnection'); - $method->setAccessible(true); + $method->setAccessible(TRUE); $check = $method->invokeArgs($this->_app->last['onError'][0], array()); @@ -211,8 +214,8 @@ class ServerProtocolTest extends \PHPUnit_Framework_TestCase { $conn = new WampConnection($this->newConn()); $this->_comp->onOpen($conn); - $prefix = 'incoming'; - $fullURI = "http://example.com/$prefix"; + $prefix = 'incoming'; + $fullURI = "http://example.com/$prefix"; $method = 'call'; $this->_comp->onMessage($conn, json_encode(array(1, $prefix, $fullURI))); @@ -249,9 +252,9 @@ class ServerProtocolTest extends \PHPUnit_Framework_TestCase { public function badFormatProvider() { return array( - array(json_encode(true)) - , array('{"valid":"json", "invalid": "message"}') - , array('{"0": "fail", "hello": "world"}') + array(json_encode(TRUE)) + , array('{"valid":"json", "invalid": "message"}') + , array('{"0": "fail", "hello": "world"}') ); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/TopicManagerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/TopicManagerTest.php index b21b6bc..51aaf15 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/TopicManagerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/TopicManagerTest.php @@ -1,10 +1,12 @@ getMethod('getTopic'); - $method->setAccessible(true); + $method->setAccessible(TRUE); $topic = $method->invokeArgs($this->mngr, array('The Topic')); @@ -39,9 +41,9 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase { public function testGetTopicCreatesTopicWithSameName() { $name = 'The Topic'; - $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); + $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); $method = $class->getMethod('getTopic'); - $method->setAccessible(true); + $method->setAccessible(TRUE); $topic = $method->invokeArgs($this->mngr, array($name)); @@ -49,9 +51,9 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase { } public function testGetTopicReturnsSameObject() { - $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); + $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); $method = $class->getMethod('getTopic'); - $method->setAccessible(true); + $method->setAccessible(TRUE); $topic = $method->invokeArgs($this->mngr, array('No copy')); $again = $method->invokeArgs($this->mngr, array('No copy')); @@ -69,9 +71,9 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase { $this->mock->expects($this->once())->method('onCall')->with( $this->conn - , $id - , $this->isInstanceOf('Ratchet\Wamp\Topic') - , array() + , $id + , $this->isInstanceOf('Ratchet\Wamp\Topic') + , array() ); $this->mngr->onCall($this->conn, $id, 'new topic', array()); @@ -88,9 +90,9 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase { public function testTopicIsInConnectionOnSubscribe() { $name = 'New Topic'; - $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); + $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); $method = $class->getMethod('getTopic'); - $method->setAccessible(true); + $method->setAccessible(TRUE); $topic = $method->invokeArgs($this->mngr, array($name)); @@ -120,7 +122,7 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase { $name = 'getting sleepy'; $this->mock->expects($this->exactly(1))->method('onUnsubscribe'); - $this->mngr->onSubscribe($this->conn, $name); + $this->mngr->onSubscribe($this->conn, $name); $this->mngr->onUnsubscribe($this->conn, $name); $this->mngr->onUnsubscribe($this->conn, $name); } @@ -128,9 +130,9 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase { public function testUnsubscribeRemovesTopicFromConnection() { $name = 'Bye Bye Topic'; - $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); + $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); $method = $class->getMethod('getTopic'); - $method->setAccessible(true); + $method->setAccessible(TRUE); $topic = $method->invokeArgs($this->mngr, array($name)); @@ -145,10 +147,10 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase { $this->mock->expects($this->once())->method('onPublish')->with( $this->conn - , $this->isInstanceOf('Ratchet\Wamp\Topic') - , $msg - , $this->isType('array') - , $this->isType('array') + , $this->isInstanceOf('Ratchet\Wamp\Topic') + , $msg + , $this->isType('array') + , $this->isType('array') ); $this->mngr->onPublish($this->conn, 'topic coverage', $msg, array(), array()); @@ -160,12 +162,12 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase { } protected function topicProvider($name) { - $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); + $class = new \ReflectionClass('Ratchet\Wamp\TopicManager'); $method = $class->getMethod('getTopic'); - $method->setAccessible(true); + $method->setAccessible(TRUE); $attribute = $class->getProperty('topicLookup'); - $attribute->setAccessible(true); + $attribute->setAccessible(TRUE); $topic = $method->invokeArgs($this->mngr, array($name)); @@ -186,8 +188,8 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase { public static function topicConnExpectationProvider() { return [ - [ 'onClose', 0] - , ['onUnsubscribe', 0] + ['onClose', 0] + , ['onUnsubscribe', 0] ]; } @@ -217,7 +219,7 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase { public function testGetSubProtocolsBubbles() { $subs = array('hello', 'world'); - $app = $this->getMock('Ratchet\Wamp\Stub\WsWampServerInterface'); + $app = $this->getMock('Ratchet\Wamp\Stub\WsWampServerInterface'); $app->expects($this->once())->method('getSubProtocols')->will($this->returnValue($subs)); $mngr = new TopicManager($app); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/TopicTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/TopicTest.php index b8685b7..531c2de 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/TopicTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/TopicTest.php @@ -1,12 +1,14 @@ assertEquals($id, $topic->getId()); @@ -23,7 +25,7 @@ class TopicTest extends \PHPUnit_Framework_TestCase { } public function testRemove() { - $topic = new Topic('boop'); + $topic = new Topic('boop'); $tracked = $this->newConn(); $topic->add($this->newConn()); @@ -36,20 +38,20 @@ class TopicTest extends \PHPUnit_Framework_TestCase { } public function testBroadcast() { - $msg = 'Hello World!'; + $msg = 'Hello World!'; $name = 'Batman'; $protocol = json_encode(array(8, $name, $msg)); - $first = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); + $first = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); $second = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); $first->expects($this->once()) - ->method('send') - ->with($this->equalTo($protocol)); + ->method('send') + ->with($this->equalTo($protocol)); $second->expects($this->once()) - ->method('send') - ->with($this->equalTo($protocol)); + ->method('send') + ->with($this->equalTo($protocol)); $topic = new Topic($name); $topic->add($first); @@ -59,13 +61,13 @@ class TopicTest extends \PHPUnit_Framework_TestCase { } public function testBroadcastWithExclude() { - $msg = 'Hello odd numbers'; + $msg = 'Hello odd numbers'; $name = 'Excluding'; $protocol = json_encode(array(8, $name, $msg)); - $first = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); + $first = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); $second = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); - $third = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); + $third = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); $first->expects($this->once()) ->method('send') @@ -86,13 +88,13 @@ class TopicTest extends \PHPUnit_Framework_TestCase { } public function testBroadcastWithEligible() { - $msg = 'Hello white list'; + $msg = 'Hello white list'; $name = 'Eligible'; $protocol = json_encode(array(8, $name, $msg)); - $first = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); + $first = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); $second = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); - $third = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); + $third = $this->getMock('Ratchet\\Wamp\\WampConnection', array('send'), array($this->getMock('\\Ratchet\\ConnectionInterface'))); $first->expects($this->once()) ->method('send') @@ -113,29 +115,29 @@ class TopicTest extends \PHPUnit_Framework_TestCase { } public function testIterator() { - $first = $this->newConn(); + $first = $this->newConn(); $second = $this->newConn(); - $third = $this->newConn(); + $third = $this->newConn(); - $topic = new Topic('Joker'); + $topic = new Topic('Joker'); $topic->add($first)->add($second)->add($third); $check = array($first, $second, $third); foreach ($topic as $mock) { - $this->assertNotSame(false, array_search($mock, $check)); + $this->assertNotSame(FALSE, array_search($mock, $check)); } } public function testToString() { - $name = 'Bane'; + $name = 'Bane'; $topic = new Topic($name); $this->assertEquals($name, (string)$topic); } public function testDoesHave() { - $conn = $this->newConn(); + $conn = $this->newConn(); $topic = new Topic('Two Face'); $topic->add($conn); @@ -143,14 +145,14 @@ class TopicTest extends \PHPUnit_Framework_TestCase { } public function testDoesNotHave() { - $conn = $this->newConn(); + $conn = $this->newConn(); $topic = new Topic('Alfred'); $this->assertFalse($topic->has($conn)); } public function testDoesNotHaveAfterRemove() { - $conn = $this->newConn(); + $conn = $this->newConn(); $topic = new Topic('Ras'); $topic->add($conn)->remove($conn); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/WampConnectionTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/WampConnectionTest.php index adf59d5..5167449 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/WampConnectionTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/WampConnectionTest.php @@ -1,10 +1,12 @@ 'world', 'herp' => 'derp'); + $data = array('hello' => 'world', 'herp' => 'derp'); $this->mock->expects($this->once())->method('send')->with(json_encode(array(3, $callId, $data))); @@ -24,7 +26,7 @@ class WampConnectionTest extends \PHPUnit_Framework_TestCase { public function testCallError() { $callId = uniqid(); - $uri = 'http://example.com/end/point'; + $uri = 'http://example.com/end/point'; $this->mock->expects($this->once())->method('send')->with(json_encode(array(4, $callId, $uri, ''))); @@ -33,7 +35,7 @@ class WampConnectionTest extends \PHPUnit_Framework_TestCase { public function testCallErrorWithTopic() { $callId = uniqid(); - $uri = 'http://example.com/end/point'; + $uri = 'http://example.com/end/point'; $this->mock->expects($this->once())->method('send')->with(json_encode(array(4, $callId, $uri, ''))); @@ -42,8 +44,8 @@ class WampConnectionTest extends \PHPUnit_Framework_TestCase { public function testDetailedCallError() { $callId = uniqid(); - $uri = 'http://example.com/end/point'; - $desc = 'beep boop beep'; + $uri = 'http://example.com/end/point'; + $desc = 'beep boop beep'; $detail = 'Error: Too much awesome'; $this->mock->expects($this->once())->method('send')->with(json_encode(array(4, $callId, $uri, $desc, $detail))); @@ -53,7 +55,7 @@ class WampConnectionTest extends \PHPUnit_Framework_TestCase { public function testPrefix() { $shortOut = 'outgoing'; - $longOut = 'http://example.com/outgoing'; + $longOut = 'http://example.com/outgoing'; $this->mock->expects($this->once())->method('send')->with(json_encode(array(1, $shortOut, $longOut))); @@ -61,7 +63,7 @@ class WampConnectionTest extends \PHPUnit_Framework_TestCase { } public function testGetUriWhenNoCurieGiven() { - $uri = 'http://example.com/noshort'; + $uri = 'http://example.com/noshort'; $this->assertEquals($uri, $this->conn->getUri($uri)); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/WampServerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/WampServerTest.php index 626b1ce..0f427fe 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/WampServerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/cboden/ratchet/tests/unit/Wamp/WampServerTest.php @@ -1,11 +1,14 @@ _app->expects($this->once())->method('onPublish')->with( $this->isExpectedConnection() - , new \PHPUnit_Framework_Constraint_IsInstanceOf('\Ratchet\Wamp\Topic') - , $published - , array() - , array() + , new \PHPUnit_Framework_Constraint_IsInstanceOf('\Ratchet\Wamp\Topic') + , $published + , array() + , array() ); $this->_serv->onMessage($this->_conn, json_encode(array(7, 'topic', $published))); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/composer/ClassLoader.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/composer/ClassLoader.php index dc02dfb..f80a8ef 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/composer/ClassLoader.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/composer/ClassLoader.php @@ -51,14 +51,13 @@ class ClassLoader private $prefixesPsr0 = array(); private $fallbackDirsPsr0 = array(); - private $useIncludePath = false; + private $useIncludePath = FALSE; private $classMap = array(); - private $classMapAuthoritative = false; + private $classMapAuthoritative = FALSE; private $missingClasses = array(); private $apcuPrefix; - public function getPrefixes() - { + public function getPrefixes() { if (!empty($this->prefixesPsr0)) { return call_user_func_array('array_merge', $this->prefixesPsr0); } @@ -66,31 +65,26 @@ class ClassLoader return array(); } - public function getPrefixesPsr4() - { + public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } - public function getFallbackDirs() - { + public function getFallbackDirs() { return $this->fallbackDirsPsr0; } - public function getFallbackDirsPsr4() - { + public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } - public function getClassMap() - { + public function getClassMap() { return $this->classMap; } /** * @param array $classMap Class to filename map */ - public function addClassMap(array $classMap) - { + public function addClassMap(array $classMap) { if ($this->classMap) { $this->classMap = array_merge($this->classMap, $classMap); } else { @@ -102,22 +96,21 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories */ - public function add($prefix, $paths, $prepend = false) - { + public function add($prefix, $paths, $prepend = FALSE) { if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - (array) $paths, + (array)$paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - (array) $paths + (array)$paths ); } @@ -126,19 +119,19 @@ class ClassLoader $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; + $this->prefixesPsr0[$first][$prefix] = (array)$paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, + (array)$paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - (array) $paths + (array)$paths ); } } @@ -147,46 +140,45 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException */ - public function addPsr4($prefix, $paths, $prepend = false) - { + public function addPsr4($prefix, $paths, $prepend = FALSE) { if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - (array) $paths, + (array)$paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - (array) $paths + (array)$paths ); } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + } else if (!isset($this->prefixDirsPsr4[$prefix])) { // Register directories for a new namespace. $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { + $this->prefixDirsPsr4[$prefix] = (array)$paths; + } else if ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, + (array)$paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - (array) $paths + (array)$paths ); } } @@ -195,15 +187,14 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param array|string $paths The PSR-0 base directories */ - public function set($prefix, $paths) - { + public function set($prefix, $paths) { if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; + $this->fallbackDirsPsr0 = (array)$paths; } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + $this->prefixesPsr0[$prefix[0]][$prefix] = (array)$paths; } } @@ -211,22 +202,21 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param array|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException */ - public function setPsr4($prefix, $paths) - { + public function setPsr4($prefix, $paths) { if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; + $this->fallbackDirsPsr4 = (array)$paths; } else { $length = strlen($prefix); if ('\\' !== $prefix[$length - 1]) { throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; + $this->prefixDirsPsr4[$prefix] = (array)$paths; } } @@ -235,8 +225,7 @@ class ClassLoader * * @param bool $useIncludePath */ - public function setUseIncludePath($useIncludePath) - { + public function setUseIncludePath($useIncludePath) { $this->useIncludePath = $useIncludePath; } @@ -246,8 +235,7 @@ class ClassLoader * * @return bool */ - public function getUseIncludePath() - { + public function getUseIncludePath() { return $this->useIncludePath; } @@ -257,8 +245,7 @@ class ClassLoader * * @param bool $classMapAuthoritative */ - public function setClassMapAuthoritative($classMapAuthoritative) - { + public function setClassMapAuthoritative($classMapAuthoritative) { $this->classMapAuthoritative = $classMapAuthoritative; } @@ -267,8 +254,7 @@ class ClassLoader * * @return bool */ - public function isClassMapAuthoritative() - { + public function isClassMapAuthoritative() { return $this->classMapAuthoritative; } @@ -277,9 +263,8 @@ class ClassLoader * * @param string|null $apcuPrefix */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; + public function setApcuPrefix($apcuPrefix) { + $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : NULL; } /** @@ -287,8 +272,7 @@ class ClassLoader * * @return string|null */ - public function getApcuPrefix() - { + public function getApcuPrefix() { return $this->apcuPrefix; } @@ -297,31 +281,28 @@ class ClassLoader * * @param bool $prepend Whether to prepend the autoloader or not */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); + public function register($prepend = FALSE) { + spl_autoload_register(array($this, 'loadClass'), TRUE, $prepend); } /** * Unregisters this instance as an autoloader. */ - public function unregister() - { + public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); } /** * Loads the given class or interface. * - * @param string $class The name of the class + * @param string $class The name of the class * @return bool|null True if loaded, null otherwise */ - public function loadClass($class) - { + public function loadClass($class) { if ($file = $this->findFile($class)) { includeFile($file); - return true; + return TRUE; } } @@ -332,17 +313,16 @@ class ClassLoader * * @return string|false The path if found, false otherwise */ - public function findFile($class) - { + public function findFile($class) { // class map lookup if (isset($this->classMap[$class])) { return $this->classMap[$class]; } if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; + return FALSE; } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if (NULL !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix . $class, $hit); if ($hit) { return $file; } @@ -351,33 +331,32 @@ class ClassLoader $file = $this->findFileWithExtension($class, '.php'); // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { + if (FALSE === $file && defined('HHVM_VERSION')) { $file = $this->findFileWithExtension($class, '.hh'); } - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); + if (NULL !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix . $class, $file); } - if (false === $file) { + if (FALSE === $file) { // Remember that this class does not exist. - $this->missingClasses[$class] = true; + $this->missingClasses[$class] = TRUE; } return $file; } - private function findFileWithExtension($class, $ext) - { + private function findFileWithExtension($class, $ext) { // PSR-4 lookup $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; $first = $class[0]; if (isset($this->prefixLengthsPsr4[$first])) { $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { + while (FALSE !== $lastPos = strrpos($subPath, '\\')) { $subPath = substr($subPath, 0, $lastPos); - $search = $subPath.'\\'; + $search = $subPath . '\\'; if (isset($this->prefixDirsPsr4[$search])) { $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); foreach ($this->prefixDirsPsr4[$search] as $dir) { @@ -397,7 +376,7 @@ class ClassLoader } // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { + if (FALSE !== $pos = strrpos($class, '\\')) { // namespaced class name $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); @@ -430,7 +409,7 @@ class ClassLoader return $file; } - return false; + return FALSE; } } @@ -439,7 +418,6 @@ class ClassLoader * * Prevents access to $this/self from included files. */ -function includeFile($file) -{ +function includeFile($file) { include $file; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/composer/autoload_real.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/composer/autoload_real.php index 8fc42a0..9f21621 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/composer/autoload_real.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/composer/autoload_real.php @@ -6,20 +6,18 @@ class ComposerAutoloaderInit3c5661e077098f105cbab5a541fd4883 { private static $loader; - public static function loadClassLoader($class) - { + public static function loadClassLoader($class) { if ('Composer\Autoload\ClassLoader' === $class) { require __DIR__ . '/ClassLoader.php'; } } - public static function getLoader() - { - if (null !== self::$loader) { + public static function getLoader() { + if (NULL !== self::$loader) { return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit3c5661e077098f105cbab5a541fd4883', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit3c5661e077098f105cbab5a541fd4883', 'loadClassLoader'), TRUE, TRUE); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); spl_autoload_unregister(array('ComposerAutoloaderInit3c5661e077098f105cbab5a541fd4883', 'loadClassLoader')); @@ -45,7 +43,7 @@ class ComposerAutoloaderInit3c5661e077098f105cbab5a541fd4883 } } - $loader->register(true); + $loader->register(TRUE); if ($useStaticLoader) { $includeFiles = Composer\Autoload\ComposerStaticInit3c5661e077098f105cbab5a541fd4883::$files; @@ -60,11 +58,10 @@ class ComposerAutoloaderInit3c5661e077098f105cbab5a541fd4883 } } -function composerRequire3c5661e077098f105cbab5a541fd4883($fileIdentifier, $file) -{ +function composerRequire3c5661e077098f105cbab5a541fd4883($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { require $file; - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = TRUE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/composer/autoload_static.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/composer/autoload_static.php index b5b4c27..7358687 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/composer/autoload_static.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/composer/autoload_static.php @@ -6,7 +6,7 @@ namespace Composer\Autoload; class ComposerStaticInit3c5661e077098f105cbab5a541fd4883 { - public static $files = array ( + public static $files = array( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', '5255c38a0faeba867671b61dfda6d864' => __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php', '6b06ce8ccf69c43a60a1e48495a034c9' => __DIR__ . '/..' . '/react/promise-timer/src/functions.php', @@ -15,139 +15,139 @@ class ComposerStaticInit3c5661e077098f105cbab5a541fd4883 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', ); - public static $prefixLengthsPsr4 = array ( - 'W' => - array ( - 'Websocket\\' => 10, - ), - 'S' => - array ( - 'Symfony\\Polyfill\\Php70\\' => 23, - 'Symfony\\Polyfill\\Mbstring\\' => 26, - 'Symfony\\Component\\Routing\\' => 26, - 'Symfony\\Component\\HttpFoundation\\' => 33, - ), - 'R' => - array ( - 'React\\Stream\\' => 13, - 'React\\Socket\\' => 13, - 'React\\Promise\\Timer\\' => 20, - 'React\\Promise\\' => 14, - 'React\\EventLoop\\' => 16, - 'React\\Dns\\' => 10, - 'React\\Cache\\' => 12, - 'Ratchet\\RFC6455\\' => 16, - 'Ratchet\\' => 8, - ), - 'P' => - array ( - 'Psr\\Http\\Message\\' => 17, - ), - 'N' => - array ( - 'Nubs\\RandomNameGenerator\\' => 25, - ), - 'M' => - array ( - 'MatthiasMullie\\PathConverter\\' => 29, - 'MatthiasMullie\\Minify\\' => 22, - ), - 'G' => - array ( - 'GuzzleHttp\\Psr7\\' => 16, - ), + public static $prefixLengthsPsr4 = array( + 'W' => + array( + 'Websocket\\' => 10, + ), + 'S' => + array( + 'Symfony\\Polyfill\\Php70\\' => 23, + 'Symfony\\Polyfill\\Mbstring\\' => 26, + 'Symfony\\Component\\Routing\\' => 26, + 'Symfony\\Component\\HttpFoundation\\' => 33, + ), + 'R' => + array( + 'React\\Stream\\' => 13, + 'React\\Socket\\' => 13, + 'React\\Promise\\Timer\\' => 20, + 'React\\Promise\\' => 14, + 'React\\EventLoop\\' => 16, + 'React\\Dns\\' => 10, + 'React\\Cache\\' => 12, + 'Ratchet\\RFC6455\\' => 16, + 'Ratchet\\' => 8, + ), + 'P' => + array( + 'Psr\\Http\\Message\\' => 17, + ), + 'N' => + array( + 'Nubs\\RandomNameGenerator\\' => 25, + ), + 'M' => + array( + 'MatthiasMullie\\PathConverter\\' => 29, + 'MatthiasMullie\\Minify\\' => 22, + ), + 'G' => + array( + 'GuzzleHttp\\Psr7\\' => 16, + ), ); - public static $prefixDirsPsr4 = array ( - 'Websocket\\' => - array ( - 0 => __DIR__ . '/../..' . '/Chatserver/src', - ), - 'Symfony\\Polyfill\\Php70\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php70', - ), - 'Symfony\\Polyfill\\Mbstring\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', - ), - 'Symfony\\Component\\Routing\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/routing', - ), - 'Symfony\\Component\\HttpFoundation\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/http-foundation', - ), - 'React\\Stream\\' => - array ( - 0 => __DIR__ . '/..' . '/react/stream/src', - ), - 'React\\Socket\\' => - array ( - 0 => __DIR__ . '/..' . '/react/socket/src', - ), - 'React\\Promise\\Timer\\' => - array ( - 0 => __DIR__ . '/..' . '/react/promise-timer/src', - ), - 'React\\Promise\\' => - array ( - 0 => __DIR__ . '/..' . '/react/promise/src', - ), - 'React\\EventLoop\\' => - array ( - 0 => __DIR__ . '/..' . '/react/event-loop/src', - ), - 'React\\Dns\\' => - array ( - 0 => __DIR__ . '/..' . '/react/dns/src', - ), - 'React\\Cache\\' => - array ( - 0 => __DIR__ . '/..' . '/react/cache/src', - ), - 'Ratchet\\RFC6455\\' => - array ( - 0 => __DIR__ . '/..' . '/ratchet/rfc6455/src', - ), - 'Ratchet\\' => - array ( - 0 => __DIR__ . '/..' . '/cboden/ratchet/src/Ratchet', - ), - 'Psr\\Http\\Message\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/http-message/src', - ), - 'Nubs\\RandomNameGenerator\\' => - array ( - 0 => __DIR__ . '/..' . '/nubs/random-name-generator/src', - ), - 'MatthiasMullie\\PathConverter\\' => - array ( - 0 => __DIR__ . '/..' . '/matthiasmullie/path-converter/src', - ), - 'MatthiasMullie\\Minify\\' => - array ( - 0 => __DIR__ . '/..' . '/matthiasmullie/minify/src', - ), - 'GuzzleHttp\\Psr7\\' => - array ( - 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', - ), + public static $prefixDirsPsr4 = array( + 'Websocket\\' => + array( + 0 => __DIR__ . '/../..' . '/Chatserver/src', + ), + 'Symfony\\Polyfill\\Php70\\' => + array( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php70', + ), + 'Symfony\\Polyfill\\Mbstring\\' => + array( + 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', + ), + 'Symfony\\Component\\Routing\\' => + array( + 0 => __DIR__ . '/..' . '/symfony/routing', + ), + 'Symfony\\Component\\HttpFoundation\\' => + array( + 0 => __DIR__ . '/..' . '/symfony/http-foundation', + ), + 'React\\Stream\\' => + array( + 0 => __DIR__ . '/..' . '/react/stream/src', + ), + 'React\\Socket\\' => + array( + 0 => __DIR__ . '/..' . '/react/socket/src', + ), + 'React\\Promise\\Timer\\' => + array( + 0 => __DIR__ . '/..' . '/react/promise-timer/src', + ), + 'React\\Promise\\' => + array( + 0 => __DIR__ . '/..' . '/react/promise/src', + ), + 'React\\EventLoop\\' => + array( + 0 => __DIR__ . '/..' . '/react/event-loop/src', + ), + 'React\\Dns\\' => + array( + 0 => __DIR__ . '/..' . '/react/dns/src', + ), + 'React\\Cache\\' => + array( + 0 => __DIR__ . '/..' . '/react/cache/src', + ), + 'Ratchet\\RFC6455\\' => + array( + 0 => __DIR__ . '/..' . '/ratchet/rfc6455/src', + ), + 'Ratchet\\' => + array( + 0 => __DIR__ . '/..' . '/cboden/ratchet/src/Ratchet', + ), + 'Psr\\Http\\Message\\' => + array( + 0 => __DIR__ . '/..' . '/psr/http-message/src', + ), + 'Nubs\\RandomNameGenerator\\' => + array( + 0 => __DIR__ . '/..' . '/nubs/random-name-generator/src', + ), + 'MatthiasMullie\\PathConverter\\' => + array( + 0 => __DIR__ . '/..' . '/matthiasmullie/path-converter/src', + ), + 'MatthiasMullie\\Minify\\' => + array( + 0 => __DIR__ . '/..' . '/matthiasmullie/minify/src', + ), + 'GuzzleHttp\\Psr7\\' => + array( + 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', + ), ); - public static $prefixesPsr0 = array ( - 'E' => - array ( - 'Evenement' => - array ( - 0 => __DIR__ . '/..' . '/evenement/evenement/src', - ), - ), + public static $prefixesPsr0 = array( + 'E' => + array( + 'Evenement' => + array( + 0 => __DIR__ . '/..' . '/evenement/evenement/src', + ), + ), ); - public static $classMap = array ( + public static $classMap = array( 'ArithmeticError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php', 'AssertionError' => __DIR__ . '/..' . '/symfony/polyfill-php70/Resources/stubs/AssertionError.php', 'CssAtCharsetParserPlugin' => __DIR__ . '/..' . '/natxet/CssMin/src/CssMin.php', @@ -225,14 +225,13 @@ class ComposerStaticInit3c5661e077098f105cbab5a541fd4883 'aCssToken' => __DIR__ . '/..' . '/natxet/CssMin/src/CssMin.php', ); - public static function getInitializer(ClassLoader $loader) - { + public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInit3c5661e077098f105cbab5a541fd4883::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit3c5661e077098f105cbab5a541fd4883::$prefixDirsPsr4; $loader->prefixesPsr0 = ComposerStaticInit3c5661e077098f105cbab5a541fd4883::$prefixesPsr0; $loader->classMap = ComposerStaticInit3c5661e077098f105cbab5a541fd4883::$classMap; - }, null, ClassLoader::class); + }, NULL, ClassLoader::class); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/composer/installed.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/composer/installed.json index c8ca472..cf395d9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/composer/installed.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/composer/installed.json @@ -1,1125 +1,1125 @@ [ - { - "name": "cboden/ratchet", - "version": "v0.4.1", - "version_normalized": "0.4.1.0", - "source": { - "type": "git", - "url": "https://github.com/ratchetphp/Ratchet.git", - "reference": "0d31f3a8ad4795fd48397712709e55cd07f51360" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ratchetphp/Ratchet/zipball/0d31f3a8ad4795fd48397712709e55cd07f51360", - "reference": "0d31f3a8ad4795fd48397712709e55cd07f51360", - "shasum": "" - }, - "require": { - "guzzlehttp/psr7": "^1.0", - "php": ">=5.4.2", - "ratchet/rfc6455": "^0.2", - "react/socket": "^1.0 || ^0.8 || ^0.7 || ^0.6 || ^0.5", - "symfony/http-foundation": "^2.6|^3.0|^4.0", - "symfony/routing": "^2.6|^3.0|^4.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.8" - }, - "time": "2017-12-12T00:49:31+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Ratchet\\": "src/Ratchet" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "role": "Developer" - } - ], - "description": "PHP WebSocket library", - "homepage": "http://socketo.me", - "keywords": [ - "Ratchet", - "WebSockets", - "server", - "sockets", - "websocket" - ] - }, - { - "name": "evenement/evenement", - "version": "v3.0.1", - "version_normalized": "3.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/igorw/evenement.git", - "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/igorw/evenement/zipball/531bfb9d15f8aa57454f5f0285b18bec903b8fb7", - "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "time": "2017-07-23T21:35:13+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Evenement": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - } - ], - "description": "Événement is a very simple event dispatching library for PHP", - "keywords": [ - "event-dispatcher", - "event-emitter" - ] - }, - { - "name": "guzzlehttp/psr7", - "version": "1.4.2", - "version_normalized": "1.4.2.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "time": "2017-03-20T17:10:46+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "request", - "response", - "stream", - "uri", - "url" - ] - }, - { - "name": "matthiasmullie/minify", - "version": "1.3.59", - "version_normalized": "1.3.59.0", - "source": { - "type": "git", - "url": "https://github.com/matthiasmullie/minify.git", - "reference": "62dac3bce06de66f0d71fe6490cf1c508d3c3ff7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/62dac3bce06de66f0d71fe6490cf1c508d3c3ff7", - "reference": "62dac3bce06de66f0d71fe6490cf1c508d3c3ff7", - "shasum": "" - }, - "require": { - "ext-pcre": "*", - "matthiasmullie/path-converter": "~1.1", - "php": ">=5.3.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~2.0", - "matthiasmullie/scrapbook": "~1.0", - "phpunit/phpunit": "~4.8" - }, - "suggest": { - "psr/cache-implementation": "Cache implementation to use with Minify::cache" - }, - "time": "2018-02-02T12:44:18+00:00", - "bin": [ - "bin/minifycss", - "bin/minifyjs" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "MatthiasMullie\\Minify\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Matthias Mullie", - "email": "minify@mullie.eu", - "homepage": "http://www.mullie.eu", - "role": "Developer" - } - ], - "description": "CSS & JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.", - "homepage": "http://www.minifier.org", - "keywords": [ - "JS", - "css", - "javascript", - "minifier", - "minify" - ] - }, - { - "name": "matthiasmullie/path-converter", - "version": "1.1.1", - "version_normalized": "1.1.1.0", - "source": { - "type": "git", - "url": "https://github.com/matthiasmullie/path-converter.git", - "reference": "3082a6838be02b930239a97d38b5c9da4d693aca" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/matthiasmullie/path-converter/zipball/3082a6838be02b930239a97d38b5c9da4d693aca", - "reference": "3082a6838be02b930239a97d38b5c9da4d693aca", - "shasum": "" - }, - "require": { - "ext-pcre": "*", - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.8" - }, - "time": "2018-02-02T11:30:10+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "MatthiasMullie\\PathConverter\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Matthias Mullie", - "email": "pathconverter@mullie.eu", - "homepage": "http://www.mullie.eu", - "role": "Developer" - } - ], - "description": "Relative path converter", - "homepage": "http://github.com/matthiasmullie/path-converter", - "keywords": [ - "converter", - "path", - "paths", - "relative" - ] - }, - { - "name": "natxet/CssMin", - "version": "v3.0.6", - "version_normalized": "3.0.6.0", - "source": { - "type": "git", - "url": "https://github.com/natxet/CssMin.git", - "reference": "d5d9f4c3e5cedb1ae96a95a21731f8790e38f1dd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/natxet/CssMin/zipball/d5d9f4c3e5cedb1ae96a95a21731f8790e38f1dd", - "reference": "d5d9f4c3e5cedb1ae96a95a21731f8790e38f1dd", - "shasum": "" - }, - "require": { - "php": ">=5.0" - }, - "time": "2018-01-09T11:15:01+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Joe Scylla", - "email": "joe.scylla@gmail.com", - "homepage": "https://profiles.google.com/joe.scylla" - } - ], - "description": "Minifying CSS", - "homepage": "http://code.google.com/p/cssmin/", - "keywords": [ - "css", - "minify" - ] - }, - { - "name": "nubs/random-name-generator", - "version": "v2.1.0", - "version_normalized": "2.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/nubs/random-name-generator.git", - "reference": "7004eb1724e1c4a154553e44312b7045fe412b77" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nubs/random-name-generator/zipball/7004eb1724e1c4a154553e44312b7045fe412b77", - "reference": "7004eb1724e1c4a154553e44312b7045fe412b77", - "shasum": "" - }, - "require": { - "php": "~5.6 || ~7.0" - }, - "require-dev": { - "cinam/randomizer": ">=1.1.1,<2.0", - "phpunit/phpunit": "~5.0", - "satooshi/php-coveralls": "~1.0", - "squizlabs/php_codesniffer": "~2.3" - }, - "time": "2016-12-04T01:57:19+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Nubs\\RandomNameGenerator\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Spencer Rinehart", - "email": "anubis@overthemonkey.com", - "role": "Developer" - } - ], - "description": "A library to create interesting, sometimes entertaining, random names.", - "keywords": [ - "alliteration", - "generator", - "random", - "video game" - ] - }, - { - "name": "paragonie/random_compat", - "version": "v2.0.12", - "version_normalized": "2.0.12.0", - "source": { - "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/258c89a6b97de7dfaf5b8c7607d0478e236b04fb", - "reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb", - "shasum": "" - }, - "require": { - "php": ">=5.2.0" - }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." - }, - "time": "2018-04-04T21:24:14+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "lib/random.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "pseudorandom", - "random" - ] - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2016-08-06T14:39:51+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ] - }, - { - "name": "ratchet/rfc6455", - "version": "v0.2.3", - "version_normalized": "0.2.3.0", - "source": { - "type": "git", - "url": "https://github.com/ratchetphp/RFC6455.git", - "reference": "cc8a1a46a703ce01de10fdb5fab387381b66edc8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ratchetphp/RFC6455/zipball/cc8a1a46a703ce01de10fdb5fab387381b66edc8", - "reference": "cc8a1a46a703ce01de10fdb5fab387381b66edc8", - "shasum": "" - }, - "require": { - "guzzlehttp/psr7": "^1.0", - "php": ">=5.4.2" - }, - "require-dev": { - "phpunit/phpunit": "4.8.*", - "react/http": "^0.4.1", - "react/socket-client": "^0.4.3" - }, - "time": "2017-09-13T13:49:42+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Ratchet\\RFC6455\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Chris Boden", - "email": "cboden@gmail.com", - "role": "Developer" - } - ], - "description": "RFC6455 WebSocket protocol handler", - "homepage": "http://socketo.me", - "keywords": [ - "WebSockets", - "rfc6455", - "websocket" - ] - }, - { - "name": "react/cache", - "version": "v0.4.2", - "version_normalized": "0.4.2.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/cache.git", - "reference": "75494f26b4ef089db9bf8c90b63c296246e099e8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/cache/zipball/75494f26b4ef089db9bf8c90b63c296246e099e8", - "reference": "75494f26b4ef089db9bf8c90b63c296246e099e8", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "react/promise": "~2.0|~1.1" - }, - "require-dev": { - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" - }, - "time": "2017-12-20T16:47:13+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "React\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Async, Promise-based cache interface for ReactPHP", - "keywords": [ - "cache", - "caching", - "promise", - "reactphp" - ] - }, - { - "name": "react/dns", - "version": "v0.4.13", - "version_normalized": "0.4.13.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/dns.git", - "reference": "7d1e08c300fd7de600810883386ee5e2a64898f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/dns/zipball/7d1e08c300fd7de600810883386ee5e2a64898f4", - "reference": "7d1e08c300fd7de600810883386ee5e2a64898f4", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "react/cache": "~0.4.0|~0.3.0", - "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", - "react/promise": "^2.1 || ^1.2.1", - "react/promise-timer": "^1.2", - "react/stream": "^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4.5" - }, - "require-dev": { - "clue/block-react": "^1.2", - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" - }, - "time": "2018-02-27T12:51:22+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "React\\Dns\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Async DNS resolver for ReactPHP", - "keywords": [ - "async", - "dns", - "dns-resolver", - "reactphp" - ] - }, - { - "name": "react/event-loop", - "version": "v0.5.1", - "version_normalized": "0.5.1.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/event-loop.git", - "reference": "e1e0647a5c6e2c86013a24e9c8252113df86105a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/event-loop/zipball/e1e0647a5c6e2c86013a24e9c8252113df86105a", - "reference": "e1e0647a5c6e2c86013a24e9c8252113df86105a", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.8.35 || ^5.7 || ^6.4" - }, - "suggest": { - "ext-event": "~1.0 for ExtEventLoop", - "ext-pcntl": "For signal handling support when using the StreamSelectLoop" - }, - "time": "2018-04-09T11:59:21+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "React\\EventLoop\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", - "keywords": [ - "asynchronous", - "event-loop" - ] - }, - { - "name": "react/promise", - "version": "v2.5.1", - "version_normalized": "2.5.1.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "62785ae604c8d69725d693eb370e1d67e94c4053" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/62785ae604c8d69725d693eb370e1d67e94c4053", - "reference": "62785ae604c8d69725d693eb370e1d67e94c4053", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.8" - }, - "time": "2017-03-25T12:08:31+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "React\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "keywords": [ - "promise", - "promises" - ] - }, - { - "name": "react/promise-timer", - "version": "v1.2.1", - "version_normalized": "1.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise-timer.git", - "reference": "9b4cd9cbe7457e0d87fe8aa7ccceab8a2c830fbd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise-timer/zipball/9b4cd9cbe7457e0d87fe8aa7ccceab8a2c830fbd", - "reference": "9b4cd9cbe7457e0d87fe8aa7ccceab8a2c830fbd", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", - "react/promise": "~2.1|~1.2" - }, - "require-dev": { - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" - }, - "time": "2017-12-22T15:41:41+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "React\\Promise\\Timer\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@lueck.tv" - } - ], - "description": "A trivial implementation of timeouts for Promises, built on top of ReactPHP.", - "homepage": "https://github.com/react/promise-timer", - "keywords": [ - "async", - "event-loop", - "promise", - "reactphp", - "timeout", - "timer" - ] - }, - { - "name": "react/socket", - "version": "v0.8.10", - "version_normalized": "0.8.10.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/socket.git", - "reference": "d3957313c92b539537fccc80170c05a27ec25796" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/socket/zipball/d3957313c92b539537fccc80170c05a27ec25796", - "reference": "d3957313c92b539537fccc80170c05a27ec25796", - "shasum": "" - }, - "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "php": ">=5.3.0", - "react/dns": "^0.4.13", - "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", - "react/promise": "^2.1 || ^1.2", - "react/promise-timer": "~1.0", - "react/stream": "^1.0 || ^0.7.1" - }, - "require-dev": { - "clue/block-react": "^1.2", - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" - }, - "time": "2018-02-28T09:32:38+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "React\\Socket\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", - "keywords": [ - "Connection", - "Socket", - "async", - "reactphp", - "stream" - ] - }, - { - "name": "react/stream", - "version": "v0.7.7", - "version_normalized": "0.7.7.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/stream.git", - "reference": "10100896018fd847a257cd81143b8e1b7be08e40" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/stream/zipball/10100896018fd847a257cd81143b8e1b7be08e40", - "reference": "10100896018fd847a257cd81143b8e1b7be08e40", - "shasum": "" - }, - "require": { - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "php": ">=5.3.8", - "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5" - }, - "require-dev": { - "clue/stream-filter": "~1.2", - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" - }, - "time": "2018-01-19T15:04:38+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "React\\Stream\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", - "keywords": [ - "event-driven", - "io", - "non-blocking", - "pipe", - "reactphp", - "readable", - "stream", - "writable" - ] - }, - { - "name": "symfony/http-foundation", - "version": "v3.4.8", - "version_normalized": "3.4.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "b11e6d165ff4cbf5685d185ab19a90f2f3bb7d1e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b11e6d165ff4cbf5685d185ab19a90f2f3bb7d1e", - "reference": "b11e6d165ff4cbf5685d185ab19a90f2f3bb7d1e", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-mbstring": "~1.1", - "symfony/polyfill-php70": "~1.6" - }, - "require-dev": { - "symfony/expression-language": "~2.8|~3.0|~4.0" - }, - "time": "2018-04-03T05:22:50+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\HttpFoundation\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony HttpFoundation Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.7.0", - "version_normalized": "1.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "time": "2018-01-30T19:27:44+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ] - }, - { - "name": "symfony/polyfill-php70", - "version": "v1.7.0", - "version_normalized": "1.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "3532bfcd8f933a7816f3a0a59682fc404776600f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/3532bfcd8f933a7816f3a0a59682fc404776600f", - "reference": "3532bfcd8f933a7816f3a0a59682fc404776600f", - "shasum": "" - }, - "require": { - "paragonie/random_compat": "~1.0|~2.0", - "php": ">=5.3.3" - }, - "time": "2018-01-30T19:27:44+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php70\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ] - }, - { - "name": "symfony/routing", - "version": "v3.4.8", - "version_normalized": "3.4.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/routing.git", - "reference": "50f333b707bef9f6972ad04e6df3ec8875c9a67c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/50f333b707bef9f6972ad04e6df3ec8875c9a67c", - "reference": "50f333b707bef9f6972ad04e6df3ec8875c9a67c", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "conflict": { - "symfony/config": "<3.3.1", - "symfony/dependency-injection": "<3.3", - "symfony/yaml": "<3.4" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "doctrine/common": "~2.2", - "psr/log": "~1.0", - "symfony/config": "^3.3.1|~4.0", - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/http-foundation": "~2.8|~3.0|~4.0", - "symfony/yaml": "~3.4|~4.0" - }, - "suggest": { - "doctrine/annotations": "For using the annotation loader", - "symfony/config": "For using the all-in-one router or any loader", - "symfony/dependency-injection": "For loading routes from a service", - "symfony/expression-language": "For using expression matching", - "symfony/http-foundation": "For using a Symfony Request object", - "symfony/yaml": "For using the YAML loader" - }, - "time": "2018-04-04T13:22:16+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Routing\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Routing Component", - "homepage": "https://symfony.com", - "keywords": [ - "router", - "routing", - "uri", - "url" - ] - } + { + "name": "cboden/ratchet", + "version": "v0.4.1", + "version_normalized": "0.4.1.0", + "source": { + "type": "git", + "url": "https://github.com/ratchetphp/Ratchet.git", + "reference": "0d31f3a8ad4795fd48397712709e55cd07f51360" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ratchetphp/Ratchet/zipball/0d31f3a8ad4795fd48397712709e55cd07f51360", + "reference": "0d31f3a8ad4795fd48397712709e55cd07f51360", + "shasum": "" + }, + "require": { + "guzzlehttp/psr7": "^1.0", + "php": ">=5.4.2", + "ratchet/rfc6455": "^0.2", + "react/socket": "^1.0 || ^0.8 || ^0.7 || ^0.6 || ^0.5", + "symfony/http-foundation": "^2.6|^3.0|^4.0", + "symfony/routing": "^2.6|^3.0|^4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "time": "2017-12-12T00:49:31+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Ratchet\\": "src/Ratchet" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "role": "Developer" + } + ], + "description": "PHP WebSocket library", + "homepage": "http://socketo.me", + "keywords": [ + "Ratchet", + "WebSockets", + "server", + "sockets", + "websocket" + ] + }, + { + "name": "evenement/evenement", + "version": "v3.0.1", + "version_normalized": "3.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/igorw/evenement.git", + "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/igorw/evenement/zipball/531bfb9d15f8aa57454f5f0285b18bec903b8fb7", + "reference": "531bfb9d15f8aa57454f5f0285b18bec903b8fb7", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "time": "2017-07-23T21:35:13+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Evenement": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ] + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "version_normalized": "1.4.2.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "time": "2017-03-20T17:10:46+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ] + }, + { + "name": "matthiasmullie/minify", + "version": "1.3.59", + "version_normalized": "1.3.59.0", + "source": { + "type": "git", + "url": "https://github.com/matthiasmullie/minify.git", + "reference": "62dac3bce06de66f0d71fe6490cf1c508d3c3ff7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/62dac3bce06de66f0d71fe6490cf1c508d3c3ff7", + "reference": "62dac3bce06de66f0d71fe6490cf1c508d3c3ff7", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "matthiasmullie/path-converter": "~1.1", + "php": ">=5.3.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.0", + "matthiasmullie/scrapbook": "~1.0", + "phpunit/phpunit": "~4.8" + }, + "suggest": { + "psr/cache-implementation": "Cache implementation to use with Minify::cache" + }, + "time": "2018-02-02T12:44:18+00:00", + "bin": [ + "bin/minifycss", + "bin/minifyjs" + ], + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "MatthiasMullie\\Minify\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthias Mullie", + "email": "minify@mullie.eu", + "homepage": "http://www.mullie.eu", + "role": "Developer" + } + ], + "description": "CSS & JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.", + "homepage": "http://www.minifier.org", + "keywords": [ + "JS", + "css", + "javascript", + "minifier", + "minify" + ] + }, + { + "name": "matthiasmullie/path-converter", + "version": "1.1.1", + "version_normalized": "1.1.1.0", + "source": { + "type": "git", + "url": "https://github.com/matthiasmullie/path-converter.git", + "reference": "3082a6838be02b930239a97d38b5c9da4d693aca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/matthiasmullie/path-converter/zipball/3082a6838be02b930239a97d38b5c9da4d693aca", + "reference": "3082a6838be02b930239a97d38b5c9da4d693aca", + "shasum": "" + }, + "require": { + "ext-pcre": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "time": "2018-02-02T11:30:10+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "MatthiasMullie\\PathConverter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthias Mullie", + "email": "pathconverter@mullie.eu", + "homepage": "http://www.mullie.eu", + "role": "Developer" + } + ], + "description": "Relative path converter", + "homepage": "http://github.com/matthiasmullie/path-converter", + "keywords": [ + "converter", + "path", + "paths", + "relative" + ] + }, + { + "name": "natxet/CssMin", + "version": "v3.0.6", + "version_normalized": "3.0.6.0", + "source": { + "type": "git", + "url": "https://github.com/natxet/CssMin.git", + "reference": "d5d9f4c3e5cedb1ae96a95a21731f8790e38f1dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/natxet/CssMin/zipball/d5d9f4c3e5cedb1ae96a95a21731f8790e38f1dd", + "reference": "d5d9f4c3e5cedb1ae96a95a21731f8790e38f1dd", + "shasum": "" + }, + "require": { + "php": ">=5.0" + }, + "time": "2018-01-09T11:15:01+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joe Scylla", + "email": "joe.scylla@gmail.com", + "homepage": "https://profiles.google.com/joe.scylla" + } + ], + "description": "Minifying CSS", + "homepage": "http://code.google.com/p/cssmin/", + "keywords": [ + "css", + "minify" + ] + }, + { + "name": "nubs/random-name-generator", + "version": "v2.1.0", + "version_normalized": "2.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/nubs/random-name-generator.git", + "reference": "7004eb1724e1c4a154553e44312b7045fe412b77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nubs/random-name-generator/zipball/7004eb1724e1c4a154553e44312b7045fe412b77", + "reference": "7004eb1724e1c4a154553e44312b7045fe412b77", + "shasum": "" + }, + "require": { + "php": "~5.6 || ~7.0" + }, + "require-dev": { + "cinam/randomizer": ">=1.1.1,<2.0", + "phpunit/phpunit": "~5.0", + "satooshi/php-coveralls": "~1.0", + "squizlabs/php_codesniffer": "~2.3" + }, + "time": "2016-12-04T01:57:19+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Nubs\\RandomNameGenerator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Spencer Rinehart", + "email": "anubis@overthemonkey.com", + "role": "Developer" + } + ], + "description": "A library to create interesting, sometimes entertaining, random names.", + "keywords": [ + "alliteration", + "generator", + "random", + "video game" + ] + }, + { + "name": "paragonie/random_compat", + "version": "v2.0.12", + "version_normalized": "2.0.12.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/258c89a6b97de7dfaf5b8c7607d0478e236b04fb", + "reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "time": "2018-04-04T21:24:14+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "lib/random.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "pseudorandom", + "random" + ] + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2016-08-06T14:39:51+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ] + }, + { + "name": "ratchet/rfc6455", + "version": "v0.2.3", + "version_normalized": "0.2.3.0", + "source": { + "type": "git", + "url": "https://github.com/ratchetphp/RFC6455.git", + "reference": "cc8a1a46a703ce01de10fdb5fab387381b66edc8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ratchetphp/RFC6455/zipball/cc8a1a46a703ce01de10fdb5fab387381b66edc8", + "reference": "cc8a1a46a703ce01de10fdb5fab387381b66edc8", + "shasum": "" + }, + "require": { + "guzzlehttp/psr7": "^1.0", + "php": ">=5.4.2" + }, + "require-dev": { + "phpunit/phpunit": "4.8.*", + "react/http": "^0.4.1", + "react/socket-client": "^0.4.3" + }, + "time": "2017-09-13T13:49:42+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Ratchet\\RFC6455\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "role": "Developer" + } + ], + "description": "RFC6455 WebSocket protocol handler", + "homepage": "http://socketo.me", + "keywords": [ + "WebSockets", + "rfc6455", + "websocket" + ] + }, + { + "name": "react/cache", + "version": "v0.4.2", + "version_normalized": "0.4.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "75494f26b4ef089db9bf8c90b63c296246e099e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/75494f26b4ef089db9bf8c90b63c296246e099e8", + "reference": "75494f26b4ef089db9bf8c90b63c296246e099e8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "~2.0|~1.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + }, + "time": "2017-12-20T16:47:13+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ] + }, + { + "name": "react/dns", + "version": "v0.4.13", + "version_normalized": "0.4.13.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/dns.git", + "reference": "7d1e08c300fd7de600810883386ee5e2a64898f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/dns/zipball/7d1e08c300fd7de600810883386ee5e2a64898f4", + "reference": "7d1e08c300fd7de600810883386ee5e2a64898f4", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/cache": "~0.4.0|~0.3.0", + "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", + "react/promise": "^2.1 || ^1.2.1", + "react/promise-timer": "^1.2", + "react/stream": "^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4.5" + }, + "require-dev": { + "clue/block-react": "^1.2", + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + }, + "time": "2018-02-27T12:51:22+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "React\\Dns\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ] + }, + { + "name": "react/event-loop", + "version": "v0.5.1", + "version_normalized": "0.5.1.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "e1e0647a5c6e2c86013a24e9c8252113df86105a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/e1e0647a5c6e2c86013a24e9c8252113df86105a", + "reference": "e1e0647a5c6e2c86013a24e9c8252113df86105a", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.35 || ^5.7 || ^6.4" + }, + "suggest": { + "ext-event": "~1.0 for ExtEventLoop", + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "time": "2018-04-09T11:59:21+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ] + }, + { + "name": "react/promise", + "version": "v2.5.1", + "version_normalized": "2.5.1.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "62785ae604c8d69725d693eb370e1d67e94c4053" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/62785ae604c8d69725d693eb370e1d67e94c4053", + "reference": "62785ae604c8d69725d693eb370e1d67e94c4053", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "time": "2017-03-25T12:08:31+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "React\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ] + }, + { + "name": "react/promise-timer", + "version": "v1.2.1", + "version_normalized": "1.2.1.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise-timer.git", + "reference": "9b4cd9cbe7457e0d87fe8aa7ccceab8a2c830fbd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise-timer/zipball/9b4cd9cbe7457e0d87fe8aa7ccceab8a2c830fbd", + "reference": "9b4cd9cbe7457e0d87fe8aa7ccceab8a2c830fbd", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", + "react/promise": "~2.1|~1.2" + }, + "require-dev": { + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + }, + "time": "2017-12-22T15:41:41+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "React\\Promise\\Timer\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@lueck.tv" + } + ], + "description": "A trivial implementation of timeouts for Promises, built on top of ReactPHP.", + "homepage": "https://github.com/react/promise-timer", + "keywords": [ + "async", + "event-loop", + "promise", + "reactphp", + "timeout", + "timer" + ] + }, + { + "name": "react/socket", + "version": "v0.8.10", + "version_normalized": "0.8.10.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/socket.git", + "reference": "d3957313c92b539537fccc80170c05a27ec25796" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/socket/zipball/d3957313c92b539537fccc80170c05a27ec25796", + "reference": "d3957313c92b539537fccc80170c05a27ec25796", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^0.4.13", + "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", + "react/promise": "^2.1 || ^1.2", + "react/promise-timer": "~1.0", + "react/stream": "^1.0 || ^0.7.1" + }, + "require-dev": { + "clue/block-react": "^1.2", + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + }, + "time": "2018-02-28T09:32:38+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "React\\Socket\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": [ + "Connection", + "Socket", + "async", + "reactphp", + "stream" + ] + }, + { + "name": "react/stream", + "version": "v0.7.7", + "version_normalized": "0.7.7.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/stream.git", + "reference": "10100896018fd847a257cd81143b8e1b7be08e40" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/stream/zipball/10100896018fd847a257cd81143b8e1b7be08e40", + "reference": "10100896018fd847a257cd81143b8e1b7be08e40", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5" + }, + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + }, + "time": "2018-01-19T15:04:38+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "React\\Stream\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ] + }, + { + "name": "symfony/http-foundation", + "version": "v3.4.8", + "version_normalized": "3.4.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "b11e6d165ff4cbf5685d185ab19a90f2f3bb7d1e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/b11e6d165ff4cbf5685d185ab19a90f2f3bb7d1e", + "reference": "b11e6d165ff4cbf5685d185ab19a90f2f3bb7d1e", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php70": "~1.6" + }, + "require-dev": { + "symfony/expression-language": "~2.8|~3.0|~4.0" + }, + "time": "2018-04-03T05:22:50+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony HttpFoundation Component", + "homepage": "https://symfony.com" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.7.0", + "version_normalized": "1.7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "time": "2018-01-30T19:27:44+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ] + }, + { + "name": "symfony/polyfill-php70", + "version": "v1.7.0", + "version_normalized": "1.7.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "3532bfcd8f933a7816f3a0a59682fc404776600f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/3532bfcd8f933a7816f3a0a59682fc404776600f", + "reference": "3532bfcd8f933a7816f3a0a59682fc404776600f", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "~1.0|~2.0", + "php": ">=5.3.3" + }, + "time": "2018-01-30T19:27:44+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php70\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ] + }, + { + "name": "symfony/routing", + "version": "v3.4.8", + "version_normalized": "3.4.8.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/routing.git", + "reference": "50f333b707bef9f6972ad04e6df3ec8875c9a67c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/routing/zipball/50f333b707bef9f6972ad04e6df3ec8875c9a67c", + "reference": "50f333b707bef9f6972ad04e6df3ec8875c9a67c", + "shasum": "" + }, + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "conflict": { + "symfony/config": "<3.3.1", + "symfony/dependency-injection": "<3.3", + "symfony/yaml": "<3.4" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "doctrine/common": "~2.2", + "psr/log": "~1.0", + "symfony/config": "^3.3.1|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/http-foundation": "~2.8|~3.0|~4.0", + "symfony/yaml": "~3.4|~4.0" + }, + "suggest": { + "doctrine/annotations": "For using the annotation loader", + "symfony/config": "For using the all-in-one router or any loader", + "symfony/dependency-injection": "For loading routes from a service", + "symfony/expression-language": "For using expression matching", + "symfony/http-foundation": "For using a Symfony Request object", + "symfony/yaml": "For using the YAML loader" + }, + "time": "2018-04-04T13:22:16+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Routing\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Routing Component", + "homepage": "https://symfony.com", + "keywords": [ + "router", + "routing", + "uri", + "url" + ] + } ] diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/composer.json index cbb4827..d0a986a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/composer.json @@ -1,29 +1,34 @@ { - "name": "evenement/evenement", - "description": "Événement is a very simple event dispatching library for PHP", - "keywords": ["event-dispatcher", "event-emitter"], - "license": "MIT", - "authors": [ - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - } - ], - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "autoload": { - "psr-0": { - "Evenement": "src" - } - }, - "autoload-dev": { - "psr-0": { - "Evenement": "tests" - }, - "files": ["tests/Evenement/Tests/functions.php"] + "name": "evenement/evenement", + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "license": "MIT", + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" } + ], + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "autoload": { + "psr-0": { + "Evenement": "src" + } + }, + "autoload-dev": { + "psr-0": { + "Evenement": "tests" + }, + "files": [ + "tests/Evenement/Tests/functions.php" + ] + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-emit-no-arguments.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-emit-no-arguments.php index 53d7f4b..535ae7b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-emit-no-arguments.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-emit-no-arguments.php @@ -13,16 +13,17 @@ const ITERATIONS = 10000000; use Evenement\EventEmitter; -require __DIR__.'/../vendor/autoload.php'; +require __DIR__ . '/../vendor/autoload.php'; $emitter = new EventEmitter(); -$emitter->on('event', function () {}); +$emitter->on('event', function () { +}); -$start = microtime(true); +$start = microtime(TRUE); for ($i = 0; $i < ITERATIONS; $i++) { $emitter->emit('event'); } -$time = microtime(true) - $start; +$time = microtime(TRUE) - $start; echo 'Emitting ', number_format(ITERATIONS), ' events took: ', number_format($time, 2), 's', PHP_EOL; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-emit-once.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-emit-once.php index 74f4d17..d0c74ec 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-emit-once.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-emit-once.php @@ -15,16 +15,17 @@ const ITERATIONS = 100000; use Evenement\EventEmitter; -require __DIR__.'/../vendor/autoload.php'; +require __DIR__ . '/../vendor/autoload.php'; $emitter = new EventEmitter(); for ($i = 0; $i < ITERATIONS; $i++) { - $emitter->once('event', function ($a, $b, $c) {}); + $emitter->once('event', function ($a, $b, $c) { + }); } -$start = microtime(true); +$start = microtime(TRUE); $emitter->emit('event', [1, 2, 3]); -$time = microtime(true) - $start; +$time = microtime(TRUE) - $start; echo 'Emitting one event to ', number_format(ITERATIONS), ' once listeners took: ', number_format($time, 2), 's', PHP_EOL; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-emit-one-argument.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-emit-one-argument.php index 39fc4ba..0bb1890 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-emit-one-argument.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-emit-one-argument.php @@ -13,16 +13,17 @@ const ITERATIONS = 10000000; use Evenement\EventEmitter; -require __DIR__.'/../vendor/autoload.php'; +require __DIR__ . '/../vendor/autoload.php'; $emitter = new EventEmitter(); -$emitter->on('event', function ($a) {}); +$emitter->on('event', function ($a) { +}); -$start = microtime(true); +$start = microtime(TRUE); for ($i = 0; $i < ITERATIONS; $i++) { $emitter->emit('event', [1]); } -$time = microtime(true) - $start; +$time = microtime(TRUE) - $start; echo 'Emitting ', number_format(ITERATIONS), ' events took: ', number_format($time, 2), 's', PHP_EOL; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-emit.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-emit.php index 3ab639e..3ac6c55 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-emit.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-emit.php @@ -13,16 +13,17 @@ const ITERATIONS = 10000000; use Evenement\EventEmitter; -require __DIR__.'/../vendor/autoload.php'; +require __DIR__ . '/../vendor/autoload.php'; $emitter = new EventEmitter(); -$emitter->on('event', function ($a, $b, $c) {}); +$emitter->on('event', function ($a, $b, $c) { +}); -$start = microtime(true); +$start = microtime(TRUE); for ($i = 0; $i < ITERATIONS; $i++) { $emitter->emit('event', [1, 2, 3]); } -$time = microtime(true) - $start; +$time = microtime(TRUE) - $start; echo 'Emitting ', number_format(ITERATIONS), ' events took: ', number_format($time, 2), 's', PHP_EOL; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-remove-listener-once.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-remove-listener-once.php index 414be3b..e0f8a7d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-remove-listener-once.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/examples/benchmark-remove-listener-once.php @@ -15,25 +15,26 @@ const ITERATIONS = 100000; use Evenement\EventEmitter; -require __DIR__.'/../vendor/autoload.php'; +require __DIR__ . '/../vendor/autoload.php'; $emitter = new EventEmitter(); $listeners = []; for ($i = 0; $i < ITERATIONS; $i++) { - $listeners[] = function ($a, $b, $c) {}; + $listeners[] = function ($a, $b, $c) { + }; } -$start = microtime(true); +$start = microtime(TRUE); foreach ($listeners as $listener) { $emitter->once('event', $listener); } -$time = microtime(true) - $start; +$time = microtime(TRUE) - $start; echo 'Adding ', number_format(ITERATIONS), ' once listeners took: ', number_format($time, 2), 's', PHP_EOL; -$start = microtime(true); +$start = microtime(TRUE); foreach ($listeners as $listener) { $emitter->removeListener('event', $listener); } -$time = microtime(true) - $start; +$time = microtime(TRUE) - $start; echo 'Removing ', number_format(ITERATIONS), ' once listeners took: ', number_format($time, 2), 's', PHP_EOL; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/src/Evenement/EventEmitterInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/src/Evenement/EventEmitterInterface.php index 310631a..65c83b3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/src/Evenement/EventEmitterInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/src/Evenement/EventEmitterInterface.php @@ -14,9 +14,14 @@ namespace Evenement; interface EventEmitterInterface { public function on($event, callable $listener); + public function once($event, callable $listener); + public function removeListener($event, callable $listener); - public function removeAllListeners($event = null); - public function listeners($event = null); + + public function removeAllListeners($event = NULL); + + public function listeners($event = NULL); + public function emit($event, array $arguments = []); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php index a78e65c..f186835 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php @@ -18,9 +18,8 @@ trait EventEmitterTrait protected $listeners = []; protected $onceListeners = []; - public function on($event, callable $listener) - { - if ($event === null) { + public function on($event, callable $listener) { + if ($event === NULL) { throw new InvalidArgumentException('event name must not be null'); } @@ -33,9 +32,8 @@ trait EventEmitterTrait return $this; } - public function once($event, callable $listener) - { - if ($event === null) { + public function once($event, callable $listener) { + if ($event === NULL) { throw new InvalidArgumentException('event name must not be null'); } @@ -48,15 +46,14 @@ trait EventEmitterTrait return $this; } - public function removeListener($event, callable $listener) - { - if ($event === null) { + public function removeListener($event, callable $listener) { + if ($event === NULL) { throw new InvalidArgumentException('event name must not be null'); } if (isset($this->listeners[$event])) { - $index = \array_search($listener, $this->listeners[$event], true); - if (false !== $index) { + $index = \array_search($listener, $this->listeners[$event], TRUE); + if (FALSE !== $index) { unset($this->listeners[$event][$index]); if (\count($this->listeners[$event]) === 0) { unset($this->listeners[$event]); @@ -65,8 +62,8 @@ trait EventEmitterTrait } if (isset($this->onceListeners[$event])) { - $index = \array_search($listener, $this->onceListeners[$event], true); - if (false !== $index) { + $index = \array_search($listener, $this->onceListeners[$event], TRUE); + if (FALSE !== $index) { unset($this->onceListeners[$event][$index]); if (\count($this->onceListeners[$event]) === 0) { unset($this->onceListeners[$event]); @@ -75,24 +72,22 @@ trait EventEmitterTrait } } - public function removeAllListeners($event = null) - { - if ($event !== null) { + public function removeAllListeners($event = NULL) { + if ($event !== NULL) { unset($this->listeners[$event]); } else { $this->listeners = []; } - if ($event !== null) { + if ($event !== NULL) { unset($this->onceListeners[$event]); } else { $this->onceListeners = []; } } - public function listeners($event = null): array - { - if ($event === null) { + public function listeners($event = NULL): array { + if ($event === NULL) { $events = []; $eventNames = \array_unique( \array_merge(\array_keys($this->listeners), \array_keys($this->onceListeners)) @@ -112,9 +107,8 @@ trait EventEmitterTrait ); } - public function emit($event, array $arguments = []) - { - if ($event === null) { + public function emit($event, array $arguments = []) { + if ($event === NULL) { throw new InvalidArgumentException('event name must not be null'); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/tests/Evenement/Tests/EventEmitterTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/tests/Evenement/Tests/EventEmitterTest.php index 28f3011..89ea145 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/tests/Evenement/Tests/EventEmitterTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/tests/Evenement/Tests/EventEmitterTest.php @@ -19,29 +19,25 @@ class EventEmitterTest extends TestCase { private $emitter; - public function setUp() - { + public function setUp() { $this->emitter = new EventEmitter(); } - public function testAddListenerWithLambda() - { - $this->emitter->on('foo', function () {}); + public function testAddListenerWithLambda() { + $this->emitter->on('foo', function () { + }); } - public function testAddListenerWithMethod() - { + public function testAddListenerWithMethod() { $listener = new Listener(); $this->emitter->on('foo', [$listener, 'onFoo']); } - public function testAddListenerWithStaticMethod() - { + public function testAddListenerWithStaticMethod() { $this->emitter->on('bar', ['Evenement\Tests\Listener', 'onBar']); } - public function testAddListenerWithInvalidListener() - { + public function testAddListenerWithInvalidListener() { try { $this->emitter->on('foo', 'not a callable'); $this->fail(); @@ -50,8 +46,7 @@ class EventEmitterTest extends TestCase } } - public function testOnce() - { + public function testOnce() { $listenerCalled = 0; $this->emitter->once('foo', function () use (&$listenerCalled) { @@ -69,8 +64,7 @@ class EventEmitterTest extends TestCase $this->assertSame(1, $listenerCalled); } - public function testOnceWithArguments() - { + public function testOnceWithArguments() { $capturedArgs = []; $this->emitter->once('foo', function ($a, $b) use (&$capturedArgs) { @@ -82,63 +76,58 @@ class EventEmitterTest extends TestCase $this->assertSame(array('a', 'b'), $capturedArgs); } - public function testEmitWithoutArguments() - { - $listenerCalled = false; + public function testEmitWithoutArguments() { + $listenerCalled = FALSE; $this->emitter->on('foo', function () use (&$listenerCalled) { - $listenerCalled = true; + $listenerCalled = TRUE; }); - $this->assertSame(false, $listenerCalled); + $this->assertSame(FALSE, $listenerCalled); $this->emitter->emit('foo'); - $this->assertSame(true, $listenerCalled); + $this->assertSame(TRUE, $listenerCalled); } - public function testEmitWithOneArgument() - { + public function testEmitWithOneArgument() { $test = $this; - $listenerCalled = false; + $listenerCalled = FALSE; $this->emitter->on('foo', function ($value) use (&$listenerCalled, $test) { - $listenerCalled = true; + $listenerCalled = TRUE; $test->assertSame('bar', $value); }); - $this->assertSame(false, $listenerCalled); + $this->assertSame(FALSE, $listenerCalled); $this->emitter->emit('foo', ['bar']); - $this->assertSame(true, $listenerCalled); + $this->assertSame(TRUE, $listenerCalled); } - public function testEmitWithTwoArguments() - { + public function testEmitWithTwoArguments() { $test = $this; - $listenerCalled = false; + $listenerCalled = FALSE; $this->emitter->on('foo', function ($arg1, $arg2) use (&$listenerCalled, $test) { - $listenerCalled = true; + $listenerCalled = TRUE; $test->assertSame('bar', $arg1); $test->assertSame('baz', $arg2); }); - $this->assertSame(false, $listenerCalled); + $this->assertSame(FALSE, $listenerCalled); $this->emitter->emit('foo', ['bar', 'baz']); - $this->assertSame(true, $listenerCalled); + $this->assertSame(TRUE, $listenerCalled); } - public function testEmitWithNoListeners() - { + public function testEmitWithNoListeners() { $this->emitter->emit('foo'); $this->emitter->emit('foo', ['bar']); $this->emitter->emit('foo', ['bar', 'baz']); } - public function testEmitWithTwoListeners() - { + public function testEmitWithTwoListeners() { $listenersCalled = 0; $this->emitter->on('foo', function () use (&$listenersCalled) { @@ -154,8 +143,7 @@ class EventEmitterTest extends TestCase $this->assertSame(2, $listenersCalled); } - public function testRemoveListenerMatching() - { + public function testRemoveListenerMatching() { $listenersCalled = 0; $listener = function () use (&$listenersCalled) { @@ -170,8 +158,7 @@ class EventEmitterTest extends TestCase $this->assertSame(0, $listenersCalled); } - public function testRemoveListenerNotMatching() - { + public function testRemoveListenerNotMatching() { $listenersCalled = 0; $listener = function () use (&$listenersCalled) { @@ -186,8 +173,7 @@ class EventEmitterTest extends TestCase $this->assertSame(1, $listenersCalled); } - public function testRemoveAllListenersMatching() - { + public function testRemoveAllListenersMatching() { $listenersCalled = 0; $this->emitter->on('foo', function () use (&$listenersCalled) { @@ -201,8 +187,7 @@ class EventEmitterTest extends TestCase $this->assertSame(0, $listenersCalled); } - public function testRemoveAllListenersNotMatching() - { + public function testRemoveAllListenersNotMatching() { $listenersCalled = 0; $this->emitter->on('foo', function () use (&$listenersCalled) { @@ -216,8 +201,7 @@ class EventEmitterTest extends TestCase $this->assertSame(1, $listenersCalled); } - public function testRemoveAllListenersWithoutArguments() - { + public function testRemoveAllListenersWithoutArguments() { $listenersCalled = 0; $this->emitter->on('foo', function () use (&$listenersCalled) { @@ -236,9 +220,8 @@ class EventEmitterTest extends TestCase $this->assertSame(0, $listenersCalled); } - public function testCallablesClosure() - { - $calledWith = null; + public function testCallablesClosure() { + $calledWith = NULL; $this->emitter->on('foo', function ($data) use (&$calledWith) { $calledWith = $data; @@ -249,8 +232,7 @@ class EventEmitterTest extends TestCase self::assertSame('bar', $calledWith); } - public function testCallablesClass() - { + public function testCallablesClass() { $listener = new Listener(); $this->emitter->on('foo', [$listener, 'onFoo']); @@ -260,8 +242,7 @@ class EventEmitterTest extends TestCase } - public function testCallablesClassInvoke() - { + public function testCallablesClassInvoke() { $listener = new Listener(); $this->emitter->on('foo', $listener); @@ -270,8 +251,7 @@ class EventEmitterTest extends TestCase self::assertSame(['bar'], $listener->getMagicData()); } - public function testCallablesStaticClass() - { + public function testCallablesStaticClass() { $this->emitter->on('foo', '\Evenement\Tests\Listener::onBar'); $this->emitter->emit('foo', ['bar']); @@ -279,8 +259,7 @@ class EventEmitterTest extends TestCase self::assertSame(['bar'], Listener::getStaticData()); } - public function testCallablesFunction() - { + public function testCallablesFunction() { $this->emitter->on('foo', '\Evenement\Tests\setGlobalTestData'); $this->emitter->emit('foo', ['bar']); @@ -290,14 +269,19 @@ class EventEmitterTest extends TestCase unset($GLOBALS['evenement-evenement-test-data']); } - public function testListeners() - { - $onA = function () {}; - $onB = function () {}; - $onC = function () {}; - $onceA = function () {}; - $onceB = function () {}; - $onceC = function () {}; + public function testListeners() { + $onA = function () { + }; + $onB = function () { + }; + $onC = function () { + }; + $onceA = function () { + }; + $onceB = function () { + }; + $onceC = function () { + }; self::assertCount(0, $this->emitter->listeners('event')); $this->emitter->on('event', $onA); @@ -332,15 +316,14 @@ class EventEmitterTest extends TestCase self::assertSame([$onA, $onC], $this->emitter->listeners('event')); } - public function testOnceCallIsNotRemovedWhenWorkingOverOnceListeners() - { - $aCalled = false; + public function testOnceCallIsNotRemovedWhenWorkingOverOnceListeners() { + $aCalled = FALSE; $aCallable = function () use (&$aCalled) { - $aCalled = true; + $aCalled = TRUE; }; - $bCalled = false; + $bCalled = FALSE; $bCallable = function () use (&$bCalled, $aCallable) { - $bCalled = true; + $bCalled = TRUE; $this->emitter->once('event', $aCallable); }; $this->emitter->once('event', $bCallable); @@ -357,44 +340,46 @@ class EventEmitterTest extends TestCase self::assertTrue($bCalled); } - public function testEventNameMustBeStringOn() - { + public function testEventNameMustBeStringOn() { self::expectException(InvalidArgumentException::class); self::expectExceptionMessage('event name must not be null'); - $this->emitter->on(null, function () {}); + $this->emitter->on(NULL, function () { + }); } - public function testEventNameMustBeStringOnce() - { + public function testEventNameMustBeStringOnce() { self::expectException(InvalidArgumentException::class); self::expectExceptionMessage('event name must not be null'); - $this->emitter->once(null, function () {}); + $this->emitter->once(NULL, function () { + }); } - public function testEventNameMustBeStringRemoveListener() - { + public function testEventNameMustBeStringRemoveListener() { self::expectException(InvalidArgumentException::class); self::expectExceptionMessage('event name must not be null'); - $this->emitter->removeListener(null, function () {}); + $this->emitter->removeListener(NULL, function () { + }); } - public function testEventNameMustBeStringEmit() - { + public function testEventNameMustBeStringEmit() { self::expectException(InvalidArgumentException::class); self::expectExceptionMessage('event name must not be null'); - $this->emitter->emit(null); + $this->emitter->emit(NULL); } - public function testListenersGetAll() - { - $a = function () {}; - $b = function () {}; - $c = function () {}; - $d = function () {}; + public function testListenersGetAll() { + $a = function () { + }; + $b = function () { + }; + $c = function () { + }; + $d = function () { + }; $this->emitter->once('event2', $c); $this->emitter->on('event', $a); @@ -418,8 +403,7 @@ class EventEmitterTest extends TestCase ); } - public function testOnceNestedCallRegression() - { + public function testOnceNestedCallRegression() { $first = 0; $second = 0; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/tests/Evenement/Tests/Listener.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/tests/Evenement/Tests/Listener.php index df17424..eee0aac 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/tests/Evenement/Tests/Listener.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/tests/Evenement/Tests/Listener.php @@ -19,33 +19,27 @@ class Listener private static $staticData = []; - public function onFoo($data) - { + public function onFoo($data) { $this->data[] = $data; } - public function __invoke($data) - { + public function __invoke($data) { $this->magicData[] = $data; } - public static function onBar($data) - { + public static function onBar($data) { self::$staticData[] = $data; } - public function getData() - { + public function getData() { return $this->data; } - public function getMagicData() - { + public function getMagicData() { return $this->magicData; } - public static function getStaticData() - { + public static function getStaticData() { return self::$staticData; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/tests/Evenement/Tests/functions.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/tests/Evenement/Tests/functions.php index 7f11f5b..7928621 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/tests/Evenement/Tests/functions.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/evenement/evenement/tests/Evenement/Tests/functions.php @@ -11,7 +11,6 @@ namespace Evenement\Tests; -function setGlobalTestData($data) -{ +function setGlobalTestData($data) { $GLOBALS['evenement-evenement-test-data'] = $data; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/composer.json index b1c5a90..906d94d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/composer.json @@ -1,39 +1,49 @@ { - "name": "guzzlehttp/psr7", - "type": "library", - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": ["request", "response", "message", "stream", "http", "uri", "url"], - "license": "MIT", - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" + "name": "guzzlehttp/psr7", + "type": "library", + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "request", + "response", + "message", + "stream", + "http", + "uri", + "url" + ], + "license": "MIT", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": ["src/functions_include.php"] + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" }, - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } + "files": [ + "src/functions_include.php" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" } + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/AppendStream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/AppendStream.php index 23039fd..c9a1977 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/AppendStream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/AppendStream.php @@ -1,4 +1,5 @@ addStream($stream); } } - public function __toString() - { + public function __toString() { try { $this->rewind(); return $this->getContents(); @@ -46,22 +45,20 @@ class AppendStream implements StreamInterface * * @throws \InvalidArgumentException if the stream is not readable */ - public function addStream(StreamInterface $stream) - { + public function addStream(StreamInterface $stream) { if (!$stream->isReadable()) { throw new \InvalidArgumentException('Each stream must be readable'); } // The stream is only seekable if all streams are seekable if (!$stream->isSeekable()) { - $this->seekable = false; + $this->seekable = FALSE; } $this->streams[] = $stream; } - public function getContents() - { + public function getContents() { return copy_to_string($this); } @@ -70,8 +67,7 @@ class AppendStream implements StreamInterface * * {@inheritdoc} */ - public function close() - { + public function close() { $this->pos = $this->current = 0; foreach ($this->streams as $stream) { @@ -86,14 +82,12 @@ class AppendStream implements StreamInterface * * {@inheritdoc} */ - public function detach() - { + public function detach() { $this->close(); - $this->detached = true; + $this->detached = TRUE; } - public function tell() - { + public function tell() { return $this->pos; } @@ -105,14 +99,13 @@ class AppendStream implements StreamInterface * * {@inheritdoc} */ - public function getSize() - { + public function getSize() { $size = 0; foreach ($this->streams as $stream) { $s = $stream->getSize(); - if ($s === null) { - return null; + if ($s === NULL) { + return NULL; } $size += $s; } @@ -120,15 +113,13 @@ class AppendStream implements StreamInterface return $size; } - public function eof() - { + public function eof() { return !$this->streams || ($this->current >= count($this->streams) - 1 && - $this->streams[$this->current]->eof()); + $this->streams[$this->current]->eof()); } - public function rewind() - { + public function rewind() { $this->seek(0); } @@ -137,11 +128,10 @@ class AppendStream implements StreamInterface * * {@inheritdoc} */ - public function seek($offset, $whence = SEEK_SET) - { + public function seek($offset, $whence = SEEK_SET) { if (!$this->seekable) { throw new \RuntimeException('This AppendStream is not seekable'); - } elseif ($whence !== SEEK_SET) { + } else if ($whence !== SEEK_SET) { throw new \RuntimeException('The AppendStream can only seek with SEEK_SET'); } @@ -171,18 +161,17 @@ class AppendStream implements StreamInterface * * {@inheritdoc} */ - public function read($length) - { + public function read($length) { $buffer = ''; $total = count($this->streams) - 1; $remaining = $length; - $progressToNext = false; + $progressToNext = FALSE; while ($remaining > 0) { // Progress to the next stream if needed. if ($progressToNext || $this->streams[$this->current]->eof()) { - $progressToNext = false; + $progressToNext = FALSE; if ($this->current === $total) { break; } @@ -192,8 +181,8 @@ class AppendStream implements StreamInterface $result = $this->streams[$this->current]->read($remaining); // Using a loose comparison here to match on '', false, and null - if ($result == null) { - $progressToNext = true; + if ($result == NULL) { + $progressToNext = TRUE; continue; } @@ -206,28 +195,23 @@ class AppendStream implements StreamInterface return $buffer; } - public function isReadable() - { - return true; + public function isReadable() { + return TRUE; } - public function isWritable() - { - return false; + public function isWritable() { + return FALSE; } - public function isSeekable() - { + public function isSeekable() { return $this->seekable; } - public function write($string) - { + public function write($string) { throw new \RuntimeException('Cannot write to an AppendStream'); } - public function getMetadata($key = null) - { - return $key ? null : []; + public function getMetadata($key = NULL) { + return $key ? NULL : []; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/BufferStream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/BufferStream.php index af4d4c2..ab21e27 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/BufferStream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/BufferStream.php @@ -1,4 +1,5 @@ hwm = $hwm; } - public function __toString() - { + public function __toString() { return $this->getContents(); } - public function getContents() - { + public function getContents() { $buffer = $this->buffer; $this->buffer = ''; return $buffer; } - public function close() - { + public function close() { $this->buffer = ''; } - public function detach() - { + public function detach() { $this->close(); } - public function getSize() - { + public function getSize() { return strlen($this->buffer); } - public function isReadable() - { - return true; + public function isReadable() { + return TRUE; } - public function isWritable() - { - return true; + public function isWritable() { + return TRUE; } - public function isSeekable() - { - return false; + public function isSeekable() { + return FALSE; } - public function rewind() - { + public function rewind() { $this->seek(0); } - public function seek($offset, $whence = SEEK_SET) - { + public function seek($offset, $whence = SEEK_SET) { throw new \RuntimeException('Cannot seek a BufferStream'); } - public function eof() - { + public function eof() { return strlen($this->buffer) === 0; } - public function tell() - { + public function tell() { throw new \RuntimeException('Cannot determine the position of a BufferStream'); } /** * Reads data from the buffer. */ - public function read($length) - { + public function read($length) { $currentLength = strlen($this->buffer); if ($length >= $currentLength) { @@ -114,24 +101,22 @@ class BufferStream implements StreamInterface /** * Writes data to the buffer. */ - public function write($string) - { + public function write($string) { $this->buffer .= $string; // TODO: What should happen here? if (strlen($this->buffer) >= $this->hwm) { - return false; + return FALSE; } return strlen($string); } - public function getMetadata($key = null) - { + public function getMetadata($key = NULL) { if ($key == 'hwm') { return $this->hwm; } - return $key ? null : []; + return $key ? NULL : []; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/CachingStream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/CachingStream.php index ed68f08..4bd0846 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/CachingStream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/CachingStream.php @@ -1,4 +1,5 @@ remoteStream = $stream; $this->stream = $target ?: new Stream(fopen('php://temp', 'r+')); } - public function getSize() - { + public function getSize() { return max($this->stream->getSize(), $this->remoteStream->getSize()); } - public function rewind() - { + public function rewind() { $this->seek(0); } - public function seek($offset, $whence = SEEK_SET) - { + public function seek($offset, $whence = SEEK_SET) { if ($whence == SEEK_SET) { $byte = $offset; - } elseif ($whence == SEEK_CUR) { + } else if ($whence == SEEK_CUR) { $byte = $offset + $this->tell(); - } elseif ($whence == SEEK_END) { + } else if ($whence == SEEK_END) { $size = $this->remoteStream->getSize(); - if ($size === null) { + if ($size === NULL) { $size = $this->cacheEntireStream(); } $byte = $size + $offset; @@ -72,8 +70,7 @@ class CachingStream implements StreamInterface } } - public function read($length) - { + public function read($length) { // Perform a regular read on any previously read data from the buffer $data = $this->stream->read($length); $remaining = $length - strlen($data); @@ -101,8 +98,7 @@ class CachingStream implements StreamInterface return $data; } - public function write($string) - { + public function write($string) { // When appending to the end of the currently read stream, you'll want // to skip bytes from being read from the remote stream to emulate // other stream wrappers. Basically replacing bytes of data of a fixed @@ -115,21 +111,18 @@ class CachingStream implements StreamInterface return $this->stream->write($string); } - public function eof() - { + public function eof() { return $this->stream->eof() && $this->remoteStream->eof(); } /** * Close both the remote stream and buffer stream */ - public function close() - { + public function close() { $this->remoteStream->close() && $this->stream->close(); } - private function cacheEntireStream() - { + private function cacheEntireStream() { $target = new FnStream(['write' => 'strlen']); copy_to_stream($this, $target); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/DroppingStream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/DroppingStream.php index 8935c80..52dea6f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/DroppingStream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/DroppingStream.php @@ -1,4 +1,5 @@ stream = $stream; $this->maxLength = $maxLength; } - public function write($string) - { + public function write($string) { $diff = $this->maxLength - $this->stream->getSize(); // Begin returning 0 when the underlying stream is too large. diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/FnStream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/FnStream.php index cc9b445..1b6a898 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/FnStream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/FnStream.php @@ -1,4 +1,5 @@ methods = $methods; // Create the functions on the class @@ -36,8 +36,7 @@ class FnStream implements StreamInterface * Lazily determine which methods are not implemented. * @throws \BadMethodCallException */ - public function __get($name) - { + public function __get($name) { throw new \BadMethodCallException(str_replace('_fn_', '', $name) . '() is not implemented in the FnStream'); } @@ -45,8 +44,7 @@ class FnStream implements StreamInterface /** * The close method is called on the underlying stream only if possible. */ - public function __destruct() - { + public function __destruct() { if (isset($this->_fn_close)) { call_user_func($this->_fn_close); } @@ -56,13 +54,12 @@ class FnStream implements StreamInterface * Adds custom functionality to an underlying stream by intercepting * specific method calls. * - * @param StreamInterface $stream Stream to decorate - * @param array $methods Hash of method name to a closure + * @param StreamInterface $stream Stream to decorate + * @param array $methods Hash of method name to a closure * * @return FnStream */ - public static function decorate(StreamInterface $stream, array $methods) - { + public static function decorate(StreamInterface $stream, array $methods) { // If any of the required methods were not provided, then simply // proxy to the decorated stream. foreach (array_diff(self::$slots, array_keys($methods)) as $diff) { @@ -72,78 +69,63 @@ class FnStream implements StreamInterface return new self($methods); } - public function __toString() - { + public function __toString() { return call_user_func($this->_fn___toString); } - public function close() - { + public function close() { return call_user_func($this->_fn_close); } - public function detach() - { + public function detach() { return call_user_func($this->_fn_detach); } - public function getSize() - { + public function getSize() { return call_user_func($this->_fn_getSize); } - public function tell() - { + public function tell() { return call_user_func($this->_fn_tell); } - public function eof() - { + public function eof() { return call_user_func($this->_fn_eof); } - public function isSeekable() - { + public function isSeekable() { return call_user_func($this->_fn_isSeekable); } - public function rewind() - { + public function rewind() { call_user_func($this->_fn_rewind); } - public function seek($offset, $whence = SEEK_SET) - { + public function seek($offset, $whence = SEEK_SET) { call_user_func($this->_fn_seek, $offset, $whence); } - public function isWritable() - { + public function isWritable() { return call_user_func($this->_fn_isWritable); } - public function write($string) - { + public function write($string) { return call_user_func($this->_fn_write, $string); } - public function isReadable() - { + public function isReadable() { return call_user_func($this->_fn_isReadable); } - public function read($length) - { + public function read($length) { return call_user_func($this->_fn_read, $length); } - public function getContents() - { + public function getContents() { return call_user_func($this->_fn_getContents); } - public function getMetadata($key = null) - { + public function getMetadata($key = NULL) { return call_user_func($this->_fn_getMetadata, $key); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/InflateStream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/InflateStream.php index 0051d3f..a3e9731 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/InflateStream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/InflateStream.php @@ -1,4 +1,5 @@ read(10); $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header); @@ -35,8 +35,7 @@ class InflateStream implements StreamInterface * @param $header * @return int */ - private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header) - { + private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header) { $filename_header_length = 0; if (substr(bin2hex($header), 6, 2) === '08') { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/LazyOpenStream.php index 02cec3a..487f7a3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/LazyOpenStream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/LazyOpenStream.php @@ -1,4 +1,5 @@ filename = $filename; $this->mode = $mode; } @@ -32,8 +32,7 @@ class LazyOpenStream implements StreamInterface * * @return StreamInterface */ - protected function createStream() - { + protected function createStream() { return stream_for(try_fopen($this->filename, $this->mode)); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/LimitStream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/LimitStream.php index 3c13d4f..f5332d1 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/LimitStream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/LimitStream.php @@ -1,4 +1,5 @@ setOffset($offset); } - public function eof() - { + public function eof() { // Always return true if the underlying stream is EOF if ($this->stream->eof()) { - return true; + return TRUE; } // No limit and the underlying stream is not at EOF if ($this->limit == -1) { - return false; + return FALSE; } return $this->stream->tell() >= $this->offset + $this->limit; @@ -53,11 +53,10 @@ class LimitStream implements StreamInterface * Returns the size of the limited subset of data * {@inheritdoc} */ - public function getSize() - { - if (null === ($length = $this->stream->getSize())) { - return null; - } elseif ($this->limit == -1) { + public function getSize() { + if (NULL === ($length = $this->stream->getSize())) { + return NULL; + } else if ($this->limit == -1) { return $length - $this->offset; } else { return min($this->limit, $length - $this->offset); @@ -68,8 +67,7 @@ class LimitStream implements StreamInterface * Allow for a bounded seek on the read limited stream * {@inheritdoc} */ - public function seek($offset, $whence = SEEK_SET) - { + public function seek($offset, $whence = SEEK_SET) { if ($whence !== SEEK_SET || $offset < 0) { throw new \RuntimeException(sprintf( 'Cannot seek to offset % with whence %s', @@ -93,8 +91,7 @@ class LimitStream implements StreamInterface * Give a relative tell() * {@inheritdoc} */ - public function tell() - { + public function tell() { return $this->stream->tell() - $this->offset; } @@ -105,15 +102,14 @@ class LimitStream implements StreamInterface * * @throws \RuntimeException if the stream cannot be seeked. */ - public function setOffset($offset) - { + public function setOffset($offset) { $current = $this->stream->tell(); if ($current !== $offset) { // If the stream cannot seek to the offset position, then read to it if ($this->stream->isSeekable()) { $this->stream->seek($offset); - } elseif ($current > $offset) { + } else if ($current > $offset) { throw new \RuntimeException("Could not seek to stream offset $offset"); } else { $this->stream->read($offset - $current); @@ -130,13 +126,11 @@ class LimitStream implements StreamInterface * @param int $limit Number of bytes to allow to be read from the stream. * Use -1 for no limit. */ - public function setLimit($limit) - { + public function setLimit($limit) { $this->limit = $limit; } - public function read($length) - { + public function read($length) { if ($this->limit == -1) { return $this->stream->read($length); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/MessageTrait.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/MessageTrait.php index 1e4da64..01b61c4 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/MessageTrait.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/MessageTrait.php @@ -1,4 +1,5 @@ original name at registration */ - private $headerNames = []; + private $headerNames = []; /** @var string */ private $protocol = '1.1'; @@ -20,13 +21,11 @@ trait MessageTrait /** @var StreamInterface */ private $stream; - public function getProtocolVersion() - { + public function getProtocolVersion() { return $this->protocol; } - public function withProtocolVersion($version) - { + public function withProtocolVersion($version) { if ($this->protocol === $version) { return $this; } @@ -36,18 +35,15 @@ trait MessageTrait return $new; } - public function getHeaders() - { + public function getHeaders() { return $this->headers; } - public function hasHeader($header) - { + public function hasHeader($header) { return isset($this->headerNames[strtolower($header)]); } - public function getHeader($header) - { + public function getHeader($header) { $header = strtolower($header); if (!isset($this->headerNames[$header])) { @@ -59,13 +55,11 @@ trait MessageTrait return $this->headers[$header]; } - public function getHeaderLine($header) - { + public function getHeaderLine($header) { return implode(', ', $this->getHeader($header)); } - public function withHeader($header, $value) - { + public function withHeader($header, $value) { if (!is_array($value)) { $value = [$value]; } @@ -83,8 +77,7 @@ trait MessageTrait return $new; } - public function withAddedHeader($header, $value) - { + public function withAddedHeader($header, $value) { if (!is_array($value)) { $value = [$value]; } @@ -104,8 +97,7 @@ trait MessageTrait return $new; } - public function withoutHeader($header) - { + public function withoutHeader($header) { $normalized = strtolower($header); if (!isset($this->headerNames[$normalized])) { @@ -120,8 +112,7 @@ trait MessageTrait return $new; } - public function getBody() - { + public function getBody() { if (!$this->stream) { $this->stream = stream_for(''); } @@ -129,8 +120,7 @@ trait MessageTrait return $this->stream; } - public function withBody(StreamInterface $body) - { + public function withBody(StreamInterface $body) { if ($body === $this->stream) { return $this; } @@ -140,8 +130,7 @@ trait MessageTrait return $new; } - private function setHeaders(array $headers) - { + private function setHeaders(array $headers) { $this->headerNames = $this->headers = []; foreach ($headers as $header => $value) { if (!is_array($value)) { @@ -174,8 +163,7 @@ trait MessageTrait * * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 */ - private function trimHeaderValues(array $values) - { + private function trimHeaderValues(array $values) { return array_map(function ($value) { return trim($value, " \t"); }, $values); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/MultipartStream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/MultipartStream.php index c0fd584..1e6ddc6 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/MultipartStream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/MultipartStream.php @@ -1,4 +1,5 @@ boundary = $boundary ?: sha1(uniqid('', true)); + public function __construct(array $elements = [], $boundary = NULL) { + $this->boundary = $boundary ?: sha1(uniqid('', TRUE)); $this->stream = $this->createStream($elements); } @@ -36,21 +36,18 @@ class MultipartStream implements StreamInterface * * @return string */ - public function getBoundary() - { + public function getBoundary() { return $this->boundary; } - public function isWritable() - { - return false; + public function isWritable() { + return FALSE; } /** * Get the headers needed before transferring the content of a POST file */ - private function getHeaders(array $headers) - { + private function getHeaders(array $headers) { $str = ''; foreach ($headers as $key => $value) { $str .= "{$key}: {$value}\r\n"; @@ -62,8 +59,7 @@ class MultipartStream implements StreamInterface /** * Create the aggregate stream that will be used to upload the POST data */ - protected function createStream(array $elements) - { + protected function createStream(array $elements) { $stream = new AppendStream(); foreach ($elements as $element) { @@ -76,8 +72,7 @@ class MultipartStream implements StreamInterface return $stream; } - private function addElement(AppendStream $stream, array $element) - { + private function addElement(AppendStream $stream, array $element) { foreach (['contents', 'name'] as $key) { if (!array_key_exists($key, $element)) { throw new \InvalidArgumentException("A '{$key}' key is required"); @@ -96,7 +91,7 @@ class MultipartStream implements StreamInterface list($body, $headers) = $this->createElement( $element['name'], $element['contents'], - isset($element['filename']) ? $element['filename'] : null, + isset($element['filename']) ? $element['filename'] : NULL, isset($element['headers']) ? $element['headers'] : [] ); @@ -108,8 +103,7 @@ class MultipartStream implements StreamInterface /** * @return array */ - private function createElement($name, StreamInterface $stream, $filename, array $headers) - { + private function createElement($name, StreamInterface $stream, $filename, array $headers) { // Set a default content-disposition header if one was no provided $disposition = $this->getHeader($headers, 'content-disposition'); if (!$disposition) { @@ -124,7 +118,7 @@ class MultipartStream implements StreamInterface $length = $this->getHeader($headers, 'content-length'); if (!$length) { if ($length = $stream->getSize()) { - $headers['Content-Length'] = (string) $length; + $headers['Content-Length'] = (string)$length; } } @@ -139,8 +133,7 @@ class MultipartStream implements StreamInterface return [$stream, $headers]; } - private function getHeader(array $headers, $key) - { + private function getHeader(array $headers, $key) { $lowercaseHeader = strtolower($key); foreach ($headers as $k => $v) { if (strtolower($k) === $lowercaseHeader) { @@ -148,6 +141,6 @@ class MultipartStream implements StreamInterface } } - return null; + return NULL; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/NoSeekStream.php index 2332218..ebe6994 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/NoSeekStream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/NoSeekStream.php @@ -1,4 +1,5 @@ source = $source; - $this->size = isset($options['size']) ? $options['size'] : null; + $this->size = isset($options['size']) ? $options['size'] : NULL; $this->metadata = isset($options['metadata']) ? $options['metadata'] : []; $this->buffer = new BufferStream(); } - public function __toString() - { + public function __toString() { try { return copy_to_string($this); } catch (\Exception $e) { @@ -57,64 +56,52 @@ class PumpStream implements StreamInterface } } - public function close() - { + public function close() { $this->detach(); } - public function detach() - { - $this->tellPos = false; - $this->source = null; + public function detach() { + $this->tellPos = FALSE; + $this->source = NULL; } - public function getSize() - { + public function getSize() { return $this->size; } - public function tell() - { + public function tell() { return $this->tellPos; } - public function eof() - { + public function eof() { return !$this->source; } - public function isSeekable() - { - return false; + public function isSeekable() { + return FALSE; } - public function rewind() - { + public function rewind() { $this->seek(0); } - public function seek($offset, $whence = SEEK_SET) - { + public function seek($offset, $whence = SEEK_SET) { throw new \RuntimeException('Cannot seek a PumpStream'); } - public function isWritable() - { - return false; + public function isWritable() { + return FALSE; } - public function write($string) - { + public function write($string) { throw new \RuntimeException('Cannot write to a PumpStream'); } - public function isReadable() - { - return true; + public function isReadable() { + return TRUE; } - public function read($length) - { + public function read($length) { $data = $this->buffer->read($length); $readLen = strlen($data); $this->tellPos += $readLen; @@ -129,8 +116,7 @@ class PumpStream implements StreamInterface return $data; } - public function getContents() - { + public function getContents() { $result = ''; while (!$this->eof()) { $result .= $this->read(1000000); @@ -139,22 +125,20 @@ class PumpStream implements StreamInterface return $result; } - public function getMetadata($key = null) - { + public function getMetadata($key = NULL) { if (!$key) { return $this->metadata; } - return isset($this->metadata[$key]) ? $this->metadata[$key] : null; + return isset($this->metadata[$key]) ? $this->metadata[$key] : NULL; } - private function pump($length) - { + private function pump($length) { if ($this->source) { do { $data = call_user_func($this->source, $length); - if ($data === false || $data === null) { - $this->source = null; + if ($data === FALSE || $data === NULL) { + $this->source = NULL; return; } $this->buffer->write($data); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/Request.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/Request.php index 0828548..00fa21e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/Request.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/Request.php @@ -1,4 +1,5 @@ updateHostFromUri(); } - if ($body !== '' && $body !== null) { + if ($body !== '' && $body !== NULL) { $this->stream = stream_for($body); } } - public function getRequestTarget() - { - if ($this->requestTarget !== null) { + public function getRequestTarget() { + if ($this->requestTarget !== NULL) { return $this->requestTarget; } @@ -71,8 +71,7 @@ class Request implements RequestInterface return $target; } - public function withRequestTarget($requestTarget) - { + public function withRequestTarget($requestTarget) { if (preg_match('#\s#', $requestTarget)) { throw new InvalidArgumentException( 'Invalid request target provided; cannot contain whitespace' @@ -84,25 +83,21 @@ class Request implements RequestInterface return $new; } - public function getMethod() - { + public function getMethod() { return $this->method; } - public function withMethod($method) - { + public function withMethod($method) { $new = clone $this; $new->method = strtoupper($method); return $new; } - public function getUri() - { + public function getUri() { return $this->uri; } - public function withUri(UriInterface $uri, $preserveHost = false) - { + public function withUri(UriInterface $uri, $preserveHost = FALSE) { if ($uri === $this->uri) { return $this; } @@ -117,15 +112,14 @@ class Request implements RequestInterface return $new; } - private function updateHostFromUri() - { + private function updateHostFromUri() { $host = $this->uri->getHost(); if ($host == '') { return; } - if (($port = $this->uri->getPort()) !== null) { + if (($port = $this->uri->getPort()) !== NULL) { $host .= ':' . $port; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/Response.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/Response.php index 2830c6c..cbec573 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/Response.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/Response.php @@ -1,4 +1,5 @@ statusCode = (int) $status; + $this->statusCode = (int)$status; - if ($body !== '' && $body !== null) { + if ($body !== '' && $body !== NULL) { $this->stream = stream_for($body); } @@ -103,26 +104,23 @@ class Response implements ResponseInterface if ($reason == '' && isset(self::$phrases[$this->statusCode])) { $this->reasonPhrase = self::$phrases[$this->statusCode]; } else { - $this->reasonPhrase = (string) $reason; + $this->reasonPhrase = (string)$reason; } $this->protocol = $version; } - public function getStatusCode() - { + public function getStatusCode() { return $this->statusCode; } - public function getReasonPhrase() - { + public function getReasonPhrase() { return $this->reasonPhrase; } - public function withStatus($code, $reasonPhrase = '') - { + public function withStatus($code, $reasonPhrase = '') { $new = clone $this; - $new->statusCode = (int) $code; + $new->statusCode = (int)$code; if ($reasonPhrase == '' && isset(self::$phrases[$new->statusCode])) { $reasonPhrase = self::$phrases[$new->statusCode]; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/ServerRequest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/ServerRequest.php index 575aab8..66a3fbf 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/ServerRequest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/ServerRequest.php @@ -55,18 +55,18 @@ class ServerRequest extends Request implements ServerRequestInterface private $uploadedFiles = []; /** - * @param string $method HTTP method - * @param string|UriInterface $uri URI - * @param array $headers Request headers - * @param string|null|resource|StreamInterface $body Request body - * @param string $version Protocol version - * @param array $serverParams Typically the $_SERVER superglobal + * @param string $method HTTP method + * @param string|UriInterface $uri URI + * @param array $headers Request headers + * @param string|null|resource|StreamInterface $body Request body + * @param string $version Protocol version + * @param array $serverParams Typically the $_SERVER superglobal */ public function __construct( $method, $uri, array $headers = [], - $body = null, + $body = NULL, $version = '1.1', array $serverParams = [] ) { @@ -82,16 +82,15 @@ class ServerRequest extends Request implements ServerRequestInterface * @throws InvalidArgumentException for unrecognized values * @return array */ - public static function normalizeFiles(array $files) - { + public static function normalizeFiles(array $files) { $normalized = []; foreach ($files as $key => $value) { if ($value instanceof UploadedFileInterface) { $normalized[$key] = $value; - } elseif (is_array($value) && isset($value['tmp_name'])) { + } else if (is_array($value) && isset($value['tmp_name'])) { $normalized[$key] = self::createUploadedFileFromSpec($value); - } elseif (is_array($value)) { + } else if (is_array($value)) { $normalized[$key] = self::normalizeFiles($value); continue; } else { @@ -111,16 +110,15 @@ class ServerRequest extends Request implements ServerRequestInterface * @param array $value $_FILES struct * @return array|UploadedFileInterface */ - private static function createUploadedFileFromSpec(array $value) - { + private static function createUploadedFileFromSpec(array $value) { if (is_array($value['tmp_name'])) { return self::normalizeNestedFileSpec($value); } return new UploadedFile( $value['tmp_name'], - (int) $value['size'], - (int) $value['error'], + (int)$value['size'], + (int)$value['error'], $value['name'], $value['type'] ); @@ -135,17 +133,16 @@ class ServerRequest extends Request implements ServerRequestInterface * @param array $files * @return UploadedFileInterface[] */ - private static function normalizeNestedFileSpec(array $files = []) - { + private static function normalizeNestedFileSpec(array $files = []) { $normalizedFiles = []; foreach (array_keys($files['tmp_name']) as $key) { $spec = [ 'tmp_name' => $files['tmp_name'][$key], - 'size' => $files['size'][$key], - 'error' => $files['error'][$key], - 'name' => $files['name'][$key], - 'type' => $files['type'][$key], + 'size' => $files['size'][$key], + 'error' => $files['error'][$key], + 'name' => $files['name'][$key], + 'type' => $files['type'][$key], ]; $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec); } @@ -163,8 +160,7 @@ class ServerRequest extends Request implements ServerRequestInterface * * @return ServerRequestInterface */ - public static function fromGlobals() - { + public static function fromGlobals() { $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET'; $headers = function_exists('getallheaders') ? getallheaders() : []; $uri = self::getUriFromGlobals(); @@ -190,17 +186,17 @@ class ServerRequest extends Request implements ServerRequestInterface $uri = $uri->withScheme(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' ? 'https' : 'http'); - $hasPort = false; + $hasPort = FALSE; if (isset($_SERVER['HTTP_HOST'])) { $hostHeaderParts = explode(':', $_SERVER['HTTP_HOST']); $uri = $uri->withHost($hostHeaderParts[0]); if (isset($hostHeaderParts[1])) { - $hasPort = true; + $hasPort = TRUE; $uri = $uri->withPort($hostHeaderParts[1]); } - } elseif (isset($_SERVER['SERVER_NAME'])) { + } else if (isset($_SERVER['SERVER_NAME'])) { $uri = $uri->withHost($_SERVER['SERVER_NAME']); - } elseif (isset($_SERVER['SERVER_ADDR'])) { + } else if (isset($_SERVER['SERVER_ADDR'])) { $uri = $uri->withHost($_SERVER['SERVER_ADDR']); } @@ -208,12 +204,12 @@ class ServerRequest extends Request implements ServerRequestInterface $uri = $uri->withPort($_SERVER['SERVER_PORT']); } - $hasQuery = false; + $hasQuery = FALSE; if (isset($_SERVER['REQUEST_URI'])) { $requestUriParts = explode('?', $_SERVER['REQUEST_URI']); $uri = $uri->withPath($requestUriParts[0]); if (isset($requestUriParts[1])) { - $hasQuery = true; + $hasQuery = TRUE; $uri = $uri->withQuery($requestUriParts[1]); } } @@ -229,24 +225,21 @@ class ServerRequest extends Request implements ServerRequestInterface /** * {@inheritdoc} */ - public function getServerParams() - { + public function getServerParams() { return $this->serverParams; } /** * {@inheritdoc} */ - public function getUploadedFiles() - { + public function getUploadedFiles() { return $this->uploadedFiles; } /** * {@inheritdoc} */ - public function withUploadedFiles(array $uploadedFiles) - { + public function withUploadedFiles(array $uploadedFiles) { $new = clone $this; $new->uploadedFiles = $uploadedFiles; @@ -256,16 +249,14 @@ class ServerRequest extends Request implements ServerRequestInterface /** * {@inheritdoc} */ - public function getCookieParams() - { + public function getCookieParams() { return $this->cookieParams; } /** * {@inheritdoc} */ - public function withCookieParams(array $cookies) - { + public function withCookieParams(array $cookies) { $new = clone $this; $new->cookieParams = $cookies; @@ -275,16 +266,14 @@ class ServerRequest extends Request implements ServerRequestInterface /** * {@inheritdoc} */ - public function getQueryParams() - { + public function getQueryParams() { return $this->queryParams; } /** * {@inheritdoc} */ - public function withQueryParams(array $query) - { + public function withQueryParams(array $query) { $new = clone $this; $new->queryParams = $query; @@ -294,16 +283,14 @@ class ServerRequest extends Request implements ServerRequestInterface /** * {@inheritdoc} */ - public function getParsedBody() - { + public function getParsedBody() { return $this->parsedBody; } /** * {@inheritdoc} */ - public function withParsedBody($data) - { + public function withParsedBody($data) { $new = clone $this; $new->parsedBody = $data; @@ -313,17 +300,15 @@ class ServerRequest extends Request implements ServerRequestInterface /** * {@inheritdoc} */ - public function getAttributes() - { + public function getAttributes() { return $this->attributes; } /** * {@inheritdoc} */ - public function getAttribute($attribute, $default = null) - { - if (false === array_key_exists($attribute, $this->attributes)) { + public function getAttribute($attribute, $default = NULL) { + if (FALSE === array_key_exists($attribute, $this->attributes)) { return $default; } @@ -333,8 +318,7 @@ class ServerRequest extends Request implements ServerRequestInterface /** * {@inheritdoc} */ - public function withAttribute($attribute, $value) - { + public function withAttribute($attribute, $value) { $new = clone $this; $new->attributes[$attribute] = $value; @@ -344,9 +328,8 @@ class ServerRequest extends Request implements ServerRequestInterface /** * {@inheritdoc} */ - public function withoutAttribute($attribute) - { - if (false === array_key_exists($attribute, $this->attributes)) { + public function withoutAttribute($attribute) { + if (FALSE === array_key_exists($attribute, $this->attributes)) { return $this; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/Stream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/Stream.php index e336628..212c3d5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/Stream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/Stream.php @@ -1,4 +1,5 @@ [ - 'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true, - 'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true, - 'c+b' => true, 'rt' => true, 'w+t' => true, 'r+t' => true, - 'x+t' => true, 'c+t' => true, 'a+' => true + 'r' => TRUE, 'w+' => TRUE, 'r+' => TRUE, 'x+' => TRUE, 'c+' => TRUE, + 'rb' => TRUE, 'w+b' => TRUE, 'r+b' => TRUE, 'x+b' => TRUE, + 'c+b' => TRUE, 'rt' => TRUE, 'w+t' => TRUE, 'r+t' => TRUE, + 'x+t' => TRUE, 'c+t' => TRUE, 'a+' => TRUE ], 'write' => [ - 'w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true, - 'c+' => true, 'wb' => true, 'w+b' => true, 'r+b' => true, - 'x+b' => true, 'c+b' => true, 'w+t' => true, 'r+t' => true, - 'x+t' => true, 'c+t' => true, 'a' => true, 'a+' => true + 'w' => TRUE, 'w+' => TRUE, 'rw' => TRUE, 'r+' => TRUE, 'x+' => TRUE, + 'c+' => TRUE, 'wb' => TRUE, 'w+b' => TRUE, 'r+b' => TRUE, + 'x+b' => TRUE, 'c+b' => TRUE, 'w+t' => TRUE, 'r+t' => TRUE, + 'x+t' => TRUE, 'c+t' => TRUE, 'a' => TRUE, 'a+' => TRUE ] ]; @@ -43,13 +44,12 @@ class Stream implements StreamInterface * - metadata: (array) Any additional metadata to return when the metadata * of the stream is accessed. * - * @param resource $stream Stream resource to wrap. - * @param array $options Associative array of options. + * @param resource $stream Stream resource to wrap. + * @param array $options Associative array of options. * * @throws \InvalidArgumentException if the stream is not a stream resource */ - public function __construct($stream, $options = []) - { + public function __construct($stream, $options = []) { if (!is_resource($stream)) { throw new \InvalidArgumentException('Stream must be a resource'); } @@ -70,8 +70,7 @@ class Stream implements StreamInterface $this->uri = $this->getMetadata('uri'); } - public function __get($name) - { + public function __get($name) { if ($name == 'stream') { throw new \RuntimeException('The stream is detached'); } @@ -82,34 +81,30 @@ class Stream implements StreamInterface /** * Closes the stream when the destructed */ - public function __destruct() - { + public function __destruct() { $this->close(); } - public function __toString() - { + public function __toString() { try { $this->seek(0); - return (string) stream_get_contents($this->stream); + return (string)stream_get_contents($this->stream); } catch (\Exception $e) { return ''; } } - public function getContents() - { + public function getContents() { $contents = stream_get_contents($this->stream); - if ($contents === false) { + if ($contents === FALSE) { throw new \RuntimeException('Unable to read stream contents'); } return $contents; } - public function close() - { + public function close() { if (isset($this->stream)) { if (is_resource($this->stream)) { fclose($this->stream); @@ -118,33 +113,31 @@ class Stream implements StreamInterface } } - public function detach() - { + public function detach() { if (!isset($this->stream)) { - return null; + return NULL; } $result = $this->stream; unset($this->stream); - $this->size = $this->uri = null; - $this->readable = $this->writable = $this->seekable = false; + $this->size = $this->uri = NULL; + $this->readable = $this->writable = $this->seekable = FALSE; return $result; } - public function getSize() - { - if ($this->size !== null) { + public function getSize() { + if ($this->size !== NULL) { return $this->size; } if (!isset($this->stream)) { - return null; + return NULL; } // Clear the stat cache if the stream has a URI if ($this->uri) { - clearstatcache(true, $this->uri); + clearstatcache(TRUE, $this->uri); } $stats = fstat($this->stream); @@ -153,57 +146,49 @@ class Stream implements StreamInterface return $this->size; } - return null; + return NULL; } - public function isReadable() - { + public function isReadable() { return $this->readable; } - public function isWritable() - { + public function isWritable() { return $this->writable; } - public function isSeekable() - { + public function isSeekable() { return $this->seekable; } - public function eof() - { + public function eof() { return !$this->stream || feof($this->stream); } - public function tell() - { + public function tell() { $result = ftell($this->stream); - if ($result === false) { + if ($result === FALSE) { throw new \RuntimeException('Unable to determine stream position'); } return $result; } - public function rewind() - { + public function rewind() { $this->seek(0); } - public function seek($offset, $whence = SEEK_SET) - { + public function seek($offset, $whence = SEEK_SET) { if (!$this->seekable) { throw new \RuntimeException('Stream is not seekable'); - } elseif (fseek($this->stream, $offset, $whence) === -1) { + } else if (fseek($this->stream, $offset, $whence) === -1) { throw new \RuntimeException('Unable to seek to stream position ' - . $offset . ' with whence ' . var_export($whence, true)); + . $offset . ' with whence ' . var_export($whence, TRUE)); } } - public function read($length) - { + public function read($length) { if (!$this->readable) { throw new \RuntimeException('Cannot read from non-readable stream'); } @@ -216,42 +201,40 @@ class Stream implements StreamInterface } $string = fread($this->stream, $length); - if (false === $string) { + if (FALSE === $string) { throw new \RuntimeException('Unable to read from stream'); } return $string; } - public function write($string) - { + public function write($string) { if (!$this->writable) { throw new \RuntimeException('Cannot write to a non-writable stream'); } // We can't know the size after writing anything - $this->size = null; + $this->size = NULL; $result = fwrite($this->stream, $string); - if ($result === false) { + if ($result === FALSE) { throw new \RuntimeException('Unable to write to stream'); } return $result; } - public function getMetadata($key = null) - { + public function getMetadata($key = NULL) { if (!isset($this->stream)) { - return $key ? null : []; - } elseif (!$key) { + return $key ? NULL : []; + } else if (!$key) { return $this->customMetadata + stream_get_meta_data($this->stream); - } elseif (isset($this->customMetadata[$key])) { + } else if (isset($this->customMetadata[$key])) { return $this->customMetadata[$key]; } $meta = stream_get_meta_data($this->stream); - return isset($meta[$key]) ? $meta[$key] : null; + return isset($meta[$key]) ? $meta[$key] : NULL; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php index daec6f5..e0eb00e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php @@ -1,4 +1,5 @@ stream = $stream; } @@ -25,8 +25,7 @@ trait StreamDecoratorTrait * * @return StreamInterface */ - public function __get($name) - { + public function __get($name) { if ($name == 'stream') { $this->stream = $this->createStream(); return $this->stream; @@ -35,8 +34,7 @@ trait StreamDecoratorTrait throw new \UnexpectedValueException("$name not found on class"); } - public function __toString() - { + public function __toString() { try { if ($this->isSeekable()) { $this->seek(0); @@ -45,13 +43,12 @@ trait StreamDecoratorTrait } catch (\Exception $e) { // Really, PHP? https://bugs.php.net/bug.php?id=53648 trigger_error('StreamDecorator::__toString exception: ' - . (string) $e, E_USER_ERROR); + . (string)$e, E_USER_ERROR); return ''; } } - public function getContents() - { + public function getContents() { return copy_to_string($this); } @@ -59,80 +56,66 @@ trait StreamDecoratorTrait * Allow decorators to implement custom methods * * @param string $method Missing method name - * @param array $args Method arguments + * @param array $args Method arguments * * @return mixed */ - public function __call($method, array $args) - { + public function __call($method, array $args) { $result = call_user_func_array([$this->stream, $method], $args); // Always return the wrapped object if the result is a return $this return $result === $this->stream ? $this : $result; } - public function close() - { + public function close() { $this->stream->close(); } - public function getMetadata($key = null) - { + public function getMetadata($key = NULL) { return $this->stream->getMetadata($key); } - public function detach() - { + public function detach() { return $this->stream->detach(); } - public function getSize() - { + public function getSize() { return $this->stream->getSize(); } - public function eof() - { + public function eof() { return $this->stream->eof(); } - public function tell() - { + public function tell() { return $this->stream->tell(); } - public function isReadable() - { + public function isReadable() { return $this->stream->isReadable(); } - public function isWritable() - { + public function isWritable() { return $this->stream->isWritable(); } - public function isSeekable() - { + public function isSeekable() { return $this->stream->isSeekable(); } - public function rewind() - { + public function rewind() { $this->seek(0); } - public function seek($offset, $whence = SEEK_SET) - { + public function seek($offset, $whence = SEEK_SET) { $this->stream->seek($offset, $whence); } - public function read($length) - { + public function read($length) { return $this->stream->read($length); } - public function write($string) - { + public function write($string) { return $this->stream->write($string); } @@ -142,8 +125,7 @@ trait StreamDecoratorTrait * @return StreamInterface * @throws \BadMethodCallException */ - protected function createStream() - { + protected function createStream() { throw new \BadMethodCallException('Not implemented'); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/StreamWrapper.php index cf7b223..20e3458 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/StreamWrapper.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/StreamWrapper.php @@ -1,4 +1,5 @@ isReadable()) { $mode = $stream->isWritable() ? 'r+' : 'r'; - } elseif ($stream->isWritable()) { + } else if ($stream->isWritable()) { $mode = 'w'; } else { throw new \InvalidArgumentException('The stream must be readable, ' . 'writable, or both.'); } - return fopen('guzzle://stream', $mode, null, stream_context_create([ + return fopen('guzzle://stream', $mode, NULL, stream_context_create([ 'guzzle' => ['stream' => $stream] ])); } @@ -46,76 +46,68 @@ class StreamWrapper /** * Registers the stream wrapper if needed */ - public static function register() - { + public static function register() { if (!in_array('guzzle', stream_get_wrappers())) { stream_wrapper_register('guzzle', __CLASS__); } } - public function stream_open($path, $mode, $options, &$opened_path) - { + public function stream_open($path, $mode, $options, &$opened_path) { $options = stream_context_get_options($this->context); if (!isset($options['guzzle']['stream'])) { - return false; + return FALSE; } $this->mode = $mode; $this->stream = $options['guzzle']['stream']; - return true; + return TRUE; } - public function stream_read($count) - { + public function stream_read($count) { return $this->stream->read($count); } - public function stream_write($data) - { - return (int) $this->stream->write($data); + public function stream_write($data) { + return (int)$this->stream->write($data); } - public function stream_tell() - { + public function stream_tell() { return $this->stream->tell(); } - public function stream_eof() - { + public function stream_eof() { return $this->stream->eof(); } - public function stream_seek($offset, $whence) - { + public function stream_seek($offset, $whence) { $this->stream->seek($offset, $whence); - return true; + return TRUE; } - public function stream_stat() - { + public function stream_stat() { static $modeMap = [ - 'r' => 33060, + 'r' => 33060, 'r+' => 33206, - 'w' => 33188 + 'w' => 33188 ]; return [ - 'dev' => 0, - 'ino' => 0, - 'mode' => $modeMap[$this->mode], - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => $this->stream->getSize() ?: 0, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, + 'dev' => 0, + 'ino' => 0, + 'mode' => $modeMap[$this->mode], + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => $this->stream->getSize() ?: 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, 'blksize' => 0, - 'blocks' => 0 + 'blocks' => 0 ]; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/UploadedFile.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/UploadedFile.php index e62bd5c..7f67c34 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/UploadedFile.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/UploadedFile.php @@ -1,4 +1,5 @@ setError($errorStatus); $this->setSize($size); @@ -87,13 +88,12 @@ class UploadedFile implements UploadedFileInterface * @param mixed $streamOrFile * @throws InvalidArgumentException */ - private function setStreamOrFile($streamOrFile) - { + private function setStreamOrFile($streamOrFile) { if (is_string($streamOrFile)) { $this->file = $streamOrFile; - } elseif (is_resource($streamOrFile)) { + } else if (is_resource($streamOrFile)) { $this->stream = new Stream($streamOrFile); - } elseif ($streamOrFile instanceof StreamInterface) { + } else if ($streamOrFile instanceof StreamInterface) { $this->stream = $streamOrFile; } else { throw new InvalidArgumentException( @@ -106,15 +106,14 @@ class UploadedFile implements UploadedFileInterface * @param int $error * @throws InvalidArgumentException */ - private function setError($error) - { - if (false === is_int($error)) { + private function setError($error) { + if (FALSE === is_int($error)) { throw new InvalidArgumentException( 'Upload file error status must be an integer' ); } - if (false === in_array($error, UploadedFile::$errors)) { + if (FALSE === in_array($error, UploadedFile::$errors)) { throw new InvalidArgumentException( 'Invalid error status for UploadedFile' ); @@ -127,9 +126,8 @@ class UploadedFile implements UploadedFileInterface * @param int $size * @throws InvalidArgumentException */ - private function setSize($size) - { - if (false === is_int($size)) { + private function setSize($size) { + if (FALSE === is_int($size)) { throw new InvalidArgumentException( 'Upload file size must be an integer' ); @@ -142,8 +140,7 @@ class UploadedFile implements UploadedFileInterface * @param mixed $param * @return boolean */ - private function isStringOrNull($param) - { + private function isStringOrNull($param) { return in_array(gettype($param), ['string', 'NULL']); } @@ -151,18 +148,16 @@ class UploadedFile implements UploadedFileInterface * @param mixed $param * @return boolean */ - private function isStringNotEmpty($param) - { - return is_string($param) && false === empty($param); + private function isStringNotEmpty($param) { + return is_string($param) && FALSE === empty($param); } /** * @param string|null $clientFilename * @throws InvalidArgumentException */ - private function setClientFilename($clientFilename) - { - if (false === $this->isStringOrNull($clientFilename)) { + private function setClientFilename($clientFilename) { + if (FALSE === $this->isStringOrNull($clientFilename)) { throw new InvalidArgumentException( 'Upload file client filename must be a string or null' ); @@ -175,9 +170,8 @@ class UploadedFile implements UploadedFileInterface * @param string|null $clientMediaType * @throws InvalidArgumentException */ - private function setClientMediaType($clientMediaType) - { - if (false === $this->isStringOrNull($clientMediaType)) { + private function setClientMediaType($clientMediaType) { + if (FALSE === $this->isStringOrNull($clientMediaType)) { throw new InvalidArgumentException( 'Upload file client media type must be a string or null' ); @@ -191,25 +185,22 @@ class UploadedFile implements UploadedFileInterface * * @return boolean */ - private function isOk() - { + private function isOk() { return $this->error === UPLOAD_ERR_OK; } /** * @return boolean */ - public function isMoved() - { + public function isMoved() { return $this->moved; } /** * @throws RuntimeException if is moved or not ok */ - private function validateActive() - { - if (false === $this->isOk()) { + private function validateActive() { + if (FALSE === $this->isOk()) { throw new RuntimeException('Cannot retrieve stream due to upload error'); } @@ -222,8 +213,7 @@ class UploadedFile implements UploadedFileInterface * {@inheritdoc} * @throws RuntimeException if the upload was not successful. */ - public function getStream() - { + public function getStream() { $this->validateActive(); if ($this->stream instanceof StreamInterface) { @@ -244,11 +234,10 @@ class UploadedFile implements UploadedFileInterface * @throws RuntimeException on any error during the move operation, or on * the second or subsequent call to the method. */ - public function moveTo($targetPath) - { + public function moveTo($targetPath) { $this->validateActive(); - if (false === $this->isStringNotEmpty($targetPath)) { + if (FALSE === $this->isStringNotEmpty($targetPath)) { throw new InvalidArgumentException( 'Invalid path provided for move operation; must be a non-empty string' ); @@ -264,10 +253,10 @@ class UploadedFile implements UploadedFileInterface new LazyOpenStream($targetPath, 'w') ); - $this->moved = true; + $this->moved = TRUE; } - if (false === $this->moved) { + if (FALSE === $this->moved) { throw new RuntimeException( sprintf('Uploaded file could not be moved to %s', $targetPath) ); @@ -279,8 +268,7 @@ class UploadedFile implements UploadedFileInterface * * @return int|null The file size in bytes or null if unknown. */ - public function getSize() - { + public function getSize() { return $this->size; } @@ -290,8 +278,7 @@ class UploadedFile implements UploadedFileInterface * @see http://php.net/manual/en/features.file-upload.errors.php * @return int One of PHP's UPLOAD_ERR_XXX constants. */ - public function getError() - { + public function getError() { return $this->error; } @@ -301,16 +288,14 @@ class UploadedFile implements UploadedFileInterface * @return string|null The filename sent by the client or null if none * was provided. */ - public function getClientFilename() - { + public function getClientFilename() { return $this->clientFilename; } /** * {@inheritdoc} */ - public function getClientMediaType() - { + public function getClientMediaType() { return $this->clientMediaType; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/Uri.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/Uri.php index f46c1db..2869b36 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/Uri.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/Uri.php @@ -1,4 +1,5 @@ 80, + 'http' => 80, 'https' => 443, 'ftp' => 21, 'gopher' => 70, @@ -62,20 +63,18 @@ class Uri implements UriInterface /** * @param string $uri URI to parse */ - public function __construct($uri = '') - { + public function __construct($uri = '') { // weak type check to also accept null until we can add scalar type hints if ($uri != '') { $parts = parse_url($uri); - if ($parts === false) { + if ($parts === FALSE) { throw new \InvalidArgumentException("Unable to parse URI: $uri"); } $this->applyParts($parts); } } - public function __toString() - { + public function __toString() { return self::composeComponents( $this->scheme, $this->getAuthority(), @@ -111,8 +110,7 @@ class Uri implements UriInterface * * @link https://tools.ietf.org/html/rfc3986#section-5.3 */ - public static function composeComponents($scheme, $authority, $path, $query, $fragment) - { + public static function composeComponents($scheme, $authority, $path, $query, $fragment) { $uri = ''; // weak type checks to also accept null until we can add scalar type hints @@ -120,7 +118,7 @@ class Uri implements UriInterface $uri .= $scheme . ':'; } - if ($authority != ''|| $scheme === 'file') { + if ($authority != '' || $scheme === 'file') { $uri .= '//' . $authority; } @@ -147,9 +145,8 @@ class Uri implements UriInterface * * @return bool */ - public static function isDefaultPort(UriInterface $uri) - { - return $uri->getPort() === null + public static function isDefaultPort(UriInterface $uri) { + return $uri->getPort() === NULL || (isset(self::$defaultPorts[$uri->getScheme()]) && $uri->getPort() === self::$defaultPorts[$uri->getScheme()]); } @@ -171,8 +168,7 @@ class Uri implements UriInterface * @see Uri::isRelativePathReference * @link https://tools.ietf.org/html/rfc3986#section-4 */ - public static function isAbsolute(UriInterface $uri) - { + public static function isAbsolute(UriInterface $uri) { return $uri->getScheme() !== ''; } @@ -186,8 +182,7 @@ class Uri implements UriInterface * @return bool * @link https://tools.ietf.org/html/rfc3986#section-4.2 */ - public static function isNetworkPathReference(UriInterface $uri) - { + public static function isNetworkPathReference(UriInterface $uri) { return $uri->getScheme() === '' && $uri->getAuthority() !== ''; } @@ -201,8 +196,7 @@ class Uri implements UriInterface * @return bool * @link https://tools.ietf.org/html/rfc3986#section-4.2 */ - public static function isAbsolutePathReference(UriInterface $uri) - { + public static function isAbsolutePathReference(UriInterface $uri) { return $uri->getScheme() === '' && $uri->getAuthority() === '' && isset($uri->getPath()[0]) @@ -219,8 +213,7 @@ class Uri implements UriInterface * @return bool * @link https://tools.ietf.org/html/rfc3986#section-4.2 */ - public static function isRelativePathReference(UriInterface $uri) - { + public static function isRelativePathReference(UriInterface $uri) { return $uri->getScheme() === '' && $uri->getAuthority() === '' && (!isset($uri->getPath()[0]) || $uri->getPath()[0] !== '/'); @@ -233,15 +226,14 @@ class Uri implements UriInterface * component, identical to the base URI. When no base URI is given, only an empty * URI reference (apart from its fragment) is considered a same-document reference. * - * @param UriInterface $uri The URI to check + * @param UriInterface $uri The URI to check * @param UriInterface|null $base An optional base URI to compare against * * @return bool * @link https://tools.ietf.org/html/rfc3986#section-4.4 */ - public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null) - { - if ($base !== null) { + public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = NULL) { + if ($base !== NULL) { $uri = UriResolver::resolve($base, $uri); return ($uri->getScheme() === $base->getScheme()) @@ -263,24 +255,22 @@ class Uri implements UriInterface * @deprecated since version 1.4. Use UriResolver::removeDotSegments instead. * @see UriResolver::removeDotSegments */ - public static function removeDotSegments($path) - { + public static function removeDotSegments($path) { return UriResolver::removeDotSegments($path); } /** * Converts the relative URI into a new URI that is resolved against the base URI. * - * @param UriInterface $base Base URI - * @param string|UriInterface $rel Relative URI + * @param UriInterface $base Base URI + * @param string|UriInterface $rel Relative URI * * @return UriInterface * * @deprecated since version 1.4. Use UriResolver::resolve instead. * @see UriResolver::resolve */ - public static function resolve(UriInterface $base, $rel) - { + public static function resolve(UriInterface $base, $rel) { if (!($rel instanceof UriInterface)) { $rel = new self($rel); } @@ -295,12 +285,11 @@ class Uri implements UriInterface * removed. * * @param UriInterface $uri URI to use as a base. - * @param string $key Query string key to remove. + * @param string $key Query string key to remove. * * @return UriInterface */ - public static function withoutQueryValue(UriInterface $uri, $key) - { + public static function withoutQueryValue(UriInterface $uri, $key) { $current = $uri->getQuery(); if ($current === '') { return $uri; @@ -323,14 +312,13 @@ class Uri implements UriInterface * A value of null will set the query string key without a value, e.g. "key" * instead of "key=value". * - * @param UriInterface $uri URI to use as a base. - * @param string $key Key to set. - * @param string|null $value Value to set + * @param UriInterface $uri URI to use as a base. + * @param string $key Key to set. + * @param string|null $value Value to set * * @return UriInterface */ - public static function withQueryValue(UriInterface $uri, $key, $value) - { + public static function withQueryValue(UriInterface $uri, $key, $value) { $current = $uri->getQuery(); if ($current === '') { @@ -347,7 +335,7 @@ class Uri implements UriInterface // chars that need percent-encoding will be encoded by withQuery(). $key = strtr($key, self::$replaceQuery); - if ($value !== null) { + if ($value !== NULL) { $result[] = $key . '=' . strtr($value, self::$replaceQuery); } else { $result[] = $key; @@ -366,8 +354,7 @@ class Uri implements UriInterface * * @throws \InvalidArgumentException If the components do not form a valid URI. */ - public static function fromParts(array $parts) - { + public static function fromParts(array $parts) { $uri = new self(); $uri->applyParts($parts); $uri->validateState(); @@ -375,57 +362,48 @@ class Uri implements UriInterface return $uri; } - public function getScheme() - { + public function getScheme() { return $this->scheme; } - public function getAuthority() - { + public function getAuthority() { $authority = $this->host; if ($this->userInfo !== '') { $authority = $this->userInfo . '@' . $authority; } - if ($this->port !== null) { + if ($this->port !== NULL) { $authority .= ':' . $this->port; } return $authority; } - public function getUserInfo() - { + public function getUserInfo() { return $this->userInfo; } - public function getHost() - { + public function getHost() { return $this->host; } - public function getPort() - { + public function getPort() { return $this->port; } - public function getPath() - { + public function getPath() { return $this->path; } - public function getQuery() - { + public function getQuery() { return $this->query; } - public function getFragment() - { + public function getFragment() { return $this->fragment; } - public function withScheme($scheme) - { + public function withScheme($scheme) { $scheme = $this->filterScheme($scheme); if ($this->scheme === $scheme) { @@ -440,8 +418,7 @@ class Uri implements UriInterface return $new; } - public function withUserInfo($user, $password = null) - { + public function withUserInfo($user, $password = NULL) { $info = $user; if ($password != '') { $info .= ':' . $password; @@ -458,8 +435,7 @@ class Uri implements UriInterface return $new; } - public function withHost($host) - { + public function withHost($host) { $host = $this->filterHost($host); if ($this->host === $host) { @@ -473,8 +449,7 @@ class Uri implements UriInterface return $new; } - public function withPort($port) - { + public function withPort($port) { $port = $this->filterPort($port); if ($this->port === $port) { @@ -489,8 +464,7 @@ class Uri implements UriInterface return $new; } - public function withPath($path) - { + public function withPath($path) { $path = $this->filterPath($path); if ($this->path === $path) { @@ -504,8 +478,7 @@ class Uri implements UriInterface return $new; } - public function withQuery($query) - { + public function withQuery($query) { $query = $this->filterQueryAndFragment($query); if ($this->query === $query) { @@ -518,8 +491,7 @@ class Uri implements UriInterface return $new; } - public function withFragment($fragment) - { + public function withFragment($fragment) { $fragment = $this->filterQueryAndFragment($fragment); if ($this->fragment === $fragment) { @@ -537,8 +509,7 @@ class Uri implements UriInterface * * @param array $parts Array of parse_url parts to apply. */ - private function applyParts(array $parts) - { + private function applyParts(array $parts) { $this->scheme = isset($parts['scheme']) ? $this->filterScheme($parts['scheme']) : ''; @@ -548,7 +519,7 @@ class Uri implements UriInterface : ''; $this->port = isset($parts['port']) ? $this->filterPort($parts['port']) - : null; + : NULL; $this->path = isset($parts['path']) ? $this->filterPath($parts['path']) : ''; @@ -572,8 +543,7 @@ class Uri implements UriInterface * * @throws \InvalidArgumentException If the scheme is invalid. */ - private function filterScheme($scheme) - { + private function filterScheme($scheme) { if (!is_string($scheme)) { throw new \InvalidArgumentException('Scheme must be a string'); } @@ -588,8 +558,7 @@ class Uri implements UriInterface * * @throws \InvalidArgumentException If the host is invalid. */ - private function filterHost($host) - { + private function filterHost($host) { if (!is_string($host)) { throw new \InvalidArgumentException('Host must be a string'); } @@ -604,13 +573,12 @@ class Uri implements UriInterface * * @throws \InvalidArgumentException If the port is invalid. */ - private function filterPort($port) - { - if ($port === null) { - return null; + private function filterPort($port) { + if ($port === NULL) { + return NULL; } - $port = (int) $port; + $port = (int)$port; if (1 > $port || 0xffff < $port) { throw new \InvalidArgumentException( sprintf('Invalid port: %d. Must be between 1 and 65535', $port) @@ -620,10 +588,9 @@ class Uri implements UriInterface return $port; } - private function removeDefaultPort() - { - if ($this->port !== null && self::isDefaultPort($this)) { - $this->port = null; + private function removeDefaultPort() { + if ($this->port !== NULL && self::isDefaultPort($this)) { + $this->port = NULL; } } @@ -636,8 +603,7 @@ class Uri implements UriInterface * * @throws \InvalidArgumentException If the path is invalid. */ - private function filterPath($path) - { + private function filterPath($path) { if (!is_string($path)) { throw new \InvalidArgumentException('Path must be a string'); } @@ -658,8 +624,7 @@ class Uri implements UriInterface * * @throws \InvalidArgumentException If the query or fragment is invalid. */ - private function filterQueryAndFragment($str) - { + private function filterQueryAndFragment($str) { if (!is_string($str)) { throw new \InvalidArgumentException('Query and fragment must be a string'); } @@ -671,13 +636,11 @@ class Uri implements UriInterface ); } - private function rawurlencodeMatchZero(array $match) - { + private function rawurlencodeMatchZero(array $match) { return rawurlencode($match[0]); } - private function validateState() - { + private function validateState() { if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) { $this->host = self::HTTP_DEFAULT_HOST; } @@ -686,16 +649,16 @@ class Uri implements UriInterface if (0 === strpos($this->path, '//')) { throw new \InvalidArgumentException('The path of a URI without an authority must not start with two slashes "//"'); } - if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) { + if ($this->scheme === '' && FALSE !== strpos(explode('/', $this->path, 2)[0], ':')) { throw new \InvalidArgumentException('A relative URI must not have a path beginning with a segment containing a colon'); } - } elseif (isset($this->path[0]) && $this->path[0] !== '/') { + } else if (isset($this->path[0]) && $this->path[0] !== '/') { @trigger_error( 'The path of a URI with an authority must start with a slash "/" or be empty. Automagically fixing the URI ' . 'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.', E_USER_DEPRECATED ); - $this->path = '/'. $this->path; + $this->path = '/' . $this->path; //throw new \InvalidArgumentException('The path of a URI with an authority must start with a slash "/" or be empty'); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/UriNormalizer.php index 384c29e..28bf06c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/UriNormalizer.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/UriNormalizer.php @@ -1,4 +1,5 @@ withHost(''); } - if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) { - $uri = $uri->withPort(null); + if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== NULL && Uri::isDefaultPort($uri)) { + $uri = $uri->withPort(NULL); } if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) { @@ -165,20 +165,18 @@ final class UriNormalizer * resolved against the same base URI. If this is not the case, determination of equivalence or difference of * relative references does not mean anything. * - * @param UriInterface $uri1 An URI to compare - * @param UriInterface $uri2 An URI to compare - * @param int $normalizations A bitmask of normalizations to apply, see constants + * @param UriInterface $uri1 An URI to compare + * @param UriInterface $uri2 An URI to compare + * @param int $normalizations A bitmask of normalizations to apply, see constants * * @return bool * @link https://tools.ietf.org/html/rfc3986#section-6.1 */ - public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS) - { - return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations); + public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS) { + return (string)self::normalize($uri1, $normalizations) === (string)self::normalize($uri2, $normalizations); } - private static function capitalizePercentEncoding(UriInterface $uri) - { + private static function capitalizePercentEncoding(UriInterface $uri) { $regex = '/(?:%[A-Fa-f0-9]{2})++/'; $callback = function (array $match) { @@ -193,8 +191,7 @@ final class UriNormalizer ); } - private static function decodeUnreservedCharacters(UriInterface $uri) - { + private static function decodeUnreservedCharacters(UriInterface $uri) { $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i'; $callback = function (array $match) { @@ -209,8 +206,7 @@ final class UriNormalizer ); } - private function __construct() - { + private function __construct() { // cannot be instantiated } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/UriResolver.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/UriResolver.php index c1cb8a2..0a9b169 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/UriResolver.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/UriResolver.php @@ -1,4 +1,5 @@ getPath(); } else { $lastSlashPos = strrpos($base->getPath(), '/'); - if ($lastSlashPos === false) { + if ($lastSlashPos === FALSE) { $targetPath = $rel->getPath(); } else { $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1) . $rel->getPath(); @@ -129,13 +128,12 @@ final class UriResolver * * echo UriResolver::relativize($base, new Uri('/a/b/c')); // prints 'c' as well * - * @param UriInterface $base Base URI + * @param UriInterface $base Base URI * @param UriInterface $target Target URI * * @return UriInterface The relative URI reference */ - public static function relativize(UriInterface $base, UriInterface $target) - { + public static function relativize(UriInterface $base, UriInterface $target) { if ($target->getScheme() !== '' && ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '') ) { @@ -156,7 +154,7 @@ final class UriResolver // We must remove the path before removing the authority because if the path starts with two slashes, the URI // would turn invalid. And we also cannot set a relative path before removing the authority, as that is also // invalid. - $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(null)->withHost(''); + $emptyPathUri = $target->withScheme('')->withPath('')->withUserInfo('')->withPort(NULL)->withHost(''); if ($base->getPath() !== $target->getPath()) { return $emptyPathUri->withPath(self::getRelativePath($base, $target)); @@ -179,8 +177,7 @@ final class UriResolver return $emptyPathUri; } - private static function getRelativePath(UriInterface $base, UriInterface $target) - { + private static function getRelativePath(UriInterface $base, UriInterface $target) { $sourceSegments = explode('/', $base->getPath()); $targetSegments = explode('/', $target->getPath()); array_pop($sourceSegments); @@ -198,9 +195,9 @@ final class UriResolver // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./". // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used // as the first segment of a relative-path reference, as it would be mistaken for a scheme name. - if ('' === $relativePath || false !== strpos(explode('/', $relativePath, 2)[0], ':')) { + if ('' === $relativePath || FALSE !== strpos(explode('/', $relativePath, 2)[0], ':')) { $relativePath = "./$relativePath"; - } elseif ('/' === $relativePath[0]) { + } else if ('/' === $relativePath[0]) { if ($base->getAuthority() != '' && $base->getPath() === '') { // In this case an extra slash is added by resolve() automatically. So we must not add one here. $relativePath = ".$relativePath"; @@ -212,8 +209,7 @@ final class UriResolver return $relativePath; } - private function __construct() - { + private function __construct() { // cannot be instantiated } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/functions.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/functions.php index e40348d..47f6fdb 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/functions.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/guzzlehttp/psr7/src/functions.php @@ -1,4 +1,5 @@ getMethod() . ' ' . $message->getRequestTarget()) @@ -24,7 +24,7 @@ function str(MessageInterface $message) if (!$message->hasHeader('host')) { $msg .= "\r\nHost: " . $message->getUri()->getHost(); } - } elseif ($message instanceof ResponseInterface) { + } else if ($message instanceof ResponseInterface) { $msg = 'HTTP/' . $message->getProtocolVersion() . ' ' . $message->getStatusCode() . ' ' . $message->getReasonPhrase(); @@ -51,11 +51,10 @@ function str(MessageInterface $message) * @return UriInterface * @throws \InvalidArgumentException */ -function uri_for($uri) -{ +function uri_for($uri) { if ($uri instanceof UriInterface) { return $uri; - } elseif (is_string($uri)) { + } else if (is_string($uri)) { return new Uri($uri); } @@ -70,13 +69,12 @@ function uri_for($uri) * - size: Size of the stream. * * @param resource|string|null|int|float|bool|StreamInterface|callable $resource Entity body data - * @param array $options Additional options + * @param array $options Additional options * * @return Stream * @throws \InvalidArgumentException if the $resource arg is not valid. */ -function stream_for($resource = '', array $options = []) -{ +function stream_for($resource = '', array $options = []) { if (is_scalar($resource)) { $stream = fopen('php://temp', 'r+'); if ($resource !== '') { @@ -92,17 +90,17 @@ function stream_for($resource = '', array $options = []) case 'object': if ($resource instanceof StreamInterface) { return $resource; - } elseif ($resource instanceof \Iterator) { + } else if ($resource instanceof \Iterator) { return new PumpStream(function () use ($resource) { if (!$resource->valid()) { - return false; + return FALSE; } $result = $resource->current(); $resource->next(); return $result; }, $options); - } elseif (method_exists($resource, '__toString')) { - return stream_for((string) $resource, $options); + } else if (method_exists($resource, '__toString')) { + return stream_for((string)$resource, $options); } break; case 'NULL': @@ -126,8 +124,7 @@ function stream_for($resource = '', array $options = []) * * @return array Returns the parsed header values. */ -function parse_header($header) -{ +function parse_header($header) { static $trimmed = "\"' \n\t\r"; $params = $matches = []; @@ -159,16 +156,15 @@ function parse_header($header) * * @return array Returns the normalized header field values. */ -function normalize_header($header) -{ +function normalize_header($header) { if (!is_array($header)) { return array_map('trim', explode(',', $header)); } $result = []; foreach ($header as $value) { - foreach ((array) $value as $v) { - if (strpos($v, ',') === false) { + foreach ((array)$value as $v) { + if (strpos($v, ',') === FALSE) { $result[] = $v; continue; } @@ -194,12 +190,11 @@ function normalize_header($header) * - version: (string) Set the protocol version. * * @param RequestInterface $request Request to clone and modify. - * @param array $changes Changes to apply. + * @param array $changes Changes to apply. * * @return RequestInterface */ -function modify_request(RequestInterface $request, array $changes) -{ +function modify_request(RequestInterface $request, array $changes) { if (!$changes) { return $request; } @@ -217,7 +212,7 @@ function modify_request(RequestInterface $request, array $changes) $standardPorts = ['http' => 80, 'https' => 443]; $scheme = $changes['uri']->getScheme(); if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { - $changes['set_headers']['Host'] .= ':'.$port; + $changes['set_headers']['Host'] .= ':' . $port; } } } @@ -271,8 +266,7 @@ function modify_request(RequestInterface $request, array $changes) * * @throws \RuntimeException */ -function rewind_body(MessageInterface $message) -{ +function rewind_body(MessageInterface $message) { $body = $message->getBody(); if ($body->tell()) { @@ -287,14 +281,13 @@ function rewind_body(MessageInterface $message) * error handler that checks for errors and throws an exception instead. * * @param string $filename File to open - * @param string $mode Mode used to open the file + * @param string $mode Mode used to open the file * * @return resource * @throws \RuntimeException if the file cannot be opened */ -function try_fopen($filename, $mode) -{ - $ex = null; +function try_fopen($filename, $mode) { + $ex = NULL; set_error_handler(function () use ($filename, $mode, &$ex) { $ex = new \RuntimeException(sprintf( 'Unable to open %s using mode %s: %s', @@ -320,20 +313,19 @@ function try_fopen($filename, $mode) * bytes have been read. * * @param StreamInterface $stream Stream to read - * @param int $maxLen Maximum number of bytes to read. Pass -1 + * @param int $maxLen Maximum number of bytes to read. Pass -1 * to read the entire stream. * @return string * @throws \RuntimeException on error. */ -function copy_to_string(StreamInterface $stream, $maxLen = -1) -{ +function copy_to_string(StreamInterface $stream, $maxLen = -1) { $buffer = ''; if ($maxLen === -1) { while (!$stream->eof()) { $buf = $stream->read(1048576); // Using a loose equality here to match on '' and false. - if ($buf == null) { + if ($buf == NULL) { break; } $buffer .= $buf; @@ -345,7 +337,7 @@ function copy_to_string(StreamInterface $stream, $maxLen = -1) while (!$stream->eof() && $len < $maxLen) { $buf = $stream->read($maxLen - $len); // Using a loose equality here to match on '' and false. - if ($buf == null) { + if ($buf == NULL) { break; } $buffer .= $buf; @@ -360,8 +352,8 @@ function copy_to_string(StreamInterface $stream, $maxLen = -1) * of bytes have been read. * * @param StreamInterface $source Stream to read from - * @param StreamInterface $dest Stream to write to - * @param int $maxLen Maximum number of bytes to read. Pass -1 + * @param StreamInterface $dest Stream to write to + * @param int $maxLen Maximum number of bytes to read. Pass -1 * to read the entire stream. * * @throws \RuntimeException on error. @@ -396,9 +388,9 @@ function copy_to_stream( /** * Calculate a hash of a Stream * - * @param StreamInterface $stream Stream to calculate the hash for - * @param string $algo Hash algorithm (e.g. md5, crc32, etc) - * @param bool $rawOutput Whether or not to use raw output + * @param StreamInterface $stream Stream to calculate the hash for + * @param string $algo Hash algorithm (e.g. md5, crc32, etc) + * @param bool $rawOutput Whether or not to use raw output * * @return string Returns the hash of the stream * @throws \RuntimeException on error. @@ -406,7 +398,7 @@ function copy_to_stream( function hash( StreamInterface $stream, $algo, - $rawOutput = false + $rawOutput = FALSE ) { $pos = $stream->tell(); @@ -419,7 +411,7 @@ function hash( hash_update($ctx, $stream->read(1048576)); } - $out = hash_final($ctx, (bool) $rawOutput); + $out = hash_final($ctx, (bool)$rawOutput); $stream->seek($pos); return $out; @@ -428,19 +420,18 @@ function hash( /** * Read a line from the stream up to the maximum allowed buffer length * - * @param StreamInterface $stream Stream to read from - * @param int $maxLength Maximum buffer length + * @param StreamInterface $stream Stream to read from + * @param int $maxLength Maximum buffer length * * @return string|bool */ -function readline(StreamInterface $stream, $maxLength = null) -{ +function readline(StreamInterface $stream, $maxLength = NULL) { $buffer = ''; $size = 0; while (!$stream->eof()) { // Using a loose equality here to match on '' and false. - if (null == ($byte = $stream->read(1))) { + if (NULL == ($byte = $stream->read(1))) { return $buffer; } $buffer .= $byte; @@ -460,8 +451,7 @@ function readline(StreamInterface $stream, $maxLength = null) * * @return Request */ -function parse_request($message) -{ +function parse_request($message) { $data = _parse_message($message); $matches = []; if (!preg_match('/^[\S]+\s+([a-zA-Z]+:\/\/|\/).*/', $data['start-line'], $matches)) { @@ -488,8 +478,7 @@ function parse_request($message) * * @return Response */ -function parse_response($message) -{ +function parse_response($message) { $data = _parse_message($message); // According to https://tools.ietf.org/html/rfc7230#section-3.1.2 the space // between status-code and reason-phrase is required. But browsers accept @@ -504,7 +493,7 @@ function parse_response($message) $data['headers'], $data['body'], explode('/', $parts[0])[1], - isset($parts[2]) ? $parts[2] : null + isset($parts[2]) ? $parts[2] : NULL ); } @@ -516,35 +505,36 @@ function parse_response($message) * PHP style arrays into an associative array (e.g., foo[a]=1&foo[b]=2 will * be parsed into ['foo[a]' => '1', 'foo[b]' => '2']). * - * @param string $str Query string to parse + * @param string $str Query string to parse * @param bool|string $urlEncoding How the query string is encoded * * @return array */ -function parse_query($str, $urlEncoding = true) -{ +function parse_query($str, $urlEncoding = TRUE) { $result = []; if ($str === '') { return $result; } - if ($urlEncoding === true) { + if ($urlEncoding === TRUE) { $decoder = function ($value) { return rawurldecode(str_replace('+', ' ', $value)); }; - } elseif ($urlEncoding == PHP_QUERY_RFC3986) { + } else if ($urlEncoding == PHP_QUERY_RFC3986) { $decoder = 'rawurldecode'; - } elseif ($urlEncoding == PHP_QUERY_RFC1738) { + } else if ($urlEncoding == PHP_QUERY_RFC1738) { $decoder = 'urldecode'; } else { - $decoder = function ($str) { return $str; }; + $decoder = function ($str) { + return $str; + }; } foreach (explode('&', $str) as $kvp) { $parts = explode('=', $kvp, 2); $key = $decoder($parts[0]); - $value = isset($parts[1]) ? $decoder($parts[1]) : null; + $value = isset($parts[1]) ? $decoder($parts[1]) : NULL; if (!isset($result[$key])) { $result[$key] = $value; } else { @@ -565,23 +555,24 @@ function parse_query($str, $urlEncoding = true) * string. This function does not modify the provided keys when an array is * encountered (like http_build_query would). * - * @param array $params Query string parameters. + * @param array $params Query string parameters. * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 * to encode using RFC3986, or PHP_QUERY_RFC1738 * to encode using RFC1738. * @return string */ -function build_query(array $params, $encoding = PHP_QUERY_RFC3986) -{ +function build_query(array $params, $encoding = PHP_QUERY_RFC3986) { if (!$params) { return ''; } - if ($encoding === false) { - $encoder = function ($str) { return $str; }; - } elseif ($encoding === PHP_QUERY_RFC3986) { + if ($encoding === FALSE) { + $encoder = function ($str) { + return $str; + }; + } else if ($encoding === PHP_QUERY_RFC3986) { $encoder = 'rawurlencode'; - } elseif ($encoding === PHP_QUERY_RFC1738) { + } else if ($encoding === PHP_QUERY_RFC1738) { $encoder = 'urlencode'; } else { throw new \InvalidArgumentException('Invalid type'); @@ -592,14 +583,14 @@ function build_query(array $params, $encoding = PHP_QUERY_RFC3986) $k = $encoder($k); if (!is_array($v)) { $qs .= $k; - if ($v !== null) { + if ($v !== NULL) { $qs .= '=' . $encoder($v); } $qs .= '&'; } else { foreach ($v as $vv) { $qs .= $k; - if ($vv !== null) { + if ($vv !== NULL) { $qs .= '=' . $encoder($vv); } $qs .= '&'; @@ -607,7 +598,7 @@ function build_query(array $params, $encoding = PHP_QUERY_RFC3986) } } - return $qs ? (string) substr($qs, 0, -1) : ''; + return $qs ? (string)substr($qs, 0, -1) : ''; } /** @@ -617,8 +608,7 @@ function build_query(array $params, $encoding = PHP_QUERY_RFC3986) * * @return null|string */ -function mimetype_from_filename($filename) -{ +function mimetype_from_filename($filename) { return mimetype_from_extension(pathinfo($filename, PATHINFO_EXTENSION)); } @@ -630,8 +620,7 @@ function mimetype_from_filename($filename) * @return string|null * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types */ -function mimetype_from_extension($extension) -{ +function mimetype_from_extension($extension) { static $mimetypes = [ '7z' => 'application/x-7z-compressed', 'aac' => 'audio/x-aac', @@ -737,7 +726,7 @@ function mimetype_from_extension($extension) return isset($mimetypes[$extension]) ? $mimetypes[$extension] - : null; + : NULL; } /** @@ -752,8 +741,7 @@ function mimetype_from_extension($extension) * @return array * @internal */ -function _parse_message($message) -{ +function _parse_message($message) { if (!$message) { throw new \InvalidArgumentException('Invalid message'); } @@ -786,14 +774,13 @@ function _parse_message($message) /** * Constructs a URI for an HTTP request message. * - * @param string $path Path from the start-line - * @param array $headers Array of headers (each value an array). + * @param string $path Path from the start-line + * @param array $headers Array of headers (each value an array). * * @return string * @internal */ -function _parse_request_uri($path, array $headers) -{ +function _parse_request_uri($path, array $headers) { $hostKey = array_filter(array_keys($headers), function ($k) { return strtolower($k) === 'host'; }); @@ -810,8 +797,7 @@ function _parse_request_uri($path, array $headers) } /** @internal */ -function _caseless_remove($keys, array $data) -{ +function _caseless_remove($keys, array $data) { $result = []; foreach ($keys as &$key) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/composer.json index 80755d7..9469529 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/composer.json @@ -1,56 +1,64 @@ { - "name": "kriswallsmith/assetic", - "description": "Asset Management for PHP", - "keywords": [ "assets", "compression", "minification" ], - "homepage": "https://github.com/kriswallsmith/assetic", - "type": "library", - "license": "MIT", - "authors": [ - { - "name": "Kris Wallsmith", - "email": "kris.wallsmith@gmail.com", - "homepage": "http://kriswallsmith.net/" - } - ], - "require": { - "php": ">=5.3.1", - "symfony/process": "~2.1|~3.0" - }, - "conflict": { - "twig/twig": "<1.27" - }, - "require-dev": { - "leafo/lessphp": "^0.3.7", - "leafo/scssphp": "~0.1", - "meenie/javascript-packer": "^1.1", - "mrclay/minify": "<2.3", - "natxet/cssmin": "3.0.4", - "patchwork/jsqueeze": "~1.0|~2.0", - "phpunit/phpunit": "~4.8 || ^5.6", - "psr/log": "~1.0", - "ptachoire/cssembed": "~1.0", - "symfony/phpunit-bridge": "~2.7|~3.0", - "twig/twig": "~1.23|~2.0", - "yfix/packager": "dev-master" - }, - "suggest": { - "twig/twig": "Assetic provides the integration with the Twig templating engine", - "leafo/lessphp": "Assetic provides the integration with the lessphp LESS compiler", - "leafo/scssphp": "Assetic provides the integration with the scssphp SCSS compiler", - "ptachoire/cssembed": "Assetic provides the integration with phpcssembed to embed data uris", - "leafo/scssphp-compass": "Assetic provides the integration with the SCSS compass plugin", - "patchwork/jsqueeze": "Assetic provides the integration with the JSqueeze JavaScript compressor" - }, - "autoload": { - "psr-0": { "Assetic": "src/" }, - "files": [ "src/functions.php" ] - }, - "config": { - "bin-dir": "bin" + "name": "kriswallsmith/assetic", + "description": "Asset Management for PHP", + "keywords": [ + "assets", + "compression", + "minification" + ], + "homepage": "https://github.com/kriswallsmith/assetic", + "type": "library", + "license": "MIT", + "authors": [ + { + "name": "Kris Wallsmith", + "email": "kris.wallsmith@gmail.com", + "homepage": "http://kriswallsmith.net/" + } + ], + "require": { + "php": ">=5.3.1", + "symfony/process": "~2.1|~3.0" + }, + "conflict": { + "twig/twig": "<1.27" + }, + "require-dev": { + "leafo/lessphp": "^0.3.7", + "leafo/scssphp": "~0.1", + "meenie/javascript-packer": "^1.1", + "mrclay/minify": "<2.3", + "natxet/cssmin": "3.0.4", + "patchwork/jsqueeze": "~1.0|~2.0", + "phpunit/phpunit": "~4.8 || ^5.6", + "psr/log": "~1.0", + "ptachoire/cssembed": "~1.0", + "symfony/phpunit-bridge": "~2.7|~3.0", + "twig/twig": "~1.23|~2.0", + "yfix/packager": "dev-master" + }, + "suggest": { + "twig/twig": "Assetic provides the integration with the Twig templating engine", + "leafo/lessphp": "Assetic provides the integration with the lessphp LESS compiler", + "leafo/scssphp": "Assetic provides the integration with the scssphp SCSS compiler", + "ptachoire/cssembed": "Assetic provides the integration with phpcssembed to embed data uris", + "leafo/scssphp-compass": "Assetic provides the integration with the SCSS compass plugin", + "patchwork/jsqueeze": "Assetic provides the integration with the JSqueeze JavaScript compressor" + }, + "autoload": { + "psr-0": { + "Assetic": "src/" }, - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } + "files": [ + "src/functions.php" + ] + }, + "config": { + "bin-dir": "bin" + }, + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" } + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCache.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCache.php index 7ce62b5..63c8e94 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCache.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCache.php @@ -25,29 +25,24 @@ class AssetCache implements AssetInterface private $asset; private $cache; - public function __construct(AssetInterface $asset, CacheInterface $cache) - { + public function __construct(AssetInterface $asset, CacheInterface $cache) { $this->asset = $asset; $this->cache = $cache; } - public function ensureFilter(FilterInterface $filter) - { + public function ensureFilter(FilterInterface $filter) { $this->asset->ensureFilter($filter); } - public function getFilters() - { + public function getFilters() { return $this->asset->getFilters(); } - public function clearFilters() - { + public function clearFilters() { $this->asset->clearFilters(); } - public function load(FilterInterface $additionalFilter = null) - { + public function load(FilterInterface $additionalFilter = NULL) { $cacheKey = self::getCacheKey($this->asset, $additionalFilter, 'load'); if ($this->cache->has($cacheKey)) { $this->asset->setContent($this->cache->get($cacheKey)); @@ -59,8 +54,7 @@ class AssetCache implements AssetInterface $this->cache->set($cacheKey, $this->asset->getContent()); } - public function dump(FilterInterface $additionalFilter = null) - { + public function dump(FilterInterface $additionalFilter = NULL) { $cacheKey = self::getCacheKey($this->asset, $additionalFilter, 'dump'); if ($this->cache->has($cacheKey)) { return $this->cache->get($cacheKey); @@ -72,58 +66,47 @@ class AssetCache implements AssetInterface return $content; } - public function getContent() - { + public function getContent() { return $this->asset->getContent(); } - public function setContent($content) - { + public function setContent($content) { $this->asset->setContent($content); } - public function getSourceRoot() - { + public function getSourceRoot() { return $this->asset->getSourceRoot(); } - public function getSourcePath() - { + public function getSourcePath() { return $this->asset->getSourcePath(); } - public function getSourceDirectory() - { + public function getSourceDirectory() { return $this->asset->getSourceDirectory(); } - public function getTargetPath() - { + public function getTargetPath() { return $this->asset->getTargetPath(); } - public function setTargetPath($targetPath) - { + public function setTargetPath($targetPath) { $this->asset->setTargetPath($targetPath); } - public function getLastModified() - { + public function getLastModified() { return $this->asset->getLastModified(); } - public function getVars() - { + public function getVars() { return $this->asset->getVars(); } - public function setValues(array $values) - { + public function setValues(array $values) { $this->asset->setValues($values); } - public function getValues() - { + public function getValues() { return $this->asset->getValues(); } @@ -138,20 +121,19 @@ class AssetCache implements AssetInterface * * last modified * * filters * - * @param AssetInterface $asset The asset + * @param AssetInterface $asset The asset * @param FilterInterface $additionalFilter Any additional filter being applied - * @param string $salt Salt for the key + * @param string $salt Salt for the key * * @return string A key for identifying the current asset */ - private static function getCacheKey(AssetInterface $asset, FilterInterface $additionalFilter = null, $salt = '') - { + private static function getCacheKey(AssetInterface $asset, FilterInterface $additionalFilter = NULL, $salt = '') { if ($additionalFilter) { $asset = clone $asset; $asset->ensureFilter($additionalFilter); } - $cacheKey = $asset->getSourceRoot(); + $cacheKey = $asset->getSourceRoot(); $cacheKey .= $asset->getSourcePath(); $cacheKey .= $asset->getTargetPath(); $cacheKey .= $asset->getLastModified(); @@ -169,6 +151,6 @@ class AssetCache implements AssetInterface $cacheKey .= serialize($values); } - return md5($cacheKey.$salt); + return md5($cacheKey . $salt); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollection.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollection.php index 3141af5..5efe43c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollection.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollection.php @@ -35,13 +35,12 @@ class AssetCollection implements \IteratorAggregate, AssetCollectionInterface /** * Constructor. * - * @param array $assets Assets for the current collection - * @param array $filters Filters for the current collection + * @param array $assets Assets for the current collection + * @param array $filters Filters for the current collection * @param string $sourceRoot The root directory - * @param array $vars + * @param array $vars */ - public function __construct($assets = array(), $filters = array(), $sourceRoot = null, array $vars = array()) - { + public function __construct($assets = array(), $filters = array(), $sourceRoot = NULL, array $vars = array()) { $this->assets = array(); foreach ($assets as $asset) { $this->add($asset); @@ -54,85 +53,76 @@ class AssetCollection implements \IteratorAggregate, AssetCollectionInterface $this->values = array(); } - public function __clone() - { + public function __clone() { $this->filters = clone $this->filters; $this->clones = new \SplObjectStorage(); } - public function all() - { + public function all() { return $this->assets; } - public function add(AssetInterface $asset) - { + public function add(AssetInterface $asset) { $this->assets[] = $asset; } - public function removeLeaf(AssetInterface $needle, $graceful = false) - { + public function removeLeaf(AssetInterface $needle, $graceful = FALSE) { foreach ($this->assets as $i => $asset) { - $clone = isset($this->clones[$asset]) ? $this->clones[$asset] : null; - if (in_array($needle, array($asset, $clone), true)) { + $clone = isset($this->clones[$asset]) ? $this->clones[$asset] : NULL; + if (in_array($needle, array($asset, $clone), TRUE)) { unset($this->clones[$asset], $this->assets[$i]); - return true; + return TRUE; } - if ($asset instanceof AssetCollectionInterface && $asset->removeLeaf($needle, true)) { - return true; + if ($asset instanceof AssetCollectionInterface && $asset->removeLeaf($needle, TRUE)) { + return TRUE; } } if ($graceful) { - return false; + return FALSE; } throw new \InvalidArgumentException('Leaf not found.'); } - public function replaceLeaf(AssetInterface $needle, AssetInterface $replacement, $graceful = false) - { + public function replaceLeaf(AssetInterface $needle, AssetInterface $replacement, $graceful = FALSE) { foreach ($this->assets as $i => $asset) { - $clone = isset($this->clones[$asset]) ? $this->clones[$asset] : null; - if (in_array($needle, array($asset, $clone), true)) { + $clone = isset($this->clones[$asset]) ? $this->clones[$asset] : NULL; + if (in_array($needle, array($asset, $clone), TRUE)) { unset($this->clones[$asset]); $this->assets[$i] = $replacement; - return true; + return TRUE; } - if ($asset instanceof AssetCollectionInterface && $asset->replaceLeaf($needle, $replacement, true)) { - return true; + if ($asset instanceof AssetCollectionInterface && $asset->replaceLeaf($needle, $replacement, TRUE)) { + return TRUE; } } if ($graceful) { - return false; + return FALSE; } throw new \InvalidArgumentException('Leaf not found.'); } - public function ensureFilter(FilterInterface $filter) - { + public function ensureFilter(FilterInterface $filter) { $this->filters->ensure($filter); } - public function getFilters() - { + public function getFilters() { return $this->filters->all(); } - public function clearFilters() - { + public function clearFilters() { $this->filters->clear(); $this->clones = new \SplObjectStorage(); } - public function load(FilterInterface $additionalFilter = null) - { + public function load(FilterInterface $additionalFilter = NULL) { // loop through leaves and load each asset $parts = array(); foreach ($this as $asset) { @@ -143,8 +133,7 @@ class AssetCollection implements \IteratorAggregate, AssetCollectionInterface $this->content = implode("\n", $parts); } - public function dump(FilterInterface $additionalFilter = null) - { + public function dump(FilterInterface $additionalFilter = NULL) { // loop through leaves and dump each asset $parts = array(); foreach ($this as $asset) { @@ -154,36 +143,29 @@ class AssetCollection implements \IteratorAggregate, AssetCollectionInterface return implode("\n", $parts); } - public function getContent() - { + public function getContent() { return $this->content; } - public function setContent($content) - { + public function setContent($content) { $this->content = $content; } - public function getSourceRoot() - { + public function getSourceRoot() { return $this->sourceRoot; } - public function getSourcePath() - { + public function getSourcePath() { } - public function getSourceDirectory() - { + public function getSourceDirectory() { } - public function getTargetPath() - { + public function getTargetPath() { return $this->targetPath; } - public function setTargetPath($targetPath) - { + public function setTargetPath($targetPath) { $this->targetPath = $targetPath; } @@ -192,8 +174,7 @@ class AssetCollection implements \IteratorAggregate, AssetCollectionInterface * * @return integer|null A UNIX timestamp */ - public function getLastModified() - { + public function getLastModified() { if (!count($this->assets)) { return; } @@ -212,18 +193,15 @@ class AssetCollection implements \IteratorAggregate, AssetCollectionInterface /** * Returns an iterator for looping recursively over unique leaves. */ - public function getIterator() - { + public function getIterator() { return new \RecursiveIteratorIterator(new AssetCollectionFilterIterator(new AssetCollectionIterator($this, $this->clones))); } - public function getVars() - { + public function getVars() { return $this->vars; } - public function setValues(array $values) - { + public function setValues(array $values) { $this->values = $values; foreach ($this as $asset) { @@ -231,8 +209,7 @@ class AssetCollection implements \IteratorAggregate, AssetCollectionInterface } } - public function getValues() - { + public function getValues() { return $this->values; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollectionInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollectionInterface.php index f029d1b..656eaa5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollectionInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollectionInterface.php @@ -35,25 +35,25 @@ interface AssetCollectionInterface extends AssetInterface, \Traversable /** * Removes a leaf. * - * @param AssetInterface $leaf The leaf to remove - * @param Boolean $graceful Whether the failure should return false or throw an exception + * @param AssetInterface $leaf The leaf to remove + * @param Boolean $graceful Whether the failure should return false or throw an exception * * @return Boolean Whether the asset has been found * * @throws \InvalidArgumentException If the asset cannot be found */ - public function removeLeaf(AssetInterface $leaf, $graceful = false); + public function removeLeaf(AssetInterface $leaf, $graceful = FALSE); /** * Replaces an existing leaf with a new one. * - * @param AssetInterface $needle The current asset to replace + * @param AssetInterface $needle The current asset to replace * @param AssetInterface $replacement The new asset - * @param Boolean $graceful Whether the failure should return false or throw an exception + * @param Boolean $graceful Whether the failure should return false or throw an exception * * @return Boolean Whether the asset has been found * * @throws \InvalidArgumentException If the asset cannot be found */ - public function replaceLeaf(AssetInterface $needle, AssetInterface $replacement, $graceful = false); + public function replaceLeaf(AssetInterface $needle, AssetInterface $replacement, $graceful = FALSE); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetInterface.php index b1d655c..2894576 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetInterface.php @@ -46,7 +46,7 @@ interface AssetInterface * * @param FilterInterface $additionalFilter An additional filter */ - public function load(FilterInterface $additionalFilter = null); + public function load(FilterInterface $additionalFilter = NULL); /** * Applies dump filters and returns the asset as a string. @@ -62,7 +62,7 @@ interface AssetInterface * * @return string The filtered content of the current asset */ - public function dump(FilterInterface $additionalFilter = null); + public function dump(FilterInterface $additionalFilter = NULL); /** * Returns the loaded content of the current asset. diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetReference.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetReference.php index f66b769..1243efc 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetReference.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetReference.php @@ -24,122 +24,102 @@ class AssetReference implements AssetInterface private $am; private $name; private $filters = array(); - private $clone = false; + private $clone = FALSE; private $asset; - public function __construct(AssetManager $am, $name) - { + public function __construct(AssetManager $am, $name) { $this->am = $am; $this->name = $name; } - public function __clone() - { - $this->clone = true; + public function __clone() { + $this->clone = TRUE; if ($this->asset) { $this->asset = clone $this->asset; } } - public function ensureFilter(FilterInterface $filter) - { + public function ensureFilter(FilterInterface $filter) { $this->filters[] = $filter; } - public function getFilters() - { + public function getFilters() { $this->flushFilters(); return $this->callAsset(__FUNCTION__); } - public function clearFilters() - { + public function clearFilters() { $this->filters = array(); $this->callAsset(__FUNCTION__); } - public function load(FilterInterface $additionalFilter = null) - { + public function load(FilterInterface $additionalFilter = NULL) { $this->flushFilters(); return $this->callAsset(__FUNCTION__, array($additionalFilter)); } - public function dump(FilterInterface $additionalFilter = null) - { + public function dump(FilterInterface $additionalFilter = NULL) { $this->flushFilters(); return $this->callAsset(__FUNCTION__, array($additionalFilter)); } - public function getContent() - { + public function getContent() { return $this->callAsset(__FUNCTION__); } - public function setContent($content) - { + public function setContent($content) { $this->callAsset(__FUNCTION__, array($content)); } - public function getSourceRoot() - { + public function getSourceRoot() { return $this->callAsset(__FUNCTION__); } - public function getSourcePath() - { + public function getSourcePath() { return $this->callAsset(__FUNCTION__); } - public function getSourceDirectory() - { + public function getSourceDirectory() { return $this->callAsset(__FUNCTION__); } - public function getTargetPath() - { + public function getTargetPath() { return $this->callAsset(__FUNCTION__); } - public function setTargetPath($targetPath) - { + public function setTargetPath($targetPath) { $this->callAsset(__FUNCTION__, array($targetPath)); } - public function getLastModified() - { + public function getLastModified() { return $this->callAsset(__FUNCTION__); } - public function getVars() - { + public function getVars() { return $this->callAsset(__FUNCTION__); } - public function getValues() - { + public function getValues() { return $this->callAsset(__FUNCTION__); } - public function setValues(array $values) - { + public function setValues(array $values) { $this->callAsset(__FUNCTION__, array($values)); } // private - private function callAsset($method, $arguments = array()) - { + private function callAsset($method, $arguments = array()) { $asset = $this->resolve(); return call_user_func_array(array($asset, $method), $arguments); } - private function flushFilters() - { + private function flushFilters() { $asset = $this->resolve(); while ($filter = array_shift($this->filters)) { @@ -147,8 +127,7 @@ class AssetReference implements AssetInterface } } - private function resolve() - { + private function resolve() { if ($this->asset) { return $this->asset; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/BaseAsset.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/BaseAsset.php index 093b92a..322ba92 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/BaseAsset.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/BaseAsset.php @@ -37,13 +37,12 @@ abstract class BaseAsset implements AssetInterface /** * Constructor. * - * @param array $filters Filters for the asset + * @param array $filters Filters for the asset * @param string $sourceRoot The root directory * @param string $sourcePath The asset path - * @param array $vars + * @param array $vars */ - public function __construct($filters = array(), $sourceRoot = null, $sourcePath = null, array $vars = array()) - { + public function __construct($filters = array(), $sourceRoot = NULL, $sourcePath = NULL, array $vars = array()) { $this->filters = new FilterCollection($filters); $this->sourceRoot = $sourceRoot; $this->sourcePath = $sourcePath; @@ -52,37 +51,32 @@ abstract class BaseAsset implements AssetInterface } $this->vars = $vars; $this->values = array(); - $this->loaded = false; + $this->loaded = FALSE; } - public function __clone() - { + public function __clone() { $this->filters = clone $this->filters; } - public function ensureFilter(FilterInterface $filter) - { + public function ensureFilter(FilterInterface $filter) { $this->filters->ensure($filter); } - public function getFilters() - { + public function getFilters() { return $this->filters->all(); } - public function clearFilters() - { + public function clearFilters() { $this->filters->clear(); } /** * Encapsulates asset loading logic. * - * @param string $content The asset content + * @param string $content The asset content * @param FilterInterface $additionalFilter An additional filter */ - protected function doLoad($content, FilterInterface $additionalFilter = null) - { + protected function doLoad($content, FilterInterface $additionalFilter = NULL) { $filter = clone $this->filters; if ($additionalFilter) { $filter->ensure($additionalFilter); @@ -94,11 +88,10 @@ abstract class BaseAsset implements AssetInterface $filter->filterLoad($asset); $this->content = $asset->getContent(); - $this->loaded = true; + $this->loaded = TRUE; } - public function dump(FilterInterface $additionalFilter = null) - { + public function dump(FilterInterface $additionalFilter = NULL) { if (!$this->loaded) { $this->load(); } @@ -114,41 +107,34 @@ abstract class BaseAsset implements AssetInterface return $asset->getContent(); } - public function getContent() - { + public function getContent() { return $this->content; } - public function setContent($content) - { + public function setContent($content) { $this->content = $content; } - public function getSourceRoot() - { + public function getSourceRoot() { return $this->sourceRoot; } - public function getSourcePath() - { + public function getSourcePath() { return $this->sourcePath; } - public function getSourceDirectory() - { + public function getSourceDirectory() { return $this->sourceDir; } - public function getTargetPath() - { + public function getTargetPath() { return $this->targetPath; } - public function setTargetPath($targetPath) - { + public function setTargetPath($targetPath) { if ($this->vars) { foreach ($this->vars as $var) { - if (false === strpos($targetPath, $var)) { + if (FALSE === strpos($targetPath, $var)) { throw new \RuntimeException(sprintf('The asset target path "%s" must contain the variable "{%s}".', $targetPath, $var)); } } @@ -157,25 +143,22 @@ abstract class BaseAsset implements AssetInterface $this->targetPath = $targetPath; } - public function getVars() - { + public function getVars() { return $this->vars; } - public function setValues(array $values) - { + public function setValues(array $values) { foreach ($values as $var => $v) { - if (!in_array($var, $this->vars, true)) { + if (!in_array($var, $this->vars, TRUE)) { throw new \InvalidArgumentException(sprintf('The asset with source path "%s" has no variable named "%s".', $this->sourcePath, $var)); } } $this->values = $values; - $this->loaded = false; + $this->loaded = FALSE; } - public function getValues() - { + public function getValues() { return $this->values; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/FileAsset.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/FileAsset.php index 2a33e08..74bee1a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/FileAsset.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/FileAsset.php @@ -26,22 +26,21 @@ class FileAsset extends BaseAsset /** * Constructor. * - * @param string $source An absolute path - * @param array $filters An array of filters + * @param string $source An absolute path + * @param array $filters An array of filters * @param string $sourceRoot The source asset root directory * @param string $sourcePath The source asset path - * @param array $vars + * @param array $vars * * @throws \InvalidArgumentException If the supplied root doesn't match the source when guessing the path */ - public function __construct($source, $filters = array(), $sourceRoot = null, $sourcePath = null, array $vars = array()) - { - if (null === $sourceRoot) { + public function __construct($source, $filters = array(), $sourceRoot = NULL, $sourcePath = NULL, array $vars = array()) { + if (NULL === $sourceRoot) { $sourceRoot = dirname($source); - if (null === $sourcePath) { + if (NULL === $sourcePath) { $sourcePath = basename($source); } - } elseif (null === $sourcePath) { + } else if (NULL === $sourcePath) { if (0 !== strpos($source, $sourceRoot)) { throw new \InvalidArgumentException(sprintf('The source "%s" is not in the root directory "%s"', $source, $sourceRoot)); } @@ -54,8 +53,7 @@ class FileAsset extends BaseAsset parent::__construct($filters, $sourceRoot, $sourcePath, $vars); } - public function load(FilterInterface $additionalFilter = null) - { + public function load(FilterInterface $additionalFilter = NULL) { $source = VarUtils::resolve($this->source, $this->getVars(), $this->getValues()); if (!is_file($source)) { @@ -65,8 +63,7 @@ class FileAsset extends BaseAsset $this->doLoad(file_get_contents($source), $additionalFilter); } - public function getLastModified() - { + public function getLastModified() { $source = VarUtils::resolve($this->source, $this->getVars(), $this->getValues()); if (!is_file($source)) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/GlobAsset.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/GlobAsset.php index 6444e61..13fa9a0 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/GlobAsset.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/GlobAsset.php @@ -27,21 +27,19 @@ class GlobAsset extends AssetCollection /** * Constructor. * - * @param string|array $globs A single glob path or array of paths - * @param array $filters An array of filters - * @param string $root The root directory - * @param array $vars + * @param string|array $globs A single glob path or array of paths + * @param array $filters An array of filters + * @param string $root The root directory + * @param array $vars */ - public function __construct($globs, $filters = array(), $root = null, array $vars = array()) - { - $this->globs = (array) $globs; - $this->initialized = false; + public function __construct($globs, $filters = array(), $root = NULL, array $vars = array()) { + $this->globs = (array)$globs; + $this->initialized = FALSE; parent::__construct(array(), $filters, $root, $vars); } - public function all() - { + public function all() { if (!$this->initialized) { $this->initialize(); } @@ -49,8 +47,7 @@ class GlobAsset extends AssetCollection return parent::all(); } - public function load(FilterInterface $additionalFilter = null) - { + public function load(FilterInterface $additionalFilter = NULL) { if (!$this->initialized) { $this->initialize(); } @@ -58,8 +55,7 @@ class GlobAsset extends AssetCollection parent::load($additionalFilter); } - public function dump(FilterInterface $additionalFilter = null) - { + public function dump(FilterInterface $additionalFilter = NULL) { if (!$this->initialized) { $this->initialize(); } @@ -67,8 +63,7 @@ class GlobAsset extends AssetCollection return parent::dump($additionalFilter); } - public function getLastModified() - { + public function getLastModified() { if (!$this->initialized) { $this->initialize(); } @@ -76,8 +71,7 @@ class GlobAsset extends AssetCollection return parent::getLastModified(); } - public function getIterator() - { + public function getIterator() { if (!$this->initialized) { $this->initialize(); } @@ -85,24 +79,22 @@ class GlobAsset extends AssetCollection return parent::getIterator(); } - public function setValues(array $values) - { + public function setValues(array $values) { parent::setValues($values); - $this->initialized = false; + $this->initialized = FALSE; } /** * Initializes the collection based on the glob(s) passed in. */ - private function initialize() - { + private function initialize() { foreach ($this->globs as $glob) { $glob = VarUtils::resolve($glob, $this->getVars(), $this->getValues()); - if (false !== $paths = glob($glob)) { + if (FALSE !== $paths = glob($glob)) { foreach ($paths as $path) { if (is_file($path)) { - $asset = new FileAsset($path, array(), $this->getSourceRoot(), null, $this->getVars()); + $asset = new FileAsset($path, array(), $this->getSourceRoot(), NULL, $this->getVars()); $asset->setValues($this->getValues()); $this->add($asset); } @@ -110,6 +102,6 @@ class GlobAsset extends AssetCollection } } - $this->initialized = true; + $this->initialized = TRUE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/HttpAsset.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/HttpAsset.php index cd56761..a188416 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/HttpAsset.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/HttpAsset.php @@ -27,18 +27,17 @@ class HttpAsset extends BaseAsset /** * Constructor. * - * @param string $sourceUrl The source URL - * @param array $filters An array of filters + * @param string $sourceUrl The source URL + * @param array $filters An array of filters * @param Boolean $ignoreErrors - * @param array $vars + * @param array $vars * * @throws \InvalidArgumentException If the first argument is not an URL */ - public function __construct($sourceUrl, $filters = array(), $ignoreErrors = false, array $vars = array()) - { + public function __construct($sourceUrl, $filters = array(), $ignoreErrors = FALSE, array $vars = array()) { if (0 === strpos($sourceUrl, '//')) { - $sourceUrl = 'http:'.$sourceUrl; - } elseif (false === strpos($sourceUrl, '://')) { + $sourceUrl = 'http:' . $sourceUrl; + } else if (FALSE === strpos($sourceUrl, '://')) { throw new \InvalidArgumentException(sprintf('"%s" is not a valid URL.', $sourceUrl)); } @@ -48,25 +47,23 @@ class HttpAsset extends BaseAsset list($scheme, $url) = explode('://', $sourceUrl, 2); list($host, $path) = explode('/', $url, 2); - parent::__construct($filters, $scheme.'://'.$host, $path, $vars); + parent::__construct($filters, $scheme . '://' . $host, $path, $vars); } - public function load(FilterInterface $additionalFilter = null) - { + public function load(FilterInterface $additionalFilter = NULL) { $content = @file_get_contents( VarUtils::resolve($this->sourceUrl, $this->getVars(), $this->getValues()) ); - if (false === $content && !$this->ignoreErrors) { + if (FALSE === $content && !$this->ignoreErrors) { throw new \RuntimeException(sprintf('Unable to load asset from URL "%s"', $this->sourceUrl)); } $this->doLoad($content, $additionalFilter); } - public function getLastModified() - { - if (false !== @file_get_contents($this->sourceUrl, false, stream_context_create(array('http' => array('method' => 'HEAD'))))) { + public function getLastModified() { + if (FALSE !== @file_get_contents($this->sourceUrl, FALSE, stream_context_create(array('http' => array('method' => 'HEAD'))))) { foreach ($http_response_header as $header) { if (0 === stripos($header, 'Last-Modified: ')) { list(, $mtime) = explode(':', $header, 2); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionFilterIterator.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionFilterIterator.php index fae5d13..fb4722f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionFilterIterator.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionFilterIterator.php @@ -28,11 +28,10 @@ class AssetCollectionFilterIterator extends \RecursiveFilterIterator * Constructor. * * @param AssetCollectionIterator $iterator The inner iterator - * @param array $visited An array of visited asset objects - * @param array $sources An array of visited source strings + * @param array $visited An array of visited asset objects + * @param array $sources An array of visited source strings */ - public function __construct(AssetCollectionIterator $iterator, array $visited = array(), array $sources = array()) - { + public function __construct(AssetCollectionIterator $iterator, array $visited = array(), array $sources = array()) { parent::__construct($iterator); $this->visited = $visited; @@ -47,14 +46,13 @@ class AssetCollectionFilterIterator extends \RecursiveFilterIterator * * @return Boolean Returns true if we have not seen this asset yet */ - public function accept() - { - $asset = $this->getInnerIterator()->current(true); - $duplicate = false; + public function accept() { + $asset = $this->getInnerIterator()->current(TRUE); + $duplicate = FALSE; // check strict equality - if (in_array($asset, $this->visited, true)) { - $duplicate = true; + if (in_array($asset, $this->visited, TRUE)) { + $duplicate = TRUE; } else { $this->visited[] = $asset; } @@ -63,9 +61,9 @@ class AssetCollectionFilterIterator extends \RecursiveFilterIterator $sourceRoot = $asset->getSourceRoot(); $sourcePath = $asset->getSourcePath(); if ($sourceRoot && $sourcePath) { - $source = $sourceRoot.'/'.$sourcePath; + $source = $sourceRoot . '/' . $sourcePath; if (in_array($source, $this->sources)) { - $duplicate = true; + $duplicate = TRUE; } else { $this->sources[] = $source; } @@ -77,8 +75,7 @@ class AssetCollectionFilterIterator extends \RecursiveFilterIterator /** * Passes visited objects and source URLs to the child iterator. */ - public function getChildren() - { + public function getChildren() { return new self($this->getInnerIterator()->getChildren(), $this->visited, $this->sources); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php index e4cf128..c5f9bcd 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/Iterator/AssetCollectionIterator.php @@ -29,18 +29,17 @@ class AssetCollectionIterator implements \RecursiveIterator private $output; private $clones; - public function __construct(AssetCollectionInterface $coll, \SplObjectStorage $clones) - { - $this->assets = $coll->all(); + public function __construct(AssetCollectionInterface $coll, \SplObjectStorage $clones) { + $this->assets = $coll->all(); $this->filters = $coll->getFilters(); - $this->vars = $coll->getVars(); - $this->output = $coll->getTargetPath(); - $this->clones = $clones; + $this->vars = $coll->getVars(); + $this->output = $coll->getTargetPath(); + $this->clones = $clones; - if (false === $pos = strrpos($this->output, '.')) { + if (FALSE === $pos = strrpos($this->output, '.')) { $this->output .= '_*'; } else { - $this->output = substr($this->output, 0, $pos).'_*'.substr($this->output, $pos); + $this->output = substr($this->output, 0, $pos) . '_*' . substr($this->output, $pos); } } @@ -51,8 +50,7 @@ class AssetCollectionIterator implements \RecursiveIterator * * @return \Assetic\Asset\AssetInterface */ - public function current($raw = false) - { + public function current($raw = FALSE) { $asset = current($this->assets); if ($raw) { @@ -81,44 +79,37 @@ class AssetCollectionIterator implements \RecursiveIterator return $clone; } - public function key() - { + public function key() { return key($this->assets); } - public function next() - { + public function next() { return next($this->assets); } - public function rewind() - { + public function rewind() { return reset($this->assets); } - public function valid() - { - return false !== current($this->assets); + public function valid() { + return FALSE !== current($this->assets); } - public function hasChildren() - { + public function hasChildren() { return current($this->assets) instanceof AssetCollectionInterface; } /** * @uses current() */ - public function getChildren() - { + public function getChildren() { return new self($this->current(), $this->clones); } - private function removeDuplicateVar($name) - { + private function removeDuplicateVar($name) { foreach ($this->vars as $var) { - $var = '{'.$var.'}'; - if (false !== strpos($name, $var) && false !== strpos($this->output, $var)) { + $var = '{' . $var . '}'; + if (FALSE !== strpos($name, $var) && FALSE !== strpos($this->output, $var)) { $name = str_replace($var, '', $name); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/StringAsset.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/StringAsset.php index d9b9a88..1f1e60d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/StringAsset.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Asset/StringAsset.php @@ -26,30 +26,26 @@ class StringAsset extends BaseAsset /** * Constructor. * - * @param string $content The content of the asset - * @param array $filters Filters for the asset + * @param string $content The content of the asset + * @param array $filters Filters for the asset * @param string $sourceRoot The source asset root directory * @param string $sourcePath The source asset path */ - public function __construct($content, $filters = array(), $sourceRoot = null, $sourcePath = null) - { + public function __construct($content, $filters = array(), $sourceRoot = NULL, $sourcePath = NULL) { $this->string = $content; parent::__construct($filters, $sourceRoot, $sourcePath); } - public function load(FilterInterface $additionalFilter = null) - { + public function load(FilterInterface $additionalFilter = NULL) { $this->doLoad($this->string, $additionalFilter); } - public function setLastModified($lastModified) - { + public function setLastModified($lastModified) { $this->lastModified = $lastModified; } - public function getLastModified() - { + public function getLastModified() { return $this->lastModified; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/AssetManager.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/AssetManager.php index 9b8ee12..631ec8b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/AssetManager.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/AssetManager.php @@ -31,8 +31,7 @@ class AssetManager * * @throws \InvalidArgumentException If there is no asset by that name */ - public function get($name) - { + public function get($name) { if (!isset($this->assets[$name])) { throw new \InvalidArgumentException(sprintf('There is no "%s" asset.', $name)); } @@ -47,21 +46,19 @@ class AssetManager * * @return Boolean True if the asset has been set, false if not */ - public function has($name) - { + public function has($name) { return isset($this->assets[$name]); } /** * Registers an asset to the current asset manager. * - * @param string $name The asset name + * @param string $name The asset name * @param AssetInterface $asset The asset * * @throws \InvalidArgumentException If the asset name is invalid */ - public function set($name, AssetInterface $asset) - { + public function set($name, AssetInterface $asset) { if (!ctype_alnum(str_replace('_', '', $name))) { throw new \InvalidArgumentException(sprintf('The name "%s" is invalid.', $name)); } @@ -74,16 +71,14 @@ class AssetManager * * @return array An array of asset names */ - public function getNames() - { + public function getNames() { return array_keys($this->assets); } /** * Clears all assets. */ - public function clear() - { + public function clear() { $this->assets = array(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php index 4f010a4..538ced4 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php @@ -28,13 +28,12 @@ class AssetWriter /** * Constructor. * - * @param string $dir The base web directory - * @param array $values Variable values + * @param string $dir The base web directory + * @param array $values Variable values * * @throws \InvalidArgumentException if a variable value is not a string */ - public function __construct($dir, array $values = array()) - { + public function __construct($dir, array $values = array()) { foreach ($values as $var => $vals) { foreach ($vals as $value) { if (!is_string($value)) { @@ -47,20 +46,18 @@ class AssetWriter $this->values = $values; } - public function writeManagerAssets(AssetManager $am) - { + public function writeManagerAssets(AssetManager $am) { foreach ($am->getNames() as $name) { $this->writeAsset($am->get($name)); } } - public function writeAsset(AssetInterface $asset) - { + public function writeAsset(AssetInterface $asset) { foreach (VarUtils::getCombinations($asset->getVars(), $this->values) as $combination) { $asset->setValues($combination); static::write( - $this->dir.'/'.VarUtils::resolve( + $this->dir . '/' . VarUtils::resolve( $asset->getTargetPath(), $asset->getVars(), $asset->getValues() @@ -70,14 +67,13 @@ class AssetWriter } } - protected static function write($path, $contents) - { - if (!is_dir($dir = dirname($path)) && false === @mkdir($dir, 0777, true)) { - throw new \RuntimeException('Unable to create directory '.$dir); + protected static function write($path, $contents) { + if (!is_dir($dir = dirname($path)) && FALSE === @mkdir($dir, 0777, TRUE)) { + throw new \RuntimeException('Unable to create directory ' . $dir); } - if (false === @file_put_contents($path, $contents)) { - throw new \RuntimeException('Unable to write file '.$path); + if (FALSE === @file_put_contents($path, $contents)) { + throw new \RuntimeException('Unable to write file ' . $path); } } @@ -87,8 +83,7 @@ class AssetWriter * This method is provided for backward compatibility with certain versions * of AsseticBundle. */ - private function getCombinations(array $vars) - { + private function getCombinations(array $vars) { return VarUtils::getCombinations($vars, $this->values); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/ApcCache.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/ApcCache.php index 8c7aa11..b195ea7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/ApcCache.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/ApcCache.php @@ -23,20 +23,18 @@ class ApcCache implements CacheInterface /** * @see CacheInterface::has() */ - public function has($key) - { + public function has($key) { return apc_exists($key); } /** * @see CacheInterface::get() */ - public function get($key) - { + public function get($key) { $value = apc_fetch($key, $success); if (!$success) { - throw new \RuntimeException('There is no cached value for '.$key); + throw new \RuntimeException('There is no cached value for ' . $key); } return $value; @@ -45,12 +43,11 @@ class ApcCache implements CacheInterface /** * @see CacheInterface::set() */ - public function set($key, $value) - { + public function set($key, $value) { $store = apc_store($key, $value, $this->ttl); if (!$store) { - throw new \RuntimeException('Unable to store "'.$key.'" for '.$this->ttl.' seconds.'); + throw new \RuntimeException('Unable to store "' . $key . '" for ' . $this->ttl . ' seconds.'); } return $store; @@ -59,8 +56,7 @@ class ApcCache implements CacheInterface /** * @see CacheInterface::remove() */ - public function remove($key) - { + public function remove($key) { return apc_delete($key); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/ArrayCache.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/ArrayCache.php index 7f357ac..6ced263 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/ArrayCache.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/ArrayCache.php @@ -23,18 +23,16 @@ class ArrayCache implements CacheInterface /** * @see CacheInterface::has() */ - public function has($key) - { + public function has($key) { return isset($this->cache[$key]); } /** * @see CacheInterface::get() */ - public function get($key) - { + public function get($key) { if (!$this->has($key)) { - throw new \RuntimeException('There is no cached value for '.$key); + throw new \RuntimeException('There is no cached value for ' . $key); } return $this->cache[$key]; @@ -43,16 +41,14 @@ class ArrayCache implements CacheInterface /** * @see CacheInterface::set() */ - public function set($key, $value) - { + public function set($key, $value) { $this->cache[$key] = $value; } /** * @see CacheInterface::remove() */ - public function remove($key) - { + public function remove($key) { unset($this->cache[$key]); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/CacheInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/CacheInterface.php index be13310..08e9eb9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/CacheInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/CacheInterface.php @@ -39,7 +39,7 @@ interface CacheInterface /** * Sets a value in the cache. * - * @param string $key A unique key + * @param string $key A unique key * @param string $value The value to cache */ public function set($key, $value); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/ConfigCache.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/ConfigCache.php index e285e0b..3dcfb4d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/ConfigCache.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/ConfigCache.php @@ -25,8 +25,7 @@ class ConfigCache * * @param string $dir The cache directory */ - public function __construct($dir) - { + public function __construct($dir) { $this->dir = $dir; } @@ -37,8 +36,7 @@ class ConfigCache * * @return Boolean True if a file exists */ - public function has($resource) - { + public function has($resource) { return file_exists($this->getSourcePath($resource)); } @@ -46,21 +44,20 @@ class ConfigCache * Writes a value to a file. * * @param string $resource A cache key - * @param mixed $value A value to cache + * @param mixed $value A value to cache */ - public function set($resource, $value) - { + public function set($resource, $value) { $path = $this->getSourcePath($resource); - if (!is_dir($dir = dirname($path)) && false === @mkdir($dir, 0777, true)) { + if (!is_dir($dir = dirname($path)) && FALSE === @mkdir($dir, 0777, TRUE)) { // @codeCoverageIgnoreStart - throw new \RuntimeException('Unable to create directory '.$dir); + throw new \RuntimeException('Unable to create directory ' . $dir); // @codeCoverageIgnoreEnd } - if (false === @file_put_contents($path, sprintf("getSourcePath($resource); if (!file_exists($path)) { - throw new \RuntimeException('There is no cached value for '.$resource); + throw new \RuntimeException('There is no cached value for ' . $resource); } return include $path; @@ -90,17 +86,16 @@ class ConfigCache * * @return integer A UNIX timestamp */ - public function getTimestamp($resource) - { + public function getTimestamp($resource) { $path = $this->getSourcePath($resource); if (!file_exists($path)) { - throw new \RuntimeException('There is no cached value for '.$resource); + throw new \RuntimeException('There is no cached value for ' . $resource); } - if (false === $mtime = @filemtime($path)) { + if (FALSE === $mtime = @filemtime($path)) { // @codeCoverageIgnoreStart - throw new \RuntimeException('Unable to determine file mtime for '.$path); + throw new \RuntimeException('Unable to determine file mtime for ' . $path); // @codeCoverageIgnoreEnd } @@ -114,10 +109,9 @@ class ConfigCache * * @return string A file path */ - private function getSourcePath($resource) - { + private function getSourcePath($resource) { $key = md5($resource); - return $this->dir.'/'.$key[0].'/'.$key.'.php'; + return $this->dir . '/' . $key[0] . '/' . $key . '.php'; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/ExpiringCache.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/ExpiringCache.php index 46ef85f..04dedc2 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/ExpiringCache.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/ExpiringCache.php @@ -21,40 +21,35 @@ class ExpiringCache implements CacheInterface private $cache; private $lifetime; - public function __construct(CacheInterface $cache, $lifetime) - { + public function __construct(CacheInterface $cache, $lifetime) { $this->cache = $cache; $this->lifetime = $lifetime; } - public function has($key) - { + public function has($key) { if ($this->cache->has($key)) { - if (time() < $this->cache->get($key.'.expires')) { - return true; + if (time() < $this->cache->get($key . '.expires')) { + return TRUE; } - $this->cache->remove($key.'.expires'); + $this->cache->remove($key . '.expires'); $this->cache->remove($key); } - return false; + return FALSE; } - public function get($key) - { + public function get($key) { return $this->cache->get($key); } - public function set($key, $value) - { - $this->cache->set($key.'.expires', time() + $this->lifetime); + public function set($key, $value) { + $this->cache->set($key . '.expires', time() + $this->lifetime); $this->cache->set($key, $value); } - public function remove($key) - { - $this->cache->remove($key.'.expires'); + public function remove($key) { + $this->cache->remove($key . '.expires'); $this->cache->remove($key); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/FilesystemCache.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/FilesystemCache.php index f8eddfd..4e2f64e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/FilesystemCache.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Cache/FilesystemCache.php @@ -20,46 +20,41 @@ class FilesystemCache implements CacheInterface { private $dir; - public function __construct($dir) - { + public function __construct($dir) { $this->dir = $dir; } - public function has($key) - { - return file_exists($this->dir.'/'.$key); + public function has($key) { + return file_exists($this->dir . '/' . $key); } - public function get($key) - { - $path = $this->dir.'/'.$key; + public function get($key) { + $path = $this->dir . '/' . $key; if (!file_exists($path)) { - throw new \RuntimeException('There is no cached value for '.$key); + throw new \RuntimeException('There is no cached value for ' . $key); } return file_get_contents($path); } - public function set($key, $value) - { - if (!is_dir($this->dir) && false === @mkdir($this->dir, 0777, true)) { - throw new \RuntimeException('Unable to create directory '.$this->dir); + public function set($key, $value) { + if (!is_dir($this->dir) && FALSE === @mkdir($this->dir, 0777, TRUE)) { + throw new \RuntimeException('Unable to create directory ' . $this->dir); } - $path = $this->dir.'/'.$key; + $path = $this->dir . '/' . $key; - if (false === @file_put_contents($path, $value)) { - throw new \RuntimeException('Unable to write file '.$path); + if (FALSE === @file_put_contents($path, $value)) { + throw new \RuntimeException('Unable to write file ' . $path); } } - public function remove($key) - { - $path = $this->dir.'/'.$key; + public function remove($key) { + $path = $this->dir . '/' . $key; - if (file_exists($path) && false === @unlink($path)) { - throw new \RuntimeException('Unable to remove file '.$path); + if (file_exists($path) && FALSE === @unlink($path)) { + throw new \RuntimeException('Unable to remove file ' . $path); } } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Exception/FilterException.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Exception/FilterException.php index 03a230b..ad250ff 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Exception/FilterException.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Exception/FilterException.php @@ -23,49 +23,44 @@ class FilterException extends \RuntimeException implements Exception private $originalMessage; private $input; - public static function fromProcess(Process $proc) - { + public static function fromProcess(Process $proc) { $message = sprintf("An error occurred while running:\n%s", $proc->getCommandLine()); $errorOutput = $proc->getErrorOutput(); if (!empty($errorOutput)) { - $message .= "\n\nError Output:\n".str_replace("\r", '', $errorOutput); + $message .= "\n\nError Output:\n" . str_replace("\r", '', $errorOutput); } $output = $proc->getOutput(); if (!empty($output)) { - $message .= "\n\nOutput:\n".str_replace("\r", '', $output); + $message .= "\n\nOutput:\n" . str_replace("\r", '', $output); } return new self($message); } - public function __construct($message, $code = 0, \Exception $previous = null) - { + public function __construct($message, $code = 0, \Exception $previous = NULL) { parent::__construct($message, $code, $previous); $this->originalMessage = $message; } - public function setInput($input) - { + public function setInput($input) { $this->input = $input; $this->updateMessage(); return $this; } - public function getInput() - { + public function getInput() { return $this->input; } - private function updateMessage() - { + private function updateMessage() { $message = $this->originalMessage; if (!empty($this->input)) { - $message .= "\n\nInput:\n".$this->input; + $message .= "\n\nInput:\n" . $this->input; } $this->message = $message; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticExtension.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticExtension.php index 951e1c8..d02a914 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticExtension.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticExtension.php @@ -20,8 +20,7 @@ class AsseticExtension extends \Twig_Extension implements \Twig_Extension_Global protected $functions; protected $valueSupplier; - public function __construct(AssetFactory $factory, $functions = array(), ValueSupplierInterface $valueSupplier = null) - { + public function __construct(AssetFactory $factory, $functions = array(), ValueSupplierInterface $valueSupplier = NULL) { $this->factory = $factory; $this->functions = array(); $this->valueSupplier = $valueSupplier; @@ -35,17 +34,15 @@ class AsseticExtension extends \Twig_Extension implements \Twig_Extension_Global } } - public function getTokenParsers() - { + public function getTokenParsers() { return array( new AsseticTokenParser($this->factory, 'javascripts', 'js/*.js'), new AsseticTokenParser($this->factory, 'stylesheets', 'css/*.css'), - new AsseticTokenParser($this->factory, 'image', 'images/*', true), + new AsseticTokenParser($this->factory, 'image', 'images/*', TRUE), ); } - public function getFunctions() - { + public function getFunctions() { $functions = array(); foreach ($this->functions as $function => $filter) { $functions[] = new AsseticFilterFunction($function); @@ -54,23 +51,20 @@ class AsseticExtension extends \Twig_Extension implements \Twig_Extension_Global return $functions; } - public function getGlobals() - { + public function getGlobals() { return array( 'assetic' => array( 'debug' => $this->factory->isDebug(), - 'vars' => null !== $this->valueSupplier ? new ValueContainer($this->valueSupplier) : array(), + 'vars' => NULL !== $this->valueSupplier ? new ValueContainer($this->valueSupplier) : array(), ), ); } - public function getFilterInvoker($function) - { + public function getFilterInvoker($function) { return new AsseticFilterInvoker($this->factory, $this->functions[$function]); } - public function getName() - { + public function getName() { return 'assetic'; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterFunction.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterFunction.php index 2c2b13c..95304ea 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterFunction.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterFunction.php @@ -13,11 +13,10 @@ namespace Assetic\Extension\Twig; class AsseticFilterFunction extends \Twig_SimpleFunction { - public function __construct($name, $options = array()) - { - parent::__construct($name, null, array_merge($options, array( - 'needs_environment' => false, - 'needs_context' => false, + public function __construct($name, $options = array()) { + parent::__construct($name, NULL, array_merge($options, array( + 'needs_environment' => FALSE, + 'needs_context' => FALSE, 'node_class' => '\Assetic\Extension\Twig\AsseticFilterNode', ))); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterInvoker.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterInvoker.php index 1b70e43..2bd85f8 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterInvoker.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterInvoker.php @@ -22,36 +22,31 @@ class AsseticFilterInvoker private $filters; private $options; - public function __construct($factory, $filter) - { + public function __construct($factory, $filter) { $this->factory = $factory; if (is_array($filter) && isset($filter['filter'])) { - $this->filters = (array) $filter['filter']; - $this->options = isset($filter['options']) ? (array) $filter['options'] : array(); + $this->filters = (array)$filter['filter']; + $this->options = isset($filter['options']) ? (array)$filter['options'] : array(); } else { - $this->filters = (array) $filter; + $this->filters = (array)$filter; $this->options = array(); } } - public function getFactory() - { + public function getFactory() { return $this->factory; } - public function getFilters() - { + public function getFilters() { return $this->filters; } - public function getOptions() - { + public function getOptions() { return $this->options; } - public function invoke($input, array $options = array()) - { + public function invoke($input, array $options = array()) { $asset = $this->factory->createAsset($input, $this->filters, $options + $this->options); return $asset->getTargetPath(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterNode.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterNode.php index 3fe05ac..550e0df 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterNode.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticFilterNode.php @@ -13,8 +13,7 @@ namespace Assetic\Extension\Twig; class AsseticFilterNode extends \Twig_Node_Expression_Function { - protected function compileCallable(\Twig_Compiler $compiler) - { + protected function compileCallable(\Twig_Compiler $compiler) { $compiler->raw(sprintf('$this->env->getExtension(\'Assetic\\Extension\\Twig\\AsseticExtension\')->getFilterInvoker(\'%s\')->invoke', $this->getAttribute('name'))); $this->compileArguments($compiler); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticNode.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticNode.php index 950e46c..9200d2d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticNode.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticNode.php @@ -24,21 +24,20 @@ class AsseticNode extends \Twig_Node * * combine: Whether to combine assets * * var_name: The name of the variable to expose to the body node * - * @param AssetInterface $asset The asset - * @param \Twig_Node $body The body node - * @param array $inputs An array of input strings - * @param array $filters An array of filter strings - * @param string $name The name of the asset - * @param array $attributes An array of attributes - * @param integer $lineno The line number - * @param string $tag The tag name + * @param AssetInterface $asset The asset + * @param \Twig_Node $body The body node + * @param array $inputs An array of input strings + * @param array $filters An array of filter strings + * @param string $name The name of the asset + * @param array $attributes An array of attributes + * @param integer $lineno The line number + * @param string $tag The tag name */ - public function __construct(AssetInterface $asset, \Twig_Node $body, array $inputs, array $filters, $name, array $attributes = array(), $lineno = 0, $tag = null) - { + public function __construct(AssetInterface $asset, \Twig_Node $body, array $inputs, array $filters, $name, array $attributes = array(), $lineno = 0, $tag = NULL) { $nodes = array('body' => $body); $attributes = array_replace( - array('debug' => null, 'combine' => null, 'var_name' => 'asset_url'), + array('debug' => NULL, 'combine' => NULL, 'var_name' => 'asset_url'), $attributes, array('asset' => $asset, 'inputs' => $inputs, 'filters' => $filters, 'name' => $name) ); @@ -46,38 +45,34 @@ class AsseticNode extends \Twig_Node parent::__construct($nodes, $attributes, $lineno, $tag); } - public function compile(\Twig_Compiler $compiler) - { + public function compile(\Twig_Compiler $compiler) { $compiler->addDebugInfo($this); $combine = $this->getAttribute('combine'); $debug = $this->getAttribute('debug'); - if (null === $combine && null !== $debug) { + if (NULL === $combine && NULL !== $debug) { $combine = !$debug; } - if (null === $combine) { + if (NULL === $combine) { $compiler ->write("if (isset(\$context['assetic']['debug']) && \$context['assetic']['debug']) {\n") - ->indent() - ; + ->indent(); $this->compileDebug($compiler); $compiler ->outdent() ->write("} else {\n") - ->indent() - ; + ->indent(); $this->compileAsset($compiler, $this->getAttribute('asset'), $this->getAttribute('name')); $compiler ->outdent() - ->write("}\n") - ; - } elseif ($combine) { + ->write("}\n"); + } else if ($combine) { $this->compileAsset($compiler, $this->getAttribute('asset'), $this->getAttribute('name')); } else { $this->compileDebug($compiler); @@ -86,21 +81,18 @@ class AsseticNode extends \Twig_Node $compiler ->write('unset($context[') ->repr($this->getAttribute('var_name')) - ->raw("]);\n") - ; + ->raw("]);\n"); } - protected function compileDebug(\Twig_Compiler $compiler) - { + protected function compileDebug(\Twig_Compiler $compiler) { $i = 0; foreach ($this->getAttribute('asset') as $leaf) { - $leafName = $this->getAttribute('name').'_'.$i++; + $leafName = $this->getAttribute('name') . '_' . $i++; $this->compileAsset($compiler, $leaf, $leafName); } } - protected function compileAsset(\Twig_Compiler $compiler, AssetInterface $asset, $name) - { + protected function compileAsset(\Twig_Compiler $compiler, AssetInterface $asset, $name) { if ($vars = $asset->getVars()) { $compiler->write("// check variable conditions\n"); @@ -108,10 +100,9 @@ class AsseticNode extends \Twig_Node $compiler ->write("if (!isset(\$context['assetic']['vars']['$var'])) {\n") ->indent() - ->write("throw new \RuntimeException(sprintf('The asset \"".$name."\" expected variable \"".$var."\" to be set, but got only these vars: %s. Did you set-up a value supplier?', isset(\$context['assetic']['vars']) && \$context['assetic']['vars'] ? implode(', ', \$context['assetic']['vars']) : '# none #'));\n") + ->write("throw new \RuntimeException(sprintf('The asset \"" . $name . "\" expected variable \"" . $var . "\" to be set, but got only these vars: %s. Did you set-up a value supplier?', isset(\$context['assetic']['vars']) && \$context['assetic']['vars'] ? implode(', ', \$context['assetic']['vars']) : '# none #'));\n") ->outdent() - ->write("}\n") - ; + ->write("}\n"); } $compiler->raw("\n"); @@ -121,19 +112,16 @@ class AsseticNode extends \Twig_Node ->write("// asset \"$name\"\n") ->write('$context[') ->repr($this->getAttribute('var_name')) - ->raw('] = ') - ; + ->raw('] = '); $this->compileAssetUrl($compiler, $asset, $name); $compiler ->raw(";\n") - ->subcompile($this->getNode('body')) - ; + ->subcompile($this->getNode('body')); } - protected function compileAssetUrl(\Twig_Compiler $compiler, AssetInterface $asset, $name) - { + protected function compileAssetUrl(\Twig_Compiler $compiler, AssetInterface $asset, $name) { if (!$vars = $asset->getVars()) { $compiler->repr($asset->getTargetPath()); @@ -145,21 +133,19 @@ class AsseticNode extends \Twig_Node ->string($asset->getTargetPath()) ->raw(", array("); - $first = true; + $first = TRUE; foreach ($vars as $var) { if (!$first) { $compiler->raw(", "); } - $first = false; + $first = FALSE; $compiler - ->string("{".$var."}") - ->raw(" => \$context['assetic']['vars']['$var']") - ; + ->string("{" . $var . "}") + ->raw(" => \$context['assetic']['vars']['$var']"); } $compiler - ->raw("))") - ; + ->raw("))"); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticTokenParser.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticTokenParser.php index 614f567..c5bba8b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticTokenParser.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/AsseticTokenParser.php @@ -28,30 +28,28 @@ class AsseticTokenParser extends \Twig_TokenParser * Attributes can be added to the tag by passing names as the options * array. These values, if found, will be passed to the factory and node. * - * @param AssetFactory $factory The asset factory - * @param string $tag The tag name - * @param string $output The default output string - * @param Boolean $single Whether to force a single asset - * @param array $extensions Additional attribute names to look for + * @param AssetFactory $factory The asset factory + * @param string $tag The tag name + * @param string $output The default output string + * @param Boolean $single Whether to force a single asset + * @param array $extensions Additional attribute names to look for */ - public function __construct(AssetFactory $factory, $tag, $output, $single = false, array $extensions = array()) - { - $this->factory = $factory; - $this->tag = $tag; - $this->output = $output; - $this->single = $single; + public function __construct(AssetFactory $factory, $tag, $output, $single = FALSE, array $extensions = array()) { + $this->factory = $factory; + $this->tag = $tag; + $this->output = $output; + $this->single = $single; $this->extensions = $extensions; } - public function parse(\Twig_Token $token) - { + public function parse(\Twig_Token $token) { $inputs = array(); $filters = array(); - $name = null; + $name = NULL; $attributes = array( - 'output' => $this->output, + 'output' => $this->output, 'var_name' => 'asset_url', - 'vars' => array(), + 'vars' => array(), ); $stream = $this->parser->getStream(); @@ -59,37 +57,37 @@ class AsseticTokenParser extends \Twig_TokenParser if ($stream->test(\Twig_Token::STRING_TYPE)) { // '@jquery', 'js/src/core/*', 'js/src/extra.js' $inputs[] = $stream->next()->getValue(); - } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'filter')) { + } else if ($stream->test(\Twig_Token::NAME_TYPE, 'filter')) { // filter='yui_js' $stream->next(); $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); $filters = array_merge($filters, array_filter(array_map('trim', explode(',', $stream->expect(\Twig_Token::STRING_TYPE)->getValue())))); - } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'output')) { + } else if ($stream->test(\Twig_Token::NAME_TYPE, 'output')) { // output='js/packed/*.js' OR output='js/core.js' $stream->next(); $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); $attributes['output'] = $stream->expect(\Twig_Token::STRING_TYPE)->getValue(); - } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'name')) { + } else if ($stream->test(\Twig_Token::NAME_TYPE, 'name')) { // name='core_js' $stream->next(); $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); $name = $stream->expect(\Twig_Token::STRING_TYPE)->getValue(); - } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'as')) { + } else if ($stream->test(\Twig_Token::NAME_TYPE, 'as')) { // as='the_url' $stream->next(); $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); $attributes['var_name'] = $stream->expect(\Twig_Token::STRING_TYPE)->getValue(); - } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'debug')) { + } else if ($stream->test(\Twig_Token::NAME_TYPE, 'debug')) { // debug=true $stream->next(); $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); $attributes['debug'] = 'true' == $stream->expect(\Twig_Token::NAME_TYPE, array('true', 'false'))->getValue(); - } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'combine')) { + } else if ($stream->test(\Twig_Token::NAME_TYPE, 'combine')) { // combine=true $stream->next(); $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); $attributes['combine'] = 'true' == $stream->expect(\Twig_Token::NAME_TYPE, array('true', 'false'))->getValue(); - } elseif ($stream->test(\Twig_Token::NAME_TYPE, 'vars')) { + } else if ($stream->test(\Twig_Token::NAME_TYPE, 'vars')) { // vars=['locale','browser'] $stream->next(); $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); @@ -106,7 +104,7 @@ class AsseticTokenParser extends \Twig_TokenParser } $stream->expect(\Twig_Token::PUNCTUATION_TYPE, ']'); - } elseif ($stream->test(\Twig_Token::NAME_TYPE, $this->extensions)) { + } else if ($stream->test(\Twig_Token::NAME_TYPE, $this->extensions)) { // an arbitrary configured attribute $key = $stream->next()->getValue(); $stream->expect(\Twig_Token::OPERATOR_TYPE, '='); @@ -119,7 +117,7 @@ class AsseticTokenParser extends \Twig_TokenParser $stream->expect(\Twig_Token::BLOCK_END_TYPE); - $body = $this->parser->subparse(array($this, 'testEndTag'), true); + $body = $this->parser->subparse(array($this, 'testEndTag'), TRUE); $stream->expect(\Twig_Token::BLOCK_END_TYPE); @@ -136,30 +134,27 @@ class AsseticTokenParser extends \Twig_TokenParser return $this->createBodyNode($asset, $body, $inputs, $filters, $name, $attributes, $token->getLine(), $this->getTag()); } - public function getTag() - { + public function getTag() { return $this->tag; } - public function testEndTag(\Twig_Token $token) - { - return $token->test(array('end'.$this->getTag())); + public function testEndTag(\Twig_Token $token) { + return $token->test(array('end' . $this->getTag())); } /** * @param AssetInterface $asset - * @param \Twig_Node $body - * @param array $inputs - * @param array $filters - * @param string $name - * @param array $attributes - * @param int $lineno - * @param string $tag + * @param \Twig_Node $body + * @param array $inputs + * @param array $filters + * @param string $name + * @param array $attributes + * @param int $lineno + * @param string $tag * * @return \Twig_Node */ - protected function createBodyNode(AssetInterface $asset, \Twig_Node $body, array $inputs, array $filters, $name, array $attributes = array(), $lineno = 0, $tag = null) - { + protected function createBodyNode(AssetInterface $asset, \Twig_Node $body, array $inputs, array $filters, $name, array $attributes = array(), $lineno = 0, $tag = NULL) { $reflector = new \ReflectionMethod($this, 'createNode'); if (__CLASS__ !== $reflector->getDeclaringClass()->name) { @@ -172,21 +167,20 @@ class AsseticTokenParser extends \Twig_TokenParser } /** - * @param AssetInterface $asset + * @param AssetInterface $asset * @param \Twig_NodeInterface $body - * @param array $inputs - * @param array $filters - * @param string $name - * @param array $attributes - * @param int $lineno - * @param string $tag + * @param array $inputs + * @param array $filters + * @param string $name + * @param array $attributes + * @param int $lineno + * @param string $tag * * @return \Twig_Node * * @deprecated since 1.3.0, to be removed in 2.0. Use createBodyNode instead. */ - protected function createNode(AssetInterface $asset, \Twig_NodeInterface $body, array $inputs, array $filters, $name, array $attributes = array(), $lineno = 0, $tag = null) - { + protected function createNode(AssetInterface $asset, \Twig_NodeInterface $body, array $inputs, array $filters, $name, array $attributes = array(), $lineno = 0, $tag = NULL) { @trigger_error(sprintf('The %s method is deprecated since 1.3 and will be removed in 2.0. Use createBodyNode instead.', __METHOD__), E_USER_DEPRECATED); if (!$body instanceof \Twig_Node) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigFormulaLoader.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigFormulaLoader.php index 2c12d7e..12c2288 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigFormulaLoader.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigFormulaLoader.php @@ -25,17 +25,15 @@ class TwigFormulaLoader implements FormulaLoaderInterface private $twig; private $logger; - public function __construct(\Twig_Environment $twig, LoggerInterface $logger = null) - { + public function __construct(\Twig_Environment $twig, LoggerInterface $logger = NULL) { $this->twig = $twig; $this->logger = $logger; } - public function load(ResourceInterface $resource) - { + public function load(ResourceInterface $resource) { try { - $tokens = $this->twig->tokenize(new \Twig_Source($resource->getContent(), (string) $resource)); - $nodes = $this->twig->parse($tokens); + $tokens = $this->twig->tokenize(new \Twig_Source($resource->getContent(), (string)$resource)); + $nodes = $this->twig->parse($tokens); } catch (\Exception $e) { if ($this->logger) { $this->logger->error(sprintf('The template "%s" contains an error: %s', $resource, $e->getMessage())); @@ -54,8 +52,7 @@ class TwigFormulaLoader implements FormulaLoaderInterface * * @return array An array of asset formulae indexed by name */ - private function loadNode(\Twig_Node $node) - { + private function loadNode(\Twig_Node $node) { $formulae = array(); if ($node instanceof AsseticNode) { @@ -63,24 +60,24 @@ class TwigFormulaLoader implements FormulaLoaderInterface $node->getAttribute('inputs'), $node->getAttribute('filters'), array( - 'output' => $node->getAttribute('asset')->getTargetPath(), - 'name' => $node->getAttribute('name'), - 'debug' => $node->getAttribute('debug'), + 'output' => $node->getAttribute('asset')->getTargetPath(), + 'name' => $node->getAttribute('name'), + 'debug' => $node->getAttribute('debug'), 'combine' => $node->getAttribute('combine'), - 'vars' => $node->getAttribute('vars'), + 'vars' => $node->getAttribute('vars'), ), ); - } elseif ($node instanceof AsseticFilterNode) { + } else if ($node instanceof AsseticFilterNode) { $name = $node->getAttribute('name'); $arguments = array(); foreach ($node->getNode('arguments') as $argument) { - $arguments[] = eval('return '.$this->twig->compile($argument).';'); + $arguments[] = eval('return ' . $this->twig->compile($argument) . ';'); } $invoker = $this->twig->getExtension('Assetic\Extension\Twig\AsseticExtension')->getFilterInvoker($name); - $inputs = isset($arguments[0]) ? (array) $arguments[0] : array(); + $inputs = isset($arguments[0]) ? (array)$arguments[0] : array(); $filters = $invoker->getFilters(); $options = array_replace($invoker->getOptions(), isset($arguments[1]) ? $arguments[1] : array()); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigResource.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigResource.php index 21d040a..c7389f3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigResource.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/TwigResource.php @@ -23,14 +23,12 @@ class TwigResource implements ResourceInterface private $loader; private $name; - public function __construct(\Twig_LoaderInterface $loader, $name) - { + public function __construct(\Twig_LoaderInterface $loader, $name) { $this->loader = $loader; $this->name = $name; } - public function getContent() - { + public function getContent() { try { return method_exists($this->loader, 'getSourceContext') ? $this->loader->getSourceContext($this->name)->getCode() @@ -40,17 +38,15 @@ class TwigResource implements ResourceInterface } } - public function isFresh($timestamp) - { + public function isFresh($timestamp) { try { return $this->loader->isFresh($this->name, $timestamp); } catch (\Twig_Error_Loader $e) { - return false; + return FALSE; } } - public function __toString() - { + public function __toString() { return $this->name; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/ValueContainer.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/ValueContainer.php index e197224..f2ec98d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/ValueContainer.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Extension/Twig/ValueContainer.php @@ -23,20 +23,17 @@ class ValueContainer implements \ArrayAccess, \IteratorAggregate, \Countable private $values; private $valueSupplier; - public function __construct(ValueSupplierInterface $valueSupplier) - { + public function __construct(ValueSupplierInterface $valueSupplier) { $this->valueSupplier = $valueSupplier; } - public function offsetExists($offset) - { + public function offsetExists($offset) { $this->initialize(); return array_key_exists($offset, $this->values); } - public function offsetGet($offset) - { + public function offsetGet($offset) { $this->initialize(); if (!array_key_exists($offset, $this->values)) { @@ -46,33 +43,28 @@ class ValueContainer implements \ArrayAccess, \IteratorAggregate, \Countable return $this->values[$offset]; } - public function offsetSet($offset, $value) - { + public function offsetSet($offset, $value) { throw new \BadMethodCallException('The ValueContainer is read-only.'); } - public function offsetUnset($offset) - { + public function offsetUnset($offset) { throw new \BadMethodCallException('The ValueContainer is read-only.'); } - public function getIterator() - { + public function getIterator() { $this->initialize(); return new \ArrayIterator($this->values); } - public function count() - { + public function count() { $this->initialize(); return count($this->values); } - private function initialize() - { - if (null === $this->values) { + private function initialize() { + if (NULL === $this->values) { $this->values = $this->valueSupplier->getValues(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/AssetFactory.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/AssetFactory.php index e267196..168c77f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/AssetFactory.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/AssetFactory.php @@ -40,15 +40,14 @@ class AssetFactory /** * Constructor. * - * @param string $root The default root directory + * @param string $root The default root directory * @param Boolean $debug Filters prefixed with a "?" will be omitted in debug mode */ - public function __construct($root, $debug = false) - { - $this->root = rtrim($root, '/'); - $this->debug = $debug; - $this->output = 'assetic/*'; - $this->workers = array(); + public function __construct($root, $debug = FALSE) { + $this->root = rtrim($root, '/'); + $this->debug = $debug; + $this->output = 'assetic/*'; + $this->workers = array(); } /** @@ -56,8 +55,7 @@ class AssetFactory * * @param Boolean $debug Debug mode */ - public function setDebug($debug) - { + public function setDebug($debug) { $this->debug = $debug; } @@ -66,8 +64,7 @@ class AssetFactory * * @return Boolean Debug mode */ - public function isDebug() - { + public function isDebug() { return $this->debug; } @@ -76,8 +73,7 @@ class AssetFactory * * @param string $output The default output string */ - public function setDefaultOutput($output) - { + public function setDefaultOutput($output) { $this->output = $output; } @@ -86,8 +82,7 @@ class AssetFactory * * @param WorkerInterface $worker A worker */ - public function addWorker(WorkerInterface $worker) - { + public function addWorker(WorkerInterface $worker) { $this->workers[] = $worker; } @@ -96,8 +91,7 @@ class AssetFactory * * @return AssetManager|null The asset manager */ - public function getAssetManager() - { + public function getAssetManager() { return $this->am; } @@ -106,8 +100,7 @@ class AssetFactory * * @param AssetManager $am The asset manager */ - public function setAssetManager(AssetManager $am) - { + public function setAssetManager(AssetManager $am) { $this->am = $am; } @@ -116,8 +109,7 @@ class AssetFactory * * @return FilterManager|null The filter manager */ - public function getFilterManager() - { + public function getFilterManager() { return $this->fm; } @@ -126,8 +118,7 @@ class AssetFactory * * @param FilterManager $fm The filter manager */ - public function setFilterManager(FilterManager $fm) - { + public function setFilterManager(FilterManager $fm) { $this->fm = $fm; } @@ -144,14 +135,13 @@ class AssetFactory * * debug: Forces debug mode on or off for this asset * * root: An array or string of more root directories * - * @param array|string $inputs An array of input strings + * @param array|string $inputs An array of input strings * @param array|string $filters An array of filter names - * @param array $options An array of options + * @param array $options An array of options * * @return AssetCollection An asset collection */ - public function createAsset($inputs = array(), $filters = array(), array $options = array()) - { + public function createAsset($inputs = array(), $filters = array(), array $options = array()) { if (!is_array($inputs)) { $inputs = array($inputs); } @@ -196,7 +186,7 @@ class AssetFactory $asset->add(call_user_func_array(array($this, 'createAsset'), $input)); } else { $asset->add($this->parseInput($input, $options)); - $extensions[pathinfo($input, PATHINFO_EXTENSION)] = true; + $extensions[pathinfo($input, PATHINFO_EXTENSION)] = TRUE; } } @@ -204,7 +194,7 @@ class AssetFactory foreach ($filters as $filter) { if ('?' != $filter[0]) { $asset->ensureFilter($this->getFilter($filter)); - } elseif (!$options['debug']) { + } else if (!$options['debug']) { $asset->ensureFilter($this->getFilter(substr($filter, 1))); } } @@ -213,21 +203,21 @@ class AssetFactory if (!empty($options['vars'])) { $toAdd = array(); foreach ($options['vars'] as $var) { - if (false !== strpos($options['output'], '{'.$var.'}')) { + if (FALSE !== strpos($options['output'], '{' . $var . '}')) { continue; } - $toAdd[] = '{'.$var.'}'; + $toAdd[] = '{' . $var . '}'; } if ($toAdd) { - $options['output'] = str_replace('*', '*.'.implode('.', $toAdd), $options['output']); + $options['output'] = str_replace('*', '*.' . implode('.', $toAdd), $options['output']); } } // append consensus extension if missing if (1 == count($extensions) && !pathinfo($options['output'], PATHINFO_EXTENSION) && $extension = key($extensions)) { - $options['output'] .= '.'.$extension; + $options['output'] .= '.' . $extension; } // output --> target url @@ -237,19 +227,17 @@ class AssetFactory return $this->applyWorkers($asset); } - public function generateAssetName($inputs, $filters, $options = array()) - { + public function generateAssetName($inputs, $filters, $options = array()) { foreach (array_diff(array_keys($options), array('output', 'debug', 'root')) as $key) { unset($options[$key]); } ksort($options); - return substr(sha1(serialize($inputs).serialize($filters).serialize($options)), 0, 7); + return substr(sha1(serialize($inputs) . serialize($filters) . serialize($options)), 0, 7); } - public function getLastModified(AssetInterface $asset) - { + public function getLastModified(AssetInterface $asset) { $mtime = 0; foreach ($asset instanceof AssetCollectionInterface ? $asset : array($asset) as $leaf) { $mtime = max($mtime, $leaf->getLastModified()); @@ -295,18 +283,17 @@ class AssetFactory * * Both globs and paths will be absolutized using the current root directory. * - * @param string $input An input string - * @param array $options An array of options + * @param string $input An input string + * @param array $options An array of options * * @return AssetInterface An asset */ - protected function parseInput($input, array $options = array()) - { + protected function parseInput($input, array $options = array()) { if ('@' == $input[0]) { return $this->createAssetReference(substr($input, 1)); } - if (false !== strpos($input, '://') || 0 === strpos($input, '//')) { + if (FALSE !== strpos($input, '://') || 0 === strpos($input, '//')) { return $this->createHttpAsset($input, $options['vars']); } @@ -314,28 +301,26 @@ class AssetFactory if ($root = self::findRootDir($input, $options['root'])) { $path = ltrim(substr($input, strlen($root)), '/'); } else { - $path = null; + $path = NULL; } } else { - $root = $this->root; - $path = $input; - $input = $this->root.'/'.$path; + $root = $this->root; + $path = $input; + $input = $this->root . '/' . $path; } - if (false !== strpos($input, '*')) { + if (FALSE !== strpos($input, '*')) { return $this->createGlobAsset($input, $root, $options['vars']); } return $this->createFileAsset($input, $root, $path, $options['vars']); } - protected function createAssetCollection(array $assets = array(), array $options = array()) - { - return new AssetCollection($assets, array(), null, isset($options['vars']) ? $options['vars'] : array()); + protected function createAssetCollection(array $assets = array(), array $options = array()) { + return new AssetCollection($assets, array(), NULL, isset($options['vars']) ? $options['vars'] : array()); } - protected function createAssetReference($name) - { + protected function createAssetReference($name) { if (!$this->am) { throw new \LogicException('There is no asset manager.'); } @@ -343,23 +328,19 @@ class AssetFactory return new AssetReference($this->am, $name); } - protected function createHttpAsset($sourceUrl, $vars) - { - return new HttpAsset($sourceUrl, array(), false, $vars); + protected function createHttpAsset($sourceUrl, $vars) { + return new HttpAsset($sourceUrl, array(), FALSE, $vars); } - protected function createGlobAsset($glob, $root = null, $vars) - { + protected function createGlobAsset($glob, $root = NULL, $vars) { return new GlobAsset($glob, array(), $root, $vars); } - protected function createFileAsset($source, $root = null, $path = null, $vars) - { + protected function createFileAsset($source, $root = NULL, $path = NULL, $vars) { return new FileAsset($source, array(), $root, $path, $vars); } - protected function getFilter($name) - { + protected function getFilter($name) { if (!$this->fm) { throw new \LogicException('There is no filter manager.'); } @@ -377,8 +358,7 @@ class AssetFactory * * @return AssetCollectionInterface */ - private function applyWorkers(AssetCollectionInterface $asset) - { + private function applyWorkers(AssetCollectionInterface $asset) { foreach ($asset as $leaf) { foreach ($this->workers as $worker) { $retval = $worker->process($leaf, $this); @@ -400,21 +380,19 @@ class AssetFactory return $asset instanceof AssetCollectionInterface ? $asset : $this->createAssetCollection(array($asset)); } - private static function isAbsolutePath($path) - { + private static function isAbsolutePath($path) { return '/' == $path[0] || '\\' == $path[0] || (3 < strlen($path) && ctype_alpha($path[0]) && $path[1] == ':' && ('\\' == $path[2] || '/' == $path[2])); } /** * Loops through the root directories and returns the first match. * - * @param string $path An absolute path - * @param array $roots An array of root directories + * @param string $path An absolute path + * @param array $roots An array of root directories * * @return string|null The matching root directory, if found */ - private static function findRootDir($path, array $roots) - { + private static function findRootDir($path, array $roots) { foreach ($roots as $root) { if (0 === strpos($path, $root)) { return $root; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php index bef72e5..bcbcad4 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/LazyAssetManager.php @@ -34,16 +34,15 @@ class LazyAssetManager extends AssetManager * Constructor. * * @param AssetFactory $factory The asset factory - * @param array $loaders An array of loaders indexed by alias + * @param array $loaders An array of loaders indexed by alias */ - public function __construct(AssetFactory $factory, $loaders = array()) - { + public function __construct(AssetFactory $factory, $loaders = array()) { $this->factory = $factory; $this->loaders = array(); $this->resources = array(); $this->formulae = array(); - $this->loaded = false; - $this->loading = false; + $this->loaded = FALSE; + $this->loading = FALSE; foreach ($loaders as $alias => $loader) { $this->setLoader($alias, $loader); @@ -53,25 +52,23 @@ class LazyAssetManager extends AssetManager /** * Adds a loader to the asset manager. * - * @param string $alias An alias for the loader + * @param string $alias An alias for the loader * @param FormulaLoaderInterface $loader A loader */ - public function setLoader($alias, FormulaLoaderInterface $loader) - { + public function setLoader($alias, FormulaLoaderInterface $loader) { $this->loaders[$alias] = $loader; - $this->loaded = false; + $this->loaded = FALSE; } /** * Adds a resource to the asset manager. * * @param ResourceInterface $resource A resource - * @param string $loader The loader alias for this resource + * @param string $loader The loader alias for this resource */ - public function addResource(ResourceInterface $resource, $loader) - { + public function addResource(ResourceInterface $resource, $loader) { $this->resources[$loader][] = $resource; - $this->loaded = false; + $this->loaded = FALSE; } /** @@ -79,8 +76,7 @@ class LazyAssetManager extends AssetManager * * @return array An array of resources */ - public function getResources() - { + public function getResources() { $resources = array(); foreach ($this->resources as $r) { $resources = array_merge($resources, $r); @@ -96,8 +92,7 @@ class LazyAssetManager extends AssetManager * * @return Boolean If there is a formula */ - public function hasFormula($name) - { + public function hasFormula($name) { if (!$this->loaded) { $this->load(); } @@ -114,8 +109,7 @@ class LazyAssetManager extends AssetManager * * @throws \InvalidArgumentException If there is no formula by that name */ - public function getFormula($name) - { + public function getFormula($name) { if (!$this->loaded) { $this->load(); } @@ -130,11 +124,10 @@ class LazyAssetManager extends AssetManager /** * Sets a formula on the asset manager. * - * @param string $name An asset name - * @param array $formula A formula + * @param string $name An asset name + * @param array $formula A formula */ - public function setFormula($name, array $formula) - { + public function setFormula($name, array $formula) { $this->formulae[$name] = $formula; } @@ -143,17 +136,16 @@ class LazyAssetManager extends AssetManager * * @throws \LogicException If a resource has been added to an invalid loader */ - public function load() - { + public function load() { if ($this->loading) { return; } if ($diff = array_diff(array_keys($this->resources), array_keys($this->loaders))) { - throw new \LogicException('The following loader(s) are not registered: '.implode(', ', $diff)); + throw new \LogicException('The following loader(s) are not registered: ' . implode(', ', $diff)); } - $this->loading = true; + $this->loading = TRUE; foreach ($this->resources as $loader => $resources) { foreach ($resources as $resource) { @@ -161,12 +153,11 @@ class LazyAssetManager extends AssetManager } } - $this->loaded = true; - $this->loading = false; + $this->loaded = TRUE; + $this->loading = FALSE; } - public function get($name) - { + public function get($name) { if (!$this->loaded) { $this->load(); } @@ -180,8 +171,7 @@ class LazyAssetManager extends AssetManager return parent::get($name); } - public function has($name) - { + public function has($name) { if (!$this->loaded) { $this->load(); } @@ -189,8 +179,7 @@ class LazyAssetManager extends AssetManager return isset($this->formulae[$name]) || parent::has($name); } - public function getNames() - { + public function getNames() { if (!$this->loaded) { $this->load(); } @@ -198,13 +187,11 @@ class LazyAssetManager extends AssetManager return array_unique(array_merge(parent::getNames(), array_keys($this->formulae))); } - public function isDebug() - { + public function isDebug() { return $this->factory->isDebug(); } - public function getLastModified(AssetInterface $asset) - { + public function getLastModified(AssetInterface $asset) { return $this->factory->getLastModified($asset); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/BasePhpFormulaLoader.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/BasePhpFormulaLoader.php index 4c747df..1bdadd9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/BasePhpFormulaLoader.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/BasePhpFormulaLoader.php @@ -25,8 +25,7 @@ abstract class BasePhpFormulaLoader implements FormulaLoaderInterface protected $factory; protected $prototypes; - public function __construct(AssetFactory $factory) - { + public function __construct(AssetFactory $factory) { $this->factory = $factory; $this->prototypes = array(); @@ -35,16 +34,14 @@ abstract class BasePhpFormulaLoader implements FormulaLoaderInterface } } - public function addPrototype($prototype, array $options = array()) - { - $tokens = token_get_all('prototypes[$prototype] = array($tokens, $options); } - public function load(ResourceInterface $resource) - { + public function load(ResourceInterface $resource) { if (!$nbProtos = count($this->prototypes)) { throw new \LogicException('There are no prototypes registered.'); } @@ -60,28 +57,32 @@ abstract class BasePhpFormulaLoader implements FormulaLoaderInterface $current = self::tokenToString($token); // loop through each prototype (by reference) foreach (array_keys($this->prototypes) as $i) { - $prototype = & $this->prototypes[$i][0]; + $prototype = &$this->prototypes[$i][0]; $options = $this->prototypes[$i][1]; - $buffer = & $buffers[$i]; - $level = & $bufferLevels[$i]; + $buffer = &$buffers[$i]; + $level = &$bufferLevels[$i]; if (isset($buffersInWildcard[$i])) { switch ($current) { - case '(': ++$level; break; - case ')': --$level; break; + case '(': + ++$level; + break; + case ')': + --$level; + break; } $buffer .= $current; if (!$level) { - $calls[] = array($buffer.';', $options); + $calls[] = array($buffer . ';', $options); $buffer = ''; unset($buffersInWildcard[$i]); } - } elseif ($current == self::tokenToString(current($prototype))) { + } else if ($current == self::tokenToString(current($prototype))) { $buffer .= $current; if ('*' == self::tokenToString(next($prototype))) { - $buffersInWildcard[$i] = true; + $buffersInWildcard[$i] = TRUE; ++$level; } } else { @@ -100,8 +101,7 @@ abstract class BasePhpFormulaLoader implements FormulaLoaderInterface return $formulae; } - private function processCall($call, array $protoOptions = array()) - { + private function processCall($call, array $protoOptions = array()) { $tmp = FilesystemUtils::createTemporaryFile('php_formula_loader'); file_put_contents($tmp, implode("\n", array( 'loader = $loader; $this->configCache = $configCache; $this->debug = $debug; } - public function load(ResourceInterface $resources) - { + public function load(ResourceInterface $resources) { if (!$resources instanceof IteratorResourceInterface) { $resources = array($resources); } @@ -54,7 +52,7 @@ class CachedFormulaLoader implements FormulaLoaderInterface $formulae = array(); foreach ($resources as $resource) { - $id = (string) $resource; + $id = (string)$resource; if (!$this->configCache->has($id) || ($this->debug && !$resource->isFresh($this->configCache->getTimestamp($id)))) { $formulae += $this->loader->load($resource); $this->configCache->set($id, $formulae); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FunctionCallsFormulaLoader.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FunctionCallsFormulaLoader.php index 58b56e1..04e8630 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FunctionCallsFormulaLoader.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Loader/FunctionCallsFormulaLoader.php @@ -18,17 +18,15 @@ namespace Assetic\Factory\Loader; */ class FunctionCallsFormulaLoader extends BasePhpFormulaLoader { - protected function registerPrototypes() - { + protected function registerPrototypes() { return array( 'assetic_javascripts(*)' => array('output' => 'js/*.js'), 'assetic_stylesheets(*)' => array('output' => 'css/*.css'), - 'assetic_image(*)' => array('output' => 'images/*'), + 'assetic_image(*)' => array('output' => 'images/*'), ); } - protected function registerSetupCode() - { + protected function registerSetupCode() { return <<<'EOF' function assetic_javascripts() { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/CoalescingDirectoryResource.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/CoalescingDirectoryResource.php index 6c08900..f041e21 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/CoalescingDirectoryResource.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/CoalescingDirectoryResource.php @@ -20,8 +20,7 @@ class CoalescingDirectoryResource implements IteratorResourceInterface { private $directories; - public function __construct($directories) - { + public function __construct($directories) { $this->directories = array(); foreach ($directories as $directory) { @@ -29,24 +28,21 @@ class CoalescingDirectoryResource implements IteratorResourceInterface } } - public function addDirectory(IteratorResourceInterface $directory) - { + public function addDirectory(IteratorResourceInterface $directory) { $this->directories[] = $directory; } - public function isFresh($timestamp) - { + public function isFresh($timestamp) { foreach ($this->getFileResources() as $file) { if (!$file->isFresh($timestamp)) { - return false; + return FALSE; } } - return true; + return TRUE; } - public function getContent() - { + public function getContent() { $parts = array(); foreach ($this->getFileResources() as $file) { $parts[] = $file->getContent(); @@ -60,32 +56,29 @@ class CoalescingDirectoryResource implements IteratorResourceInterface * * @return string An identifying string */ - public function __toString() - { + public function __toString() { $parts = array(); foreach ($this->directories as $directory) { - $parts[] = (string) $directory; + $parts[] = (string)$directory; } return implode(',', $parts); } - public function getIterator() - { + public function getIterator() { return new \ArrayIterator($this->getFileResources()); } /** * Returns the relative version of a filename. * - * @param ResourceInterface $file The file + * @param ResourceInterface $file The file * @param ResourceInterface $directory The directory * * @return string The name to compare with files from other directories */ - protected function getRelativeName(ResourceInterface $file, ResourceInterface $directory) - { - return substr((string) $file, strlen((string) $directory)); + protected function getRelativeName(ResourceInterface $file, ResourceInterface $directory) { + return substr((string)$file, strlen((string)$directory)); } /** @@ -93,8 +86,7 @@ class CoalescingDirectoryResource implements IteratorResourceInterface * * @return array An array of file resources */ - private function getFileResources() - { + private function getFileResources() { $paths = array(); foreach ($this->directories as $directory) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/DirectoryResource.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/DirectoryResource.php index c823de2..c07cf5b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/DirectoryResource.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/DirectoryResource.php @@ -24,11 +24,10 @@ class DirectoryResource implements IteratorResourceInterface /** * Constructor. * - * @param string $path A directory path + * @param string $path A directory path * @param string $pattern A filename pattern */ - public function __construct($path, $pattern = null) - { + public function __construct($path, $pattern = NULL) { if (DIRECTORY_SEPARATOR != substr($path, -1)) { $path .= DIRECTORY_SEPARATOR; } @@ -37,26 +36,24 @@ class DirectoryResource implements IteratorResourceInterface $this->pattern = $pattern; } - public function isFresh($timestamp) - { + public function isFresh($timestamp) { if (!is_dir($this->path) || filemtime($this->path) > $timestamp) { - return false; + return FALSE; } foreach ($this as $resource) { if (!$resource->isFresh($timestamp)) { - return false; + return FALSE; } } - return true; + return TRUE; } /** * Returns the combined content of all inner resources. */ - public function getContent() - { + public function getContent() { $content = array(); foreach ($this as $resource) { $content[] = $resource->getContent(); @@ -65,20 +62,17 @@ class DirectoryResource implements IteratorResourceInterface return implode("\n", $content); } - public function __toString() - { + public function __toString() { return $this->path; } - public function getIterator() - { + public function getIterator() { return is_dir($this->path) ? new DirectoryResourceIterator($this->getInnerIterator()) : new \EmptyIterator(); } - protected function getInnerIterator() - { + protected function getInnerIterator() { return new DirectoryResourceFilterIterator(new \RecursiveDirectoryIterator($this->path, \RecursiveDirectoryIterator::FOLLOW_SYMLINKS), $this->pattern); } } @@ -91,8 +85,7 @@ class DirectoryResource implements IteratorResourceInterface */ class DirectoryResourceIterator extends \RecursiveIteratorIterator { - public function current() - { + public function current() { return new FileResource(parent::current()->getPathname()); } } @@ -107,15 +100,13 @@ class DirectoryResourceFilterIterator extends \RecursiveFilterIterator { protected $pattern; - public function __construct(\RecursiveDirectoryIterator $iterator, $pattern = null) - { + public function __construct(\RecursiveDirectoryIterator $iterator, $pattern = NULL) { parent::__construct($iterator); $this->pattern = $pattern; } - public function accept() - { + public function accept() { $file = $this->current(); $name = $file->getBasename(); @@ -123,11 +114,10 @@ class DirectoryResourceFilterIterator extends \RecursiveFilterIterator return '.' != $name[0]; } - return null === $this->pattern || 0 < preg_match($this->pattern, $name); + return NULL === $this->pattern || 0 < preg_match($this->pattern, $name); } - public function getChildren() - { + public function getChildren() { return new self(new \RecursiveDirectoryIterator($this->current()->getPathname(), \RecursiveDirectoryIterator::FOLLOW_SYMLINKS), $this->pattern); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/FileResource.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/FileResource.php index b7760e1..df70811 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/FileResource.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Resource/FileResource.php @@ -25,23 +25,19 @@ class FileResource implements ResourceInterface * * @param string $path The path to a file */ - public function __construct($path) - { + public function __construct($path) { $this->path = $path; } - public function isFresh($timestamp) - { + public function isFresh($timestamp) { return file_exists($this->path) && filemtime($this->path) <= $timestamp; } - public function getContent() - { + public function getContent() { return file_exists($this->path) ? file_get_contents($this->path) : ''; } - public function __toString() - { + public function __toString() { return $this->path; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/CacheBustingWorker.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/CacheBustingWorker.php index 712c90d..11bc2f0 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/CacheBustingWorker.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/CacheBustingWorker.php @@ -24,13 +24,11 @@ class CacheBustingWorker implements WorkerInterface { private $separator; - public function __construct($separator = '-') - { + public function __construct($separator = '-') { $this->separator = $separator; } - public function process(AssetInterface $asset, AssetFactory $factory) - { + public function process(AssetInterface $asset, AssetFactory $factory) { if (!$path = $asset->getTargetPath()) { // no path to work with return; @@ -41,19 +39,18 @@ class CacheBustingWorker implements WorkerInterface return; } - $replace = $this->separator.$this->getHash($asset, $factory).'.'.$search; - if (preg_match('/'.preg_quote($replace, '/').'$/', $path)) { + $replace = $this->separator . $this->getHash($asset, $factory) . '.' . $search; + if (preg_match('/' . preg_quote($replace, '/') . '$/', $path)) { // already replaced return; } $asset->setTargetPath( - preg_replace('/\.'.preg_quote($search, '/').'$/', $replace, $path) + preg_replace('/\.' . preg_quote($search, '/') . '$/', $replace, $path) ); } - protected function getHash(AssetInterface $asset, AssetFactory $factory) - { + protected function getHash(AssetInterface $asset, AssetFactory $factory) { $hash = hash_init('sha1'); hash_update($hash, $factory->getLastModified($asset)); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/EnsureFilterWorker.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/EnsureFilterWorker.php index 80fd44a..680a16c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/EnsureFilterWorker.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/EnsureFilterWorker.php @@ -33,13 +33,12 @@ class EnsureFilterWorker implements WorkerInterface /** * Constructor. * - * @param string $pattern A regex for checking the asset's target URL - * @param FilterInterface $filter A filter to apply if the regex matches - * @param integer $flags Flags for what to check + * @param string $pattern A regex for checking the asset's target URL + * @param FilterInterface $filter A filter to apply if the regex matches + * @param integer $flags Flags for what to check */ - public function __construct($pattern, FilterInterface $filter, $flags = null) - { - if (null === $flags) { + public function __construct($pattern, FilterInterface $filter, $flags = NULL) { + if (NULL === $flags) { $flags = self::CHECK_SOURCE | self::CHECK_TARGET; } @@ -48,8 +47,7 @@ class EnsureFilterWorker implements WorkerInterface $this->flags = $flags; } - public function process(AssetInterface $asset, AssetFactory $factory) - { + public function process(AssetInterface $asset, AssetFactory $factory) { if ( (self::CHECK_SOURCE === (self::CHECK_SOURCE & $this->flags) && preg_match($this->pattern, $asset->getSourcePath())) || diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/WorkerInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/WorkerInterface.php index e86cc7b..c3fef2d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/WorkerInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Factory/Worker/WorkerInterface.php @@ -24,8 +24,8 @@ interface WorkerInterface /** * Processes an asset. * - * @param AssetInterface $asset An asset - * @param AssetFactory $factory The factory + * @param AssetInterface $asset An asset + * @param AssetFactory $factory The factory * * @return AssetInterface|null May optionally return a replacement asset */ diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/AutoprefixerFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/AutoprefixerFilter.php index 5182161..8dbce79 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/AutoprefixerFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/AutoprefixerFilter.php @@ -33,29 +33,25 @@ class AutoprefixerFilter extends BaseNodeFilter */ private $browsers = array(); - public function __construct($autoprefixerBin) - { + public function __construct($autoprefixerBin) { $this->autoprefixerBin = $autoprefixerBin; } /** * @param array $browsers */ - public function setBrowsers(array $browsers) - { + public function setBrowsers(array $browsers) { $this->browsers = $browsers; } /** * @param string $browser */ - public function addBrowser($browser) - { + public function addBrowser($browser) { $this->browsers[] = $browser; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { $input = $asset->getContent(); $pb = $this->createProcessBuilder(array($this->autoprefixerBin)); @@ -81,7 +77,6 @@ class AutoprefixerFilter extends BaseNodeFilter * * @param AssetInterface $asset An asset */ - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseCssFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseCssFilter.php index 8d65271..96c3731 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseCssFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseCssFilter.php @@ -23,32 +23,28 @@ abstract class BaseCssFilter implements FilterInterface /** * @see CssUtils::filterReferences() */ - protected function filterReferences($content, $callback, $limit = -1, &$count = 0) - { + protected function filterReferences($content, $callback, $limit = -1, &$count = 0) { return CssUtils::filterReferences($content, $callback, $limit, $count); } /** * @see CssUtils::filterUrls() */ - protected function filterUrls($content, $callback, $limit = -1, &$count = 0) - { + protected function filterUrls($content, $callback, $limit = -1, &$count = 0) { return CssUtils::filterUrls($content, $callback, $limit, $count); } /** * @see CssUtils::filterImports() */ - protected function filterImports($content, $callback, $limit = -1, &$count = 0, $includeUrl = true) - { + protected function filterImports($content, $callback, $limit = -1, &$count = 0, $includeUrl = TRUE) { return CssUtils::filterImports($content, $callback, $limit, $count, $includeUrl); } /** * @see CssUtils::filterIEFilters() */ - protected function filterIEFilters($content, $callback, $limit = -1, &$count = 0) - { + protected function filterIEFilters($content, $callback, $limit = -1, &$count = 0) { return CssUtils::filterIEFilters($content, $callback, $limit, $count); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseNodeFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseNodeFilter.php index 64e5a13..547141d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseNodeFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseNodeFilter.php @@ -15,23 +15,19 @@ abstract class BaseNodeFilter extends BaseProcessFilter { private $nodePaths = array(); - public function getNodePaths() - { + public function getNodePaths() { return $this->nodePaths; } - public function setNodePaths(array $nodePaths) - { + public function setNodePaths(array $nodePaths) { $this->nodePaths = $nodePaths; } - public function addNodePath($nodePath) - { + public function addNodePath($nodePath) { $this->nodePaths[] = $nodePath; } - protected function createProcessBuilder(array $arguments = array()) - { + protected function createProcessBuilder(array $arguments = array()) { $pb = parent::createProcessBuilder($arguments); if ($this->nodePaths) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseProcessFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseProcessFilter.php index 642495a..626de1c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseProcessFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/BaseProcessFilter.php @@ -25,8 +25,7 @@ abstract class BaseProcessFilter implements FilterInterface * * @param int $timeout The timeout for the process */ - public function setTimeout($timeout) - { + public function setTimeout($timeout) { $this->timeout = $timeout; } @@ -37,19 +36,17 @@ abstract class BaseProcessFilter implements FilterInterface * * @return ProcessBuilder A new process builder */ - protected function createProcessBuilder(array $arguments = array()) - { + protected function createProcessBuilder(array $arguments = array()) { $pb = new ProcessBuilder($arguments); - if (null !== $this->timeout) { + if (NULL !== $this->timeout) { $pb->setTimeout($this->timeout); } return $pb; } - protected function mergeEnv(ProcessBuilder $pb) - { + protected function mergeEnv(ProcessBuilder $pb) { foreach (array_filter($_SERVER, 'is_scalar') as $key => $value) { $pb->setEnv($key, $value); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CallablesFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CallablesFilter.php index b81f201..5367cfd 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CallablesFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CallablesFilter.php @@ -30,30 +30,26 @@ class CallablesFilter implements FilterInterface, DependencyExtractorInterface * @param callable|null $dumper * @param callable|null $extractor */ - public function __construct($loader = null, $dumper = null, $extractor = null) - { + public function __construct($loader = NULL, $dumper = NULL, $extractor = NULL) { $this->loader = $loader; $this->dumper = $dumper; $this->extractor = $extractor; } - public function filterLoad(AssetInterface $asset) - { - if (null !== $callable = $this->loader) { + public function filterLoad(AssetInterface $asset) { + if (NULL !== $callable = $this->loader) { $callable($asset); } } - public function filterDump(AssetInterface $asset) - { - if (null !== $callable = $this->dumper) { + public function filterDump(AssetInterface $asset) { + if (NULL !== $callable = $this->dumper) { $callable($asset); } } - public function getChildren(AssetFactory $factory, $content, $loadPath = null) - { - if (null !== $callable = $this->extractor) { + public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) { + if (NULL !== $callable = $this->extractor) { return $callable($factory, $content, $loadPath); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CleanCssFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CleanCssFilter.php index ada5499..0430e36 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CleanCssFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CleanCssFilter.php @@ -29,7 +29,7 @@ class CleanCssFilter extends BaseNodeFilter private $compatibility; private $debug; private $rootPath; - private $skipImport = true; + private $skipImport = TRUE; private $timeout; private $semanticMerging; private $roundingPrecision; @@ -47,11 +47,10 @@ class CleanCssFilter extends BaseNodeFilter /** - * @param string $cleanCssBin Absolute path to the cleancss executable - * @param string $nodeBin Absolute path to the folder containg node.js executable + * @param string $cleanCssBin Absolute path to the cleancss executable + * @param string $nodeBin Absolute path to the folder containg node.js executable */ - public function __construct($cleanCssBin = '/usr/bin/cleancss', $nodeBin = null) - { + public function __construct($cleanCssBin = '/usr/bin/cleancss', $nodeBin = NULL) { $this->cleanCssBin = $cleanCssBin; $this->nodeBin = $nodeBin; } @@ -60,8 +59,7 @@ class CleanCssFilter extends BaseNodeFilter * Keep line breaks * @param bool $keepLineBreaks True to enable */ - public function setKeepLineBreaks($keepLineBreaks) - { + public function setKeepLineBreaks($keepLineBreaks) { $this->keepLineBreaks = $keepLineBreaks; } @@ -69,8 +67,7 @@ class CleanCssFilter extends BaseNodeFilter * Remove all special comments * @param bool $removeSpecialComments True to enable */ // i.e. /*! comment */ - public function setRemoveSpecialComments($removeSpecialComments) - { + public function setRemoveSpecialComments($removeSpecialComments) { $this->removeSpecialComments = $removeSpecialComments; } @@ -78,16 +75,15 @@ class CleanCssFilter extends BaseNodeFilter * Remove all special comments except the first one * @param bool $onlyKeepFirstSpecialComment True to enable */ - public function setOnlyKeepFirstSpecialComment($onlyKeepFirstSpecialComment) - { + public function setOnlyKeepFirstSpecialComment($onlyKeepFirstSpecialComment) { $this->onlyKeepFirstSpecialComment = $onlyKeepFirstSpecialComment; } + /** * Enables unsafe mode by assuming BEM-like semantic stylesheets (warning, this may break your styling!) * @param bool $semanticMerging True to enable */ - public function setSemanticMerging($semanticMerging) - { + public function setSemanticMerging($semanticMerging) { $this->semanticMerging = $semanticMerging; } @@ -95,8 +91,7 @@ class CleanCssFilter extends BaseNodeFilter * A root path to which resolve absolute @import rules * @param string $rootPath */ - public function setRootPath($rootPath) - { + public function setRootPath($rootPath) { $this->rootPath = $rootPath; } @@ -104,16 +99,15 @@ class CleanCssFilter extends BaseNodeFilter * Disable @import processing * @param bool $skipImport True to enable */ - public function setSkipImport($skipImport) - { + public function setSkipImport($skipImport) { $this->skipImport = $skipImport; } + /** * Per connection timeout when fetching remote @imports; defaults to 5 seconds * @param int $timeout */ - public function setTimeout($timeout) - { + public function setTimeout($timeout) { $this->timeout = $timeout; } @@ -121,8 +115,7 @@ class CleanCssFilter extends BaseNodeFilter * Disable URLs rebasing * @param bool $skipRebase True to enable */ - public function setSkipRebase($skipRebase) - { + public function setSkipRebase($skipRebase) { $this->skipRebase = $skipRebase; } @@ -130,8 +123,7 @@ class CleanCssFilter extends BaseNodeFilter * Disable restructuring optimizations * @param bool $skipRestructuring True to enable */ - public function setSkipRestructuring($skipRestructuring) - { + public function setSkipRestructuring($skipRestructuring) { $this->skipRestructuring = $skipRestructuring; } @@ -139,8 +131,7 @@ class CleanCssFilter extends BaseNodeFilter * Disable shorthand compacting * @param bool $skipShorthandCompacting True to enable */ - public function setSkipShorthandCompacting($skipShorthandCompacting) - { + public function setSkipShorthandCompacting($skipShorthandCompacting) { $this->skipShorthandCompacting = $skipShorthandCompacting; } @@ -148,8 +139,7 @@ class CleanCssFilter extends BaseNodeFilter * Enables building input's source map * @param bool $sourceMap True to enable */ - public function setSourceMap($sourceMap) - { + public function setSourceMap($sourceMap) { $this->sourceMap = $sourceMap; } @@ -157,8 +147,7 @@ class CleanCssFilter extends BaseNodeFilter * Enables inlining sources inside source maps * @param bool $sourceMapInlineSources True to enable */ - public function setSourceMapInlineSources($sourceMapInlineSources) - { + public function setSourceMapInlineSources($sourceMapInlineSources) { $this->sourceMapInlineSources = $sourceMapInlineSources; } @@ -166,8 +155,7 @@ class CleanCssFilter extends BaseNodeFilter * Disable advanced optimizations - selector & property merging, reduction, etc. * @param bool $skipAdvanced True to enable */ - public function setSkipAdvanced($skipAdvanced) - { + public function setSkipAdvanced($skipAdvanced) { $this->skipAdvanced = $skipAdvanced; } @@ -175,8 +163,7 @@ class CleanCssFilter extends BaseNodeFilter * Disable properties merging based on their order * @param bool $skipAggresiveMerging True to enable */ - public function setSkipAggresiveMerging($skipAggresiveMerging) - { + public function setSkipAggresiveMerging($skipAggresiveMerging) { $this->skipAggresiveMerging = $skipAggresiveMerging; } @@ -184,8 +171,7 @@ class CleanCssFilter extends BaseNodeFilter * Disable @import processing for specified rules * @param string $skipImportFrom */ - public function setSkipImportFrom($skipImportFrom) - { + public function setSkipImportFrom($skipImportFrom) { $this->skipImportFrom = $skipImportFrom; } @@ -193,8 +179,7 @@ class CleanCssFilter extends BaseNodeFilter * Disable @media merging * @param bool $mediaMerging True to enable */ - public function setMediaMerging($mediaMerging) - { + public function setMediaMerging($mediaMerging) { $this->mediaMerging = $mediaMerging; } @@ -202,8 +187,7 @@ class CleanCssFilter extends BaseNodeFilter * Rounds to `N` decimal places. Defaults to 2. -1 disables rounding. * @param int $roundingPrecision */ - public function setRoundingPrecision($roundingPrecision) - { + public function setRoundingPrecision($roundingPrecision) { $this->roundingPrecision = $roundingPrecision; } @@ -211,8 +195,7 @@ class CleanCssFilter extends BaseNodeFilter * Force compatibility mode (see https://github.com/jakubpawlowicz/clean-css/blob/master/README.md#how-to-set-compatibility-mode for advanced examples) * @param string $compatibility */ - public function setCompatibility($compatibility) - { + public function setCompatibility($compatibility) { $this->compatibility = $compatibility; } @@ -220,8 +203,7 @@ class CleanCssFilter extends BaseNodeFilter * Shows debug information (minification time & compression efficiency) * @param bool $debug True to enable */ - public function setDebug($debug) - { + public function setDebug($debug) { $this->debug = $debug; } @@ -229,8 +211,7 @@ class CleanCssFilter extends BaseNodeFilter /** * @see Assetic\Filter\FilterInterface::filterLoad() */ - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } @@ -239,8 +220,7 @@ class CleanCssFilter extends BaseNodeFilter * * @see Assetic\Filter\FilterInterface::filterDump() */ - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $pb = $this->createProcessBuilder($this->nodeBin ? array($this->nodeBin, $this->cleanCssBin) : array($this->cleanCssBin)); @@ -250,7 +230,7 @@ class CleanCssFilter extends BaseNodeFilter } if ($this->compatibility) { - $pb->add('--compatibility ' .$this->compatibility); + $pb->add('--compatibility ' . $this->compatibility); } if ($this->debug) { @@ -258,7 +238,7 @@ class CleanCssFilter extends BaseNodeFilter } if ($this->rootPath) { - $pb->add('--root ' .$this->rootPath); + $pb->add('--root ' . $this->rootPath); } if ($this->skipImport) { @@ -266,11 +246,11 @@ class CleanCssFilter extends BaseNodeFilter } if ($this->timeout) { - $pb->add('--timeout ' .$this->timeout); + $pb->add('--timeout ' . $this->timeout); } if ($this->roundingPrecision) { - $pb->add('--rounding-precision ' .$this->roundingPrecision); + $pb->add('--rounding-precision ' . $this->roundingPrecision); } if ($this->removeSpecialComments) { @@ -294,7 +274,7 @@ class CleanCssFilter extends BaseNodeFilter } if ($this->skipImportFrom) { - $pb->add('--skip-import-from ' .$this->skipImportFrom); + $pb->add('--skip-import-from ' . $this->skipImportFrom); } if ($this->mediaMerging) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CoffeeScriptFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CoffeeScriptFilter.php index a5cc818..5982819 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CoffeeScriptFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CoffeeScriptFilter.php @@ -30,24 +30,20 @@ class CoffeeScriptFilter extends BaseNodeFilter private $bare; private $noHeader; - public function __construct($coffeeBin = '/usr/bin/coffee', $nodeBin = null) - { + public function __construct($coffeeBin = '/usr/bin/coffee', $nodeBin = NULL) { $this->coffeeBin = $coffeeBin; $this->nodeBin = $nodeBin; } - public function setBare($bare) - { + public function setBare($bare) { $this->bare = $bare; } - public function setNoHeader($noHeader) - { + public function setNoHeader($noHeader) { $this->noHeader = $noHeader; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { $input = FilesystemUtils::createTemporaryFile('coffee'); file_put_contents($input, $asset->getContent()); @@ -77,7 +73,6 @@ class CoffeeScriptFilter extends BaseNodeFilter $asset->setContent($proc->getOutput()); } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php index d80a1ab..40e3941 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CompassFilter.php @@ -53,139 +53,114 @@ class CompassFilter extends BaseSassFilter private $httpGeneratedImagesPath; private $generatedImagesPath; private $httpJavascriptsPath; - private $homeEnv = true; + private $homeEnv = TRUE; - public function __construct($compassPath = '/usr/bin/compass', $rubyPath = null) - { + public function __construct($compassPath = '/usr/bin/compass', $rubyPath = NULL) { $this->compassPath = $compassPath; $this->rubyPath = $rubyPath; $this->cacheLocation = FilesystemUtils::getTemporaryDirectory(); if ('cli' !== php_sapi_name()) { - $this->boring = true; + $this->boring = TRUE; } } - public function setScss($scss) - { + public function setScss($scss) { $this->scss = $scss; } // sass options setters - public function setUnixNewlines($unixNewlines) - { + public function setUnixNewlines($unixNewlines) { $this->unixNewlines = $unixNewlines; } - public function setDebugInfo($debugInfo) - { + public function setDebugInfo($debugInfo) { $this->debugInfo = $debugInfo; } - public function setCacheLocation($cacheLocation) - { + public function setCacheLocation($cacheLocation) { $this->cacheLocation = $cacheLocation; } - public function setNoCache($noCache) - { + public function setNoCache($noCache) { $this->noCache = $noCache; } // compass options setters - public function setForce($force) - { + public function setForce($force) { $this->force = $force; } - public function setStyle($style) - { + public function setStyle($style) { $this->style = $style; } - public function setQuiet($quiet) - { + public function setQuiet($quiet) { $this->quiet = $quiet; } - public function setBoring($boring) - { + public function setBoring($boring) { $this->boring = $boring; } - public function setNoLineComments($noLineComments) - { + public function setNoLineComments($noLineComments) { $this->noLineComments = $noLineComments; } - public function setImagesDir($imagesDir) - { + public function setImagesDir($imagesDir) { $this->imagesDir = $imagesDir; } - public function setJavascriptsDir($javascriptsDir) - { + public function setJavascriptsDir($javascriptsDir) { $this->javascriptsDir = $javascriptsDir; } - public function setFontsDir($fontsDir) - { + public function setFontsDir($fontsDir) { $this->fontsDir = $fontsDir; } // compass configuration file options setters - public function setPlugins(array $plugins) - { + public function setPlugins(array $plugins) { $this->plugins = $plugins; } - public function addPlugin($plugin) - { + public function addPlugin($plugin) { $this->plugins[] = $plugin; } - public function setHttpPath($httpPath) - { + public function setHttpPath($httpPath) { $this->httpPath = $httpPath; } - public function setHttpImagesPath($httpImagesPath) - { + public function setHttpImagesPath($httpImagesPath) { $this->httpImagesPath = $httpImagesPath; } - public function setHttpFontsPath($httpFontsPath) - { + public function setHttpFontsPath($httpFontsPath) { $this->httpFontsPath = $httpFontsPath; } - public function setHttpGeneratedImagesPath($httpGeneratedImagesPath) - { + public function setHttpGeneratedImagesPath($httpGeneratedImagesPath) { $this->httpGeneratedImagesPath = $httpGeneratedImagesPath; } - public function setGeneratedImagesPath($generatedImagesPath) - { + public function setGeneratedImagesPath($generatedImagesPath) { $this->generatedImagesPath = $generatedImagesPath; } - public function setHttpJavascriptsPath($httpJavascriptsPath) - { + public function setHttpJavascriptsPath($httpJavascriptsPath) { $this->httpJavascriptsPath = $httpJavascriptsPath; } - public function setHomeEnv($homeEnv) - { + public function setHomeEnv($homeEnv) { $this->homeEnv = $homeEnv; } - public function setRelativeAssets($relativeAssets) - { + public function setRelativeAssets($relativeAssets) { $this->relativeAssets = $relativeAssets; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { $loadPaths = $this->loadPaths; if ($dir = $asset->getSourceDirectory()) { $loadPaths[] = $dir; @@ -198,7 +173,7 @@ class CompassFilter extends BaseSassFilter 'compile', $tempDir, ); - if (null !== $this->rubyPath) { + if (NULL !== $this->rubyPath) { $compassProcessArgs = array_merge(explode(' ', $this->rubyPath), $compassProcessArgs); } @@ -251,11 +226,11 @@ class CompassFilter extends BaseSassFilter } if ($this->unixNewlines) { - $optionsConfig['sass_options']['unix_newlines'] = true; + $optionsConfig['sass_options']['unix_newlines'] = TRUE; } if ($this->debugInfo) { - $optionsConfig['sass_options']['debug_info'] = true; + $optionsConfig['sass_options']['debug_info'] = TRUE; } if ($this->cacheLocation) { @@ -263,7 +238,7 @@ class CompassFilter extends BaseSassFilter } if ($this->noCache) { - $optionsConfig['sass_options']['no_cache'] = true; + $optionsConfig['sass_options']['no_cache'] = TRUE; } if ($this->httpPath) { @@ -299,22 +274,22 @@ class CompassFilter extends BaseSassFilter foreach ($optionsConfig as $name => $value) { if (!is_array($value)) { $config[] = sprintf('%s = "%s"', $name, addcslashes($value, '\\')); - } elseif (!empty($value)) { + } else if (!empty($value)) { $config[] = sprintf('%s = %s', $name, $this->formatArrayToRuby($value)); } } $configFile = tempnam($tempDir, 'assetic_compass'); - file_put_contents($configFile, implode("\n", $config)."\n"); + file_put_contents($configFile, implode("\n", $config) . "\n"); $pb->add('--config')->add($configFile); } $pb->add('--sass-dir')->add('')->add('--css-dir')->add(''); // compass choose the type (sass or scss from the filename) - if (null !== $this->scss) { + if (NULL !== $this->scss) { $type = $this->scss ? 'scss' : 'sass'; - } elseif ($path = $asset->getSourcePath()) { + } else if ($path = $asset->getSourcePath()) { // FIXME: what if the extension is something else? $type = pathinfo($path, PATHINFO_EXTENSION); } else { @@ -325,7 +300,7 @@ class CompassFilter extends BaseSassFilter unlink($tempName); // FIXME: don't use tempnam() here // input - $input = $tempName.'.'.$type; + $input = $tempName . '.' . $type; // work-around for https://github.com/chriseppstein/compass/issues/748 if (defined('PHP_WINDOWS_VERSION_MAJOR')) { @@ -336,7 +311,7 @@ class CompassFilter extends BaseSassFilter file_put_contents($input, $asset->getContent()); // output - $output = $tempName.'.css'; + $output = $tempName . '.css'; if ($this->homeEnv) { // it's not really usefull but... https://github.com/chriseppstein/compass/issues/376 @@ -365,12 +340,10 @@ class CompassFilter extends BaseSassFilter } } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } - private function formatArrayToRuby($array) - { + private function formatArrayToRuby($array) { $output = array(); // does we have an associative array ? @@ -378,12 +351,12 @@ class CompassFilter extends BaseSassFilter foreach ($array as $name => $value) { $output[] = sprintf(' :%s => "%s"', $name, addcslashes($value, '\\')); } - $output = "{\n".implode(",\n", $output)."\n}"; + $output = "{\n" . implode(",\n", $output) . "\n}"; } else { foreach ($array as $name => $value) { $output[] = sprintf(' "%s"', addcslashes($value, '\\')); } - $output = "[\n".implode(",\n", $output)."\n]"; + $output = "[\n" . implode(",\n", $output) . "\n]"; } return $output; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssCacheBustingFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssCacheBustingFilter.php index 5bf8cec..3750355 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssCacheBustingFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssCacheBustingFilter.php @@ -24,22 +24,18 @@ class CssCacheBustingFilter extends BaseCssFilter private $version; private $format = '%s?%s'; - public function setVersion($version) - { + public function setVersion($version) { $this->version = $version; } - public function setFormat($versionFormat) - { + public function setFormat($versionFormat) { $this->format = $versionFormat; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { if (!$this->version) { return; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssEmbedFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssEmbedFilter.php index 17970a9..da9a61a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssEmbedFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssEmbedFilter.php @@ -34,60 +34,50 @@ class CssEmbedFilter extends BaseProcessFilter implements DependencyExtractorInt private $maxUriLength; // Maximum length for a data URI. Defaults to 32768. private $maxImageSize; // Maximum image size (in bytes) to convert. - public function __construct($jarPath, $javaPath = '/usr/bin/java') - { + public function __construct($jarPath, $javaPath = '/usr/bin/java') { $this->jarPath = $jarPath; $this->javaPath = $javaPath; } - public function setCharset($charset) - { + public function setCharset($charset) { $this->charset = $charset; } - public function setMhtml($mhtml) - { + public function setMhtml($mhtml) { $this->mhtml = $mhtml; } - public function setMhtmlRoot($mhtmlRoot) - { + public function setMhtmlRoot($mhtmlRoot) { $this->mhtmlRoot = $mhtmlRoot; } - public function setRoot($root) - { + public function setRoot($root) { $this->root = $root; } - public function setSkipMissing($skipMissing) - { + public function setSkipMissing($skipMissing) { $this->skipMissing = $skipMissing; } - public function setMaxUriLength($maxUriLength) - { + public function setMaxUriLength($maxUriLength) { $this->maxUriLength = $maxUriLength; } - public function setMaxImageSize($maxImageSize) - { + public function setMaxImageSize($maxImageSize) { $this->maxImageSize = $maxImageSize; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $pb = $this->createProcessBuilder(array( $this->javaPath, '-jar', $this->jarPath, )); - if (null !== $this->charset) { + if (NULL !== $this->charset) { $pb->add('--charset')->add($this->charset); } @@ -95,12 +85,12 @@ class CssEmbedFilter extends BaseProcessFilter implements DependencyExtractorInt $pb->add('--mhtml'); } - if (null !== $this->mhtmlRoot) { + if (NULL !== $this->mhtmlRoot) { $pb->add('--mhtmlroot')->add($this->mhtmlRoot); } // automatically define root if not already defined - if (null === $this->root) { + if (NULL === $this->root) { if ($dir = $asset->getSourceDirectory()) { $pb->add('--root')->add($dir); } @@ -112,11 +102,11 @@ class CssEmbedFilter extends BaseProcessFilter implements DependencyExtractorInt $pb->add('--skip-missing'); } - if (null !== $this->maxUriLength) { + if (NULL !== $this->maxUriLength) { $pb->add('--max-uri-length')->add($this->maxUriLength); } - if (null !== $this->maxImageSize) { + if (NULL !== $this->maxImageSize) { $pb->add('--max-image-size')->add($this->maxImageSize); } @@ -135,8 +125,7 @@ class CssEmbedFilter extends BaseProcessFilter implements DependencyExtractorInt $asset->setContent($proc->getOutput()); } - public function getChildren(AssetFactory $factory, $content, $loadPath = null) - { + public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) { // todo return array(); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssImportFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssImportFilter.php index 77ec1c4..3939bfe 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssImportFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssImportFilter.php @@ -30,50 +30,48 @@ class CssImportFilter extends BaseCssFilter implements DependencyExtractorInterf * * @param FilterInterface $importFilter Filter for each imported asset */ - public function __construct(FilterInterface $importFilter = null) - { + public function __construct(FilterInterface $importFilter = NULL) { $this->importFilter = $importFilter ?: new CssRewriteFilter(); } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { $importFilter = $this->importFilter; $sourceRoot = $asset->getSourceRoot(); $sourcePath = $asset->getSourcePath(); $callback = function ($matches) use ($importFilter, $sourceRoot, $sourcePath) { - if (!$matches['url'] || null === $sourceRoot) { + if (!$matches['url'] || NULL === $sourceRoot) { return $matches[0]; } $importRoot = $sourceRoot; - if (false !== strpos($matches['url'], '://')) { + if (FALSE !== strpos($matches['url'], '://')) { // absolute list($importScheme, $tmp) = explode('://', $matches['url'], 2); list($importHost, $importPath) = explode('/', $tmp, 2); - $importRoot = $importScheme.'://'.$importHost; - } elseif (0 === strpos($matches['url'], '//')) { + $importRoot = $importScheme . '://' . $importHost; + } else if (0 === strpos($matches['url'], '//')) { // protocol-relative list($importHost, $importPath) = explode('/', substr($matches['url'], 2), 2); - $importRoot = '//'.$importHost; - } elseif ('/' == $matches['url'][0]) { + $importRoot = '//' . $importHost; + } else if ('/' == $matches['url'][0]) { // root-relative $importPath = substr($matches['url'], 1); - } elseif (null !== $sourcePath) { + } else if (NULL !== $sourcePath) { // document-relative $importPath = $matches['url']; if ('.' != $sourceDir = dirname($sourcePath)) { - $importPath = $sourceDir.'/'.$importPath; + $importPath = $sourceDir . '/' . $importPath; } } else { return $matches[0]; } - $importSource = $importRoot.'/'.$importPath; - if (false !== strpos($importSource, '://') || 0 === strpos($importSource, '//')) { - $import = new HttpAsset($importSource, array($importFilter), true); - } elseif ('css' != pathinfo($importPath, PATHINFO_EXTENSION) || !file_exists($importSource)) { + $importSource = $importRoot . '/' . $importPath; + if (FALSE !== strpos($importSource, '://') || 0 === strpos($importSource, '//')) { + $import = new HttpAsset($importSource, array($importFilter), TRUE); + } else if ('css' != pathinfo($importPath, PATHINFO_EXTENSION) || !file_exists($importSource)) { // ignore non-css and non-existant imports return $matches[0]; } else { @@ -96,12 +94,10 @@ class CssImportFilter extends BaseCssFilter implements DependencyExtractorInterf $asset->setContent($content); } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } - public function getChildren(AssetFactory $factory, $content, $loadPath = null) - { + public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) { // todo return array(); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssMinFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssMinFilter.php index 6f0b0d2..7857f02 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssMinFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssMinFilter.php @@ -24,42 +24,35 @@ class CssMinFilter implements FilterInterface private $filters; private $plugins; - public function __construct() - { + public function __construct() { $this->filters = array(); $this->plugins = array(); } - public function setFilters(array $filters) - { + public function setFilters(array $filters) { $this->filters = $filters; } - public function setFilter($name, $value) - { + public function setFilter($name, $value) { $this->filters[$name] = $value; } - public function setPlugins(array $plugins) - { + public function setPlugins(array $plugins) { $this->plugins = $plugins; } - public function setPlugin($name, $value) - { + public function setPlugin($name, $value) { $this->plugins[$name] = $value; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $filters = $this->filters; $plugins = $this->plugins; - if (isset($filters['ImportImports']) && true === $filters['ImportImports']) { + if (isset($filters['ImportImports']) && TRUE === $filters['ImportImports']) { if ($dir = $asset->getSourceDirectory()) { $filters['ImportImports'] = array('BasePath' => $dir); } else { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssRewriteFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssRewriteFilter.php index c2250c3..6974f2f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssRewriteFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/CssRewriteFilter.php @@ -20,27 +20,25 @@ use Assetic\Asset\AssetInterface; */ class CssRewriteFilter extends BaseCssFilter { - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $sourceBase = $asset->getSourceRoot(); $sourcePath = $asset->getSourcePath(); $targetPath = $asset->getTargetPath(); - if (null === $sourcePath || null === $targetPath || $sourcePath == $targetPath) { + if (NULL === $sourcePath || NULL === $targetPath || $sourcePath == $targetPath) { return; } // learn how to get from the target back to the source - if (false !== strpos($sourceBase, '://')) { - list($scheme, $url) = explode('://', $sourceBase.'/'.$sourcePath, 2); + if (FALSE !== strpos($sourceBase, '://')) { + list($scheme, $url) = explode('://', $sourceBase . '/' . $sourcePath, 2); list($host, $path) = explode('/', $url, 2); - $host = $scheme.'://'.$host.'/'; - $path = false === strpos($path, '/') ? '' : dirname($path); + $host = $scheme . '://' . $host . '/'; + $path = FALSE === strpos($path, '/') ? '' : dirname($path); $path .= '/'; } else { // assume source and target are on the same host @@ -49,12 +47,12 @@ class CssRewriteFilter extends BaseCssFilter // pop entries off the target until it fits in the source if ('.' == dirname($sourcePath)) { $path = str_repeat('../', substr_count($targetPath, '/')); - } elseif ('.' == $targetDir = dirname($targetPath)) { - $path = dirname($sourcePath).'/'; + } else if ('.' == $targetDir = dirname($targetPath)) { + $path = dirname($sourcePath) . '/'; } else { $path = ''; while (0 !== strpos($sourcePath, $targetDir)) { - if (false !== $pos = strrpos($targetDir, '/')) { + if (FALSE !== $pos = strrpos($targetDir, '/')) { $targetDir = substr($targetDir, 0, $pos); $path .= '../'; } else { @@ -63,19 +61,19 @@ class CssRewriteFilter extends BaseCssFilter break; } } - $path .= ltrim(substr(dirname($sourcePath).'/', strlen($targetDir)), '/'); + $path .= ltrim(substr(dirname($sourcePath) . '/', strlen($targetDir)), '/'); } } $content = $this->filterReferences($asset->getContent(), function ($matches) use ($host, $path) { - if (false !== strpos($matches['url'], '://') || 0 === strpos($matches['url'], '//') || 0 === strpos($matches['url'], 'data:')) { + if (FALSE !== strpos($matches['url'], '://') || 0 === strpos($matches['url'], '//') || 0 === strpos($matches['url'], 'data:')) { // absolute or protocol-relative or data uri return $matches[0]; } if (isset($matches['url'][0]) && '/' == $matches['url'][0]) { // root relative - return str_replace($matches['url'], $host.$matches['url'], $matches[0]); + return str_replace($matches['url'], $host . $matches['url'], $matches[0]); } // document relative @@ -86,7 +84,7 @@ class CssRewriteFilter extends BaseCssFilter } $parts = array(); - foreach (explode('/', $host.$path.$url) as $part) { + foreach (explode('/', $host . $path . $url) as $part) { if ('..' === $part && count($parts) && '..' !== end($parts)) { array_pop($parts); } else { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/DartFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/DartFilter.php index 12a3918..e046b5e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/DartFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/DartFilter.php @@ -24,23 +24,20 @@ class DartFilter extends BaseProcessFilter { private $dartBin; - public function __construct($dartBin = '/usr/bin/dart2js') - { + public function __construct($dartBin = '/usr/bin/dart2js') { $this->dartBin = $dartBin; } - public function filterLoad(AssetInterface $asset) - { - $input = FilesystemUtils::createTemporaryFile('dart'); + public function filterLoad(AssetInterface $asset) { + $input = FilesystemUtils::createTemporaryFile('dart'); $output = FilesystemUtils::createTemporaryFile('dart'); file_put_contents($input, $asset->getContent()); $pb = $this->createProcessBuilder() ->add($this->dartBin) - ->add('-o'.$output) - ->add($input) - ; + ->add('-o' . $output) + ->add($input); $proc = $pb->getProcess(); $code = $proc->run(); @@ -60,13 +57,11 @@ class DartFilter extends BaseProcessFilter $this->cleanup($output); } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } - private function cleanup($file) - { - foreach (glob($file.'*') as $related) { + private function cleanup($file) { + foreach (glob($file . '*') as $related) { unlink($related); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/DependencyExtractorInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/DependencyExtractorInterface.php index 6b9a8fb..ebf361a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/DependencyExtractorInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/DependencyExtractorInterface.php @@ -24,11 +24,11 @@ interface DependencyExtractorInterface extends FilterInterface /** * Returns child assets. * - * @param AssetFactory $factory The asset factory - * @param string $content The asset content - * @param string $loadPath An optional load path + * @param AssetFactory $factory The asset factory + * @param string $content The asset content + * @param string $loadPath An optional load path * * @return AssetInterface[] Child assets */ - public function getChildren(AssetFactory $factory, $content, $loadPath = null); + public function getChildren(AssetFactory $factory, $content, $loadPath = NULL); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/EmberPrecompileFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/EmberPrecompileFilter.php index 313d4a0..b6f3f9f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/EmberPrecompileFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/EmberPrecompileFilter.php @@ -28,14 +28,12 @@ class EmberPrecompileFilter extends BaseNodeFilter private $emberBin; private $nodeBin; - public function __construct($handlebarsBin = '/usr/bin/ember-precompile', $nodeBin = null) - { + public function __construct($handlebarsBin = '/usr/bin/ember-precompile', $nodeBin = NULL) { $this->emberBin = $handlebarsBin; $this->nodeBin = $nodeBin; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { $pb = $this->createProcessBuilder($this->nodeBin ? array($this->nodeBin, $this->emberBin) : array($this->emberBin)); @@ -47,7 +45,7 @@ class EmberPrecompileFilter extends BaseNodeFilter } $inputDirPath = FilesystemUtils::createThrowAwayDirectory('ember_in'); - $inputPath = $inputDirPath.DIRECTORY_SEPARATOR.$templateName; + $inputPath = $inputDirPath . DIRECTORY_SEPARATOR . $templateName; $outputPath = FilesystemUtils::createTemporaryFile('ember_out'); file_put_contents($inputPath, $asset->getContent()); @@ -81,7 +79,6 @@ class EmberPrecompileFilter extends BaseNodeFilter $asset->setContent($compiledJs); } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterCollection.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterCollection.php index 0fcd54e..c701334 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterCollection.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterCollection.php @@ -22,8 +22,7 @@ class FilterCollection implements FilterInterface, \IteratorAggregate, \Countabl { private $filters = array(); - public function __construct($filters = array()) - { + public function __construct($filters = array()) { foreach ($filters as $filter) { $this->ensure($filter); } @@ -35,48 +34,41 @@ class FilterCollection implements FilterInterface, \IteratorAggregate, \Countabl * If the supplied filter is another filter collection, each of its * filters will be checked. */ - public function ensure(FilterInterface $filter) - { + public function ensure(FilterInterface $filter) { if ($filter instanceof \Traversable) { foreach ($filter as $f) { $this->ensure($f); } - } elseif (!in_array($filter, $this->filters, true)) { + } else if (!in_array($filter, $this->filters, TRUE)) { $this->filters[] = $filter; } } - public function all() - { + public function all() { return $this->filters; } - public function clear() - { + public function clear() { $this->filters = array(); } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { foreach ($this->filters as $filter) { $filter->filterLoad($asset); } } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { foreach ($this->filters as $filter) { $filter->filterDump($asset); } } - public function getIterator() - { + public function getIterator() { return new \ArrayIterator($this->filters); } - public function count() - { + public function count() { return count($this->filters); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/BaseCompilerFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/BaseCompilerFilter.php index 2509f4a..466dda4 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/BaseCompilerFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/BaseCompilerFilter.php @@ -50,52 +50,42 @@ abstract class BaseCompilerFilter implements FilterInterface protected $warningLevel; protected $language; - public function setTimeout($timeout) - { + public function setTimeout($timeout) { $this->timeout = $timeout; } - public function setCompilationLevel($compilationLevel) - { + public function setCompilationLevel($compilationLevel) { $this->compilationLevel = $compilationLevel; } - public function setJsExterns($jsExterns) - { + public function setJsExterns($jsExterns) { $this->jsExterns = $jsExterns; } - public function setExternsUrl($externsUrl) - { + public function setExternsUrl($externsUrl) { $this->externsUrl = $externsUrl; } - public function setExcludeDefaultExterns($excludeDefaultExterns) - { + public function setExcludeDefaultExterns($excludeDefaultExterns) { $this->excludeDefaultExterns = $excludeDefaultExterns; } - public function setFormatting($formatting) - { + public function setFormatting($formatting) { $this->formatting = $formatting; } - public function setUseClosureLibrary($useClosureLibrary) - { + public function setUseClosureLibrary($useClosureLibrary) { $this->useClosureLibrary = $useClosureLibrary; } - public function setWarningLevel($warningLevel) - { + public function setWarningLevel($warningLevel) { $this->warningLevel = $warningLevel; } - public function setLanguage($language) - { + public function setLanguage($language) { $this->language = $language; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerApiFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerApiFilter.php index 3478057..6a7748a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerApiFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerApiFilter.php @@ -24,85 +24,82 @@ class CompilerApiFilter extends BaseCompilerFilter private $proxy; private $proxyFullUri; - public function setProxy($proxy) - { + public function setProxy($proxy) { $this->proxy = $proxy; } - public function setProxyFullUri($proxyFullUri) - { + public function setProxyFullUri($proxyFullUri) { $this->proxyFullUri = $proxyFullUri; } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $query = array( - 'js_code' => $asset->getContent(), + 'js_code' => $asset->getContent(), 'output_format' => 'json', - 'output_info' => 'compiled_code', + 'output_info' => 'compiled_code', ); - if (null !== $this->compilationLevel) { + if (NULL !== $this->compilationLevel) { $query['compilation_level'] = $this->compilationLevel; } - if (null !== $this->jsExterns) { + if (NULL !== $this->jsExterns) { $query['js_externs'] = $this->jsExterns; } - if (null !== $this->externsUrl) { + if (NULL !== $this->externsUrl) { $query['externs_url'] = $this->externsUrl; } - if (null !== $this->excludeDefaultExterns) { + if (NULL !== $this->excludeDefaultExterns) { $query['exclude_default_externs'] = $this->excludeDefaultExterns ? 'true' : 'false'; } - if (null !== $this->formatting) { + if (NULL !== $this->formatting) { $query['formatting'] = $this->formatting; } - if (null !== $this->useClosureLibrary) { + if (NULL !== $this->useClosureLibrary) { $query['use_closure_library'] = $this->useClosureLibrary ? 'true' : 'false'; } - if (null !== $this->warningLevel) { + if (NULL !== $this->warningLevel) { $query['warning_level'] = $this->warningLevel; } - if (null !== $this->language) { + if (NULL !== $this->language) { $query['language'] = $this->language; } if (preg_match('/1|yes|on|true/i', ini_get('allow_url_fopen'))) { $contextOptions = array('http' => array( - 'method' => 'POST', - 'header' => 'Content-Type: application/x-www-form-urlencoded', + 'method' => 'POST', + 'header' => 'Content-Type: application/x-www-form-urlencoded', 'content' => http_build_query($query), )); - if (null !== $this->timeout) { + if (NULL !== $this->timeout) { $contextOptions['http']['timeout'] = $this->timeout; } if ($this->proxy) { $contextOptions['http']['proxy'] = $this->proxy; - $contextOptions['http']['request_fulluri'] = (Boolean) $this->proxyFullUri; + $contextOptions['http']['request_fulluri'] = (Boolean)$this->proxyFullUri; } $context = stream_context_create($contextOptions); - $response = file_get_contents('http://closure-compiler.appspot.com/compile', false, $context); + $response = file_get_contents('http://closure-compiler.appspot.com/compile', FALSE, $context); $data = json_decode($response); - } elseif (defined('CURLOPT_POST') && !in_array('curl_init', explode(',', ini_get('disable_functions')))) { + } else if (defined('CURLOPT_POST') && !in_array('curl_init', explode(',', ini_get('disable_functions')))) { $ch = curl_init('http://closure-compiler.appspot.com/compile'); - curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/x-www-form-urlencoded')); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, $query); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15); - if (null !== $this->timeout) { + if (NULL !== $this->timeout) { curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout); } if ($this->proxy) { - curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, true); + curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, TRUE); curl_setopt($ch, CURLOPT_PROXY, $this->proxy); } $response = curl_exec($ch); @@ -115,13 +112,13 @@ class CompilerApiFilter extends BaseCompilerFilter if (isset($data->serverErrors) && 0 < count($data->serverErrors)) { // @codeCoverageIgnoreStart - throw new \RuntimeException(sprintf('The Google Closure Compiler API threw some server errors: '.print_r($data->serverErrors, true))); + throw new \RuntimeException(sprintf('The Google Closure Compiler API threw some server errors: ' . print_r($data->serverErrors, TRUE))); // @codeCoverageIgnoreEnd } if (isset($data->errors) && 0 < count($data->errors)) { // @codeCoverageIgnoreStart - throw new \RuntimeException(sprintf('The Google Closure Compiler API threw some errors: '.print_r($data->errors, true))); + throw new \RuntimeException(sprintf('The Google Closure Compiler API threw some errors: ' . print_r($data->errors, TRUE))); // @codeCoverageIgnoreEnd } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerJarFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerJarFilter.php index 7cd340e..73a614b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerJarFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/GoogleClosure/CompilerJarFilter.php @@ -28,19 +28,16 @@ class CompilerJarFilter extends BaseCompilerFilter private $javaPath; private $flagFile; - public function __construct($jarPath, $javaPath = '/usr/bin/java') - { + public function __construct($jarPath, $javaPath = '/usr/bin/java') { $this->jarPath = $jarPath; $this->javaPath = $javaPath; } - public function setFlagFile($flagFile) - { + public function setFlagFile($flagFile) { $this->flagFile = $flagFile; } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $is64bit = PHP_INT_SIZE === 8; $cleanup = array(); @@ -52,47 +49,47 @@ class CompilerJarFilter extends BaseCompilerFilter array('-jar', $this->jarPath) )); - if (null !== $this->timeout) { + if (NULL !== $this->timeout) { $pb->setTimeout($this->timeout); } - if (null !== $this->compilationLevel) { + if (NULL !== $this->compilationLevel) { $pb->add('--compilation_level')->add($this->compilationLevel); } - if (null !== $this->jsExterns) { + if (NULL !== $this->jsExterns) { $cleanup[] = $externs = FilesystemUtils::createTemporaryFile('google_closure'); file_put_contents($externs, $this->jsExterns); $pb->add('--externs')->add($externs); } - if (null !== $this->externsUrl) { + if (NULL !== $this->externsUrl) { $cleanup[] = $externs = FilesystemUtils::createTemporaryFile('google_closure'); file_put_contents($externs, file_get_contents($this->externsUrl)); $pb->add('--externs')->add($externs); } - if (null !== $this->excludeDefaultExterns) { + if (NULL !== $this->excludeDefaultExterns) { $pb->add('--use_only_custom_externs'); } - if (null !== $this->formatting) { + if (NULL !== $this->formatting) { $pb->add('--formatting')->add($this->formatting); } - if (null !== $this->useClosureLibrary) { + if (NULL !== $this->useClosureLibrary) { $pb->add('--manage_closure_dependencies'); } - if (null !== $this->warningLevel) { + if (NULL !== $this->warningLevel) { $pb->add('--warning_level')->add($this->warningLevel); } - if (null !== $this->language) { + if (NULL !== $this->language) { $pb->add('--language_in')->add($this->language); } - if (null !== $this->flagFile) { + if (NULL !== $this->flagFile) { $pb->add('--flagfile')->add($this->flagFile); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/GssFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/GssFilter.php index 4b55610..8315953 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/GssFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/GssFilter.php @@ -34,54 +34,44 @@ class GssFilter extends BaseProcessFilter private $outputOrientation; private $prettyPrint; - public function __construct($jarPath, $javaPath = '/usr/bin/java') - { + public function __construct($jarPath, $javaPath = '/usr/bin/java') { $this->jarPath = $jarPath; $this->javaPath = $javaPath; } - public function setAllowUnrecognizedFunctions($allowUnrecognizedFunctions) - { + public function setAllowUnrecognizedFunctions($allowUnrecognizedFunctions) { $this->allowUnrecognizedFunctions = $allowUnrecognizedFunctions; } - public function setAllowedNonStandardFunctions($allowNonStandardFunctions) - { + public function setAllowedNonStandardFunctions($allowNonStandardFunctions) { $this->allowedNonStandardFunctions = $allowNonStandardFunctions; } - public function setCopyrightNotice($copyrightNotice) - { + public function setCopyrightNotice($copyrightNotice) { $this->copyrightNotice = $copyrightNotice; } - public function setDefine($define) - { + public function setDefine($define) { $this->define = $define; } - public function setGssFunctionMapProvider($gssFunctionMapProvider) - { + public function setGssFunctionMapProvider($gssFunctionMapProvider) { $this->gssFunctionMapProvider = $gssFunctionMapProvider; } - public function setInputOrientation($inputOrientation) - { + public function setInputOrientation($inputOrientation) { $this->inputOrientation = $inputOrientation; } - public function setOutputOrientation($outputOrientation) - { + public function setOutputOrientation($outputOrientation) { $this->outputOrientation = $outputOrientation; } - public function setPrettyPrint($prettyPrint) - { + public function setPrettyPrint($prettyPrint) { $this->prettyPrint = $prettyPrint; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { $cleanup = array(); $pb = $this->createProcessBuilder(array( @@ -90,35 +80,35 @@ class GssFilter extends BaseProcessFilter $this->jarPath, )); - if (null !== $this->allowUnrecognizedFunctions) { + if (NULL !== $this->allowUnrecognizedFunctions) { $pb->add('--allow-unrecognized-functions'); } - if (null !== $this->allowedNonStandardFunctions) { + if (NULL !== $this->allowedNonStandardFunctions) { $pb->add('--allowed_non_standard_functions')->add($this->allowedNonStandardFunctions); } - if (null !== $this->copyrightNotice) { + if (NULL !== $this->copyrightNotice) { $pb->add('--copyright-notice')->add($this->copyrightNotice); } - if (null !== $this->define) { + if (NULL !== $this->define) { $pb->add('--define')->add($this->define); } - if (null !== $this->gssFunctionMapProvider) { + if (NULL !== $this->gssFunctionMapProvider) { $pb->add('--gss-function-map-provider')->add($this->gssFunctionMapProvider); } - if (null !== $this->inputOrientation) { + if (NULL !== $this->inputOrientation) { $pb->add('--input-orientation')->add($this->inputOrientation); } - if (null !== $this->outputOrientation) { + if (NULL !== $this->outputOrientation) { $pb->add('--output-orientation')->add($this->outputOrientation); } - if (null !== $this->prettyPrint) { + if (NULL !== $this->prettyPrint) { $pb->add('--pretty-print'); } @@ -136,7 +126,6 @@ class GssFilter extends BaseProcessFilter $asset->setContent($proc->getOutput()); } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/HandlebarsFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/HandlebarsFilter.php index f34927f..375cc17 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/HandlebarsFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/HandlebarsFilter.php @@ -26,27 +26,23 @@ class HandlebarsFilter extends BaseNodeFilter private $handlebarsBin; private $nodeBin; - private $minimize = false; - private $simple = false; + private $minimize = FALSE; + private $simple = FALSE; - public function __construct($handlebarsBin = '/usr/bin/handlebars', $nodeBin = null) - { + public function __construct($handlebarsBin = '/usr/bin/handlebars', $nodeBin = NULL) { $this->handlebarsBin = $handlebarsBin; $this->nodeBin = $nodeBin; } - public function setMinimize($minimize) - { + public function setMinimize($minimize) { $this->minimize = $minimize; } - public function setSimple($simple) - { + public function setSimple($simple) { $this->simple = $simple; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { $pb = $this->createProcessBuilder($this->nodeBin ? array($this->nodeBin, $this->handlebarsBin) : array($this->handlebarsBin)); @@ -58,7 +54,7 @@ class HandlebarsFilter extends BaseNodeFilter } $inputDirPath = FilesystemUtils::createThrowAwayDirectory('handlebars_in'); - $inputPath = $inputDirPath.DIRECTORY_SEPARATOR.$templateName; + $inputPath = $inputDirPath . DIRECTORY_SEPARATOR . $templateName; $outputPath = FilesystemUtils::createTemporaryFile('handlebars_out'); file_put_contents($inputPath, $asset->getContent()); @@ -100,7 +96,6 @@ class HandlebarsFilter extends BaseNodeFilter $asset->setContent($compiledJs); } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSMinFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSMinFilter.php index 884656b..278eeb9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSMinFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSMinFilter.php @@ -23,12 +23,10 @@ use Assetic\Asset\AssetInterface; */ class JSMinFilter implements FilterInterface { - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $asset->setContent(\JSMin::minify($asset->getContent())); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSMinPlusFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSMinPlusFilter.php index 14cd085..dac6277 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSMinPlusFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSMinPlusFilter.php @@ -23,12 +23,10 @@ use Assetic\Asset\AssetInterface; */ class JSMinPlusFilter implements FilterInterface { - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $asset->setContent(\JSMinPlus::minify($asset->getContent())); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSqueezeFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSqueezeFilter.php index 07c7fd6..cbf987e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSqueezeFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JSqueezeFilter.php @@ -21,14 +21,13 @@ use Assetic\Asset\AssetInterface; */ class JSqueezeFilter implements FilterInterface { - private $singleLine = true; - private $keepImportantComments = true; + private $singleLine = TRUE; + private $keepImportantComments = TRUE; private $className; - private $specialVarRx = false; + private $specialVarRx = FALSE; private $defaultRx; - public function __construct() - { + public function __construct() { // JSqueeze is namespaced since 2.x, this works with both 1.x and 2.x if (class_exists('\\Patchwork\\JSqueeze')) { $this->className = '\\Patchwork\\JSqueeze'; @@ -39,33 +38,28 @@ class JSqueezeFilter implements FilterInterface } } - public function setSingleLine($bool) - { - $this->singleLine = (bool) $bool; + public function setSingleLine($bool) { + $this->singleLine = (bool)$bool; } // call setSpecialVarRx(true) to enable global var/method/property // renaming with the default regex (for 1.x or 2.x) - public function setSpecialVarRx($specialVarRx) - { - if (true === $specialVarRx) { + public function setSpecialVarRx($specialVarRx) { + if (TRUE === $specialVarRx) { $this->specialVarRx = $this->defaultRx; } else { $this->specialVarRx = $specialVarRx; } } - public function keepImportantComments($bool) - { - $this->keepImportantComments = (bool) $bool; + public function keepImportantComments($bool) { + $this->keepImportantComments = (bool)$bool; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $parser = new $this->className(); $asset->setContent($parser->squeeze( $asset->getContent(), diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegoptimFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegoptimFilter.php index fcc1489..3e83965 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegoptimFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegoptimFilter.php @@ -32,27 +32,22 @@ class JpegoptimFilter extends BaseProcessFilter * * @param string $jpegoptimBin Path to the jpegoptim binary */ - public function __construct($jpegoptimBin = '/usr/bin/jpegoptim') - { + public function __construct($jpegoptimBin = '/usr/bin/jpegoptim') { $this->jpegoptimBin = $jpegoptimBin; } - public function setStripAll($stripAll) - { + public function setStripAll($stripAll) { $this->stripAll = $stripAll; } - public function setMax($max) - { + public function setMax($max) { $this->max = $max; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $pb = $this->createProcessBuilder(array($this->jpegoptimBin)); if ($this->stripAll) { @@ -60,7 +55,7 @@ class JpegoptimFilter extends BaseProcessFilter } if ($this->max) { - $pb->add('--max='.$this->max); + $pb->add('--max=' . $this->max); } $pb->add($input = FilesystemUtils::createTemporaryFile('jpegoptim')); @@ -69,7 +64,7 @@ class JpegoptimFilter extends BaseProcessFilter $proc = $pb->getProcess(); $proc->run(); - if (false !== strpos($proc->getOutput(), 'ERROR')) { + if (FALSE !== strpos($proc->getOutput(), 'ERROR')) { unlink($input); throw FilterException::fromProcess($proc)->setInput($asset->getContent()); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegtranFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegtranFilter.php index 7836538..c1547e9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegtranFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/JpegtranFilter.php @@ -38,37 +38,30 @@ class JpegtranFilter extends BaseProcessFilter * * @param string $jpegtranBin Path to the jpegtran binary */ - public function __construct($jpegtranBin = '/usr/bin/jpegtran') - { + public function __construct($jpegtranBin = '/usr/bin/jpegtran') { $this->jpegtranBin = $jpegtranBin; } - public function setOptimize($optimize) - { + public function setOptimize($optimize) { $this->optimize = $optimize; } - public function setCopy($copy) - { + public function setCopy($copy) { $this->copy = $copy; } - public function setProgressive($progressive) - { + public function setProgressive($progressive) { $this->progressive = $progressive; } - public function setRestart($restart) - { + public function setRestart($restart) { $this->restart = $restart; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $pb = $this->createProcessBuilder(array($this->jpegtranBin)); if ($this->optimize) { @@ -83,7 +76,7 @@ class JpegtranFilter extends BaseProcessFilter $pb->add('-progressive'); } - if (null !== $this->restart) { + if (NULL !== $this->restart) { $pb->add('-restart')->add($this->restart); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessFilter.php index 7ca5cd7..4532cdd 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessFilter.php @@ -49,11 +49,10 @@ class LessFilter extends BaseNodeFilter implements DependencyExtractorInterface /** * Constructor. * - * @param string $nodeBin The path to the node binary - * @param array $nodePaths An array of node paths + * @param string $nodeBin The path to the node binary + * @param array $nodePaths An array of node paths */ - public function __construct($nodeBin = '/usr/bin/node', array $nodePaths = array()) - { + public function __construct($nodeBin = '/usr/bin/node', array $nodePaths = array()) { $this->nodeBin = $nodeBin; $this->setNodePaths($nodePaths); $this->treeOptions = array(); @@ -63,13 +62,11 @@ class LessFilter extends BaseNodeFilter implements DependencyExtractorInterface /** * @param bool $compress */ - public function setCompress($compress) - { + public function setCompress($compress) { $this->addTreeOption('compress', $compress); } - public function setLoadPaths(array $loadPaths) - { + public function setLoadPaths(array $loadPaths) { $this->loadPaths = $loadPaths; } @@ -78,8 +75,7 @@ class LessFilter extends BaseNodeFilter implements DependencyExtractorInterface * * @param string $path Load path (absolute) */ - public function addLoadPath($path) - { + public function addLoadPath($path) { $this->loadPaths[] = $path; } @@ -87,8 +83,7 @@ class LessFilter extends BaseNodeFilter implements DependencyExtractorInterface * @param string $code * @param string $value */ - public function addTreeOption($code, $value) - { + public function addTreeOption($code, $value) { $this->treeOptions[$code] = $value; } @@ -96,13 +91,11 @@ class LessFilter extends BaseNodeFilter implements DependencyExtractorInterface * @param string $code * @param string $value */ - public function addParserOption($code, $value) - { + public function addParserOption($code, $value) { $this->parserOptions[$code] = $value; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { static $format = <<<'EOF' var less = require('less'); var sys = require(process.binding('natives').util ? 'util' : 'sys'); @@ -156,18 +149,16 @@ EOF; $asset->setContent($proc->getOutput()); } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } /** * @todo support for import-once * @todo support for import (less) "lib.css" */ - public function getChildren(AssetFactory $factory, $content, $loadPath = null) - { + public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) { $loadPaths = $this->loadPaths; - if (null !== $loadPath) { + if (NULL !== $loadPath) { $loadPaths[] = $loadPath; } @@ -188,7 +179,7 @@ EOF; } foreach ($loadPaths as $loadPath) { - if (file_exists($file = $loadPath.'/'.$reference)) { + if (file_exists($file = $loadPath . '/' . $reference)) { $coll = $factory->createAsset($file, array(), array('root' => $loadPath)); foreach ($coll as $leaf) { $leaf->ensureFilter($this); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessphpFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessphpFilter.php index 6116f58..5424655 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessphpFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessphpFilter.php @@ -45,8 +45,7 @@ class LessphpFilter implements DependencyExtractorInterface * * @param string $path Load Path */ - public function addLoadPath($path) - { + public function addLoadPath($path) { $this->loadPaths[] = $path; } @@ -55,39 +54,33 @@ class LessphpFilter implements DependencyExtractorInterface * * @param array $loadPaths Load paths */ - public function setLoadPaths(array $loadPaths) - { + public function setLoadPaths(array $loadPaths) { $this->loadPaths = $loadPaths; } - public function setPresets(array $presets) - { + public function setPresets(array $presets) { $this->presets = $presets; } - - public function setOptions(array $options) - { - $this->options = $options; + + public function setOptions(array $options) { + $this->options = $options; } /** * @param string $formatter One of "lessjs", "compressed", or "classic". */ - public function setFormatter($formatter) - { + public function setFormatter($formatter) { $this->formatter = $formatter; } /** * @param boolean $preserveComments */ - public function setPreserveComments($preserveComments) - { + public function setPreserveComments($preserveComments) { $this->preserveComments = $preserveComments; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { $lc = new \lessc(); if ($dir = $asset->getSourceDirectory()) { $lc->importDir = $dir; @@ -105,30 +98,27 @@ class LessphpFilter implements DependencyExtractorInterface $lc->setFormatter($this->formatter); } - if (null !== $this->preserveComments) { + if (NULL !== $this->preserveComments) { $lc->setPreserveComments($this->preserveComments); } - - if (method_exists($lc, 'setOptions') && count($this->options) > 0 ) { - $lc->setOptions($this->options); + + if (method_exists($lc, 'setOptions') && count($this->options) > 0) { + $lc->setOptions($this->options); } $asset->setContent($lc->parse($asset->getContent(), $this->presets)); } - public function registerFunction($name, $callable) - { + public function registerFunction($name, $callable) { $this->customFunctions[$name] = $callable; } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } - public function getChildren(AssetFactory $factory, $content, $loadPath = null) - { + public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) { $loadPaths = $this->loadPaths; - if (null !== $loadPath) { + if (NULL !== $loadPath) { $loadPaths[] = $loadPath; } @@ -149,7 +139,7 @@ class LessphpFilter implements DependencyExtractorInterface } foreach ($loadPaths as $loadPath) { - if (file_exists($file = $loadPath.'/'.$reference)) { + if (file_exists($file = $loadPath . '/' . $reference)) { $coll = $factory->createAsset($file, array(), array('root' => $loadPath)); foreach ($coll as $leaf) { $leaf->ensureFilter($this); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/MinifyCssCompressorFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/MinifyCssCompressorFilter.php index 180667a..4e7f521 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/MinifyCssCompressorFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/MinifyCssCompressorFilter.php @@ -24,12 +24,10 @@ use Assetic\Asset\AssetInterface; */ class MinifyCssCompressorFilter implements FilterInterface { - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $asset->setContent(\Minify_CSS_Compressor::process($asset->getContent())); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/OptiPngFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/OptiPngFilter.php index 5bc1d12..5a93a02 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/OptiPngFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/OptiPngFilter.php @@ -31,25 +31,21 @@ class OptiPngFilter extends BaseProcessFilter * * @param string $optipngBin Path to the optipng binary */ - public function __construct($optipngBin = '/usr/bin/optipng') - { + public function __construct($optipngBin = '/usr/bin/optipng') { $this->optipngBin = $optipngBin; } - public function setLevel($level) - { + public function setLevel($level) { $this->level = $level; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $pb = $this->createProcessBuilder(array($this->optipngBin)); - if (null !== $this->level) { + if (NULL !== $this->level) { $pb->add('-o')->add($this->level); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackagerFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackagerFilter.php index 23ceb4e..08fff01 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackagerFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackagerFilter.php @@ -24,42 +24,38 @@ class PackagerFilter implements FilterInterface { private $packages; - public function __construct(array $packages = array()) - { + public function __construct(array $packages = array()) { $this->packages = $packages; } - public function addPackage($package) - { + public function addPackage($package) { $this->packages[] = $package; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { static $manifest = <<getContent()); + file_put_contents($package . '/package.yml', sprintf($manifest, $hash)); + file_put_contents($package . '/source.js', $asset->getContent()); $packager = new \Packager(array_merge(array($package), $this->packages)); - $content = $packager->build(array(), array(), array('Application'.$hash)); + $content = $packager->build(array(), array(), array('Application' . $hash)); - unlink($package.'/package.yml'); - unlink($package.'/source.js'); + unlink($package . '/package.yml'); + unlink($package . '/source.js'); rmdir($package); $asset->setContent($content); } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackerFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackerFilter.php index 6dbe5f3..bc9b59d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackerFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PackerFilter.php @@ -25,31 +25,26 @@ class PackerFilter implements FilterInterface { protected $encoding = 'None'; - protected $fastDecode = true; + protected $fastDecode = TRUE; - protected $specialChars = false; + protected $specialChars = FALSE; - public function setEncoding($encoding) - { + public function setEncoding($encoding) { $this->encoding = $encoding; } - public function setFastDecode($fastDecode) - { - $this->fastDecode = (bool) $fastDecode; + public function setFastDecode($fastDecode) { + $this->fastDecode = (bool)$fastDecode; } - public function setSpecialChars($specialChars) - { - $this->specialChars = (bool) $specialChars; + public function setSpecialChars($specialChars) { + $this->specialChars = (bool)$specialChars; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $packer = new \JavaScriptPacker($asset->getContent(), $this->encoding, $this->fastDecode, $this->specialChars); $asset->setContent($packer->pack()); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PhpCssEmbedFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PhpCssEmbedFilter.php index b1ff33f..dd41eb6 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PhpCssEmbedFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PhpCssEmbedFilter.php @@ -25,13 +25,11 @@ class PhpCssEmbedFilter implements DependencyExtractorInterface { private $presets = array(); - public function setPresets(array $presets) - { + public function setPresets(array $presets) { $this->presets = $presets; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { $pce = new CssEmbed(); if ($dir = $asset->getSourceDirectory()) { $pce->setRootDir($dir); @@ -40,12 +38,10 @@ class PhpCssEmbedFilter implements DependencyExtractorInterface $asset->setContent($pce->embedString($asset->getContent())); } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } - public function getChildren(AssetFactory $factory, $content, $loadPath = null) - { + public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) { // todo return array(); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PngoutFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PngoutFilter.php index 592ef3a..a936693 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PngoutFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/PngoutFilter.php @@ -24,26 +24,26 @@ use Assetic\Util\FilesystemUtils; class PngoutFilter extends BaseProcessFilter { // -c# - const COLOR_GREY = '0'; - const COLOR_RGB = '2'; - const COLOR_PAL = '3'; + const COLOR_GREY = '0'; + const COLOR_RGB = '2'; + const COLOR_PAL = '3'; const COLOR_GRAY_ALPHA = '4'; - const COLOR_RGB_ALPHA = '6'; + const COLOR_RGB_ALPHA = '6'; // -f# - const FILTER_NONE = '0'; - const FILTER_X = '1'; - const FILTER_Y = '2'; - const FILTER_X_Y = '3'; + const FILTER_NONE = '0'; + const FILTER_X = '1'; + const FILTER_Y = '2'; + const FILTER_X_Y = '3'; const FILTER_PAETH = '4'; const FILTER_MIXED = '5'; // -s# - const STRATEGY_XTREME = '0'; - const STRATEGY_INTENSE = '1'; + const STRATEGY_XTREME = '0'; + const STRATEGY_INTENSE = '1'; const STRATEGY_LONGEST_MATCH = '2'; - const STRATEGY_HUFFMAN_ONLY = '3'; - const STRATEGY_UNCOMPRESSED = '4'; + const STRATEGY_HUFFMAN_ONLY = '3'; + const STRATEGY_UNCOMPRESSED = '4'; private $pngoutBin; private $color; @@ -56,53 +56,46 @@ class PngoutFilter extends BaseProcessFilter * * @param string $pngoutBin Path to the pngout binary */ - public function __construct($pngoutBin = '/usr/bin/pngout') - { + public function __construct($pngoutBin = '/usr/bin/pngout') { $this->pngoutBin = $pngoutBin; } - public function setColor($color) - { + public function setColor($color) { $this->color = $color; } - public function setFilter($filter) - { + public function setFilter($filter) { $this->filter = $filter; } - public function setStrategy($strategy) - { + public function setStrategy($strategy) { $this->strategy = $strategy; } - public function setBlockSplitThreshold($blockSplitThreshold) - { + public function setBlockSplitThreshold($blockSplitThreshold) { $this->blockSplitThreshold = $blockSplitThreshold; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $pb = $this->createProcessBuilder(array($this->pngoutBin)); - if (null !== $this->color) { - $pb->add('-c'.$this->color); + if (NULL !== $this->color) { + $pb->add('-c' . $this->color); } - if (null !== $this->filter) { - $pb->add('-f'.$this->filter); + if (NULL !== $this->filter) { + $pb->add('-f' . $this->filter); } - if (null !== $this->strategy) { - $pb->add('-s'.$this->strategy); + if (NULL !== $this->strategy) { + $pb->add('-s' . $this->strategy); } - if (null !== $this->blockSplitThreshold) { - $pb->add('-b'.$this->blockSplitThreshold); + if (NULL !== $this->blockSplitThreshold) { + $pb->add('-b' . $this->blockSplitThreshold); } $pb->add($input = FilesystemUtils::createTemporaryFile('pngout_in')); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/ReactJsxFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/ReactJsxFilter.php index dc4f218..a7dcc56 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/ReactJsxFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/ReactJsxFilter.php @@ -17,22 +17,20 @@ class ReactJsxFilter extends BaseNodeFilter private $jsxBin; private $nodeBin; - public function __construct($jsxBin = '/usr/bin/jsx', $nodeBin = null) - { + public function __construct($jsxBin = '/usr/bin/jsx', $nodeBin = NULL) { $this->jsxBin = $jsxBin; $this->nodeBin = $nodeBin; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { $builder = $this->createProcessBuilder($this->nodeBin ? array($this->nodeBin, $this->jsxBin) : array($this->jsxBin)); $inputDir = FilesystemUtils::createThrowAwayDirectory('jsx_in'); - $inputFile = $inputDir.DIRECTORY_SEPARATOR.'asset.js'; + $inputFile = $inputDir . DIRECTORY_SEPARATOR . 'asset.js'; $outputDir = FilesystemUtils::createThrowAwayDirectory('jsx_out'); - $outputFile = $outputDir.DIRECTORY_SEPARATOR.'asset.js'; + $outputFile = $outputDir . DIRECTORY_SEPARATOR . 'asset.js'; // create the asset file file_put_contents($inputFile, $asset->getContent()); @@ -40,8 +38,7 @@ class ReactJsxFilter extends BaseNodeFilter $builder ->add($inputDir) ->add($outputDir) - ->add('--no-cache-dir') - ; + ->add('--no-cache-dir'); $proc = $builder->getProcess(); $code = $proc->run(); @@ -69,7 +66,6 @@ class ReactJsxFilter extends BaseNodeFilter rmdir($outputDir); } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/RooleFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/RooleFilter.php index cbcaf4c..f841d6f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/RooleFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/RooleFilter.php @@ -31,18 +31,16 @@ class RooleFilter extends BaseNodeFilter implements DependencyExtractorInterface * Constructor * * @param string $rooleBin The path to the roole binary - * @param string $nodeBin The path to the node binary + * @param string $nodeBin The path to the node binary */ - public function __construct($rooleBin = '/usr/bin/roole', $nodeBin = null) - { + public function __construct($rooleBin = '/usr/bin/roole', $nodeBin = NULL) { $this->rooleBin = $rooleBin; $this->nodeBin = $nodeBin; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { $input = FilesystemUtils::createTemporaryFile('roole'); - $output = $input.'.css'; + $output = $input . '.css'; file_put_contents($input, $asset->getContent()); @@ -72,12 +70,10 @@ class RooleFilter extends BaseNodeFilter implements DependencyExtractorInterface unlink($output); } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } - public function getChildren(AssetFactory $factory, $content, $loadPath = null) - { + public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) { // todo return array(); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/BaseSassFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/BaseSassFilter.php index 68903f0..7d1e7fb 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/BaseSassFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/BaseSassFilter.php @@ -12,18 +12,15 @@ abstract class BaseSassFilter extends BaseProcessFilter implements DependencyExt { protected $loadPaths = array(); - public function setLoadPaths(array $loadPaths) - { + public function setLoadPaths(array $loadPaths) { $this->loadPaths = $loadPaths; } - public function addLoadPath($loadPath) - { + public function addLoadPath($loadPath) { $this->loadPaths[] = $loadPath; } - public function getChildren(AssetFactory $factory, $content, $loadPath = null) - { + public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) { $loadPaths = $this->loadPaths; if ($loadPath) { array_unshift($loadPaths, $loadPath); @@ -49,16 +46,16 @@ abstract class BaseSassFilter extends BaseProcessFilter implements DependencyExt ); } else { $needles = array( - $reference.'.scss', - $reference.'.sass', - self::partialize($reference).'.scss', - self::partialize($reference).'.sass', + $reference . '.scss', + $reference . '.sass', + self::partialize($reference) . '.scss', + self::partialize($reference) . '.sass', ); } foreach ($loadPaths as $loadPath) { foreach ($needles as $needle) { - if (file_exists($file = $loadPath.'/'.$needle)) { + if (file_exists($file = $loadPath . '/' . $needle)) { $coll = $factory->createAsset($file, array(), array('root' => $loadPath)); foreach ($coll as $leaf) { /** @var $leaf AssetInterface */ @@ -76,18 +73,17 @@ abstract class BaseSassFilter extends BaseProcessFilter implements DependencyExt return $children; } - private static function partialize($reference) - { + private static function partialize($reference) { $parts = pathinfo($reference); if ('.' === $parts['dirname']) { - $partial = '_'.$parts['filename']; + $partial = '_' . $parts['filename']; } else { - $partial = $parts['dirname'].DIRECTORY_SEPARATOR.'_'.$parts['filename']; + $partial = $parts['dirname'] . DIRECTORY_SEPARATOR . '_' . $parts['filename']; } if (isset($parts['extension'])) { - $partial .= '.'.$parts['extension']; + $partial .= '.' . $parts['extension']; } return $partial; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/SassFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/SassFilter.php index 68da116..a111ef0 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/SassFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/SassFilter.php @@ -23,9 +23,9 @@ use Assetic\Util\FilesystemUtils; */ class SassFilter extends BaseSassFilter { - const STYLE_NESTED = 'nested'; - const STYLE_EXPANDED = 'expanded'; - const STYLE_COMPACT = 'compact'; + const STYLE_NESTED = 'nested'; + const STYLE_EXPANDED = 'expanded'; + const STYLE_COMPACT = 'compact'; const STYLE_COMPRESSED = 'compressed'; private $sassPath; @@ -42,72 +42,59 @@ class SassFilter extends BaseSassFilter private $noCache; private $compass; - public function __construct($sassPath = '/usr/bin/sass', $rubyPath = null) - { + public function __construct($sassPath = '/usr/bin/sass', $rubyPath = NULL) { $this->sassPath = $sassPath; $this->rubyPath = $rubyPath; $this->cacheLocation = FilesystemUtils::getTemporaryDirectory(); } - public function setUnixNewlines($unixNewlines) - { + public function setUnixNewlines($unixNewlines) { $this->unixNewlines = $unixNewlines; } - public function setScss($scss) - { + public function setScss($scss) { $this->scss = $scss; } - public function setStyle($style) - { + public function setStyle($style) { $this->style = $style; } - public function setPrecision($precision) - { + public function setPrecision($precision) { $this->precision = $precision; } - public function setQuiet($quiet) - { + public function setQuiet($quiet) { $this->quiet = $quiet; } - public function setDebugInfo($debugInfo) - { + public function setDebugInfo($debugInfo) { $this->debugInfo = $debugInfo; } - public function setLineNumbers($lineNumbers) - { + public function setLineNumbers($lineNumbers) { $this->lineNumbers = $lineNumbers; } - public function setSourceMap($sourceMap) - { + public function setSourceMap($sourceMap) { $this->sourceMap = $sourceMap; } - public function setCacheLocation($cacheLocation) - { + public function setCacheLocation($cacheLocation) { $this->cacheLocation = $cacheLocation; } - public function setNoCache($noCache) - { + public function setNoCache($noCache) { $this->noCache = $noCache; } - public function setCompass($compass) - { + public function setCompass($compass) { $this->compass = $compass; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { $sassProcessArgs = array($this->sassPath); - if (null !== $this->rubyPath) { + if (NULL !== $this->rubyPath) { $sassProcessArgs = array_merge(explode(' ', $this->rubyPath), $sassProcessArgs); } @@ -121,7 +108,7 @@ class SassFilter extends BaseSassFilter $pb->add('--unix-newlines'); } - if (true === $this->scss || (null === $this->scss && 'scss' == pathinfo($asset->getSourcePath(), PATHINFO_EXTENSION))) { + if (TRUE === $this->scss || (NULL === $this->scss && 'scss' == pathinfo($asset->getSourcePath(), PATHINFO_EXTENSION))) { $pb->add('--scss'); } @@ -180,7 +167,6 @@ class SassFilter extends BaseSassFilter $asset->setContent($proc->getOutput()); } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/ScssFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/ScssFilter.php index f8be046..8fbf567 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/ScssFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Sass/ScssFilter.php @@ -19,10 +19,9 @@ namespace Assetic\Filter\Sass; */ class ScssFilter extends SassFilter { - public function __construct($sassPath = '/usr/bin/sass', $rubyPath = null) - { + public function __construct($sassPath = '/usr/bin/sass', $rubyPath = NULL) { parent::__construct($sassPath, $rubyPath); - $this->setScss(true); + $this->setScss(TRUE); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/SassphpFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/SassphpFilter.php index 5d4ed1e..9bfd042 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/SassphpFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/SassphpFilter.php @@ -26,8 +26,7 @@ class SassphpFilter implements DependencyExtractorInterface private $includePaths = array(); private $outputStyle; - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { $sass = new \Sass(); $includePaths = array_merge( @@ -45,31 +44,26 @@ class SassphpFilter implements DependencyExtractorInterface $asset->setContent($css); } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } - public function setOutputStyle($outputStyle) - { + public function setOutputStyle($outputStyle) { $this->outputStyle = $outputStyle; } - public function setIncludePaths(array $paths) - { + public function setIncludePaths(array $paths) { $this->includePaths = $paths; } - public function addIncludePath($path) - { + public function addIncludePath($path) { $this->includePaths[] = $path; } - public function getChildren(AssetFactory $factory, $content, $loadPath = null) - { + public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) { $children = array(); $includePaths = $this->includePaths; - if (null !== $loadPath && !in_array($loadPath, $includePaths)) { + if (NULL !== $loadPath && !in_array($loadPath, $includePaths)) { array_unshift($includePaths, $loadPath); } @@ -113,8 +107,7 @@ class SassphpFilter implements DependencyExtractorInterface return $children; } - private function partialize($reference) - { + private function partialize($reference) { $parts = pathinfo($reference); if ('.' === $parts['dirname']) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/ScssphpFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/ScssphpFilter.php index c2252a1..869d65a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/ScssphpFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/ScssphpFilter.php @@ -27,24 +27,21 @@ use Leafo\ScssPhp\Compiler; */ class ScssphpFilter implements DependencyExtractorInterface { - private $compass = false; + private $compass = FALSE; private $importPaths = array(); private $customFunctions = array(); private $formatter; private $variables = array(); - public function enableCompass($enable = true) - { - $this->compass = (Boolean) $enable; + public function enableCompass($enable = TRUE) { + $this->compass = (Boolean)$enable; } - public function isCompassEnabled() - { + public function isCompassEnabled() { return $this->compass; } - public function setFormatter($formatter) - { + public function setFormatter($formatter) { $legacyFormatters = array( 'scss_formatter' => 'Leafo\ScssPhp\Formatter\Expanded', 'scss_formatter_nested' => 'Leafo\ScssPhp\Formatter\Nested', @@ -61,33 +58,27 @@ class ScssphpFilter implements DependencyExtractorInterface $this->formatter = $formatter; } - public function setVariables(array $variables) - { + public function setVariables(array $variables) { $this->variables = $variables; } - public function addVariable($variable) - { + public function addVariable($variable) { $this->variables[] = $variable; } - public function setImportPaths(array $paths) - { + public function setImportPaths(array $paths) { $this->importPaths = $paths; } - public function addImportPath($path) - { + public function addImportPath($path) { $this->importPaths[] = $path; } - public function registerFunction($name, $callable) - { + public function registerFunction($name, $callable) { $this->customFunctions[$name] = $callable; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { $sc = new Compiler(); if ($this->compass) { @@ -117,14 +108,12 @@ class ScssphpFilter implements DependencyExtractorInterface $asset->setContent($sc->compile($asset->getContent())); } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } - public function getChildren(AssetFactory $factory, $content, $loadPath = null) - { + public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) { $sc = new Compiler(); - if ($loadPath !== null) { + if ($loadPath !== NULL) { $sc->addImportPath($loadPath); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/SeparatorFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/SeparatorFilter.php index a2c02ab..00b37e1 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/SeparatorFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/SeparatorFilter.php @@ -31,17 +31,14 @@ class SeparatorFilter implements FilterInterface * * @param string $separator Separator to use between assets */ - public function __construct($separator = ';') - { + public function __construct($separator = ';') { $this->separator = $separator; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $asset->setContent($asset->getContent() . $this->separator); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/SprocketsFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/SprocketsFilter.php index ed46b0f..b1d8610 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/SprocketsFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/SprocketsFilter.php @@ -37,30 +37,26 @@ class SprocketsFilter extends BaseProcessFilter implements DependencyExtractorIn * Constructor. * * @param string $sprocketsLib Path to the Sprockets lib/ directory - * @param string $rubyBin Path to the ruby binary + * @param string $rubyBin Path to the ruby binary */ - public function __construct($sprocketsLib = null, $rubyBin = '/usr/bin/ruby') - { + public function __construct($sprocketsLib = NULL, $rubyBin = '/usr/bin/ruby') { $this->sprocketsLib = $sprocketsLib; $this->rubyBin = $rubyBin; $this->includeDirs = array(); } - public function addIncludeDir($directory) - { + public function addIncludeDir($directory) { $this->includeDirs[] = $directory; } - public function setAssetRoot($assetRoot) - { + public function setAssetRoot($assetRoot) { $this->assetRoot = $assetRoot; } /** * Hack around a bit, get the job done. */ - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { static $format = <<<'EOF' #!/usr/bin/env ruby @@ -79,11 +75,11 @@ EOF; $more = ''; foreach ($this->includeDirs as $directory) { - $more .= 'options[:load_path] << '.var_export($directory, true)."\n"; + $more .= 'options[:load_path] << ' . var_export($directory, TRUE) . "\n"; } - if (null !== $this->assetRoot) { - $more .= 'options[:asset_root] = '.var_export($this->assetRoot, true)."\n"; + if (NULL !== $this->assetRoot) { + $more .= 'options[:asset_root] = ' . var_export($this->assetRoot, TRUE) . "\n"; } if ($more) { @@ -96,10 +92,10 @@ EOF; $input = FilesystemUtils::createTemporaryFile('sprockets_in'); file_put_contents($input, sprintf($format, $this->sprocketsLib - ? sprintf('File.join(%s, \'sprockets\')', var_export($this->sprocketsLib, true)) + ? sprintf('File.join(%s, \'sprockets\')', var_export($this->sprocketsLib, TRUE)) : '\'sprockets\'', $this->getHack($asset), - var_export($tmpAsset, true), + var_export($tmpAsset, TRUE), $more )); @@ -120,18 +116,15 @@ EOF; $asset->setContent($proc->getOutput()); } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } - public function getChildren(AssetFactory $factory, $content, $loadPath = null) - { + public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) { // todo return array(); } - private function getHack(AssetInterface $asset) - { + private function getHack(AssetInterface $asset) { static $format = <<<'EOF' module Sprockets @@ -146,7 +139,7 @@ end EOF; if ($dir = $asset->getSourceDirectory()) { - return sprintf($format, var_export($dir, true)); + return sprintf($format, var_export($dir, TRUE)); } } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/StylusFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/StylusFilter.php index aed7861..bca2206 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/StylusFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/StylusFilter.php @@ -31,11 +31,10 @@ class StylusFilter extends BaseNodeFilter implements DependencyExtractorInterfac /** * Constructs filter. * - * @param string $nodeBin The path to the node binary - * @param array $nodePaths An array of node paths + * @param string $nodeBin The path to the node binary + * @param array $nodePaths An array of node paths */ - public function __construct($nodeBin = '/usr/bin/node', array $nodePaths = array()) - { + public function __construct($nodeBin = '/usr/bin/node', array $nodePaths = array()) { $this->nodeBin = $nodeBin; $this->setNodePaths($nodePaths); } @@ -45,8 +44,7 @@ class StylusFilter extends BaseNodeFilter implements DependencyExtractorInterfac * * @param boolean $compress */ - public function setCompress($compress) - { + public function setCompress($compress) { $this->compress = $compress; } @@ -55,16 +53,14 @@ class StylusFilter extends BaseNodeFilter implements DependencyExtractorInterfac * * @param boolean $useNib */ - public function setUseNib($useNib) - { + public function setUseNib($useNib) { $this->useNib = $useNib; } /** * {@inheritdoc} */ - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { static $format = <<<'EOF' var stylus = require('stylus'); var sys = require(process.binding('natives').util ? 'util' : 'sys'); @@ -87,7 +83,7 @@ EOF; $parserOptions['filename'] = basename($asset->getSourcePath()); } - if (null !== $this->compress) { + if (NULL !== $this->compress) { $parserOptions['compress'] = $this->compress; } @@ -114,12 +110,10 @@ EOF; /** * {@inheritdoc} */ - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } - public function getChildren(AssetFactory $factory, $content, $loadPath = null) - { + public function getChildren(AssetFactory $factory, $content, $loadPath = NULL) { // todo return array(); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/TypeScriptFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/TypeScriptFilter.php index 24aee31..ab77030 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/TypeScriptFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/TypeScriptFilter.php @@ -26,14 +26,12 @@ class TypeScriptFilter extends BaseNodeFilter private $tscBin; private $nodeBin; - public function __construct($tscBin = '/usr/bin/tsc', $nodeBin = null) - { + public function __construct($tscBin = '/usr/bin/tsc', $nodeBin = NULL) { $this->tscBin = $tscBin; $this->nodeBin = $nodeBin; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { $pb = $this->createProcessBuilder($this->nodeBin ? array($this->nodeBin, $this->tscBin) : array($this->tscBin)); @@ -45,7 +43,7 @@ class TypeScriptFilter extends BaseNodeFilter } $inputDirPath = FilesystemUtils::createThrowAwayDirectory('typescript_in'); - $inputPath = $inputDirPath.DIRECTORY_SEPARATOR.$templateName.'.ts'; + $inputPath = $inputDirPath . DIRECTORY_SEPARATOR . $templateName . '.ts'; $outputPath = FilesystemUtils::createTemporaryFile('typescript_out'); file_put_contents($inputPath, $asset->getContent()); @@ -74,7 +72,6 @@ class TypeScriptFilter extends BaseNodeFilter $asset->setContent($compiledJs); } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/UglifyCssFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/UglifyCssFilter.php index d534fa3..f666190 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/UglifyCssFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/UglifyCssFilter.php @@ -32,10 +32,9 @@ class UglifyCssFilter extends BaseNodeFilter /** * @param string $uglifycssBin Absolute path to the uglifycss executable - * @param string $nodeBin Absolute path to the folder containg node.js executable + * @param string $nodeBin Absolute path to the folder containg node.js executable */ - public function __construct($uglifycssBin = '/usr/bin/uglifycss', $nodeBin = null) - { + public function __construct($uglifycssBin = '/usr/bin/uglifycss', $nodeBin = NULL) { $this->uglifycssBin = $uglifycssBin; $this->nodeBin = $nodeBin; } @@ -44,8 +43,7 @@ class UglifyCssFilter extends BaseNodeFilter * Expand variables * @param bool $expandVars True to enable */ - public function setExpandVars($expandVars) - { + public function setExpandVars($expandVars) { $this->expandVars = $expandVars; } @@ -53,8 +51,7 @@ class UglifyCssFilter extends BaseNodeFilter * Remove newlines within preserved comments * @param bool $uglyComments True to enable */ - public function setUglyComments($uglyComments) - { + public function setUglyComments($uglyComments) { $this->uglyComments = $uglyComments; } @@ -62,16 +59,14 @@ class UglifyCssFilter extends BaseNodeFilter * Preserve newlines within and around preserved comments * @param bool $cuteComments True to enable */ - public function setCuteComments($cuteComments) - { + public function setCuteComments($cuteComments) { $this->cuteComments = $cuteComments; } /** * @see Assetic\Filter\FilterInterface::filterLoad() */ - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } /** @@ -79,8 +74,7 @@ class UglifyCssFilter extends BaseNodeFilter * * @see Assetic\Filter\FilterInterface::filterDump() */ - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $pb = $this->createProcessBuilder($this->nodeBin ? array($this->nodeBin, $this->uglifycssBin) : array($this->uglifycssBin)); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/UglifyJs2Filter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/UglifyJs2Filter.php index c0441ae..be63941 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/UglifyJs2Filter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/UglifyJs2Filter.php @@ -33,57 +33,47 @@ class UglifyJs2Filter extends BaseNodeFilter private $wrap; private $defines; - public function __construct($uglifyjsBin = '/usr/bin/uglifyjs', $nodeBin = null) - { + public function __construct($uglifyjsBin = '/usr/bin/uglifyjs', $nodeBin = NULL) { $this->uglifyjsBin = $uglifyjsBin; $this->nodeBin = $nodeBin; } - public function setCompress($compress) - { + public function setCompress($compress) { $this->compress = $compress; } - public function setBeautify($beautify) - { + public function setBeautify($beautify) { $this->beautify = $beautify; } - public function setMangle($mangle) - { + public function setMangle($mangle) { $this->mangle = $mangle; } - public function setScrewIe8($screwIe8) - { + public function setScrewIe8($screwIe8) { $this->screwIe8 = $screwIe8; } - public function setComments($comments) - { + public function setComments($comments) { $this->comments = $comments; } - public function setWrap($wrap) - { + public function setWrap($wrap) { $this->wrap = $wrap; } - public function setDefines(array $defines) - { + public function setDefines(array $defines) { $this->defines = $defines; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $pb = $this->createProcessBuilder( $this->nodeBin - ? array($this->nodeBin, $this->uglifyjsBin) - : array($this->uglifyjsBin) + ? array($this->nodeBin, $this->uglifyjsBin) + : array($this->uglifyjsBin) ); if ($this->compress) { @@ -107,7 +97,7 @@ class UglifyJs2Filter extends BaseNodeFilter } if ($this->comments) { - $pb->add('--comments')->add(true === $this->comments ? 'all' : $this->comments); + $pb->add('--comments')->add(TRUE === $this->comments ? 'all' : $this->comments); } if ($this->wrap) { @@ -119,7 +109,7 @@ class UglifyJs2Filter extends BaseNodeFilter } // input and output files - $input = FilesystemUtils::createTemporaryFile('uglifyjs2_in'); + $input = FilesystemUtils::createTemporaryFile('uglifyjs2_in'); $output = FilesystemUtils::createTemporaryFile('uglifyjs2_out'); file_put_contents($input, $asset->getContent()); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/UglifyJsFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/UglifyJsFilter.php index ff9ad66..fcac28c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/UglifyJsFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/UglifyJsFilter.php @@ -34,10 +34,9 @@ class UglifyJsFilter extends BaseNodeFilter /** * @param string $uglifyjsBin Absolute path to the uglifyjs executable - * @param string $nodeBin Absolute path to the folder containg node.js executable + * @param string $nodeBin Absolute path to the folder containg node.js executable */ - public function __construct($uglifyjsBin = '/usr/bin/uglifyjs', $nodeBin = null) - { + public function __construct($uglifyjsBin = '/usr/bin/uglifyjs', $nodeBin = NULL) { $this->uglifyjsBin = $uglifyjsBin; $this->nodeBin = $nodeBin; } @@ -46,8 +45,7 @@ class UglifyJsFilter extends BaseNodeFilter * Removes the first block of comments as well * @param bool $noCopyright True to enable */ - public function setNoCopyright($noCopyright) - { + public function setNoCopyright($noCopyright) { $this->noCopyright = $noCopyright; } @@ -55,8 +53,7 @@ class UglifyJsFilter extends BaseNodeFilter * Output indented code * @param bool $beautify True to enable */ - public function setBeautify($beautify) - { + public function setBeautify($beautify) { $this->beautify = $beautify; } @@ -64,8 +61,7 @@ class UglifyJsFilter extends BaseNodeFilter * Enable additional optimizations that are known to be unsafe in some situations. * @param bool $unsafe True to enable */ - public function setUnsafe($unsafe) - { + public function setUnsafe($unsafe) { $this->unsafe = $unsafe; } @@ -73,21 +69,18 @@ class UglifyJsFilter extends BaseNodeFilter * Safely mangle variable and function names for greater file compress. * @param bool $mangle True to enable */ - public function setMangle($mangle) - { + public function setMangle($mangle) { $this->mangle = $mangle; } - public function setDefines(array $defines) - { + public function setDefines(array $defines) { $this->defines = $defines; } /** * @see Assetic\Filter\FilterInterface::filterLoad() */ - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } /** @@ -95,12 +88,11 @@ class UglifyJsFilter extends BaseNodeFilter * * @see Assetic\Filter\FilterInterface::filterDump() */ - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $pb = $this->createProcessBuilder( $this->nodeBin - ? array($this->nodeBin, $this->uglifyjsBin) - : array($this->uglifyjsBin) + ? array($this->nodeBin, $this->uglifyjsBin) + : array($this->uglifyjsBin) ); if ($this->noCopyright) { @@ -115,7 +107,7 @@ class UglifyJsFilter extends BaseNodeFilter $pb->add('--unsafe'); } - if (false === $this->mangle) { + if (FALSE === $this->mangle) { $pb->add('--no-mangle'); } @@ -126,7 +118,7 @@ class UglifyJsFilter extends BaseNodeFilter } // input and output files - $input = FilesystemUtils::createTemporaryFile('uglifyjs_in'); + $input = FilesystemUtils::createTemporaryFile('uglifyjs_in'); $output = FilesystemUtils::createTemporaryFile('uglifyjs_out'); file_put_contents($input, $asset->getContent()); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/BaseCompressorFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/BaseCompressorFilter.php index b3ec267..bbee1d7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/BaseCompressorFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/BaseCompressorFilter.php @@ -30,46 +30,40 @@ abstract class BaseCompressorFilter extends BaseProcessFilter private $lineBreak; private $stackSize; - public function __construct($jarPath, $javaPath = '/usr/bin/java') - { + public function __construct($jarPath, $javaPath = '/usr/bin/java') { $this->jarPath = $jarPath; $this->javaPath = $javaPath; } - public function setCharset($charset) - { + public function setCharset($charset) { $this->charset = $charset; } - public function setLineBreak($lineBreak) - { + public function setLineBreak($lineBreak) { $this->lineBreak = $lineBreak; } - public function setStackSize($stackSize) - { + public function setStackSize($stackSize) { $this->stackSize = $stackSize; } - public function filterLoad(AssetInterface $asset) - { + public function filterLoad(AssetInterface $asset) { } /** * Compresses a string. * * @param string $content The content to compress - * @param string $type The type of content, either "js" or "css" - * @param array $options An indexed array of additional options + * @param string $type The type of content, either "js" or "css" + * @param array $options An indexed array of additional options * * @return string The compressed content */ - protected function compress($content, $type, $options = array()) - { + protected function compress($content, $type, $options = array()) { $pb = $this->createProcessBuilder(array($this->javaPath)); - if (null !== $this->stackSize) { - $pb->add('-Xss'.$this->stackSize); + if (NULL !== $this->stackSize) { + $pb->add('-Xss' . $this->stackSize); } $pb->add('-jar')->add($this->jarPath); @@ -78,11 +72,11 @@ abstract class BaseCompressorFilter extends BaseProcessFilter $pb->add($option); } - if (null !== $this->charset) { + if (NULL !== $this->charset) { $pb->add('--charset')->add($this->charset); } - if (null !== $this->lineBreak) { + if (NULL !== $this->lineBreak) { $pb->add('--line-break')->add($this->lineBreak); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/CssCompressorFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/CssCompressorFilter.php index 077c6d5..ee9af32 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/CssCompressorFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/CssCompressorFilter.php @@ -21,8 +21,7 @@ use Assetic\Asset\AssetInterface; */ class CssCompressorFilter extends BaseCompressorFilter { - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $asset->setContent($this->compress($asset->getContent(), 'css')); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/JsCompressorFilter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/JsCompressorFilter.php index b2a59fb..79723ad 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/JsCompressorFilter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Filter/Yui/JsCompressorFilter.php @@ -25,23 +25,19 @@ class JsCompressorFilter extends BaseCompressorFilter private $preserveSemi; private $disableOptimizations; - public function setNomunge($nomunge = true) - { + public function setNomunge($nomunge = TRUE) { $this->nomunge = $nomunge; } - public function setPreserveSemi($preserveSemi) - { + public function setPreserveSemi($preserveSemi) { $this->preserveSemi = $preserveSemi; } - public function setDisableOptimizations($disableOptimizations) - { + public function setDisableOptimizations($disableOptimizations) { $this->disableOptimizations = $disableOptimizations; } - public function filterDump(AssetInterface $asset) - { + public function filterDump(AssetInterface $asset) { $options = array(); if ($this->nomunge) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/FilterManager.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/FilterManager.php index e2820d9..84e04f6 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/FilterManager.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/FilterManager.php @@ -22,15 +22,13 @@ class FilterManager { private $filters = array(); - public function set($alias, FilterInterface $filter) - { + public function set($alias, FilterInterface $filter) { $this->checkName($alias); $this->filters[$alias] = $filter; } - public function get($alias) - { + public function get($alias) { if (!isset($this->filters[$alias])) { throw new \InvalidArgumentException(sprintf('There is no "%s" filter.', $alias)); } @@ -38,13 +36,11 @@ class FilterManager return $this->filters[$alias]; } - public function has($alias) - { + public function has($alias) { return isset($this->filters[$alias]); } - public function getNames() - { + public function getNames() { return array_keys($this->filters); } @@ -55,8 +51,7 @@ class FilterManager * * @throws \InvalidArgumentException If the asset name is invalid */ - protected function checkName($name) - { + protected function checkName($name) { if (!ctype_alnum(str_replace('_', '', $name))) { throw new \InvalidArgumentException(sprintf('The name "%s" is invalid.', $name)); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/CssUtils.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/CssUtils.php index ebc44b0..d0b81c8 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/CssUtils.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/CssUtils.php @@ -18,24 +18,23 @@ namespace Assetic\Util; */ abstract class CssUtils { - const REGEX_URLS = '/url\((["\']?)(?P.*?)(\\1)\)/'; - const REGEX_IMPORTS = '/@import (?:url\()?(\'|"|)(?P[^\'"\)\n\r]*)\1\)?;?/'; + const REGEX_URLS = '/url\((["\']?)(?P.*?)(\\1)\)/'; + const REGEX_IMPORTS = '/@import (?:url\()?(\'|"|)(?P[^\'"\)\n\r]*)\1\)?;?/'; const REGEX_IMPORTS_NO_URLS = '/@import (?!url\()(\'|"|)(?P[^\'"\)\n\r]*)\1;?/'; - const REGEX_IE_FILTERS = '/src=(["\']?)(?P.*?)\\1/'; - const REGEX_COMMENTS = '/(\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)/'; + const REGEX_IE_FILTERS = '/src=(["\']?)(?P.*?)\\1/'; + const REGEX_COMMENTS = '/(\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)/'; /** * Filters all references -- url() and "@import" -- through a callable. * - * @param string $content The CSS + * @param string $content The CSS * @param callable $callback A PHP callable * * @return string The filtered CSS */ - public static function filterReferences($content, $callback) - { + public static function filterReferences($content, $callback) { $content = static::filterUrls($content, $callback); - $content = static::filterImports($content, $callback, false); + $content = static::filterImports($content, $callback, FALSE); $content = static::filterIEFilters($content, $callback); return $content; @@ -44,13 +43,12 @@ abstract class CssUtils /** * Filters all CSS url()'s through a callable. * - * @param string $content The CSS + * @param string $content The CSS * @param callable $callback A PHP callable * * @return string The filtered CSS */ - public static function filterUrls($content, $callback) - { + public static function filterUrls($content, $callback) { $pattern = static::REGEX_URLS; return static::filterCommentless($content, function ($part) use (& $callback, $pattern) { @@ -61,14 +59,13 @@ abstract class CssUtils /** * Filters all CSS imports through a callable. * - * @param string $content The CSS - * @param callable $callback A PHP callable - * @param Boolean $includeUrl Whether to include url() in the pattern + * @param string $content The CSS + * @param callable $callback A PHP callable + * @param Boolean $includeUrl Whether to include url() in the pattern * * @return string The filtered CSS */ - public static function filterImports($content, $callback, $includeUrl = true) - { + public static function filterImports($content, $callback, $includeUrl = TRUE) { $pattern = $includeUrl ? static::REGEX_IMPORTS : static::REGEX_IMPORTS_NO_URLS; return static::filterCommentless($content, function ($part) use (& $callback, $pattern) { @@ -79,13 +76,12 @@ abstract class CssUtils /** * Filters all IE filters (AlphaImageLoader filter) through a callable. * - * @param string $content The CSS + * @param string $content The CSS * @param callable $callback A PHP callable * * @return string The filtered CSS */ - public static function filterIEFilters($content, $callback) - { + public static function filterIEFilters($content, $callback) { $pattern = static::REGEX_IE_FILTERS; return static::filterCommentless($content, function ($part) use (& $callback, $pattern) { @@ -96,13 +92,12 @@ abstract class CssUtils /** * Filters each non-comment part through a callable. * - * @param string $content The CSS + * @param string $content The CSS * @param callable $callback A PHP callable * * @return string The filtered CSS */ - public static function filterCommentless($content, $callback) - { + public static function filterCommentless($content, $callback) { $result = ''; foreach (preg_split(static::REGEX_COMMENTS, $content, -1, PREG_SPLIT_DELIM_CAPTURE) as $part) { if (!preg_match(static::REGEX_COMMENTS, $part, $match) || $part != $match[0]) { @@ -122,8 +117,7 @@ abstract class CssUtils * * @return array An array of unique URLs */ - public static function extractImports($content) - { + public static function extractImports($content) { $imports = array(); static::filterImports($content, function ($matches) use (&$imports) { $imports[] = $matches['url']; @@ -132,7 +126,6 @@ abstract class CssUtils return array_unique(array_filter($imports)); } - final private function __construct() - { + final private function __construct() { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/FilesystemUtils.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/FilesystemUtils.php index 90e6512..a788dff 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/FilesystemUtils.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/FilesystemUtils.php @@ -21,8 +21,7 @@ class FilesystemUtils /** * Recursively removes a directory from the filesystem. */ - public static function removeDirectory($directory) - { + public static function removeDirectory($directory) { $inner = new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS); $outer = new \RecursiveIteratorIterator($inner, \RecursiveIteratorIterator::SELF_FIRST); @@ -57,9 +56,8 @@ class FilesystemUtils * * @return string The directory path */ - public static function createThrowAwayDirectory($prefix) - { - $directory = self::getTemporaryDirectory().DIRECTORY_SEPARATOR.uniqid('assetic_'.$prefix); + public static function createThrowAwayDirectory($prefix) { + $directory = self::getTemporaryDirectory() . DIRECTORY_SEPARATOR . uniqid('assetic_' . $prefix); mkdir($directory); return $directory; @@ -72,13 +70,11 @@ class FilesystemUtils * * @return string The file path */ - public static function createTemporaryFile($prefix) - { - return tempnam(self::getTemporaryDirectory(), 'assetic_'.$prefix); + public static function createTemporaryFile($prefix) { + return tempnam(self::getTemporaryDirectory(), 'assetic_' . $prefix); } - public static function getTemporaryDirectory() - { + public static function getTemporaryDirectory() { return realpath(sys_get_temp_dir()); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/LessUtils.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/LessUtils.php index 1b53f2b..e0de5a9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/LessUtils.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/LessUtils.php @@ -18,7 +18,7 @@ namespace Assetic\Util; */ abstract class LessUtils extends CssUtils { - const REGEX_IMPORTS = '/@import(?:-once)? (?:\([a-z]*\) )?(?:url\()?(\'|"|)(?P[^\'"\)\n\r]*)\1\)?;?/'; + const REGEX_IMPORTS = '/@import(?:-once)? (?:\([a-z]*\) )?(?:url\()?(\'|"|)(?P[^\'"\)\n\r]*)\1\)?;?/'; const REGEX_IMPORTS_NO_URLS = '/@import(?:-once)? (?:\([a-z]*\) )?(?!url\()(\'|"|)(?P[^\'"\)\n\r]*)\1;?/'; - const REGEX_COMMENTS = '/((?:\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)|\/\/[^\n]+)/'; + const REGEX_COMMENTS = '/((?:\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)|\/\/[^\n]+)/'; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/TraversableString.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/TraversableString.php index 400e97c..587f9c6 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/TraversableString.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/TraversableString.php @@ -21,24 +21,20 @@ class TraversableString implements \IteratorAggregate, \Countable private $one; private $many; - public function __construct($one, array $many) - { + public function __construct($one, array $many) { $this->one = $one; $this->many = $many; } - public function getIterator() - { + public function getIterator() { return new \ArrayIterator($this->many); } - public function count() - { + public function count() { return count($this->many); } - public function __toString() - { - return (string) $this->one; + public function __toString() { + return (string)$this->one; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/VarUtils.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/VarUtils.php index d9464c0..81c5cc9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/VarUtils.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/Assetic/Util/VarUtils.php @@ -22,18 +22,17 @@ abstract class VarUtils * Resolves variable placeholders. * * @param string $template A template string - * @param array $vars Variable names - * @param array $values Variable values + * @param array $vars Variable names + * @param array $values Variable values * * @return string The resolved string * * @throws \InvalidArgumentException If there is a variable with no value */ - public static function resolve($template, array $vars, array $values) - { + public static function resolve($template, array $vars, array $values) { $map = array(); foreach ($vars as $var) { - if (false === strpos($template, '{'.$var.'}')) { + if (FALSE === strpos($template, '{' . $var . '}')) { continue; } @@ -41,14 +40,13 @@ abstract class VarUtils throw new \InvalidArgumentException(sprintf('The template "%s" contains the variable "%s", but was not given any value for it.', $template, $var)); } - $map['{'.$var.'}'] = $values[$var]; + $map['{' . $var . '}'] = $values[$var]; } return strtr($template, $map); } - public static function getCombinations(array $vars, array $values) - { + public static function getCombinations(array $vars, array $values) { if (!$vars) { return array(array()); } @@ -56,7 +54,7 @@ abstract class VarUtils $combinations = array(); $nbValues = array(); foreach ($values as $var => $vals) { - if (!in_array($var, $vars, true)) { + if (!in_array($var, $vars, TRUE)) { continue; } @@ -78,7 +76,6 @@ abstract class VarUtils return $combinations; } - final private function __construct() - { + final private function __construct() { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/functions.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/functions.php index 2af5bde..3cab5a5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/functions.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/kriswallsmith/assetic/src/functions.php @@ -21,8 +21,7 @@ if (function_exists('assetic_init')) { * * @param AssetFactory $factory The asset factory */ -function assetic_init(AssetFactory $factory) -{ +function assetic_init(AssetFactory $factory) { global $_assetic; $_assetic = new stdClass(); @@ -32,14 +31,13 @@ function assetic_init(AssetFactory $factory) /** * Returns an array of javascript URLs. * - * @param array|string $inputs Input strings + * @param array|string $inputs Input strings * @param array|string $filters Filter names - * @param array $options An array of options + * @param array $options An array of options * * @return array An array of javascript URLs */ -function assetic_javascripts($inputs = array(), $filters = array(), array $options = array()) -{ +function assetic_javascripts($inputs = array(), $filters = array(), array $options = array()) { if (!isset($options['output'])) { $options['output'] = 'js/*.js'; } @@ -50,14 +48,13 @@ function assetic_javascripts($inputs = array(), $filters = array(), array $optio /** * Returns an array of stylesheet URLs. * - * @param array|string $inputs Input strings + * @param array|string $inputs Input strings * @param array|string $filters Filter names - * @param array $options An array of options + * @param array $options An array of options * * @return array An array of stylesheet URLs */ -function assetic_stylesheets($inputs = array(), $filters = array(), array $options = array()) -{ +function assetic_stylesheets($inputs = array(), $filters = array(), array $options = array()) { if (!isset($options['output'])) { $options['output'] = 'css/*.css'; } @@ -68,14 +65,13 @@ function assetic_stylesheets($inputs = array(), $filters = array(), array $optio /** * Returns an image URL. * - * @param string $input An input + * @param string $input An input * @param array|string $filters Filter names - * @param array $options An array of options + * @param array $options An array of options * * @return string An image URL */ -function assetic_image($input, $filters = array(), array $options = array()) -{ +function assetic_image($input, $filters = array(), array $options = array()) { if (!isset($options['output'])) { $options['output'] = 'images/*'; } @@ -88,14 +84,13 @@ function assetic_image($input, $filters = array(), array $options = array()) /** * Returns an array of asset urls. * - * @param array|string $inputs Input strings + * @param array|string $inputs Input strings * @param array|string $filters Filter names - * @param array $options An array of options + * @param array $options An array of options * * @return array An array of URLs */ -function _assetic_urls($inputs = array(), $filters = array(), array $options = array()) -{ +function _assetic_urls($inputs = array(), $filters = array(), array $options = array()) { global $_assetic; if (!is_array($inputs)) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/lmammino/jsmin4assetic/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/lmammino/jsmin4assetic/composer.json index d65325d..0d3c21c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/lmammino/jsmin4assetic/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/lmammino/jsmin4assetic/composer.json @@ -1,26 +1,28 @@ { - "name": "lmammino/jsmin4assetic", - "type": "library", - "description":"Library for minifying JavaScript files using jsmin with assetic and composer", - "license": "MIT", - "authors": [ - { - "name": "Douglas Crockford", - "homepage":"http://www.crockford.com" - }, - { - "name": "Bogdan Yurov", - "email":"bogdan@yurov.me" - }, - { - "name": "Luciano Mammino", - "email":"lmammino@oryzone.com" - } - ], - "require": { - "php":">=5.3" - }, - "autoload": { - "classmap": ["src/"] - } + "name": "lmammino/jsmin4assetic", + "type": "library", + "description": "Library for minifying JavaScript files using jsmin with assetic and composer", + "license": "MIT", + "authors": [ + { + "name": "Douglas Crockford", + "homepage": "http://www.crockford.com" + }, + { + "name": "Bogdan Yurov", + "email": "bogdan@yurov.me" + }, + { + "name": "Luciano Mammino", + "email": "lmammino@oryzone.com" + } + ], + "require": { + "php": ">=5.3" + }, + "autoload": { + "classmap": [ + "src/" + ] + } } \ No newline at end of file diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/lmammino/jsmin4assetic/src/JSMin.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/lmammino/jsmin4assetic/src/JSMin.php index a825229..1314e51 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/lmammino/jsmin4assetic/src/JSMin.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/lmammino/jsmin4assetic/src/JSMin.php @@ -1,4 +1,5 @@ min(); - } + /** + * Minify Javascript. + * + * @param string $js Javascript to be minified + * + * @return string + */ + public static function minify($js) { + $jsmin = new static($js); + return $jsmin->min(); + } - /** - * @param string $input - */ - public function __construct($input) { - $this->input = $input; - } + /** + * @param string $input + */ + public function __construct($input) { + $this->input = $input; + } - /** - * Perform minification, return result - * - * @return string - */ - public function min() { - if ($this->output !== '') { // min already run - return $this->output; - } + /** + * Perform minification, return result + * + * @return string + */ + public function min() { + if ($this->output !== '') { // min already run + return $this->output; + } - $mbIntEnc = null; - if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) { - $mbIntEnc = mb_internal_encoding(); - mb_internal_encoding('8bit'); - } - $this->input = str_replace("\r\n", "\n", $this->input); - $this->inputLength = strlen($this->input); + $mbIntEnc = NULL; + if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) { + $mbIntEnc = mb_internal_encoding(); + mb_internal_encoding('8bit'); + } + $this->input = str_replace("\r\n", "\n", $this->input); + $this->inputLength = strlen($this->input); - $this->action(self::ACTION_DELETE_A_B); + $this->action(self::ACTION_DELETE_A_B); - while ($this->a !== null) { - // determine next command - $command = self::ACTION_KEEP_A; // default - if ($this->a === ' ') { - if (($this->lastByteOut === '+' || $this->lastByteOut === '-') - && ($this->b === $this->lastByteOut) - ) { - // Don't delete this space. If we do, the addition/subtraction - // could be parsed as a post-increment - } elseif (!$this->isAlphaNum($this->b)) { - $command = self::ACTION_DELETE_A; - } - } elseif ($this->a === "\n") { - if ($this->b === ' ') { - $command = self::ACTION_DELETE_A_B; - // in case of mbstring.func_overload & 2, must check for null b, - // otherwise mb_strpos will give WARNING - } elseif ($this->b === null - || (false === strpos('{[(+-', $this->b) - && !$this->isAlphaNum($this->b)) - ) { - $command = self::ACTION_DELETE_A; - } - } elseif (!$this->isAlphaNum($this->a)) { - if ($this->b === ' ' - || ($this->b === "\n" - && (false === strpos('}])+-"\'', $this->a))) - ) { - $command = self::ACTION_DELETE_A_B; - } - } - $this->action($command); - } - $this->output = trim($this->output); + while ($this->a !== NULL) { + // determine next command + $command = self::ACTION_KEEP_A; // default + if ($this->a === ' ') { + if (($this->lastByteOut === '+' || $this->lastByteOut === '-') + && ($this->b === $this->lastByteOut) + ) { + // Don't delete this space. If we do, the addition/subtraction + // could be parsed as a post-increment + } else if (!$this->isAlphaNum($this->b)) { + $command = self::ACTION_DELETE_A; + } + } else if ($this->a === "\n") { + if ($this->b === ' ') { + $command = self::ACTION_DELETE_A_B; + // in case of mbstring.func_overload & 2, must check for null b, + // otherwise mb_strpos will give WARNING + } else if ($this->b === NULL + || (FALSE === strpos('{[(+-', $this->b) + && !$this->isAlphaNum($this->b)) + ) { + $command = self::ACTION_DELETE_A; + } + } else if (!$this->isAlphaNum($this->a)) { + if ($this->b === ' ' + || ($this->b === "\n" + && (FALSE === strpos('}])+-"\'', $this->a))) + ) { + $command = self::ACTION_DELETE_A_B; + } + } + $this->action($command); + } + $this->output = trim($this->output); - if ($mbIntEnc !== null) { - mb_internal_encoding($mbIntEnc); - } - return $this->output; - } + if ($mbIntEnc !== NULL) { + mb_internal_encoding($mbIntEnc); + } + return $this->output; + } - /** - * ACTION_KEEP_A = Output A. Copy B to A. Get the next B. - * ACTION_DELETE_A = Copy B to A. Get the next B. - * ACTION_DELETE_A_B = Get the next B. - * - * @param int $command - * @throws JSMinUnterminatedRegExpException|JSMinUnterminatedStringException - */ - protected function action($command) { - if ($command === self::ACTION_DELETE_A_B - && $this->b === ' ' - && ($this->a === '+' || $this->a === '-') - ) { - // Note: we're at an addition/substraction operator; the inputIndex - // will certainly be a valid index - if ($this->input[$this->inputIndex] === $this->a) { - // This is "+ +" or "- -". Don't delete the space. - $command = self::ACTION_KEEP_A; - } - } - switch ($command) { - case self::ACTION_KEEP_A: - $this->output .= $this->a; - $this->lastByteOut = $this->a; + /** + * ACTION_KEEP_A = Output A. Copy B to A. Get the next B. + * ACTION_DELETE_A = Copy B to A. Get the next B. + * ACTION_DELETE_A_B = Get the next B. + * + * @param int $command + * @throws JSMinUnterminatedRegExpException|JSMinUnterminatedStringException + */ + protected function action($command) { + if ($command === self::ACTION_DELETE_A_B + && $this->b === ' ' + && ($this->a === '+' || $this->a === '-') + ) { + // Note: we're at an addition/substraction operator; the inputIndex + // will certainly be a valid index + if ($this->input[$this->inputIndex] === $this->a) { + // This is "+ +" or "- -". Don't delete the space. + $command = self::ACTION_KEEP_A; + } + } + switch ($command) { + case self::ACTION_KEEP_A: + $this->output .= $this->a; + $this->lastByteOut = $this->a; - // fallthrough - case self::ACTION_DELETE_A: - $this->a = $this->b; - if ($this->a === "'" || $this->a === '"') { // string literal - $str = $this->a; // in case needed for exception - while (true) { - $this->output .= $this->a; - $this->lastByteOut = $this->a; + // fallthrough + case self::ACTION_DELETE_A: + $this->a = $this->b; + if ($this->a === "'" || $this->a === '"') { // string literal + $str = $this->a; // in case needed for exception + while (TRUE) { + $this->output .= $this->a; + $this->lastByteOut = $this->a; - $this->a = $this->get(); - if ($this->a === $this->b) { // end quote - break; - } - if (ord($this->a) <= self::ORD_LF) { - throw new JSMinUnterminatedStringException( - "JSMin: Unterminated String at byte " - . $this->inputIndex . ": {$str}"); - } - $str .= $this->a; - if ($this->a === '\\') { - $this->output .= $this->a; - $this->lastByteOut = $this->a; + $this->a = $this->get(); + if ($this->a === $this->b) { // end quote + break; + } + if (ord($this->a) <= self::ORD_LF) { + throw new JSMinUnterminatedStringException( + "JSMin: Unterminated String at byte " + . $this->inputIndex . ": {$str}"); + } + $str .= $this->a; + if ($this->a === '\\') { + $this->output .= $this->a; + $this->lastByteOut = $this->a; - $this->a = $this->get(); - $str .= $this->a; - } - } - } - // fallthrough - case self::ACTION_DELETE_A_B: - $this->b = $this->next(); - if ($this->b === '/' && $this->isRegexpLiteral()) { // RegExp literal - $this->output .= $this->a . $this->b; - $pattern = '/'; // in case needed for exception - while (true) { - $this->a = $this->get(); - $pattern .= $this->a; - if ($this->a === '/') { // end pattern - break; // while (true) - } elseif ($this->a === '\\') { - $this->output .= $this->a; - $this->a = $this->get(); - $pattern .= $this->a; - } elseif (ord($this->a) <= self::ORD_LF) { - throw new JSMinUnterminatedRegExpException( - "JSMin: Unterminated RegExp at byte " - . $this->inputIndex . ": {$pattern}"); - } - $this->output .= $this->a; - $this->lastByteOut = $this->a; - } - $this->b = $this->next(); - } - // end case ACTION_DELETE_A_B - } - } + $this->a = $this->get(); + $str .= $this->a; + } + } + } + // fallthrough + case self::ACTION_DELETE_A_B: + $this->b = $this->next(); + if ($this->b === '/' && $this->isRegexpLiteral()) { // RegExp literal + $this->output .= $this->a . $this->b; + $pattern = '/'; // in case needed for exception + while (TRUE) { + $this->a = $this->get(); + $pattern .= $this->a; + if ($this->a === '/') { // end pattern + break; // while (true) + } else if ($this->a === '\\') { + $this->output .= $this->a; + $this->a = $this->get(); + $pattern .= $this->a; + } else if (ord($this->a) <= self::ORD_LF) { + throw new JSMinUnterminatedRegExpException( + "JSMin: Unterminated RegExp at byte " + . $this->inputIndex . ": {$pattern}"); + } + $this->output .= $this->a; + $this->lastByteOut = $this->a; + } + $this->b = $this->next(); + } + // end case ACTION_DELETE_A_B + } + } - /** - * @return bool - */ - protected function isRegexpLiteral() { - if (false !== strpos("\n{;(,=:[!&|?", $this->a)) { // we aren't dividing - return true; - } - if (' ' === $this->a) { - $length = strlen($this->output); - if ($length < 2) { // weird edge case - return true; - } - // you can't divide a keyword - if (preg_match('/(?:case|else|in|return|typeof)$/', $this->output, $m)) { - if ($this->output === $m[0]) { // odd but could happen - return true; - } - // make sure it's a keyword, not end of an identifier - $charBeforeKeyword = substr($this->output, $length - strlen($m[0]) - 1, 1); - if (!$this->isAlphaNum($charBeforeKeyword)) { - return true; - } - } - } - return false; - } + /** + * @return bool + */ + protected function isRegexpLiteral() { + if (FALSE !== strpos("\n{;(,=:[!&|?", $this->a)) { // we aren't dividing + return TRUE; + } + if (' ' === $this->a) { + $length = strlen($this->output); + if ($length < 2) { // weird edge case + return TRUE; + } + // you can't divide a keyword + if (preg_match('/(?:case|else|in|return|typeof)$/', $this->output, $m)) { + if ($this->output === $m[0]) { // odd but could happen + return TRUE; + } + // make sure it's a keyword, not end of an identifier + $charBeforeKeyword = substr($this->output, $length - strlen($m[0]) - 1, 1); + if (!$this->isAlphaNum($charBeforeKeyword)) { + return TRUE; + } + } + } + return FALSE; + } - /** - * Get next char. Convert ctrl char to space. - * - * @return string - */ - protected function get() { - $c = $this->lookAhead; - $this->lookAhead = null; - if ($c === null) { - if ($this->inputIndex < $this->inputLength) { - $c = $this->input[$this->inputIndex]; - $this->inputIndex += 1; - } else { - return null; - } - } - if ($c === "\r" || $c === "\n") { - return "\n"; - } - if (ord($c) < self::ORD_SPACE) { // control char - return ' '; - } - return $c; - } + /** + * Get next char. Convert ctrl char to space. + * + * @return string + */ + protected function get() { + $c = $this->lookAhead; + $this->lookAhead = NULL; + if ($c === NULL) { + if ($this->inputIndex < $this->inputLength) { + $c = $this->input[$this->inputIndex]; + $this->inputIndex += 1; + } else { + return NULL; + } + } + if ($c === "\r" || $c === "\n") { + return "\n"; + } + if (ord($c) < self::ORD_SPACE) { // control char + return ' '; + } + return $c; + } - /** - * Get next char. If is ctrl character, translate to a space or newline. - * - * @return string - */ - protected function peek() { - $this->lookAhead = $this->get(); - return $this->lookAhead; - } + /** + * Get next char. If is ctrl character, translate to a space or newline. + * + * @return string + */ + protected function peek() { + $this->lookAhead = $this->get(); + return $this->lookAhead; + } - /** - * Is $c a letter, digit, underscore, dollar sign, escape, or non-ASCII? - * - * @param string $c - * - * @return bool - */ - protected function isAlphaNum($c) { - return (preg_match('/^[0-9a-zA-Z_\\$\\\\]$/', $c) || ord($c) > 126); - } + /** + * Is $c a letter, digit, underscore, dollar sign, escape, or non-ASCII? + * + * @param string $c + * + * @return bool + */ + protected function isAlphaNum($c) { + return (preg_match('/^[0-9a-zA-Z_\\$\\\\]$/', $c) || ord($c) > 126); + } - /** - * @return string - */ - protected function singleLineComment() { - $comment = ''; - while (true) { - $get = $this->get(); - $comment .= $get; - if (ord($get) <= self::ORD_LF) { // EOL reached - // if IE conditional comment - if (preg_match('/^\\/@(?:cc_on|if|elif|else|end)\\b/', $comment)) { - return "/{$comment}"; - } - return $get; - } - } - } + /** + * @return string + */ + protected function singleLineComment() { + $comment = ''; + while (TRUE) { + $get = $this->get(); + $comment .= $get; + if (ord($get) <= self::ORD_LF) { // EOL reached + // if IE conditional comment + if (preg_match('/^\\/@(?:cc_on|if|elif|else|end)\\b/', $comment)) { + return "/{$comment}"; + } + return $get; + } + } + } - /** - * @return string - * @throws JSMinUnterminatedCommentException - */ - protected function multipleLineComment() { - $this->get(); - $comment = ''; - while (true) { - $get = $this->get(); - if ($get === '*') { - if ($this->peek() === '/') { // end of comment reached - $this->get(); - // if comment preserved by YUI Compressor - if (0 === strpos($comment, '!')) { - return "\n/*!" . substr($comment, 1) . "*/\n"; - } - // if IE conditional comment - if (preg_match('/^@(?:cc_on|if|elif|else|end)\\b/', $comment)) { - return "/*{$comment}*/"; - } - return ' '; - } - } elseif ($get === null) { - throw new JSMinUnterminatedCommentException( - "JSMin: Unterminated comment at byte " - . $this->inputIndex . ": /*{$comment}"); - } - $comment .= $get; - } - } + /** + * @return string + * @throws JSMinUnterminatedCommentException + */ + protected function multipleLineComment() { + $this->get(); + $comment = ''; + while (TRUE) { + $get = $this->get(); + if ($get === '*') { + if ($this->peek() === '/') { // end of comment reached + $this->get(); + // if comment preserved by YUI Compressor + if (0 === strpos($comment, '!')) { + return "\n/*!" . substr($comment, 1) . "*/\n"; + } + // if IE conditional comment + if (preg_match('/^@(?:cc_on|if|elif|else|end)\\b/', $comment)) { + return "/*{$comment}*/"; + } + return ' '; + } + } else if ($get === NULL) { + throw new JSMinUnterminatedCommentException( + "JSMin: Unterminated comment at byte " + . $this->inputIndex . ": /*{$comment}"); + } + $comment .= $get; + } + } - /** - * Get the next character, skipping over comments. - * Some comments may be preserved. - * - * @return string - */ - protected function next() { - $get = $this->get(); - if ($get !== '/') { - return $get; - } - switch ($this->peek()) { - case '/': - return $this->singleLineComment(); - case '*': - return $this->multipleLineComment(); - default: - return $get; - } - } + /** + * Get the next character, skipping over comments. + * Some comments may be preserved. + * + * @return string + */ + protected function next() { + $get = $this->get(); + if ($get !== '/') { + return $get; + } + switch ($this->peek()) { + case '/': + return $this->singleLineComment(); + case '*': + return $this->multipleLineComment(); + default: + return $get; + } + } } \ No newline at end of file diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/lmammino/jsmin4assetic/src/JSMinUnterminatedCommentException.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/lmammino/jsmin4assetic/src/JSMinUnterminatedCommentException.php index 7ffc3b2..02cf316 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/lmammino/jsmin4assetic/src/JSMinUnterminatedCommentException.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/lmammino/jsmin4assetic/src/JSMinUnterminatedCommentException.php @@ -1,5 +1,6 @@ =5.3.0", - "ext-pcre": "*", - "matthiasmullie/path-converter": "~1.1" - }, - "require-dev": { - "matthiasmullie/scrapbook": "~1.0", - "phpunit/phpunit": "~4.8", - "friendsofphp/php-cs-fixer": "~2.0" - }, - "suggest": { - "psr/cache-implementation": "Cache implementation to use with Minify::cache" - }, - "autoload": { - "psr-4": { - "MatthiasMullie\\Minify\\": "src/" - } - }, - "bin": [ - "bin/minifycss", - "bin/minifyjs" - ] + "name": "matthiasmullie/minify", + "type": "library", + "description": "CSS & JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.", + "keywords": [ + "minify", + "minifier", + "css", + "js", + "javascript" + ], + "homepage": "http://www.minifier.org", + "license": "MIT", + "authors": [ + { + "name": "Matthias Mullie", + "homepage": "http://www.mullie.eu", + "email": "minify@mullie.eu", + "role": "Developer" + } + ], + "require": { + "php": ">=5.3.0", + "ext-pcre": "*", + "matthiasmullie/path-converter": "~1.1" + }, + "require-dev": { + "matthiasmullie/scrapbook": "~1.0", + "phpunit/phpunit": "~4.8", + "friendsofphp/php-cs-fixer": "~2.0" + }, + "suggest": { + "psr/cache-implementation": "Cache implementation to use with Minify::cache" + }, + "autoload": { + "psr-4": { + "MatthiasMullie\\Minify\\": "src/" + } + }, + "bin": [ + "bin/minifycss", + "bin/minifyjs" + ] } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/CSS.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/CSS.php index 742f043..b613322 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/CSS.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/CSS.php @@ -59,8 +59,7 @@ class CSS extends Minify * * @param int $size Size in kB */ - public function setMaxImportSize($size) - { + public function setMaxImportSize($size) { $this->maxImportSize = $size; } @@ -72,8 +71,7 @@ class CSS extends Minify * * @param string[] $extensions Array of file extensions */ - public function setImportExtensions(array $extensions) - { + public function setImportExtensions(array $extensions) { $this->importExtensions = $extensions; } @@ -84,8 +82,7 @@ class CSS extends Minify * * @return string */ - protected function moveImportsToTop($content) - { + protected function moveImportsToTop($content) { if (preg_match_all('/(;?)(@import (?url\()?(?P["\']?).+?(?P=quotes)(?(url)\)))/', $content, $matches)) { // remove from content foreach ($matches[0] as $import) { @@ -93,7 +90,7 @@ class CSS extends Minify } // add to top - $content = implode(';', $matches[2]).';'.trim($content, ';'); + $content = implode(';', $matches[2]) . ';' . trim($content, ';'); } return $content; @@ -105,16 +102,15 @@ class CSS extends Minify * @import's will be loaded and their content merged into the original file, * to save HTTP requests. * - * @param string $source The file to combine imports for - * @param string $content The CSS content to combine imports for + * @param string $source The file to combine imports for + * @param string $content The CSS content to combine imports for * @param string[] $parents Parent paths, for circular reference checks * * @return string * * @throws FileImportException */ - protected function combineImports($source, $content, $parents) - { + protected function combineImports($source, $content, $parents) { $importRegexes = array( // @import url(xxx) '/ @@ -200,7 +196,7 @@ class CSS extends Minify // loop the matches foreach ($matches as $match) { // get the path for the file that will be imported - $importPath = dirname($source).'/'.$match['path']; + $importPath = dirname($source) . '/' . $match['path']; // only replace the import with the content if we can grab the // content of the file @@ -211,7 +207,7 @@ class CSS extends Minify // check if current file was not imported previously in the same // import chain. if (in_array($importPath, $parents)) { - throw new FileImportException('Failed to import file "'.$importPath.'": circular reference detected.'); + throw new FileImportException('Failed to import file "' . $importPath . '": circular reference detected.'); } // grab referenced file & minify it (which may include importing @@ -221,7 +217,7 @@ class CSS extends Minify // check if this is only valid for certain media if (!empty($match['media'])) { - $importContent = '@media '.$match['media'].'{'.$importContent.'}'; + $importContent = '@media ' . $match['media'] . '{' . $importContent . '}'; } // add to replacement array @@ -239,13 +235,12 @@ class CSS extends Minify * @url(image.jpg) images will be loaded and their content merged into the * original file, to save HTTP requests. * - * @param string $source The file to import files for + * @param string $source The file to import files for * @param string $content The CSS content to import files for * * @return string */ - protected function importFiles($source, $content) - { + protected function importFiles($source, $content) { $regex = '/url\((["\']?)(.+?)\\1\)/i'; if ($this->importExtensions && preg_match_all($regex, $content, $matches, PREG_SET_ORDER)) { $search = array(); @@ -260,7 +255,7 @@ class CSS extends Minify // get the path for the file that will be imported $path = $match[2]; - $path = dirname($source).'/'.$path; + $path = dirname($source) . '/' . $path; // only replace the import with the content if we're able to get // the content of the file, and it's relatively small @@ -271,7 +266,7 @@ class CSS extends Minify // build replacement $search[] = $match[0]; - $replace[] = 'url('.$this->importExtensions[$extension].';base64,'.$importContent.')'; + $replace[] = 'url(' . $this->importExtensions[$extension] . ';base64,' . $importContent . ')'; } } @@ -287,12 +282,11 @@ class CSS extends Minify * Perform CSS optimizations. * * @param string[optional] $path Path to write the data to - * @param string[] $parents Parent paths, for circular reference checks + * @param string[] $parents Parent paths, for circular reference checks * * @return string The minified data */ - public function execute($path = null, $parents = array()) - { + public function execute($path = NULL, $parents = array()) { $content = ''; // loop CSS data (raw data and files) @@ -347,12 +341,11 @@ class CSS extends Minify * (e.g. ../../images/image.gif, if the new CSS file is 1 folder deeper). * * @param ConverterInterface $converter Relative path converter - * @param string $content The CSS content to update relative urls for + * @param string $content The CSS content to update relative urls for * * @return string */ - protected function move(ConverterInterface $converter, $content) - { + protected function move(ConverterInterface $converter, $content) { /* * Relative path references will usually be enclosed by url(). @import * is an exception, where url() is not necessary around the path (but is @@ -461,9 +454,9 @@ class CSS extends Minify // build replacement $search[] = $match[0]; if ($type === 'url') { - $replace[] = 'url('.$url.')'; - } elseif ($type === 'import') { - $replace[] = '@import "'.$url.'"'; + $replace[] = 'url(' . $url . ')'; + } else if ($type === 'import') { + $replace[] = '@import "' . $url . '"'; } } @@ -479,8 +472,7 @@ class CSS extends Minify * * @return string */ - protected function shortenHex($content) - { + protected function shortenHex($content) { $content = preg_replace('/(?<=[: ])#([0-9a-z])\\1([0-9a-z])\\2([0-9a-z])\\3(?=[; }])/i', '#$1$2$3', $content); // we can shorten some even more by replacing them with their color name @@ -515,7 +507,7 @@ class CSS extends Minify ); return preg_replace_callback( - '/(?<=[: ])('.implode(array_keys($colors), '|').')(?=[; }])/i', + '/(?<=[: ])(' . implode(array_keys($colors), '|') . ')(?=[; }])/i', function ($match) use ($colors) { return $colors[strtoupper($match[0])]; }, @@ -530,18 +522,17 @@ class CSS extends Minify * * @return string */ - protected function shortenFontWeights($content) - { + protected function shortenFontWeights($content) { $weights = array( 'normal' => 400, 'bold' => 700, ); $callback = function ($match) use ($weights) { - return $match[1].$weights[$match[2]]; + return $match[1] . $weights[$match[2]]; }; - return preg_replace_callback('/(font-weight\s*:\s*)('.implode('|', array_keys($weights)).')(?=[;}])/', $callback, $content); + return preg_replace_callback('/(font-weight\s*:\s*)(' . implode('|', array_keys($weights)) . ')(?=[;}])/', $callback, $content); } /** @@ -551,8 +542,7 @@ class CSS extends Minify * * @return string */ - protected function shortenZeroes($content) - { + protected function shortenZeroes($content) { // we don't want to strip units in `calc()` expressions: // `5px - 0px` is valid, but `5px - 0` is not // `10px * 0` is valid (equates to 0), and so is `10 * 0px`, but @@ -577,19 +567,19 @@ class CSS extends Minify // practice, Webkit (especially Safari) seems to stumble over at least // 0%, potentially other units as well. Only stripping 'px' for now. // @see https://github.com/matthiasmullie/minify/issues/60 - $content = preg_replace('/'.$before.'(-?0*(\.0+)?)(?<=0)px'.$after.'/', '\\1', $content); + $content = preg_replace('/' . $before . '(-?0*(\.0+)?)(?<=0)px' . $after . '/', '\\1', $content); // strip 0-digits (.0 -> 0) - $content = preg_replace('/'.$before.'\.0+'.$units.'?'.$after.'/', '0\\1', $content); + $content = preg_replace('/' . $before . '\.0+' . $units . '?' . $after . '/', '0\\1', $content); // strip trailing 0: 50.10 -> 50.1, 50.10px -> 50.1px - $content = preg_replace('/'.$before.'(-?[0-9]+\.[0-9]+)0+'.$units.'?'.$after.'/', '\\1\\2', $content); + $content = preg_replace('/' . $before . '(-?[0-9]+\.[0-9]+)0+' . $units . '?' . $after . '/', '\\1\\2', $content); // strip trailing 0: 50.00 -> 50, 50.00px -> 50px - $content = preg_replace('/'.$before.'(-?[0-9]+)\.0+'.$units.'?'.$after.'/', '\\1\\2', $content); + $content = preg_replace('/' . $before . '(-?[0-9]+)\.0+' . $units . '?' . $after . '/', '\\1\\2', $content); // strip leading 0: 0.1 -> .1, 01.1 -> 1.1 - $content = preg_replace('/'.$before.'(-?)0+([0-9]*\.[0-9]+)'.$units.'?'.$after.'/', '\\1\\2\\3', $content); + $content = preg_replace('/' . $before . '(-?)0+([0-9]*\.[0-9]+)' . $units . '?' . $after . '/', '\\1\\2\\3', $content); // strip negative zeroes (-0 -> 0) & truncate zeroes (00 -> 0) - $content = preg_replace('/'.$before.'-?0+'.$units.'?'.$after.'/', '0\\1', $content); + $content = preg_replace('/' . $before . '-?0+' . $units . '?' . $after . '/', '0\\1', $content); // IE doesn't seem to understand a unitless flex-basis value (correct - // it goes against the spec), so let's add it in again (make it `%`, @@ -611,8 +601,7 @@ class CSS extends Minify * * @return string */ - protected function stripEmptyTags($content) - { + protected function stripEmptyTags($content) { $content = preg_replace('/(?<=^)[^\{\};]+\{\s*\}/', '', $content); $content = preg_replace('/(?<=(\}|;))[^\{\};]+\{\s*\}/', '', $content); @@ -622,8 +611,7 @@ class CSS extends Minify /** * Strip comments from source code. */ - protected function stripComments() - { + protected function stripComments() { $this->registerPattern('/\/\*.*?\*\//s', ''); } @@ -634,8 +622,7 @@ class CSS extends Minify * * @return string */ - protected function stripWhitespace($content) - { + protected function stripWhitespace($content) { // remove leading & trailing whitespace $content = preg_replace('/^\s*/m', '', $content); $content = preg_replace('/\s*$/m', '', $content); @@ -655,7 +642,7 @@ class CSS extends Minify // not in things like `calc(3px + 2px)`, shorthands like `3px -2px`, or // selectors like `div.weird- p` $pseudos = array('nth-child', 'nth-last-child', 'nth-last-of-type', 'nth-of-type'); - $content = preg_replace('/:('.implode('|', $pseudos).')\(\s*([+-]?)\s*(.+?)\s*([+-]?)\s*(.*?)\s*\)/', ':$1($2$3$4$5)', $content); + $content = preg_replace('/:(' . implode('|', $pseudos) . ')\(\s*([+-]?)\s*(.+?)\s*([+-]?)\s*(.*?)\s*\)/', ':$1($2$3$4$5)', $content); // remove semicolon/whitespace followed by closing bracket $content = str_replace(';}', '}', $content); @@ -670,8 +657,7 @@ class CSS extends Minify * * @return string[] */ - protected function findCalcs($content) - { + protected function findCalcs($content) { $results = array(); preg_match_all('/calc(\(.+?)(?=$|;|calc\()/', $content, $matches, PREG_SET_ORDER); @@ -685,12 +671,12 @@ class CSS extends Minify $expr .= $char; if ($char === '(') { $opened++; - } elseif ($char === ')' && --$opened === 0) { + } else if ($char === ')' && --$opened === 0) { break; } } - $results['calc('.count($results).')'] = 'calc'.$expr; + $results['calc(' . count($results) . ')'] = 'calc' . $expr; } return $results; @@ -703,8 +689,7 @@ class CSS extends Minify * * @return bool */ - protected function canImportBySize($path) - { + protected function canImportBySize($path) { return ($size = @filesize($path)) && $size <= $this->maxImportSize * 1024; } @@ -715,8 +700,7 @@ class CSS extends Minify * * @return bool */ - protected function canImportByPath($path) - { + protected function canImportByPath($path) { return preg_match('/^(data:|https?:|\\/)/', $path) === 0; } @@ -729,8 +713,7 @@ class CSS extends Minify * * @return ConverterInterface */ - protected function getPathConverter($source, $target) - { + protected function getPathConverter($source, $target) { return new Converter($source, $target); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/Exception.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/Exception.php index d03898f..8670fc4 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/Exception.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/Exception.php @@ -6,6 +6,7 @@ * * @author Matthias Mullie */ + namespace MatthiasMullie\Minify; /** diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/Exceptions/BasicException.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/Exceptions/BasicException.php index af5e81b..2b64584 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/Exceptions/BasicException.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/Exceptions/BasicException.php @@ -8,6 +8,7 @@ * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved * @license MIT License */ + namespace MatthiasMullie\Minify\Exceptions; use MatthiasMullie\Minify\Exception; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/Exceptions/FileImportException.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/Exceptions/FileImportException.php index 912a2c9..8965b5b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/Exceptions/FileImportException.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/Exceptions/FileImportException.php @@ -8,6 +8,7 @@ * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved * @license MIT License */ + namespace MatthiasMullie\Minify\Exceptions; /** diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/Exceptions/IOException.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/Exceptions/IOException.php index b172eb4..4bcb065 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/Exceptions/IOException.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/Exceptions/IOException.php @@ -8,6 +8,7 @@ * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved * @license MIT License */ + namespace MatthiasMullie\Minify\Exceptions; /** diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/JS.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/JS.php index 651d8be..493601f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/JS.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/minify/src/JS.php @@ -8,6 +8,7 @@ * @copyright Copyright (c) 2012, Matthias Mullie. All rights reserved * @license MIT License */ + namespace MatthiasMullie\Minify; /** @@ -122,18 +123,17 @@ class JS extends Minify /** * {@inheritdoc} */ - public function __construct() - { + public function __construct() { call_user_func_array(array('parent', '__construct'), func_get_args()); - $dataDir = __DIR__.'/../data/js/'; + $dataDir = __DIR__ . '/../data/js/'; $options = FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES; - $this->keywordsReserved = file($dataDir.'keywords_reserved.txt', $options); - $this->keywordsBefore = file($dataDir.'keywords_before.txt', $options); - $this->keywordsAfter = file($dataDir.'keywords_after.txt', $options); - $this->operators = file($dataDir.'operators.txt', $options); - $this->operatorsBefore = file($dataDir.'operators_before.txt', $options); - $this->operatorsAfter = file($dataDir.'operators_after.txt', $options); + $this->keywordsReserved = file($dataDir . 'keywords_reserved.txt', $options); + $this->keywordsBefore = file($dataDir . 'keywords_before.txt', $options); + $this->keywordsAfter = file($dataDir . 'keywords_after.txt', $options); + $this->operators = file($dataDir . 'operators.txt', $options); + $this->operatorsBefore = file($dataDir . 'operators_before.txt', $options); + $this->operatorsAfter = file($dataDir . 'operators_after.txt', $options); } /** @@ -144,8 +144,7 @@ class JS extends Minify * * @return string The minified data */ - public function execute($path = null) - { + public function execute($path = NULL) { $content = ''; /* @@ -174,12 +173,12 @@ class JS extends Minify $js = $this->stripWhitespace($js); // combine js: separating the scripts by a ; - $content .= $js.";"; + $content .= $js . ";"; } // clean up leftover `;`s from the combination of multiple scripts $content = ltrim($content, ';'); - $content = (string) substr($content, 0, -1); + $content = (string)substr($content, 0, -1); /* * Earlier, we extracted strings & regular expressions and replaced them @@ -193,8 +192,7 @@ class JS extends Minify /** * Strip comments from source code. */ - protected function stripComments() - { + protected function stripComments() { // single-line comments $this->registerPattern('/\/\/.*$/m', ''); @@ -219,13 +217,12 @@ class JS extends Minify * $this->extracted and after doing all other minifying, we can restore the * original content via restoreRegex() */ - protected function extractRegex() - { + protected function extractRegex() { // PHP only supports $this inside anonymous functions since 5.4 $minifier = $this; $callback = function ($match) use ($minifier) { $count = count($minifier->extracted); - $placeholder = '"'.$count.'"'; + $placeholder = '"' . $count . '"'; $minifier->extracted[$placeholder] = $match[0]; return $placeholder; @@ -243,8 +240,8 @@ class JS extends Minify // a regular expression can only be followed by a few operators or some // of the RegExp methods (a `\` followed by a variable or value is // likely part of a division, not a regex) - $keywords = array('do', 'in', 'new', 'else', 'throw', 'yield', 'delete', 'return', 'typeof'); - $before = '([=:,;\+\-\*\/\}\(\{\[&\|!]|^|'.implode('|', $keywords).')\s*'; + $keywords = array('do', 'in', 'new', 'else', 'throw', 'yield', 'delete', 'return', 'typeof'); + $before = '([=:,;\+\-\*\/\}\(\{\[&\|!]|^|' . implode('|', $keywords) . ')\s*'; $propertiesAndMethods = array( // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#Properties_2 'constructor', @@ -264,8 +261,8 @@ class JS extends Minify ); $delimiters = array_fill(0, count($propertiesAndMethods), '/'); $propertiesAndMethods = array_map('preg_quote', $propertiesAndMethods, $delimiters); - $after = '(?=\s*[\.,;\)\}&\|+]|\/\/|$|\.('.implode('|', $propertiesAndMethods).'))'; - $this->registerPattern('/'.$before.'\K'.$pattern.$after.'/', $callback); + $after = '(?=\s*[\.,;\)\}&\|+]|\/\/|$|\.(' . implode('|', $propertiesAndMethods) . '))'; + $this->registerPattern('/' . $before . '\K' . $pattern . $after . '/', $callback); // regular expressions following a `)` are rather annoying to detect... // quite often, `/` after `)` is a division operator & if it happens to @@ -279,8 +276,8 @@ class JS extends Minify // if a regex following `)` is not followed by `.`, // it's quite likely not a regex $before = '\)\s*'; - $after = '(?=\s*\.('.implode('|', $propertiesAndMethods).'))'; - $this->registerPattern('/'.$before.'\K'.$pattern.$after.'/', $callback); + $after = '(?=\s*\.(' . implode('|', $propertiesAndMethods) . '))'; + $this->registerPattern('/' . $before . '\K' . $pattern . $after . '/', $callback); // 1 more edge case: a regex can be followed by a lot more operators or // keywords if there's a newline (ASI) in between, where the operator @@ -288,8 +285,8 @@ class JS extends Minify // (https://github.com/matthiasmullie/minify/issues/56) $operators = $this->getOperatorsForRegex($this->operatorsBefore, '/'); $operators += $this->getOperatorsForRegex($this->keywordsReserved, '/'); - $after = '(?=\s*\n\s*('.implode('|', $operators).'))'; - $this->registerPattern('/'.$pattern.$after.'/', $callback); + $after = '(?=\s*\n\s*(' . implode('|', $operators) . '))'; + $this->registerPattern('/' . $pattern . $after . '/', $callback); } /** @@ -308,8 +305,7 @@ class JS extends Minify * * @return string */ - protected function stripWhitespace($content) - { + protected function stripWhitespace($content) { // uniform line endings, make them all line feed $content = str_replace(array("\r\n", "\r"), "\n", $content); @@ -333,8 +329,8 @@ class JS extends Minify unset($operatorsBefore['+'], $operatorsBefore['-'], $operatorsAfter['+'], $operatorsAfter['-']); $content = preg_replace( array( - '/('.implode('|', $operatorsBefore).')\s+/', - '/\s+('.implode('|', $operatorsAfter).')/', + '/(' . implode('|', $operatorsBefore) . ')\s+/', + '/\s+(' . implode('|', $operatorsAfter) . ')/', ), '\\1', $content ); @@ -347,8 +343,8 @@ class JS extends Minify ); // collapse whitespace around reserved words into single space - $content = preg_replace('/(^|[;\}\s])\K('.implode('|', $keywordsBefore).')\s+/', '\\2 ', $content); - $content = preg_replace('/\s+('.implode('|', $keywordsAfter).')(?=([;\{\s]|$))/', ' \\1', $content); + $content = preg_replace('/(^|[;\}\s])\K(' . implode('|', $keywordsBefore) . ')\s+/', '\\2 ', $content); + $content = preg_replace('/\s+(' . implode('|', $keywordsAfter) . ')(?=([;\{\s]|$))/', ' \\1', $content); /* * We didn't strip whitespace after a couple of operators because they @@ -358,8 +354,8 @@ class JS extends Minify */ $operatorsDiffBefore = array_diff($operators, $operatorsBefore); $operatorsDiffAfter = array_diff($operators, $operatorsAfter); - $content = preg_replace('/('.implode('|', $operatorsDiffBefore).')[^\S\n]+/', '\\1', $content); - $content = preg_replace('/[^\S\n]+('.implode('|', $operatorsDiffAfter).')/', '\\1', $content); + $content = preg_replace('/(' . implode('|', $operatorsDiffBefore) . ')[^\S\n]+/', '\\1', $content); + $content = preg_replace('/[^\S\n]+(' . implode('|', $operatorsDiffAfter) . ')/', '\\1', $content); /* * Whitespace after `return` can be omitted in a few occasions @@ -430,12 +426,11 @@ class JS extends Minify * This will prepare the given array by escaping all characters. * * @param string[] $operators - * @param string $delimiter + * @param string $delimiter * * @return string[] */ - protected function getOperatorsForRegex(array $operators, $delimiter = '/') - { + protected function getOperatorsForRegex(array $operators, $delimiter = '/') { // escape operators for use in regex $delimiters = array_fill(0, count($operators), $delimiter); $escaped = array_map('preg_quote', $operators, $delimiters); @@ -451,7 +446,7 @@ class JS extends Minify // don't confuse = with other assignment shortcuts (e.g. +=) $chars = preg_quote('+-*\=<>%&|', $delimiter); - $operators['='] = '(?keywordsReserved; @@ -510,11 +503,11 @@ class JS extends Minify * array['key-here'] can't be replaced by array.key-here since '-' * is not a valid character there. */ - if (!preg_match('/^'.$minifier::REGEX_VARIABLE.'$/u', $property)) { + if (!preg_match('/^' . $minifier::REGEX_VARIABLE . '$/u', $property)) { return $match[0]; } - return '.'.$property; + return '.' . $property; }; /* @@ -535,9 +528,9 @@ class JS extends Minify * separate look-behind assertions, one for each keyword. */ $keywords = $this->getKeywordsForRegex($keywords); - $keywords = '(?load($data); @@ -106,12 +105,11 @@ abstract class Minify * * @return string The minified data */ - public function minify($path = null) - { + public function minify($path = NULL) { $content = $this->execute($path); // save to path - if ($path !== null) { + if ($path !== NULL) { $this->save($content, $path); } @@ -126,13 +124,12 @@ abstract class Minify * * @return string The minified & gzipped data */ - public function gzip($path = null, $level = 9) - { + public function gzip($path = NULL, $level = 9) { $content = $this->execute($path); $content = gzencode($content, $level, FORCE_GZIP); // save to path - if ($path !== null) { + if ($path !== NULL) { $this->save($content, $path); } @@ -146,8 +143,7 @@ abstract class Minify * * @return CacheItemInterface Cache item with the minifier data */ - public function cache(CacheItemInterface $item) - { + public function cache(CacheItemInterface $item) { $content = $this->execute(); $item->set($content); @@ -161,7 +157,7 @@ abstract class Minify * * @return string The minified data */ - abstract public function execute($path = null); + abstract public function execute($path = NULL); /** * Load data. @@ -170,8 +166,7 @@ abstract class Minify * * @return string */ - protected function load($data) - { + protected function load($data) { // check if the data is a file if ($this->canImportFile($data)) { $data = file_get_contents($data); @@ -189,12 +184,11 @@ abstract class Minify * Save to file. * * @param string $content The minified data - * @param string $path The path to save the minified data to + * @param string $path The path to save the minified data to * * @throws IOException */ - protected function save($content, $path) - { + protected function save($content, $path) { $handler = $this->openFileForWriting($path); $this->writeToFile($handler, $content); @@ -205,11 +199,10 @@ abstract class Minify /** * Register a pattern to execute against the source content. * - * @param string $pattern PCRE pattern + * @param string $pattern PCRE pattern * @param string|callable $replacement Replacement value for matched pattern */ - protected function registerPattern($pattern, $replacement = '') - { + protected function registerPattern($pattern, $replacement = '') { // study the pattern, we'll execute it more than once $pattern .= 'S'; @@ -228,8 +221,7 @@ abstract class Minify * * @return string The (manipulated) content */ - protected function replace($content) - { + protected function replace($content) { $processed = ''; $positions = array_fill(0, count($this->patterns), -1); $matches = array(); @@ -245,7 +237,7 @@ abstract class Minify continue; } - $match = null; + $match = NULL; if (preg_match($pattern, $content, $match, PREG_OFFSET_CAPTURE)) { $matches[$i] = $match; @@ -281,8 +273,8 @@ abstract class Minify // figure out which part of the string was unmatched; that's the // part we'll execute the patterns on again next - $content = (string) substr($content, $discardLength); - $unmatched = (string) substr($content, strpos($content, $match) + strlen($match)); + $content = (string)substr($content, $discardLength); + $unmatched = (string)substr($content, strpos($content, $match) + strlen($match)); // move the replaced part to $processed and prepare $content to // again match batch of patterns against @@ -306,14 +298,13 @@ abstract class Minify * This function will be called plenty of times, where $content will always * move up 1 character. * - * @param string $pattern Pattern to match + * @param string $pattern Pattern to match * @param string|callable $replacement Replacement value - * @param string $content Content to match pattern against + * @param string $content Content to match pattern against * * @return string */ - protected function replacePattern($pattern, $replacement, $content) - { + protected function replacePattern($pattern, $replacement, $content) { if (is_callable($replacement)) { return preg_replace_callback($pattern, $replacement, $content, 1, $count); } else { @@ -335,8 +326,7 @@ abstract class Minify * @param string[optional] $chars * @param string[optional] $placeholderPrefix */ - protected function extractStrings($chars = '\'"', $placeholderPrefix = '') - { + protected function extractStrings($chars = '\'"', $placeholderPrefix = '') { // PHP only supports $this inside anonymous functions since 5.4 $minifier = $this; $callback = function ($match) use ($minifier, $placeholderPrefix) { @@ -352,8 +342,8 @@ abstract class Minify } $count = count($minifier->extracted); - $placeholder = $match[1].$placeholderPrefix.$count.$match[1]; - $minifier->extracted[$placeholder] = $match[1].$match[2].$match[1]; + $placeholder = $match[1] . $placeholderPrefix . $count . $match[1]; + $minifier->extracted[$placeholder] = $match[1] . $match[2] . $match[1]; return $placeholder; }; @@ -370,7 +360,7 @@ abstract class Minify * considered as escape-char (times 2) and to get it in the regex, * escaped (times 2) */ - $this->registerPattern('/(['.$chars.'])(.*?(?registerPattern('/([' . $chars . '])(.*?(?extracted) { // nothing was extracted, nothing to restore return $content; @@ -403,8 +392,7 @@ abstract class Minify * * @return bool */ - protected function canImportFile($path) - { + protected function canImportFile($path) { $parsed = parse_url($path); if ( // file is elsewhere @@ -412,7 +400,7 @@ abstract class Minify // file responds to queries (may change, or need to bypass cache) isset($parsed['query']) ) { - return false; + return FALSE; } return strlen($path) < PHP_MAXPATHLEN && @is_file($path) && is_readable($path); @@ -427,10 +415,9 @@ abstract class Minify * * @throws IOException */ - protected function openFileForWriting($path) - { - if (($handler = @fopen($path, 'w')) === false) { - throw new IOException('The file "'.$path.'" could not be opened for writing. Check if PHP has enough permissions.'); + protected function openFileForWriting($path) { + if (($handler = @fopen($path, 'w')) === FALSE) { + throw new IOException('The file "' . $path . '" could not be opened for writing. Check if PHP has enough permissions.'); } return $handler; @@ -440,15 +427,14 @@ abstract class Minify * Attempts to write $content to the file specified by $handler. $path is used for printing exceptions. * * @param resource $handler The resource to write to - * @param string $content The content to write - * @param string $path The path to the file (for exception printing only) + * @param string $content The content to write + * @param string $path The path to the file (for exception printing only) * * @throws IOException */ - protected function writeToFile($handler, $content, $path = '') - { - if (($result = @fwrite($handler, $content)) === false || ($result < strlen($content))) { - throw new IOException('The file "'.$path.'" could not be written to. Check your disk space and file permissions.'); + protected function writeToFile($handler, $content, $path = '') { + if (($result = @fwrite($handler, $content)) === FALSE || ($result < strlen($content))) { + throw new IOException('The file "' . $path . '" could not be written to. Check your disk space and file permissions.'); } } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/path-converter/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/path-converter/composer.json index 1cb6a4c..fe774b0 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/path-converter/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/path-converter/composer.json @@ -1,28 +1,33 @@ { - "name": "matthiasmullie/path-converter", - "type": "library", - "description": "Relative path converter", - "keywords": ["relative", "path", "converter", "paths"], - "homepage": "http://github.com/matthiasmullie/path-converter", - "license": "MIT", - "authors": [ - { - "name": "Matthias Mullie", - "homepage": "http://www.mullie.eu", - "email": "pathconverter@mullie.eu", - "role": "Developer" - } - ], - "require": { - "php": ">=5.3.0", - "ext-pcre": "*" - }, - "require-dev": { - "phpunit/phpunit": "~4.8" - }, - "autoload": { - "psr-4": { - "MatthiasMullie\\PathConverter\\": "src/" - } + "name": "matthiasmullie/path-converter", + "type": "library", + "description": "Relative path converter", + "keywords": [ + "relative", + "path", + "converter", + "paths" + ], + "homepage": "http://github.com/matthiasmullie/path-converter", + "license": "MIT", + "authors": [ + { + "name": "Matthias Mullie", + "homepage": "http://www.mullie.eu", + "email": "pathconverter@mullie.eu", + "role": "Developer" } + ], + "require": { + "php": ">=5.3.0", + "ext-pcre": "*" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "autoload": { + "psr-4": { + "MatthiasMullie\\PathConverter\\": "src/" + } + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/path-converter/src/Converter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/path-converter/src/Converter.php index b92b24c..e26d860 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/path-converter/src/Converter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/path-converter/src/Converter.php @@ -30,17 +30,16 @@ class Converter implements ConverterInterface /** * @param string $from The original base path (directory, not file!) - * @param string $to The new base path (directory, not file!) + * @param string $to The new base path (directory, not file!) */ - public function __construct($from, $to) - { + public function __construct($from, $to) { $shared = $this->shared($from, $to); if ($shared === '') { // when both paths have nothing in common, one of them is probably // absolute while the other is relative $cwd = getcwd(); - $from = strpos($from, $cwd) === 0 ? $from : $cwd.'/'.$from; - $to = strpos($to, $cwd) === 0 ? $to : $cwd.'/'.$to; + $from = strpos($from, $cwd) === 0 ? $from : $cwd . '/' . $from; + $to = strpos($to, $cwd) === 0 ? $to : $cwd . '/' . $to; // or traveling the tree via `..` // attempt to resolve path, or assume it's fine if it doesn't exist @@ -65,8 +64,7 @@ class Converter implements ConverterInterface * * @return string */ - protected function normalize($path) - { + protected function normalize($path) { // deal with different operating systems' directory structure $path = rtrim(str_replace(DIRECTORY_SEPARATOR, '/', $path), '/'); @@ -98,8 +96,7 @@ class Converter implements ConverterInterface * * @return string */ - protected function shared($path1, $path2) - { + protected function shared($path1, $path2) { // $path could theoretically be empty (e.g. no path is given), in which // case it shouldn't expand to array(''), which would compare to one's // root / @@ -133,8 +130,7 @@ class Converter implements ConverterInterface * * @return string The new relative path */ - public function convert($path) - { + public function convert($path) { // quit early if conversion makes no sense if ($this->from === $this->to) { return $path; @@ -147,7 +143,7 @@ class Converter implements ConverterInterface } // normalize paths - $path = $this->normalize($this->from.'/'.$path); + $path = $this->normalize($this->from . '/' . $path); // strip shared ancestor paths $shared = $this->shared($path, $this->to); @@ -157,7 +153,7 @@ class Converter implements ConverterInterface // add .. for every directory that needs to be traversed to new path $to = str_repeat('../', mb_substr_count($to, '/')); - return $to.ltrim($path, '/'); + return $to . ltrim($path, '/'); } /** @@ -167,8 +163,7 @@ class Converter implements ConverterInterface * * @return string */ - protected function dirname($path) - { + protected function dirname($path) { if (@is_file($path)) { return dirname($path); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/path-converter/src/NoConverter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/path-converter/src/NoConverter.php index 2fcfd0f..85edc84 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/path-converter/src/NoConverter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/matthiasmullie/path-converter/src/NoConverter.php @@ -16,8 +16,7 @@ class NoConverter implements ConverterInterface /** * {@inheritdoc} */ - public function convert($path) - { + public function convert($path) { return $path; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/natxet/CssMin/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/natxet/CssMin/composer.json index f477e9a..e6f188a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/natxet/CssMin/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/natxet/CssMin/composer.json @@ -1,26 +1,31 @@ { - "name": "natxet/cssmin", - "description": "Minifying CSS", - "type": "library", - "keywords": ["css","minify"], - "homepage": "http://code.google.com/p/cssmin/", - "license": "MIT", - "authors": [ - { - "name": "Joe Scylla", - "email": "joe.scylla@gmail.com", - "homepage": "https://profiles.google.com/joe.scylla" - } - ], - "require": { - "php": ">=5.0" - }, - "autoload": { - "classmap": ["src/"] - }, - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - } + "name": "natxet/cssmin", + "description": "Minifying CSS", + "type": "library", + "keywords": [ + "css", + "minify" + ], + "homepage": "http://code.google.com/p/cssmin/", + "license": "MIT", + "authors": [ + { + "name": "Joe Scylla", + "email": "joe.scylla@gmail.com", + "homepage": "https://profiles.google.com/joe.scylla" + } + ], + "require": { + "php": ">=5.0" + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/natxet/CssMin/src/CssMin.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/natxet/CssMin/src/CssMin.php index f356ea5..646d6dd 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/natxet/CssMin/src/CssMin.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/natxet/CssMin/src/CssMin.php @@ -24,44 +24,45 @@ * THE SOFTWARE. * -- * - * @package CssMin - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ + /** * Abstract definition of a CSS token class. * * Every token has to extend this class. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ abstract class aCssToken { - /** - * Returns the token as string. - * - * @return string - */ - abstract public function __toString(); + /** + * Returns the token as string. + * + * @return string + */ + abstract public function __toString(); } /** * Abstract definition of a for a ruleset start token. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ abstract class aCssRulesetStartToken extends aCssToken { @@ -71,24 +72,23 @@ abstract class aCssRulesetStartToken extends aCssToken /** * Abstract definition of a for ruleset end token. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ abstract class aCssRulesetEndToken extends aCssToken { - /** - * Implements {@link aCssToken::__toString()}. - * - * @return string - */ - public function __toString() - { - return "}"; - } + /** + * Implements {@link aCssToken::__toString()}. + * + * @return string + */ + public function __toString() { + return "}"; + } } /** @@ -97,66 +97,69 @@ abstract class aCssRulesetEndToken extends aCssToken * Every parser plugin have to extend this class. A parser plugin contains the logic to parse one or aspects of a * stylesheet. * - * @package CssMin/Parser/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Parser/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ abstract class aCssParserPlugin { - /** - * Plugin configuration. - * - * @var array - */ - protected $configuration = array(); - /** - * The CssParser of the plugin. - * - * @var CssParser - */ - protected $parser = null; - /** - * Plugin buffer. - * - * @var string - */ - protected $buffer = ""; - /** - * Constructor. - * - * @param CssParser $parser The CssParser object of this plugin. - * @param array $configuration Plugin configuration [optional] - * @return void - */ - public function __construct(CssParser $parser, array $configuration = null) - { - $this->configuration = $configuration; - $this->parser = $parser; - } - /** - * Returns the array of chars triggering the parser plugin. - * - * @return array - */ - abstract public function getTriggerChars(); - /** - * Returns the array of states triggering the parser plugin or FALSE if every state will trigger the parser plugin. - * - * @return array - */ - abstract public function getTriggerStates(); - /** - * Parser routine of the plugin. - * - * @param integer $index Current index - * @param string $char Current char - * @param string $previousChar Previous char - * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing - */ - abstract public function parse($index, $char, $previousChar, $state); + /** + * Plugin configuration. + * + * @var array + */ + protected $configuration = array(); + /** + * The CssParser of the plugin. + * + * @var CssParser + */ + protected $parser = NULL; + /** + * Plugin buffer. + * + * @var string + */ + protected $buffer = ""; + + /** + * Constructor. + * + * @param CssParser $parser The CssParser object of this plugin. + * @param array $configuration Plugin configuration [optional] + * @return void + */ + public function __construct(CssParser $parser, array $configuration = NULL) { + $this->configuration = $configuration; + $this->parser = $parser; + } + + /** + * Returns the array of chars triggering the parser plugin. + * + * @return array + */ + abstract public function getTriggerChars(); + + /** + * Returns the array of states triggering the parser plugin or FALSE if every state will trigger the parser plugin. + * + * @return array + */ + abstract public function getTriggerStates(); + + /** + * Parser routine of the plugin. + * + * @param integer $index Current index + * @param string $char Current char + * @param string $previousChar Previous char + * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing + */ + abstract public function parse($index, $char, $previousChar, $state); } /** @@ -165,52 +168,54 @@ abstract class aCssParserPlugin * Minifier plugin process the parsed tokens one by one to apply changes to the token. Every minifier plugin has to * extend this class. * - * @package CssMin/Minifier/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ abstract class aCssMinifierPlugin { - /** - * Plugin configuration. - * - * @var array - */ - protected $configuration = array(); - /** - * The CssMinifier of the plugin. - * - * @var CssMinifier - */ - protected $minifier = null; - /** - * Constructor. - * - * @param CssMinifier $minifier The CssMinifier object of this plugin. - * @param array $configuration Plugin configuration [optional] - * @return void - */ - public function __construct(CssMinifier $minifier, array $configuration = array()) - { - $this->configuration = $configuration; - $this->minifier = $minifier; - } - /** - * Apply the plugin to the token. - * - * @param aCssToken $token Token to process - * @return boolean Return TRUE to break the processing of this token; FALSE to continue - */ - abstract public function apply(aCssToken &$token); - /** - * -- - * - * @return array - */ - abstract public function getTriggerTokens(); + /** + * Plugin configuration. + * + * @var array + */ + protected $configuration = array(); + /** + * The CssMinifier of the plugin. + * + * @var CssMinifier + */ + protected $minifier = NULL; + + /** + * Constructor. + * + * @param CssMinifier $minifier The CssMinifier object of this plugin. + * @param array $configuration Plugin configuration [optional] + * @return void + */ + public function __construct(CssMinifier $minifier, array $configuration = array()) { + $this->configuration = $configuration; + $this->minifier = $minifier; + } + + /** + * Apply the plugin to the token. + * + * @param aCssToken $token Token to process + * @return boolean Return TRUE to break the processing of this token; FALSE to continue + */ + abstract public function apply(aCssToken &$token); + + /** + * -- + * + * @return array + */ + abstract public function getTriggerTokens(); } /** @@ -219,46 +224,47 @@ abstract class aCssMinifierPlugin * Minifier filters allows a pre-processing of the parsed token to add, edit or delete tokens. Every minifier filter * has to extend this class. * - * @package CssMin/Minifier/Filters - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Filters + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ abstract class aCssMinifierFilter { - /** - * Filter configuration. - * - * @var array - */ - protected $configuration = array(); - /** - * The CssMinifier of the filter. - * - * @var CssMinifier - */ - protected $minifier = null; - /** - * Constructor. - * - * @param CssMinifier $minifier The CssMinifier object of this plugin. - * @param array $configuration Filter configuration [optional] - * @return void - */ - public function __construct(CssMinifier $minifier, array $configuration = array()) - { - $this->configuration = $configuration; - $this->minifier = $minifier; - } - /** - * Filter the tokens. - * - * @param array $tokens Array of objects of type aCssToken - * @return integer Count of added, changed or removed tokens; a return value large than 0 will rebuild the array - */ - abstract public function apply(array &$tokens); + /** + * Filter configuration. + * + * @var array + */ + protected $configuration = array(); + /** + * The CssMinifier of the filter. + * + * @var CssMinifier + */ + protected $minifier = NULL; + + /** + * Constructor. + * + * @param CssMinifier $minifier The CssMinifier object of this plugin. + * @param array $configuration Filter configuration [optional] + * @return void + */ + public function __construct(CssMinifier $minifier, array $configuration = array()) { + $this->configuration = $configuration; + $this->minifier = $minifier; + } + + /** + * Filter the tokens. + * + * @param array $tokens Array of objects of type aCssToken + * @return integer Count of added, changed or removed tokens; a return value large than 0 will rebuild the array + */ + abstract public function apply(array &$tokens); } /** @@ -266,126 +272,127 @@ abstract class aCssMinifierFilter * * Every formatter have to extend this class. * - * @package CssMin/Formatter - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Formatter + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ abstract class aCssFormatter { - /** - * Indent string. - * - * @var string - */ - protected $indent = " "; - /** - * Declaration padding. - * - * @var integer - */ - protected $padding = 0; - /** - * Tokens. - * - * @var array - */ - protected $tokens = array(); - /** - * Constructor. - * - * @param array $tokens Array of CssToken - * @param string $indent Indent string [optional] - * @param integer $padding Declaration value padding [optional] - */ - public function __construct(array $tokens, $indent = null, $padding = null) - { - $this->tokens = $tokens; - $this->indent = !is_null($indent) ? $indent : $this->indent; - $this->padding = !is_null($padding) ? $padding : $this->padding; - } - /** - * Returns the array of aCssToken as formatted string. - * - * @return string - */ - abstract public function __toString(); + /** + * Indent string. + * + * @var string + */ + protected $indent = " "; + /** + * Declaration padding. + * + * @var integer + */ + protected $padding = 0; + /** + * Tokens. + * + * @var array + */ + protected $tokens = array(); + + /** + * Constructor. + * + * @param array $tokens Array of CssToken + * @param string $indent Indent string [optional] + * @param integer $padding Declaration value padding [optional] + */ + public function __construct(array $tokens, $indent = NULL, $padding = NULL) { + $this->tokens = $tokens; + $this->indent = !is_null($indent) ? $indent : $this->indent; + $this->padding = !is_null($padding) ? $padding : $this->padding; + } + + /** + * Returns the array of aCssToken as formatted string. + * + * @return string + */ + abstract public function __toString(); } /** * Abstract definition of a ruleset declaration token. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ abstract class aCssDeclarationToken extends aCssToken { - /** - * Is the declaration flagged as important? - * - * @var boolean - */ - public $IsImportant = false; - /** - * Is the declaration flagged as last one of the ruleset? - * - * @var boolean - */ - public $IsLast = false; - /** - * Property name of the declaration. - * - * @var string - */ - public $Property = ""; - /** - * Value of the declaration. - * - * @var string - */ - public $Value = ""; - /** - * Set the properties of the @font-face declaration. - * - * @param string $property Property of the declaration - * @param string $value Value of the declaration - * @param boolean $isImportant Is the !important flag is set? - * @param boolean $IsLast Is the declaration the last one of the block? - * @return void - */ - public function __construct($property, $value, $isImportant = false, $isLast = false) - { - $this->Property = $property; - $this->Value = $value; - $this->IsImportant = $isImportant; - $this->IsLast = $isLast; - } - /** - * Implements {@link aCssToken::__toString()}. - * - * @return string - */ - public function __toString() - { - return $this->Property . ":" . $this->Value . ($this->IsImportant ? " !important" : "") . ($this->IsLast ? "" : ";"); - } + /** + * Is the declaration flagged as important? + * + * @var boolean + */ + public $IsImportant = FALSE; + /** + * Is the declaration flagged as last one of the ruleset? + * + * @var boolean + */ + public $IsLast = FALSE; + /** + * Property name of the declaration. + * + * @var string + */ + public $Property = ""; + /** + * Value of the declaration. + * + * @var string + */ + public $Value = ""; + + /** + * Set the properties of the @font-face declaration. + * + * @param string $property Property of the declaration + * @param string $value Value of the declaration + * @param boolean $isImportant Is the !important flag is set? + * @param boolean $IsLast Is the declaration the last one of the block? + * @return void + */ + public function __construct($property, $value, $isImportant = FALSE, $isLast = FALSE) { + $this->Property = $property; + $this->Value = $value; + $this->IsImportant = $isImportant; + $this->IsLast = $isLast; + } + + /** + * Implements {@link aCssToken::__toString()}. + * + * @return string + */ + public function __toString() { + return $this->Property . ":" . $this->Value . ($this->IsImportant ? " !important" : "") . ($this->IsLast ? "" : ";"); + } } /** * Abstract definition of a for at-rule block start token. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ abstract class aCssAtBlockStartToken extends aCssToken { @@ -395,133 +402,107 @@ abstract class aCssAtBlockStartToken extends aCssToken /** * Abstract definition of a for at-rule block end token. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ abstract class aCssAtBlockEndToken extends aCssToken { - /** - * Implements {@link aCssToken::__toString()}. - * - * @return string - */ - public function __toString() - { - return "}"; - } + /** + * Implements {@link aCssToken::__toString()}. + * + * @return string + */ + public function __toString() { + return "}"; + } } /** * {@link aCssFromatter Formatter} returning the CSS source in {@link http://goo.gl/etzLs Whitesmiths indent style}. * - * @package CssMin/Formatter - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Formatter + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssWhitesmithsFormatter extends aCssFormatter { - /** - * Implements {@link aCssFormatter::__toString()}. - * - * @return string - */ - public function __toString() - { - $r = array(); - $level = 0; - for ($i = 0, $l = count($this->tokens); $i < $l; $i++) - { - $token = $this->tokens[$i]; - $class = get_class($token); - $indent = str_repeat($this->indent, $level); - if ($class === "CssCommentToken") - { - $lines = array_map("trim", explode("\n", $token->Comment)); - for ($ii = 0, $ll = count($lines); $ii < $ll; $ii++) - { - $r[] = $indent . (substr($lines[$ii], 0, 1) == "*" ? " " : "") . $lines[$ii]; - } - } - elseif ($class === "CssAtCharsetToken") - { - $r[] = $indent . "@charset " . $token->Charset . ";"; - } - elseif ($class === "CssAtFontFaceStartToken") - { - $r[] = $indent . "@font-face"; - $r[] = $this->indent . $indent . "{"; - $level++; - } - elseif ($class === "CssAtImportToken") - { - $r[] = $indent . "@import " . $token->Import . " " . implode(", ", $token->MediaTypes) . ";"; - } - elseif ($class === "CssAtKeyframesStartToken") - { - $r[] = $indent . "@keyframes " . $token->Name; - $r[] = $this->indent . $indent . "{"; - $level++; - } - elseif ($class === "CssAtMediaStartToken") - { - $r[] = $indent . "@media " . implode(", ", $token->MediaTypes); - $r[] = $this->indent . $indent . "{"; - $level++; - } - elseif ($class === "CssAtPageStartToken") - { - $r[] = $indent . "@page"; - $r[] = $this->indent . $indent . "{"; - $level++; - } - elseif ($class === "CssAtVariablesStartToken") - { - $r[] = $indent . "@variables " . implode(", ", $token->MediaTypes); - $r[] = $this->indent . $indent . "{"; - $level++; - } - elseif ($class === "CssRulesetStartToken" || $class === "CssAtKeyframesRulesetStartToken") - { - $r[] = $indent . implode(", ", $token->Selectors); - $r[] = $this->indent . $indent . "{"; - $level++; - } - elseif ($class === "CssAtFontFaceDeclarationToken" - || $class === "CssAtKeyframesRulesetDeclarationToken" - || $class === "CssAtPageDeclarationToken" - || $class === "CssAtVariablesDeclarationToken" - || $class === "CssRulesetDeclarationToken" - ) - { - $declaration = $indent . $token->Property . ": "; - if ($this->padding) - { - $declaration = str_pad($declaration, $this->padding, " ", STR_PAD_RIGHT); - } - $r[] = $declaration . $token->Value . ($token->IsImportant ? " !important" : "") . ";"; - } - elseif ($class === "CssAtFontFaceEndToken" - || $class === "CssAtMediaEndToken" - || $class === "CssAtKeyframesEndToken" - || $class === "CssAtKeyframesRulesetEndToken" - || $class === "CssAtPageEndToken" - || $class === "CssAtVariablesEndToken" - || $class === "CssRulesetEndToken" - ) - { - $r[] = $indent . "}"; - $level--; - } - } - return implode("\n", $r); - } + /** + * Implements {@link aCssFormatter::__toString()}. + * + * @return string + */ + public function __toString() { + $r = array(); + $level = 0; + for ($i = 0, $l = count($this->tokens); $i < $l; $i++) { + $token = $this->tokens[$i]; + $class = get_class($token); + $indent = str_repeat($this->indent, $level); + if ($class === "CssCommentToken") { + $lines = array_map("trim", explode("\n", $token->Comment)); + for ($ii = 0, $ll = count($lines); $ii < $ll; $ii++) { + $r[] = $indent . (substr($lines[$ii], 0, 1) == "*" ? " " : "") . $lines[$ii]; + } + } else if ($class === "CssAtCharsetToken") { + $r[] = $indent . "@charset " . $token->Charset . ";"; + } else if ($class === "CssAtFontFaceStartToken") { + $r[] = $indent . "@font-face"; + $r[] = $this->indent . $indent . "{"; + $level++; + } else if ($class === "CssAtImportToken") { + $r[] = $indent . "@import " . $token->Import . " " . implode(", ", $token->MediaTypes) . ";"; + } else if ($class === "CssAtKeyframesStartToken") { + $r[] = $indent . "@keyframes " . $token->Name; + $r[] = $this->indent . $indent . "{"; + $level++; + } else if ($class === "CssAtMediaStartToken") { + $r[] = $indent . "@media " . implode(", ", $token->MediaTypes); + $r[] = $this->indent . $indent . "{"; + $level++; + } else if ($class === "CssAtPageStartToken") { + $r[] = $indent . "@page"; + $r[] = $this->indent . $indent . "{"; + $level++; + } else if ($class === "CssAtVariablesStartToken") { + $r[] = $indent . "@variables " . implode(", ", $token->MediaTypes); + $r[] = $this->indent . $indent . "{"; + $level++; + } else if ($class === "CssRulesetStartToken" || $class === "CssAtKeyframesRulesetStartToken") { + $r[] = $indent . implode(", ", $token->Selectors); + $r[] = $this->indent . $indent . "{"; + $level++; + } else if ($class === "CssAtFontFaceDeclarationToken" + || $class === "CssAtKeyframesRulesetDeclarationToken" + || $class === "CssAtPageDeclarationToken" + || $class === "CssAtVariablesDeclarationToken" + || $class === "CssRulesetDeclarationToken" + ) { + $declaration = $indent . $token->Property . ": "; + if ($this->padding) { + $declaration = str_pad($declaration, $this->padding, " ", STR_PAD_RIGHT); + } + $r[] = $declaration . $token->Value . ($token->IsImportant ? " !important" : "") . ";"; + } else if ($class === "CssAtFontFaceEndToken" + || $class === "CssAtMediaEndToken" + || $class === "CssAtKeyframesEndToken" + || $class === "CssAtKeyframesRulesetEndToken" + || $class === "CssAtPageEndToken" + || $class === "CssAtVariablesEndToken" + || $class === "CssRulesetEndToken" + ) { + $r[] = $indent . "}"; + $level--; + } + } + return implode("\n", $r); + } } /** @@ -533,9 +514,9 @@ class CssWhitesmithsFormatter extends aCssFormatter * Example: * * @variables - * { - * defaultColor: black; - * } + * { + * defaultColor: black; + * } * color: var(defaultColor); * * @@ -544,95 +525,90 @@ class CssWhitesmithsFormatter extends aCssFormatter * color:black; * * - * @package CssMin/Minifier/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssVariablesMinifierPlugin extends aCssMinifierPlugin { - /** - * Regular expression matching a value. - * - * @var string - */ - private $reMatch = "/var\((.+)\)/iSU"; - /** - * Parsed variables. - * - * @var array - */ - private $variables = null; - /** - * Returns the variables. - * - * @return array - */ - public function getVariables() - { - return $this->variables; - } - /** - * Implements {@link aCssMinifierPlugin::minify()}. - * - * @param aCssToken $token Token to process - * @return boolean Return TRUE to break the processing of this token; FALSE to continue - */ - public function apply(aCssToken &$token) - { - if (stripos($token->Value, "var") !== false && preg_match_all($this->reMatch, $token->Value, $m)) - { - $mediaTypes = $token->MediaTypes; - if (!in_array("all", $mediaTypes)) - { - $mediaTypes[] = "all"; - } - for ($i = 0, $l = count($m[0]); $i < $l; $i++) - { - $variable = trim($m[1][$i]); - foreach ($mediaTypes as $mediaType) - { - if (isset($this->variables[$mediaType], $this->variables[$mediaType][$variable])) - { - // Variable value found => set the declaration value to the variable value and return - $token->Value = str_replace($m[0][$i], $this->variables[$mediaType][$variable], $token->Value); - continue 2; - } - } - // If no value was found trigger an error and replace the token with a CssNullToken - CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": No value found for variable " . $variable . " in media types " . implode(", ", $mediaTypes) . "", (string) $token)); - $token = new CssNullToken(); - return true; - } - } - return false; - } - /** - * Implements {@link aMinifierPlugin::getTriggerTokens()} - * - * @return array - */ - public function getTriggerTokens() - { - return array - ( - "CssAtFontFaceDeclarationToken", - "CssAtPageDeclarationToken", - "CssRulesetDeclarationToken" - ); - } - /** - * Sets the variables. - * - * @param array $variables Variables to set - * @return void - */ - public function setVariables(array $variables) - { - $this->variables = $variables; - } + /** + * Regular expression matching a value. + * + * @var string + */ + private $reMatch = "/var\((.+)\)/iSU"; + /** + * Parsed variables. + * + * @var array + */ + private $variables = NULL; + + /** + * Returns the variables. + * + * @return array + */ + public function getVariables() { + return $this->variables; + } + + /** + * Implements {@link aCssMinifierPlugin::minify()}. + * + * @param aCssToken $token Token to process + * @return boolean Return TRUE to break the processing of this token; FALSE to continue + */ + public function apply(aCssToken &$token) { + if (stripos($token->Value, "var") !== FALSE && preg_match_all($this->reMatch, $token->Value, $m)) { + $mediaTypes = $token->MediaTypes; + if (!in_array("all", $mediaTypes)) { + $mediaTypes[] = "all"; + } + for ($i = 0, $l = count($m[0]); $i < $l; $i++) { + $variable = trim($m[1][$i]); + foreach ($mediaTypes as $mediaType) { + if (isset($this->variables[$mediaType], $this->variables[$mediaType][$variable])) { + // Variable value found => set the declaration value to the variable value and return + $token->Value = str_replace($m[0][$i], $this->variables[$mediaType][$variable], $token->Value); + continue 2; + } + } + // If no value was found trigger an error and replace the token with a CssNullToken + CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": No value found for variable " . $variable . " in media types " . implode(", ", $mediaTypes) . "", (string)$token)); + $token = new CssNullToken(); + return TRUE; + } + } + return FALSE; + } + + /** + * Implements {@link aMinifierPlugin::getTriggerTokens()} + * + * @return array + */ + public function getTriggerTokens() { + return array + ( + "CssAtFontFaceDeclarationToken", + "CssAtPageDeclarationToken", + "CssRulesetDeclarationToken" + ); + } + + /** + * Sets the variables. + * + * @param array $variables Variables to set + * @return void + */ + public function setVariables(array $variables) { + $this->variables = $variables; + } } /** @@ -640,93 +616,75 @@ class CssVariablesMinifierPlugin extends aCssMinifierPlugin * blocks. The variables will get store in the {@link CssVariablesMinifierPlugin} that will apply the variables to * declaration. * - * @package CssMin/Minifier/Filters - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Filters + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssVariablesMinifierFilter extends aCssMinifierFilter { - /** - * Implements {@link aCssMinifierFilter::filter()}. - * - * @param array $tokens Array of objects of type aCssToken - * @return integer Count of added, changed or removed tokens; a return value large than 0 will rebuild the array - */ - public function apply(array &$tokens) - { - $variables = array(); - $defaultMediaTypes = array("all"); - $mediaTypes = array(); - $remove = array(); - for($i = 0, $l = count($tokens); $i < $l; $i++) - { - // @variables at-rule block found - if (get_class($tokens[$i]) === "CssAtVariablesStartToken") - { - $remove[] = $i; - $mediaTypes = (count($tokens[$i]->MediaTypes) == 0 ? $defaultMediaTypes : $tokens[$i]->MediaTypes); - foreach ($mediaTypes as $mediaType) - { - if (!isset($variables[$mediaType])) - { - $variables[$mediaType] = array(); - } - } - // Read the variable declaration tokens - for($i = $i; $i < $l; $i++) - { - // Found a variable declaration => read the variable values - if (get_class($tokens[$i]) === "CssAtVariablesDeclarationToken") - { - foreach ($mediaTypes as $mediaType) - { - $variables[$mediaType][$tokens[$i]->Property] = $tokens[$i]->Value; - } - $remove[] = $i; - } - // Found the variables end token => break; - elseif (get_class($tokens[$i]) === "CssAtVariablesEndToken") - { - $remove[] = $i; - break; - } - } - } - } - // Variables in @variables at-rule blocks - foreach($variables as $mediaType => $null) - { - foreach($variables[$mediaType] as $variable => $value) - { - // If a var() statement in a variable value found... - if (stripos($value, "var") !== false && preg_match_all("/var\((.+)\)/iSU", $value, $m)) - { - // ... then replace the var() statement with the variable values. - for ($i = 0, $l = count($m[0]); $i < $l; $i++) - { - $variables[$mediaType][$variable] = str_replace($m[0][$i], (isset($variables[$mediaType][$m[1][$i]]) ? $variables[$mediaType][$m[1][$i]] : ""), $variables[$mediaType][$variable]); - } - } - } - } - // Remove the complete @variables at-rule block - foreach ($remove as $i) - { - $tokens[$i] = null; - } - if (!($plugin = $this->minifier->getPlugin("CssVariablesMinifierPlugin"))) - { - CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": The plugin CssVariablesMinifierPlugin was not found but is required for " . __CLASS__ . "")); - } - else - { - $plugin->setVariables($variables); - } - return count($remove); - } + /** + * Implements {@link aCssMinifierFilter::filter()}. + * + * @param array $tokens Array of objects of type aCssToken + * @return integer Count of added, changed or removed tokens; a return value large than 0 will rebuild the array + */ + public function apply(array &$tokens) { + $variables = array(); + $defaultMediaTypes = array("all"); + $mediaTypes = array(); + $remove = array(); + for ($i = 0, $l = count($tokens); $i < $l; $i++) { + // @variables at-rule block found + if (get_class($tokens[$i]) === "CssAtVariablesStartToken") { + $remove[] = $i; + $mediaTypes = (count($tokens[$i]->MediaTypes) == 0 ? $defaultMediaTypes : $tokens[$i]->MediaTypes); + foreach ($mediaTypes as $mediaType) { + if (!isset($variables[$mediaType])) { + $variables[$mediaType] = array(); + } + } + // Read the variable declaration tokens + for ($i = $i; $i < $l; $i++) { + // Found a variable declaration => read the variable values + if (get_class($tokens[$i]) === "CssAtVariablesDeclarationToken") { + foreach ($mediaTypes as $mediaType) { + $variables[$mediaType][$tokens[$i]->Property] = $tokens[$i]->Value; + } + $remove[] = $i; + } // Found the variables end token => break; + else if (get_class($tokens[$i]) === "CssAtVariablesEndToken") { + $remove[] = $i; + break; + } + } + } + } + // Variables in @variables at-rule blocks + foreach ($variables as $mediaType => $null) { + foreach ($variables[$mediaType] as $variable => $value) { + // If a var() statement in a variable value found... + if (stripos($value, "var") !== FALSE && preg_match_all("/var\((.+)\)/iSU", $value, $m)) { + // ... then replace the var() statement with the variable values. + for ($i = 0, $l = count($m[0]); $i < $l; $i++) { + $variables[$mediaType][$variable] = str_replace($m[0][$i], (isset($variables[$mediaType][$m[1][$i]]) ? $variables[$mediaType][$m[1][$i]] : ""), $variables[$mediaType][$variable]); + } + } + } + } + // Remove the complete @variables at-rule block + foreach ($remove as $i) { + $tokens[$i] = NULL; + } + if (!($plugin = $this->minifier->getPlugin("CssVariablesMinifierPlugin"))) { + CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": The plugin CssVariablesMinifierPlugin was not found but is required for " . __CLASS__ . "")); + } else { + $plugin->setVariables($variables); + } + return count($remove); + } } /** @@ -734,75 +692,65 @@ class CssVariablesMinifierFilter extends aCssMinifierFilter * * This plugin return no {@link aCssToken CssToken} but ensures that url() values will get parsed properly. * - * @package CssMin/Parser/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Parser/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssUrlParserPlugin extends aCssParserPlugin { - /** - * Implements {@link aCssParserPlugin::getTriggerChars()}. - * - * @return array - */ - public function getTriggerChars() - { - return array("(", ")"); - } - /** - * Implements {@link aCssParserPlugin::getTriggerStates()}. - * - * @return array - */ - public function getTriggerStates() - { - return false; - } - /** - * Implements {@link aCssParserPlugin::parse()}. - * - * @param integer $index Current index - * @param string $char Current char - * @param string $previousChar Previous char - * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing - */ - public function parse($index, $char, $previousChar, $state) - { - // Start of string - if ($char === "(" && strtolower(substr($this->parser->getSource(), $index - 3, 4)) === "url(" && $state !== "T_URL") - { - $this->parser->pushState("T_URL"); - $this->parser->setExclusive(__CLASS__); - } - // Escaped LF in url => remove escape backslash and LF - elseif ($char === "\n" && $previousChar === "\\" && $state === "T_URL") - { - $this->parser->setBuffer(substr($this->parser->getBuffer(), 0, -2)); - } - // Parse error: Unescaped LF in string literal - elseif ($char === "\n" && $previousChar !== "\\" && $state === "T_URL") - { - $line = $this->parser->getBuffer(); - $this->parser->setBuffer(substr($this->parser->getBuffer(), 0, -1) . ")"); // Replace the LF with the url string delimiter - $this->parser->popState(); - $this->parser->unsetExclusive(); - CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Unterminated string literal", $line . "_")); - } - // End of string - elseif ($char === ")" && $state === "T_URL") - { - $this->parser->popState(); - $this->parser->unsetExclusive(); - } - else - { - return false; - } - return true; - } + /** + * Implements {@link aCssParserPlugin::getTriggerChars()}. + * + * @return array + */ + public function getTriggerChars() { + return array("(", ")"); + } + + /** + * Implements {@link aCssParserPlugin::getTriggerStates()}. + * + * @return array + */ + public function getTriggerStates() { + return FALSE; + } + + /** + * Implements {@link aCssParserPlugin::parse()}. + * + * @param integer $index Current index + * @param string $char Current char + * @param string $previousChar Previous char + * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing + */ + public function parse($index, $char, $previousChar, $state) { + // Start of string + if ($char === "(" && strtolower(substr($this->parser->getSource(), $index - 3, 4)) === "url(" && $state !== "T_URL") { + $this->parser->pushState("T_URL"); + $this->parser->setExclusive(__CLASS__); + } // Escaped LF in url => remove escape backslash and LF + else if ($char === "\n" && $previousChar === "\\" && $state === "T_URL") { + $this->parser->setBuffer(substr($this->parser->getBuffer(), 0, -2)); + } // Parse error: Unescaped LF in string literal + else if ($char === "\n" && $previousChar !== "\\" && $state === "T_URL") { + $line = $this->parser->getBuffer(); + $this->parser->setBuffer(substr($this->parser->getBuffer(), 0, -1) . ")"); // Replace the LF with the url string delimiter + $this->parser->popState(); + $this->parser->unsetExclusive(); + CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Unterminated string literal", $line . "_")); + } // End of string + else if ($char === ")" && $state === "T_URL") { + $this->parser->popState(); + $this->parser->unsetExclusive(); + } else { + return FALSE; + } + return TRUE; + } } /** @@ -810,229 +758,219 @@ class CssUrlParserPlugin extends aCssParserPlugin * * This plugin return no {@link aCssToken CssToken} but ensures that string values will get parsed properly. * - * @package CssMin/Parser/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Parser/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssStringParserPlugin extends aCssParserPlugin { - /** - * Current string delimiter char. - * - * @var string - */ - private $delimiterChar = null; - /** - * Implements {@link aCssParserPlugin::getTriggerChars()}. - * - * @return array - */ - public function getTriggerChars() - { - return array("\"", "'", "\n"); - } - /** - * Implements {@link aCssParserPlugin::getTriggerStates()}. - * - * @return array - */ - public function getTriggerStates() - { - return false; - } - /** - * Implements {@link aCssParserPlugin::parse()}. - * - * @param integer $index Current index - * @param string $char Current char - * @param string $previousChar Previous char - * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing - */ - public function parse($index, $char, $previousChar, $state) - { - // Start of string - if (($char === "\"" || $char === "'") && $state !== "T_STRING") - { - $this->delimiterChar = $char; - $this->parser->pushState("T_STRING"); - $this->parser->setExclusive(__CLASS__); - } - // Escaped LF in string => remove escape backslash and LF - elseif ($char === "\n" && $previousChar === "\\" && $state === "T_STRING") - { - $this->parser->setBuffer(substr($this->parser->getBuffer(), 0, -2)); - } - // Parse error: Unescaped LF in string literal - elseif ($char === "\n" && $previousChar !== "\\" && $state === "T_STRING") - { - $line = $this->parser->getBuffer(); - $this->parser->popState(); - $this->parser->unsetExclusive(); - $this->parser->setBuffer(substr($this->parser->getBuffer(), 0, -1) . $this->delimiterChar); // Replace the LF with the current string char - CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Unterminated string literal", $line . "_")); - $this->delimiterChar = null; - } - // End of string - elseif ($char === $this->delimiterChar && $state === "T_STRING") - { - // If the Previous char is a escape char count the amount of the previous escape chars. If the amount of - // escape chars is uneven do not end the string - if ($previousChar == "\\") - { - $source = $this->parser->getSource(); - $c = 1; - $i = $index - 2; - while (substr($source, $i, 1) === "\\") - { - $c++; $i--; - } - if ($c % 2) - { - return false; - } - } - $this->parser->popState(); - $this->parser->unsetExclusive(); - $this->delimiterChar = null; - } - else - { - return false; - } - return true; - } + /** + * Current string delimiter char. + * + * @var string + */ + private $delimiterChar = NULL; + + /** + * Implements {@link aCssParserPlugin::getTriggerChars()}. + * + * @return array + */ + public function getTriggerChars() { + return array("\"", "'", "\n"); + } + + /** + * Implements {@link aCssParserPlugin::getTriggerStates()}. + * + * @return array + */ + public function getTriggerStates() { + return FALSE; + } + + /** + * Implements {@link aCssParserPlugin::parse()}. + * + * @param integer $index Current index + * @param string $char Current char + * @param string $previousChar Previous char + * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing + */ + public function parse($index, $char, $previousChar, $state) { + // Start of string + if (($char === "\"" || $char === "'") && $state !== "T_STRING") { + $this->delimiterChar = $char; + $this->parser->pushState("T_STRING"); + $this->parser->setExclusive(__CLASS__); + } // Escaped LF in string => remove escape backslash and LF + else if ($char === "\n" && $previousChar === "\\" && $state === "T_STRING") { + $this->parser->setBuffer(substr($this->parser->getBuffer(), 0, -2)); + } // Parse error: Unescaped LF in string literal + else if ($char === "\n" && $previousChar !== "\\" && $state === "T_STRING") { + $line = $this->parser->getBuffer(); + $this->parser->popState(); + $this->parser->unsetExclusive(); + $this->parser->setBuffer(substr($this->parser->getBuffer(), 0, -1) . $this->delimiterChar); // Replace the LF with the current string char + CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Unterminated string literal", $line . "_")); + $this->delimiterChar = NULL; + } // End of string + else if ($char === $this->delimiterChar && $state === "T_STRING") { + // If the Previous char is a escape char count the amount of the previous escape chars. If the amount of + // escape chars is uneven do not end the string + if ($previousChar == "\\") { + $source = $this->parser->getSource(); + $c = 1; + $i = $index - 2; + while (substr($source, $i, 1) === "\\") { + $c++; + $i--; + } + if ($c % 2) { + return FALSE; + } + } + $this->parser->popState(); + $this->parser->unsetExclusive(); + $this->delimiterChar = NULL; + } else { + return FALSE; + } + return TRUE; + } } /** * This {@link aCssMinifierFilter minifier filter} sorts the ruleset declarations of a ruleset by name. * - * @package CssMin/Minifier/Filters - * @link http://code.google.com/p/cssmin/ - * @author Rowan Beentje - * @copyright Rowan Beentje - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Filters + * @link http://code.google.com/p/cssmin/ + * @author Rowan Beentje + * @copyright Rowan Beentje + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssSortRulesetPropertiesMinifierFilter extends aCssMinifierFilter { - /** - * Implements {@link aCssMinifierFilter::filter()}. - * - * @param array $tokens Array of objects of type aCssToken - * @return integer Count of added, changed or removed tokens; a return value larger than 0 will rebuild the array - */ - public function apply(array &$tokens) - { - $r = 0; - for ($i = 0, $l = count($tokens); $i < $l; $i++) - { - // Only look for ruleset start rules - if (get_class($tokens[$i]) !== "CssRulesetStartToken") { continue; } - // Look for the corresponding ruleset end - $endIndex = false; - for ($ii = $i + 1; $ii < $l; $ii++) - { - if (get_class($tokens[$ii]) !== "CssRulesetEndToken") { continue; } - $endIndex = $ii; - break; - } - if (!$endIndex) { break; } - $startIndex = $i; - $i = $endIndex; - // Skip if there's only one token in this ruleset - if ($endIndex - $startIndex <= 2) { continue; } - // Ensure that everything between the start and end is a declaration token, for safety - for ($ii = $startIndex + 1; $ii < $endIndex; $ii++) - { - if (get_class($tokens[$ii]) !== "CssRulesetDeclarationToken") { continue(2); } - } - $declarations = array_slice($tokens, $startIndex + 1, $endIndex - $startIndex - 1); - // Check whether a sort is required - $sortRequired = $lastPropertyName = false; - foreach ($declarations as $declaration) - { - if ($lastPropertyName) - { - if (strcmp($lastPropertyName, $declaration->Property) > 0) - { - $sortRequired = true; - break; - } - } - $lastPropertyName = $declaration->Property; - } - if (!$sortRequired) { continue; } - // Arrange the declarations alphabetically by name - usort($declarations, array(__CLASS__, "userDefinedSort1")); - // Update "IsLast" property - for ($ii = 0, $ll = count($declarations) - 1; $ii <= $ll; $ii++) - { - if ($ii == $ll) - { - $declarations[$ii]->IsLast = true; - } - else - { - $declarations[$ii]->IsLast = false; - } - } - // Splice back into the array. - array_splice($tokens, $startIndex + 1, $endIndex - $startIndex - 1, $declarations); - $r += $endIndex - $startIndex - 1; - } - return $r; - } - /** - * User defined sort function. - * - * @return integer - */ - public static function userDefinedSort1($a, $b) - { - return strcmp($a->Property, $b->Property); - } + /** + * Implements {@link aCssMinifierFilter::filter()}. + * + * @param array $tokens Array of objects of type aCssToken + * @return integer Count of added, changed or removed tokens; a return value larger than 0 will rebuild the array + */ + public function apply(array &$tokens) { + $r = 0; + for ($i = 0, $l = count($tokens); $i < $l; $i++) { + // Only look for ruleset start rules + if (get_class($tokens[$i]) !== "CssRulesetStartToken") { + continue; + } + // Look for the corresponding ruleset end + $endIndex = FALSE; + for ($ii = $i + 1; $ii < $l; $ii++) { + if (get_class($tokens[$ii]) !== "CssRulesetEndToken") { + continue; + } + $endIndex = $ii; + break; + } + if (!$endIndex) { + break; + } + $startIndex = $i; + $i = $endIndex; + // Skip if there's only one token in this ruleset + if ($endIndex - $startIndex <= 2) { + continue; + } + // Ensure that everything between the start and end is a declaration token, for safety + for ($ii = $startIndex + 1; $ii < $endIndex; $ii++) { + if (get_class($tokens[$ii]) !== "CssRulesetDeclarationToken") { + continue(2); + } + } + $declarations = array_slice($tokens, $startIndex + 1, $endIndex - $startIndex - 1); + // Check whether a sort is required + $sortRequired = $lastPropertyName = FALSE; + foreach ($declarations as $declaration) { + if ($lastPropertyName) { + if (strcmp($lastPropertyName, $declaration->Property) > 0) { + $sortRequired = TRUE; + break; + } + } + $lastPropertyName = $declaration->Property; + } + if (!$sortRequired) { + continue; + } + // Arrange the declarations alphabetically by name + usort($declarations, array(__CLASS__, "userDefinedSort1")); + // Update "IsLast" property + for ($ii = 0, $ll = count($declarations) - 1; $ii <= $ll; $ii++) { + if ($ii == $ll) { + $declarations[$ii]->IsLast = TRUE; + } else { + $declarations[$ii]->IsLast = FALSE; + } + } + // Splice back into the array. + array_splice($tokens, $startIndex + 1, $endIndex - $startIndex - 1, $declarations); + $r += $endIndex - $startIndex - 1; + } + return $r; + } + + /** + * User defined sort function. + * + * @return integer + */ + public static function userDefinedSort1($a, $b) { + return strcmp($a->Property, $b->Property); + } } /** * This {@link aCssToken CSS token} represents the start of a ruleset. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssRulesetStartToken extends aCssRulesetStartToken { - /** - * Array of selectors. - * - * @var array - */ - public $Selectors = array(); - /** - * Set the properties of a ruleset token. - * - * @param array $selectors Selectors of the ruleset - * @return void - */ - public function __construct(array $selectors = array()) - { - $this->Selectors = $selectors; - } - /** - * Implements {@link aCssToken::__toString()}. - * - * @return string - */ - public function __toString() - { - return implode(",", $this->Selectors) . "{"; - } + /** + * Array of selectors. + * + * @var array + */ + public $Selectors = array(); + + /** + * Set the properties of a ruleset token. + * + * @param array $selectors Selectors of the ruleset + * @return void + */ + public function __construct(array $selectors = array()) { + $this->Selectors = $selectors; + } + + /** + * Implements {@link aCssToken::__toString()}. + * + * @return string + */ + public function __toString() { + return implode(",", $this->Selectors) . "{"; + } } /** @@ -1041,138 +979,117 @@ class CssRulesetStartToken extends aCssRulesetStartToken * Found rulesets will add a {@link CssRulesetStartToken} and {@link CssRulesetEndToken} to the * parser; including declarations as {@link CssRulesetDeclarationToken}. * - * @package CssMin/Parser/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Parser/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssRulesetParserPlugin extends aCssParserPlugin { - /** - * Implements {@link aCssParserPlugin::getTriggerChars()}. - * - * @return array - */ - public function getTriggerChars() - { - return array(",", "{", "}", ":", ";"); - } - /** - * Implements {@link aCssParserPlugin::getTriggerStates()}. - * - * @return array - */ - public function getTriggerStates() - { - return array("T_DOCUMENT", "T_AT_MEDIA", "T_RULESET::SELECTORS", "T_RULESET", "T_RULESET_DECLARATION"); - } - /** - * Selectors. - * - * @var array - */ - private $selectors = array(); - /** - * Implements {@link aCssParserPlugin::parse()}. - * - * @param integer $index Current index - * @param string $char Current char - * @param string $previousChar Previous char - * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing - */ - public function parse($index, $char, $previousChar, $state) - { - // Start of Ruleset and selectors - if ($char === "," && ($state === "T_DOCUMENT" || $state === "T_AT_MEDIA" || $state === "T_RULESET::SELECTORS")) - { - if ($state !== "T_RULESET::SELECTORS") - { - $this->parser->pushState("T_RULESET::SELECTORS"); - } - $this->selectors[] = $this->parser->getAndClearBuffer(",{"); - } - // End of selectors and start of declarations - elseif ($char === "{" && ($state === "T_DOCUMENT" || $state === "T_AT_MEDIA" || $state === "T_RULESET::SELECTORS")) - { - if ($this->parser->getBuffer() !== "") - { - $this->selectors[] = $this->parser->getAndClearBuffer(",{"); - if ($state == "T_RULESET::SELECTORS") - { - $this->parser->popState(); - } - $this->parser->pushState("T_RULESET"); - $this->parser->appendToken(new CssRulesetStartToken($this->selectors)); - $this->selectors = array(); - } - } - // Start of declaration - elseif ($char === ":" && $state === "T_RULESET") - { - $this->parser->pushState("T_RULESET_DECLARATION"); - $this->buffer = $this->parser->getAndClearBuffer(":;", true); - } - // Unterminated ruleset declaration - elseif ($char === ":" && $state === "T_RULESET_DECLARATION") - { - // Ignore Internet Explorer filter declarations - if ($this->buffer === "filter") - { - return false; - } - CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Unterminated declaration", $this->buffer . ":" . $this->parser->getBuffer() . "_")); - } - // End of declaration - elseif (($char === ";" || $char === "}") && $state === "T_RULESET_DECLARATION") - { - $value = $this->parser->getAndClearBuffer(";}"); - if (strtolower(substr($value, -10, 10)) === "!important") - { - $value = trim(substr($value, 0, -10)); - $isImportant = true; - } - else - { - $isImportant = false; - } - $this->parser->popState(); - $this->parser->appendToken(new CssRulesetDeclarationToken($this->buffer, $value, $this->parser->getMediaTypes(), $isImportant)); - // Declaration ends with a right curly brace; so we have to end the ruleset - if ($char === "}") - { - $this->parser->appendToken(new CssRulesetEndToken()); - $this->parser->popState(); - } - $this->buffer = ""; - } - // End of ruleset - elseif ($char === "}" && $state === "T_RULESET") - { - $this->parser->popState(); - $this->parser->clearBuffer(); - $this->parser->appendToken(new CssRulesetEndToken()); - $this->buffer = ""; - $this->selectors = array(); - } - else - { - return false; - } - return true; - } + /** + * Implements {@link aCssParserPlugin::getTriggerChars()}. + * + * @return array + */ + public function getTriggerChars() { + return array(",", "{", "}", ":", ";"); + } + + /** + * Implements {@link aCssParserPlugin::getTriggerStates()}. + * + * @return array + */ + public function getTriggerStates() { + return array("T_DOCUMENT", "T_AT_MEDIA", "T_RULESET::SELECTORS", "T_RULESET", "T_RULESET_DECLARATION"); + } + + /** + * Selectors. + * + * @var array + */ + private $selectors = array(); + + /** + * Implements {@link aCssParserPlugin::parse()}. + * + * @param integer $index Current index + * @param string $char Current char + * @param string $previousChar Previous char + * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing + */ + public function parse($index, $char, $previousChar, $state) { + // Start of Ruleset and selectors + if ($char === "," && ($state === "T_DOCUMENT" || $state === "T_AT_MEDIA" || $state === "T_RULESET::SELECTORS")) { + if ($state !== "T_RULESET::SELECTORS") { + $this->parser->pushState("T_RULESET::SELECTORS"); + } + $this->selectors[] = $this->parser->getAndClearBuffer(",{"); + } // End of selectors and start of declarations + else if ($char === "{" && ($state === "T_DOCUMENT" || $state === "T_AT_MEDIA" || $state === "T_RULESET::SELECTORS")) { + if ($this->parser->getBuffer() !== "") { + $this->selectors[] = $this->parser->getAndClearBuffer(",{"); + if ($state == "T_RULESET::SELECTORS") { + $this->parser->popState(); + } + $this->parser->pushState("T_RULESET"); + $this->parser->appendToken(new CssRulesetStartToken($this->selectors)); + $this->selectors = array(); + } + } // Start of declaration + else if ($char === ":" && $state === "T_RULESET") { + $this->parser->pushState("T_RULESET_DECLARATION"); + $this->buffer = $this->parser->getAndClearBuffer(":;", TRUE); + } // Unterminated ruleset declaration + else if ($char === ":" && $state === "T_RULESET_DECLARATION") { + // Ignore Internet Explorer filter declarations + if ($this->buffer === "filter") { + return FALSE; + } + CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Unterminated declaration", $this->buffer . ":" . $this->parser->getBuffer() . "_")); + } // End of declaration + else if (($char === ";" || $char === "}") && $state === "T_RULESET_DECLARATION") { + $value = $this->parser->getAndClearBuffer(";}"); + if (strtolower(substr($value, -10, 10)) === "!important") { + $value = trim(substr($value, 0, -10)); + $isImportant = TRUE; + } else { + $isImportant = FALSE; + } + $this->parser->popState(); + $this->parser->appendToken(new CssRulesetDeclarationToken($this->buffer, $value, $this->parser->getMediaTypes(), $isImportant)); + // Declaration ends with a right curly brace; so we have to end the ruleset + if ($char === "}") { + $this->parser->appendToken(new CssRulesetEndToken()); + $this->parser->popState(); + } + $this->buffer = ""; + } // End of ruleset + else if ($char === "}" && $state === "T_RULESET") { + $this->parser->popState(); + $this->parser->clearBuffer(); + $this->parser->appendToken(new CssRulesetEndToken()); + $this->buffer = ""; + $this->selectors = array(); + } else { + return FALSE; + } + return TRUE; + } } /** * This {@link aCssToken CSS token} represents the end of a ruleset. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssRulesetEndToken extends aCssRulesetEndToken { @@ -1182,36 +1099,36 @@ class CssRulesetEndToken extends aCssRulesetEndToken /** * This {@link aCssToken CSS token} represents a ruleset declaration. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssRulesetDeclarationToken extends aCssDeclarationToken { - /** - * Media types of the declaration. - * - * @var array - */ - public $MediaTypes = array("all"); - /** - * Set the properties of a ddocument- or at-rule @media level declaration. - * - * @param string $property Property of the declaration - * @param string $value Value of the declaration - * @param mixed $mediaTypes Media types of the declaration - * @param boolean $isImportant Is the !important flag is set - * @param boolean $isLast Is the declaration the last one of the ruleset - * @return void - */ - public function __construct($property, $value, $mediaTypes = null, $isImportant = false, $isLast = false) - { - parent::__construct($property, $value, $isImportant, $isLast); - $this->MediaTypes = $mediaTypes ? $mediaTypes : array("all"); - } + /** + * Media types of the declaration. + * + * @var array + */ + public $MediaTypes = array("all"); + + /** + * Set the properties of a ddocument- or at-rule @media level declaration. + * + * @param string $property Property of the declaration + * @param string $value Value of the declaration + * @param mixed $mediaTypes Media types of the declaration + * @param boolean $isImportant Is the !important flag is set + * @param boolean $isLast Is the declaration the last one of the ruleset + * @return void + */ + public function __construct($property, $value, $mediaTypes = NULL, $isImportant = FALSE, $isLast = FALSE) { + parent::__construct($property, $value, $isImportant, $isLast); + $this->MediaTypes = $mediaTypes ? $mediaTypes : array("all"); + } } /** @@ -1219,936 +1136,843 @@ class CssRulesetDeclarationToken extends aCssDeclarationToken * @font-face at-rule or @page at-rule block. If the property IsLast is TRUE the decrations will get stringified * without tailing semicolon. * - * @package CssMin/Minifier/Filters - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Filters + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssRemoveLastDelarationSemiColonMinifierFilter extends aCssMinifierFilter { - /** - * Implements {@link aCssMinifierFilter::filter()}. - * - * @param array $tokens Array of objects of type aCssToken - * @return integer Count of added, changed or removed tokens; a return value large than 0 will rebuild the array - */ - public function apply(array &$tokens) - { - for ($i = 0, $l = count($tokens); $i < $l; $i++) - { - $current = get_class($tokens[$i]); - $next = isset($tokens[$i+1]) ? get_class($tokens[$i+1]) : false; - if (($current === "CssRulesetDeclarationToken" && $next === "CssRulesetEndToken") || - ($current === "CssAtFontFaceDeclarationToken" && $next === "CssAtFontFaceEndToken") || - ($current === "CssAtPageDeclarationToken" && $next === "CssAtPageEndToken")) - { - $tokens[$i]->IsLast = true; - } - } - return 0; - } + /** + * Implements {@link aCssMinifierFilter::filter()}. + * + * @param array $tokens Array of objects of type aCssToken + * @return integer Count of added, changed or removed tokens; a return value large than 0 will rebuild the array + */ + public function apply(array &$tokens) { + for ($i = 0, $l = count($tokens); $i < $l; $i++) { + $current = get_class($tokens[$i]); + $next = isset($tokens[$i + 1]) ? get_class($tokens[$i + 1]) : FALSE; + if (($current === "CssRulesetDeclarationToken" && $next === "CssRulesetEndToken") || + ($current === "CssAtFontFaceDeclarationToken" && $next === "CssAtFontFaceEndToken") || + ($current === "CssAtPageDeclarationToken" && $next === "CssAtPageEndToken")) { + $tokens[$i]->IsLast = TRUE; + } + } + return 0; + } } /** * This {@link aCssMinifierFilter minifier filter} will remove any empty rulesets (including @keyframes at-rule block * rulesets). * - * @package CssMin/Minifier/Filters - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Filters + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssRemoveEmptyRulesetsMinifierFilter extends aCssMinifierFilter { - /** - * Implements {@link aCssMinifierFilter::filter()}. - * - * @param array $tokens Array of objects of type aCssToken - * @return integer Count of added, changed or removed tokens; a return value large than 0 will rebuild the array - */ - public function apply(array &$tokens) - { - $r = 0; - for ($i = 0, $l = count($tokens); $i < $l; $i++) - { - $current = get_class($tokens[$i]); - $next = isset($tokens[$i + 1]) ? get_class($tokens[$i + 1]) : false; - if (($current === "CssRulesetStartToken" && $next === "CssRulesetEndToken") || - ($current === "CssAtKeyframesRulesetStartToken" && $next === "CssAtKeyframesRulesetEndToken" && !array_intersect(array("from", "0%", "to", "100%"), array_map("strtolower", $tokens[$i]->Selectors))) - ) - { - $tokens[$i] = null; - $tokens[$i + 1] = null; - $i++; - $r = $r + 2; - } - } - return $r; - } + /** + * Implements {@link aCssMinifierFilter::filter()}. + * + * @param array $tokens Array of objects of type aCssToken + * @return integer Count of added, changed or removed tokens; a return value large than 0 will rebuild the array + */ + public function apply(array &$tokens) { + $r = 0; + for ($i = 0, $l = count($tokens); $i < $l; $i++) { + $current = get_class($tokens[$i]); + $next = isset($tokens[$i + 1]) ? get_class($tokens[$i + 1]) : FALSE; + if (($current === "CssRulesetStartToken" && $next === "CssRulesetEndToken") || + ($current === "CssAtKeyframesRulesetStartToken" && $next === "CssAtKeyframesRulesetEndToken" && !array_intersect(array("from", "0%", "to", "100%"), array_map("strtolower", $tokens[$i]->Selectors))) + ) { + $tokens[$i] = NULL; + $tokens[$i + 1] = NULL; + $i++; + $r = $r + 2; + } + } + return $r; + } } /** * This {@link aCssMinifierFilter minifier filter} will remove any empty @font-face, @keyframes, @media and @page * at-rule blocks. * - * @package CssMin/Minifier/Filters - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Filters + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssRemoveEmptyAtBlocksMinifierFilter extends aCssMinifierFilter { - /** - * Implements {@link aCssMinifierFilter::filter()}. - * - * @param array $tokens Array of objects of type aCssToken - * @return integer Count of added, changed or removed tokens; a return value large than 0 will rebuild the array - */ - public function apply(array &$tokens) - { - $r = 0; - for ($i = 0, $l = count($tokens); $i < $l; $i++) - { - $current = get_class($tokens[$i]); - $next = isset($tokens[$i + 1]) ? get_class($tokens[$i + 1]) : false; - if (($current === "CssAtFontFaceStartToken" && $next === "CssAtFontFaceEndToken") || - ($current === "CssAtKeyframesStartToken" && $next === "CssAtKeyframesEndToken") || - ($current === "CssAtPageStartToken" && $next === "CssAtPageEndToken") || - ($current === "CssAtMediaStartToken" && $next === "CssAtMediaEndToken")) - { - $tokens[$i] = null; - $tokens[$i + 1] = null; - $i++; - $r = $r + 2; - } - } - return $r; - } + /** + * Implements {@link aCssMinifierFilter::filter()}. + * + * @param array $tokens Array of objects of type aCssToken + * @return integer Count of added, changed or removed tokens; a return value large than 0 will rebuild the array + */ + public function apply(array &$tokens) { + $r = 0; + for ($i = 0, $l = count($tokens); $i < $l; $i++) { + $current = get_class($tokens[$i]); + $next = isset($tokens[$i + 1]) ? get_class($tokens[$i + 1]) : FALSE; + if (($current === "CssAtFontFaceStartToken" && $next === "CssAtFontFaceEndToken") || + ($current === "CssAtKeyframesStartToken" && $next === "CssAtKeyframesEndToken") || + ($current === "CssAtPageStartToken" && $next === "CssAtPageEndToken") || + ($current === "CssAtMediaStartToken" && $next === "CssAtMediaEndToken")) { + $tokens[$i] = NULL; + $tokens[$i + 1] = NULL; + $i++; + $r = $r + 2; + } + } + return $r; + } } /** * This {@link aCssMinifierFilter minifier filter} will remove any comments from the array of parsed tokens. * - * @package CssMin/Minifier/Filters - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Filters + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssRemoveCommentsMinifierFilter extends aCssMinifierFilter { - /** - * Regular expression whitelisting any important comments to preserve. - * - * @var string - */ - private $whitelistPattern = '/(^\/\*!|@preserve|copyright|license|author|https?:|www\.)/i'; - - /** - * Implements {@link aCssMinifierFilter::filter()}. - * - * @param array $tokens Array of objects of type aCssToken - * @return integer Count of added, changed or removed tokens; a return value large than 0 will rebuild the array - */ - public function apply(array &$tokens) - { - $r = 0; - for ($i = 0, $l = count($tokens); $i < $l; $i++) - { - if (get_class($tokens[$i]) === "CssCommentToken") - { - if (!preg_match($this->whitelistPattern, $tokens[$i]->Comment)) - { - $tokens[$i] = null; - $r++; - } - } - } - return $r; - } + /** + * Regular expression whitelisting any important comments to preserve. + * + * @var string + */ + private $whitelistPattern = '/(^\/\*!|@preserve|copyright|license|author|https?:|www\.)/i'; + + /** + * Implements {@link aCssMinifierFilter::filter()}. + * + * @param array $tokens Array of objects of type aCssToken + * @return integer Count of added, changed or removed tokens; a return value large than 0 will rebuild the array + */ + public function apply(array &$tokens) { + $r = 0; + for ($i = 0, $l = count($tokens); $i < $l; $i++) { + if (get_class($tokens[$i]) === "CssCommentToken") { + if (!preg_match($this->whitelistPattern, $tokens[$i]->Comment)) { + $tokens[$i] = NULL; + $r++; + } + } + } + return $r; + } } /** * CSS Parser. * - * @package CssMin/Parser - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Parser + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssParser { - /** - * Parse buffer. - * - * @var string - */ - private $buffer = ""; - /** - * {@link aCssParserPlugin Plugins}. - * - * @var array - */ - private $plugins = array(); - /** - * Source to parse. - * - * @var string - */ - private $source = ""; - /** - * Current state. - * - * @var integer - */ - private $state = "T_DOCUMENT"; - /** - * Exclusive state. - * - * @var string - */ - private $stateExclusive = false; - /** - * Media types state. - * - * @var mixed - */ - private $stateMediaTypes = false; - /** - * State stack. - * - * @var array - */ - private $states = array("T_DOCUMENT"); - /** - * Parsed tokens. - * - * @var array - */ - private $tokens = array(); - /** - * Constructer. - * - * Create instances of the used {@link aCssParserPlugin plugins}. - * - * @param string $source CSS source [optional] - * @param array $plugins Plugin configuration [optional] - * @return void - */ - public function __construct($source = null, array $plugins = null) - { - $plugins = array_merge(array - ( - "Comment" => true, - "String" => true, - "Url" => true, - "Expression" => true, - "Ruleset" => true, - "AtCharset" => true, - "AtFontFace" => true, - "AtImport" => true, - "AtKeyframes" => true, - "AtMedia" => true, - "AtPage" => true, - "AtVariables" => true - ), is_array($plugins) ? $plugins : array()); - // Create plugin instances - foreach ($plugins as $name => $config) - { - if ($config !== false) - { - $class = "Css" . $name . "ParserPlugin"; - $config = is_array($config) ? $config : array(); - if (class_exists($class)) - { - $this->plugins[] = new $class($this, $config); - } - else - { - CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": The plugin " . $name . " with the class name " . $class . " was not found")); - } - } - } - if (!is_null($source)) - { - $this->parse($source); - } - } - /** - * Append a token to the array of tokens. - * - * @param aCssToken $token Token to append - * @return void - */ - public function appendToken(aCssToken $token) - { - $this->tokens[] = $token; - } - /** - * Clears the current buffer. - * - * @return void - */ - public function clearBuffer() - { - $this->buffer = ""; - } - /** - * Returns and clear the current buffer. - * - * @param string $trim Chars to use to trim the returned buffer - * @param boolean $tolower if TRUE the returned buffer will get converted to lower case - * @return string - */ - public function getAndClearBuffer($trim = "", $tolower = false) - { - $r = $this->getBuffer($trim, $tolower); - $this->buffer = ""; - return $r; - } - /** - * Returns the current buffer. - * - * @param string $trim Chars to use to trim the returned buffer - * @param boolean $tolower if TRUE the returned buffer will get converted to lower case - * @return string - */ - public function getBuffer($trim = "", $tolower = false) - { - $r = $this->buffer; - if ($trim) - { - $r = trim($r, " \t\n\r\0\x0B" . $trim); - } - if ($tolower) - { - $r = strtolower($r); - } - return $r; - } - /** - * Returns the current media types state. - * - * @return array - */ - public function getMediaTypes() - { - return $this->stateMediaTypes; - } - /** - * Returns the CSS source. - * - * @return string - */ - public function getSource() - { - return $this->source; - } - /** - * Returns the current state. - * - * @return integer The current state - */ - public function getState() - { - return $this->state; - } - /** - * Returns a plugin by class name. - * - * @param string $name Class name of the plugin - * @return aCssParserPlugin - */ - public function getPlugin($class) - { - static $index = null; - if (is_null($index)) - { - $index = array(); - for ($i = 0, $l = count($this->plugins); $i < $l; $i++) - { - $index[get_class($this->plugins[$i])] = $i; - } - } - return isset($index[$class]) ? $this->plugins[$index[$class]] : false; - } - /** - * Returns the parsed tokens. - * - * @return array - */ - public function getTokens() - { - return $this->tokens; - } - /** - * Returns if the current state equals the passed state. - * - * @param integer $state State to compare with the current state - * @return boolean TRUE is the state equals to the passed state; FALSE if not - */ - public function isState($state) - { - return ($this->state == $state); - } - /** - * Parse the CSS source and return a array with parsed tokens. - * - * @param string $source CSS source - * @return array Array with tokens - */ - public function parse($source) - { - // Reset - $this->source = ""; - $this->tokens = array(); - // Create a global and plugin lookup table for trigger chars; set array of plugins as local variable and create - // several helper variables for plugin handling - $globalTriggerChars = ""; - $plugins = $this->plugins; - $pluginCount = count($plugins); - $pluginIndex = array(); - $pluginTriggerStates = array(); - $pluginTriggerChars = array(); - for ($i = 0, $l = count($plugins); $i < $l; $i++) - { - $tPluginClassName = get_class($plugins[$i]); - $pluginTriggerChars[$i] = implode("", $plugins[$i]->getTriggerChars()); - $tPluginTriggerStates = $plugins[$i]->getTriggerStates(); - $pluginTriggerStates[$i] = $tPluginTriggerStates === false ? false : "|" . implode("|", $tPluginTriggerStates) . "|"; - $pluginIndex[$tPluginClassName] = $i; - for ($ii = 0, $ll = strlen($pluginTriggerChars[$i]); $ii < $ll; $ii++) - { - $c = substr($pluginTriggerChars[$i], $ii, 1); - if (strpos($globalTriggerChars, $c) === false) - { - $globalTriggerChars .= $c; - } - } - } - // Normalise line endings - $source = str_replace("\r\n", "\n", $source); // Windows to Unix line endings - $source = str_replace("\r", "\n", $source); // Mac to Unix line endings - $this->source = $source; - // Variables - $buffer = &$this->buffer; - $exclusive = &$this->stateExclusive; - $state = &$this->state; - $c = $p = null; - // -- - for ($i = 0, $l = strlen($source); $i < $l; $i++) - { - // Set the current Char - $c = $source[$i]; // Is faster than: $c = substr($source, $i, 1); - // Normalize and filter double whitespace characters - if ($exclusive === false) - { - if ($c === "\n" || $c === "\t") - { - $c = " "; - } - if ($c === " " && $p === " ") - { - continue; - } - } - $buffer .= $c; - - // Fix case when value of url() contains parentheses, for example: url("data: ... ()") - if ($this->getState() == 'T_URL' && $c == ')') { - $trimmedBuffer = trim($buffer); - if (preg_match('@url\((\s+)?".+@', $trimmedBuffer) - && !preg_match('@url\((\s+)?".+"\)@', $trimmedBuffer) - || preg_match('@url\((\s+)?\'.+@', $trimmedBuffer) - && !preg_match('@url\((\s+)?\'.+\'\)@', $trimmedBuffer) - ) { - $p = $c; // Set the parent char - continue; - } - } - - // Extended processing only if the current char is a global trigger char - if (strpos($globalTriggerChars, $c) !== false) - { - // Exclusive state is set; process with the exclusive plugin - if ($exclusive) - { - $tPluginIndex = $pluginIndex[$exclusive]; - if (strpos($pluginTriggerChars[$tPluginIndex], $c) !== false && ($pluginTriggerStates[$tPluginIndex] === false || strpos($pluginTriggerStates[$tPluginIndex], $state) !== false)) - { - $r = $plugins[$tPluginIndex]->parse($i, $c, $p, $state); - // Return value is TRUE => continue with next char - if ($r === true) - { - continue; - } - // Return value is numeric => set new index and continue with next char - elseif ($r !== false && $r != $i) - { - $i = $r; - continue; - } - } - } - // Else iterate through the plugins - else - { - $triggerState = "|" . $state . "|"; - for ($ii = 0, $ll = $pluginCount; $ii < $ll; $ii++) - { - // Only process if the current char is one of the plugin trigger chars - if (strpos($pluginTriggerChars[$ii], $c) !== false && ($pluginTriggerStates[$ii] === false || strpos($pluginTriggerStates[$ii], $triggerState) !== false)) - { - // Process with the plugin - $r = $plugins[$ii]->parse($i, $c, $p, $state); - // Return value is TRUE => break the plugin loop and and continue with next char - if ($r === true) - { - break; - } - // Return value is numeric => set new index, break the plugin loop and and continue with next char - elseif ($r !== false && $r != $i) - { - $i = $r; - break; - } - } - } - } - } - $p = $c; // Set the parent char - } - return $this->tokens; - } - /** - * Remove the last state of the state stack and return the removed stack value. - * - * @return integer Removed state value - */ - public function popState() - { - $r = array_pop($this->states); - $this->state = $this->states[count($this->states) - 1]; - return $r; - } - /** - * Adds a new state onto the state stack. - * - * @param integer $state State to add onto the state stack. - * @return integer The index of the added state in the state stacks - */ - public function pushState($state) - { - $r = array_push($this->states, $state); - $this->state = $this->states[count($this->states) - 1]; - return $r; - } - /** - * Sets/restores the buffer. - * - * @param string $buffer Buffer to set - * @return void - */ - public function setBuffer($buffer) - { - $this->buffer = $buffer; - } - /** - * Set the exclusive state. - * - * @param string $exclusive Exclusive state - * @return void - */ - public function setExclusive($exclusive) - { - $this->stateExclusive = $exclusive; - } - /** - * Set the media types state. - * - * @param array $mediaTypes Media types state - * @return void - */ - public function setMediaTypes(array $mediaTypes) - { - $this->stateMediaTypes = $mediaTypes; - } - /** - * Sets the current state in the state stack; equals to {@link CssParser::popState()} + {@link CssParser::pushState()}. - * - * @param integer $state State to set - * @return integer - */ - public function setState($state) - { - $r = array_pop($this->states); - array_push($this->states, $state); - $this->state = $this->states[count($this->states) - 1]; - return $r; - } - /** - * Removes the exclusive state. - * - * @return void - */ - public function unsetExclusive() - { - $this->stateExclusive = false; - } - /** - * Removes the media types state. - * - * @return void - */ - public function unsetMediaTypes() - { - $this->stateMediaTypes = false; - } + /** + * Parse buffer. + * + * @var string + */ + private $buffer = ""; + /** + * {@link aCssParserPlugin Plugins}. + * + * @var array + */ + private $plugins = array(); + /** + * Source to parse. + * + * @var string + */ + private $source = ""; + /** + * Current state. + * + * @var integer + */ + private $state = "T_DOCUMENT"; + /** + * Exclusive state. + * + * @var string + */ + private $stateExclusive = FALSE; + /** + * Media types state. + * + * @var mixed + */ + private $stateMediaTypes = FALSE; + /** + * State stack. + * + * @var array + */ + private $states = array("T_DOCUMENT"); + /** + * Parsed tokens. + * + * @var array + */ + private $tokens = array(); + + /** + * Constructer. + * + * Create instances of the used {@link aCssParserPlugin plugins}. + * + * @param string $source CSS source [optional] + * @param array $plugins Plugin configuration [optional] + * @return void + */ + public function __construct($source = NULL, array $plugins = NULL) { + $plugins = array_merge(array + ( + "Comment" => TRUE, + "String" => TRUE, + "Url" => TRUE, + "Expression" => TRUE, + "Ruleset" => TRUE, + "AtCharset" => TRUE, + "AtFontFace" => TRUE, + "AtImport" => TRUE, + "AtKeyframes" => TRUE, + "AtMedia" => TRUE, + "AtPage" => TRUE, + "AtVariables" => TRUE + ), is_array($plugins) ? $plugins : array()); + // Create plugin instances + foreach ($plugins as $name => $config) { + if ($config !== FALSE) { + $class = "Css" . $name . "ParserPlugin"; + $config = is_array($config) ? $config : array(); + if (class_exists($class)) { + $this->plugins[] = new $class($this, $config); + } else { + CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": The plugin " . $name . " with the class name " . $class . " was not found")); + } + } + } + if (!is_null($source)) { + $this->parse($source); + } + } + + /** + * Append a token to the array of tokens. + * + * @param aCssToken $token Token to append + * @return void + */ + public function appendToken(aCssToken $token) { + $this->tokens[] = $token; + } + + /** + * Clears the current buffer. + * + * @return void + */ + public function clearBuffer() { + $this->buffer = ""; + } + + /** + * Returns and clear the current buffer. + * + * @param string $trim Chars to use to trim the returned buffer + * @param boolean $tolower if TRUE the returned buffer will get converted to lower case + * @return string + */ + public function getAndClearBuffer($trim = "", $tolower = FALSE) { + $r = $this->getBuffer($trim, $tolower); + $this->buffer = ""; + return $r; + } + + /** + * Returns the current buffer. + * + * @param string $trim Chars to use to trim the returned buffer + * @param boolean $tolower if TRUE the returned buffer will get converted to lower case + * @return string + */ + public function getBuffer($trim = "", $tolower = FALSE) { + $r = $this->buffer; + if ($trim) { + $r = trim($r, " \t\n\r\0\x0B" . $trim); + } + if ($tolower) { + $r = strtolower($r); + } + return $r; + } + + /** + * Returns the current media types state. + * + * @return array + */ + public function getMediaTypes() { + return $this->stateMediaTypes; + } + + /** + * Returns the CSS source. + * + * @return string + */ + public function getSource() { + return $this->source; + } + + /** + * Returns the current state. + * + * @return integer The current state + */ + public function getState() { + return $this->state; + } + + /** + * Returns a plugin by class name. + * + * @param string $name Class name of the plugin + * @return aCssParserPlugin + */ + public function getPlugin($class) { + static $index = NULL; + if (is_null($index)) { + $index = array(); + for ($i = 0, $l = count($this->plugins); $i < $l; $i++) { + $index[get_class($this->plugins[$i])] = $i; + } + } + return isset($index[$class]) ? $this->plugins[$index[$class]] : FALSE; + } + + /** + * Returns the parsed tokens. + * + * @return array + */ + public function getTokens() { + return $this->tokens; + } + + /** + * Returns if the current state equals the passed state. + * + * @param integer $state State to compare with the current state + * @return boolean TRUE is the state equals to the passed state; FALSE if not + */ + public function isState($state) { + return ($this->state == $state); + } + + /** + * Parse the CSS source and return a array with parsed tokens. + * + * @param string $source CSS source + * @return array Array with tokens + */ + public function parse($source) { + // Reset + $this->source = ""; + $this->tokens = array(); + // Create a global and plugin lookup table for trigger chars; set array of plugins as local variable and create + // several helper variables for plugin handling + $globalTriggerChars = ""; + $plugins = $this->plugins; + $pluginCount = count($plugins); + $pluginIndex = array(); + $pluginTriggerStates = array(); + $pluginTriggerChars = array(); + for ($i = 0, $l = count($plugins); $i < $l; $i++) { + $tPluginClassName = get_class($plugins[$i]); + $pluginTriggerChars[$i] = implode("", $plugins[$i]->getTriggerChars()); + $tPluginTriggerStates = $plugins[$i]->getTriggerStates(); + $pluginTriggerStates[$i] = $tPluginTriggerStates === FALSE ? FALSE : "|" . implode("|", $tPluginTriggerStates) . "|"; + $pluginIndex[$tPluginClassName] = $i; + for ($ii = 0, $ll = strlen($pluginTriggerChars[$i]); $ii < $ll; $ii++) { + $c = substr($pluginTriggerChars[$i], $ii, 1); + if (strpos($globalTriggerChars, $c) === FALSE) { + $globalTriggerChars .= $c; + } + } + } + // Normalise line endings + $source = str_replace("\r\n", "\n", $source); // Windows to Unix line endings + $source = str_replace("\r", "\n", $source); // Mac to Unix line endings + $this->source = $source; + // Variables + $buffer = &$this->buffer; + $exclusive = &$this->stateExclusive; + $state = &$this->state; + $c = $p = NULL; + // -- + for ($i = 0, $l = strlen($source); $i < $l; $i++) { + // Set the current Char + $c = $source[$i]; // Is faster than: $c = substr($source, $i, 1); + // Normalize and filter double whitespace characters + if ($exclusive === FALSE) { + if ($c === "\n" || $c === "\t") { + $c = " "; + } + if ($c === " " && $p === " ") { + continue; + } + } + $buffer .= $c; + + // Fix case when value of url() contains parentheses, for example: url("data: ... ()") + if ($this->getState() == 'T_URL' && $c == ')') { + $trimmedBuffer = trim($buffer); + if (preg_match('@url\((\s+)?".+@', $trimmedBuffer) + && !preg_match('@url\((\s+)?".+"\)@', $trimmedBuffer) + || preg_match('@url\((\s+)?\'.+@', $trimmedBuffer) + && !preg_match('@url\((\s+)?\'.+\'\)@', $trimmedBuffer) + ) { + $p = $c; // Set the parent char + continue; + } + } + + // Extended processing only if the current char is a global trigger char + if (strpos($globalTriggerChars, $c) !== FALSE) { + // Exclusive state is set; process with the exclusive plugin + if ($exclusive) { + $tPluginIndex = $pluginIndex[$exclusive]; + if (strpos($pluginTriggerChars[$tPluginIndex], $c) !== FALSE && ($pluginTriggerStates[$tPluginIndex] === FALSE || strpos($pluginTriggerStates[$tPluginIndex], $state) !== FALSE)) { + $r = $plugins[$tPluginIndex]->parse($i, $c, $p, $state); + // Return value is TRUE => continue with next char + if ($r === TRUE) { + continue; + } // Return value is numeric => set new index and continue with next char + else if ($r !== FALSE && $r != $i) { + $i = $r; + continue; + } + } + } // Else iterate through the plugins + else { + $triggerState = "|" . $state . "|"; + for ($ii = 0, $ll = $pluginCount; $ii < $ll; $ii++) { + // Only process if the current char is one of the plugin trigger chars + if (strpos($pluginTriggerChars[$ii], $c) !== FALSE && ($pluginTriggerStates[$ii] === FALSE || strpos($pluginTriggerStates[$ii], $triggerState) !== FALSE)) { + // Process with the plugin + $r = $plugins[$ii]->parse($i, $c, $p, $state); + // Return value is TRUE => break the plugin loop and and continue with next char + if ($r === TRUE) { + break; + } // Return value is numeric => set new index, break the plugin loop and and continue with next char + else if ($r !== FALSE && $r != $i) { + $i = $r; + break; + } + } + } + } + } + $p = $c; // Set the parent char + } + return $this->tokens; + } + + /** + * Remove the last state of the state stack and return the removed stack value. + * + * @return integer Removed state value + */ + public function popState() { + $r = array_pop($this->states); + $this->state = $this->states[count($this->states) - 1]; + return $r; + } + + /** + * Adds a new state onto the state stack. + * + * @param integer $state State to add onto the state stack. + * @return integer The index of the added state in the state stacks + */ + public function pushState($state) { + $r = array_push($this->states, $state); + $this->state = $this->states[count($this->states) - 1]; + return $r; + } + + /** + * Sets/restores the buffer. + * + * @param string $buffer Buffer to set + * @return void + */ + public function setBuffer($buffer) { + $this->buffer = $buffer; + } + + /** + * Set the exclusive state. + * + * @param string $exclusive Exclusive state + * @return void + */ + public function setExclusive($exclusive) { + $this->stateExclusive = $exclusive; + } + + /** + * Set the media types state. + * + * @param array $mediaTypes Media types state + * @return void + */ + public function setMediaTypes(array $mediaTypes) { + $this->stateMediaTypes = $mediaTypes; + } + + /** + * Sets the current state in the state stack; equals to {@link CssParser::popState()} + {@link CssParser::pushState()}. + * + * @param integer $state State to set + * @return integer + */ + public function setState($state) { + $r = array_pop($this->states); + array_push($this->states, $state); + $this->state = $this->states[count($this->states) - 1]; + return $r; + } + + /** + * Removes the exclusive state. + * + * @return void + */ + public function unsetExclusive() { + $this->stateExclusive = FALSE; + } + + /** + * Removes the media types state. + * + * @return void + */ + public function unsetMediaTypes() { + $this->stateMediaTypes = FALSE; + } } /** * {@link aCssFromatter Formatter} returning the CSS source in {@link http://goo.gl/j4XdU OTBS indent style} (The One True Brace Style). * - * @package CssMin/Formatter - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Formatter + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssOtbsFormatter extends aCssFormatter { - /** - * Implements {@link aCssFormatter::__toString()}. - * - * @return string - */ - public function __toString() - { - $r = array(); - $level = 0; - for ($i = 0, $l = count($this->tokens); $i < $l; $i++) - { - $token = $this->tokens[$i]; - $class = get_class($token); - $indent = str_repeat($this->indent, $level); - if ($class === "CssCommentToken") - { - $lines = array_map("trim", explode("\n", $token->Comment)); - for ($ii = 0, $ll = count($lines); $ii < $ll; $ii++) - { - $r[] = $indent . (substr($lines[$ii], 0, 1) == "*" ? " " : "") . $lines[$ii]; - } - } - elseif ($class === "CssAtCharsetToken") - { - $r[] = $indent . "@charset " . $token->Charset . ";"; - } - elseif ($class === "CssAtFontFaceStartToken") - { - $r[] = $indent . "@font-face {"; - $level++; - } - elseif ($class === "CssAtImportToken") - { - $r[] = $indent . "@import " . $token->Import . " " . implode(", ", $token->MediaTypes) . ";"; - } - elseif ($class === "CssAtKeyframesStartToken") - { - $r[] = $indent . "@keyframes " . $token->Name . " {"; - $level++; - } - elseif ($class === "CssAtMediaStartToken") - { - $r[] = $indent . "@media " . implode(", ", $token->MediaTypes) . " {"; - $level++; - } - elseif ($class === "CssAtPageStartToken") - { - $r[] = $indent . "@page {"; - $level++; - } - elseif ($class === "CssAtVariablesStartToken") - { - $r[] = $indent . "@variables " . implode(", ", $token->MediaTypes) . " {"; - $level++; - } - elseif ($class === "CssRulesetStartToken" || $class === "CssAtKeyframesRulesetStartToken") - { - $r[] = $indent . implode(", ", $token->Selectors) . " {"; - $level++; - } - elseif ($class === "CssAtFontFaceDeclarationToken" - || $class === "CssAtKeyframesRulesetDeclarationToken" - || $class === "CssAtPageDeclarationToken" - || $class === "CssAtVariablesDeclarationToken" - || $class === "CssRulesetDeclarationToken" - ) - { - $declaration = $indent . $token->Property . ": "; - if ($this->padding) - { - $declaration = str_pad($declaration, $this->padding, " ", STR_PAD_RIGHT); - } - $r[] = $declaration . $token->Value . ($token->IsImportant ? " !important" : "") . ";"; - } - elseif ($class === "CssAtFontFaceEndToken" - || $class === "CssAtMediaEndToken" - || $class === "CssAtKeyframesEndToken" - || $class === "CssAtKeyframesRulesetEndToken" - || $class === "CssAtPageEndToken" - || $class === "CssAtVariablesEndToken" - || $class === "CssRulesetEndToken" - ) - { - $level--; - $r[] = str_repeat($indent, $level) . "}"; - } - } - return implode("\n", $r); - } + /** + * Implements {@link aCssFormatter::__toString()}. + * + * @return string + */ + public function __toString() { + $r = array(); + $level = 0; + for ($i = 0, $l = count($this->tokens); $i < $l; $i++) { + $token = $this->tokens[$i]; + $class = get_class($token); + $indent = str_repeat($this->indent, $level); + if ($class === "CssCommentToken") { + $lines = array_map("trim", explode("\n", $token->Comment)); + for ($ii = 0, $ll = count($lines); $ii < $ll; $ii++) { + $r[] = $indent . (substr($lines[$ii], 0, 1) == "*" ? " " : "") . $lines[$ii]; + } + } else if ($class === "CssAtCharsetToken") { + $r[] = $indent . "@charset " . $token->Charset . ";"; + } else if ($class === "CssAtFontFaceStartToken") { + $r[] = $indent . "@font-face {"; + $level++; + } else if ($class === "CssAtImportToken") { + $r[] = $indent . "@import " . $token->Import . " " . implode(", ", $token->MediaTypes) . ";"; + } else if ($class === "CssAtKeyframesStartToken") { + $r[] = $indent . "@keyframes " . $token->Name . " {"; + $level++; + } else if ($class === "CssAtMediaStartToken") { + $r[] = $indent . "@media " . implode(", ", $token->MediaTypes) . " {"; + $level++; + } else if ($class === "CssAtPageStartToken") { + $r[] = $indent . "@page {"; + $level++; + } else if ($class === "CssAtVariablesStartToken") { + $r[] = $indent . "@variables " . implode(", ", $token->MediaTypes) . " {"; + $level++; + } else if ($class === "CssRulesetStartToken" || $class === "CssAtKeyframesRulesetStartToken") { + $r[] = $indent . implode(", ", $token->Selectors) . " {"; + $level++; + } else if ($class === "CssAtFontFaceDeclarationToken" + || $class === "CssAtKeyframesRulesetDeclarationToken" + || $class === "CssAtPageDeclarationToken" + || $class === "CssAtVariablesDeclarationToken" + || $class === "CssRulesetDeclarationToken" + ) { + $declaration = $indent . $token->Property . ": "; + if ($this->padding) { + $declaration = str_pad($declaration, $this->padding, " ", STR_PAD_RIGHT); + } + $r[] = $declaration . $token->Value . ($token->IsImportant ? " !important" : "") . ";"; + } else if ($class === "CssAtFontFaceEndToken" + || $class === "CssAtMediaEndToken" + || $class === "CssAtKeyframesEndToken" + || $class === "CssAtKeyframesRulesetEndToken" + || $class === "CssAtPageEndToken" + || $class === "CssAtVariablesEndToken" + || $class === "CssRulesetEndToken" + ) { + $level--; + $r[] = str_repeat($indent, $level) . "}"; + } + } + return implode("\n", $r); + } } /** * This {@link aCssToken CSS token} is a utility token that extends {@link aNullToken} and returns only a empty string. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssNullToken extends aCssToken { - /** - * Implements {@link aCssToken::__toString()}. - * - * @return string - */ - public function __toString() - { - return ""; - } + /** + * Implements {@link aCssToken::__toString()}. + * + * @return string + */ + public function __toString() { + return ""; + } } /** * CSS Minifier. * - * @package CssMin/Minifier - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssMinifier { - /** - * {@link aCssMinifierFilter Filters}. - * - * @var array - */ - private $filters = array(); - /** - * {@link aCssMinifierPlugin Plugins}. - * - * @var array - */ - private $plugins = array(); - /** - * Minified source. - * - * @var string - */ - private $minified = ""; - /** - * Constructer. - * - * Creates instances of {@link aCssMinifierFilter filters} and {@link aCssMinifierPlugin plugins}. - * - * @param string $source CSS source [optional] - * @param array $filters Filter configuration [optional] - * @param array $plugins Plugin configuration [optional] - * @return void - */ - public function __construct($source = null, array $filters = null, array $plugins = null) - { - $filters = array_merge(array - ( - "ImportImports" => false, - "RemoveComments" => true, - "RemoveEmptyRulesets" => true, - "RemoveEmptyAtBlocks" => true, - "ConvertLevel3Properties" => false, - "ConvertLevel3AtKeyframes" => false, - "Variables" => true, - "RemoveLastDelarationSemiColon" => true - ), is_array($filters) ? $filters : array()); - $plugins = array_merge(array - ( - "Variables" => true, - "ConvertFontWeight" => false, - "ConvertHslColors" => false, - "ConvertRgbColors" => false, - "ConvertNamedColors" => false, - "CompressColorValues" => false, - "CompressUnitValues" => false, - "CompressExpressionValues" => false - ), is_array($plugins) ? $plugins : array()); - // Filters - foreach ($filters as $name => $config) - { - if ($config !== false) - { - $class = "Css" . $name . "MinifierFilter"; - $config = is_array($config) ? $config : array(); - if (class_exists($class)) - { - $this->filters[] = new $class($this, $config); - } - else - { - CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": The filter " . $name . " with the class name " . $class . " was not found")); - } - } - } - // Plugins - foreach ($plugins as $name => $config) - { - if ($config !== false) - { - $class = "Css" . $name . "MinifierPlugin"; - $config = is_array($config) ? $config : array(); - if (class_exists($class)) - { - $this->plugins[] = new $class($this, $config); - } - else - { - CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": The plugin " . $name . " with the class name " . $class . " was not found")); - } - } - } - // -- - if (!is_null($source)) - { - $this->minify($source); - } - } - /** - * Returns the minified Source. - * - * @return string - */ - public function getMinified() - { - return $this->minified; - } - /** - * Returns a plugin by class name. - * - * @param string $name Class name of the plugin - * @return aCssMinifierPlugin - */ - public function getPlugin($class) - { - static $index = null; - if (is_null($index)) - { - $index = array(); - for ($i = 0, $l = count($this->plugins); $i < $l; $i++) - { - $index[get_class($this->plugins[$i])] = $i; - } - } - return isset($index[$class]) ? $this->plugins[$index[$class]] : false; - } - /** - * Minifies the CSS source. - * - * @param string $source CSS source - * @return string - */ - public function minify($source) - { - // Variables - $r = ""; - $parser = new CssParser($source); - $tokens = $parser->getTokens(); - $filters = $this->filters; - $filterCount = count($this->filters); - $plugins = $this->plugins; - $pluginCount = count($plugins); - $pluginIndex = array(); - $pluginTriggerTokens = array(); - $globalTriggerTokens = array(); - for ($i = 0, $l = count($plugins); $i < $l; $i++) - { - $tPluginClassName = get_class($plugins[$i]); - $pluginTriggerTokens[$i] = $plugins[$i]->getTriggerTokens(); - foreach ($pluginTriggerTokens[$i] as $v) - { - if (!in_array($v, $globalTriggerTokens)) - { - $globalTriggerTokens[] = $v; - } - } - $pluginTriggerTokens[$i] = "|" . implode("|", $pluginTriggerTokens[$i]) . "|"; - $pluginIndex[$tPluginClassName] = $i; - } - $globalTriggerTokens = "|" . implode("|", $globalTriggerTokens) . "|"; - /* + /** + * {@link aCssMinifierFilter Filters}. + * + * @var array + */ + private $filters = array(); + /** + * {@link aCssMinifierPlugin Plugins}. + * + * @var array + */ + private $plugins = array(); + /** + * Minified source. + * + * @var string + */ + private $minified = ""; + + /** + * Constructer. + * + * Creates instances of {@link aCssMinifierFilter filters} and {@link aCssMinifierPlugin plugins}. + * + * @param string $source CSS source [optional] + * @param array $filters Filter configuration [optional] + * @param array $plugins Plugin configuration [optional] + * @return void + */ + public function __construct($source = NULL, array $filters = NULL, array $plugins = NULL) { + $filters = array_merge(array + ( + "ImportImports" => FALSE, + "RemoveComments" => TRUE, + "RemoveEmptyRulesets" => TRUE, + "RemoveEmptyAtBlocks" => TRUE, + "ConvertLevel3Properties" => FALSE, + "ConvertLevel3AtKeyframes" => FALSE, + "Variables" => TRUE, + "RemoveLastDelarationSemiColon" => TRUE + ), is_array($filters) ? $filters : array()); + $plugins = array_merge(array + ( + "Variables" => TRUE, + "ConvertFontWeight" => FALSE, + "ConvertHslColors" => FALSE, + "ConvertRgbColors" => FALSE, + "ConvertNamedColors" => FALSE, + "CompressColorValues" => FALSE, + "CompressUnitValues" => FALSE, + "CompressExpressionValues" => FALSE + ), is_array($plugins) ? $plugins : array()); + // Filters + foreach ($filters as $name => $config) { + if ($config !== FALSE) { + $class = "Css" . $name . "MinifierFilter"; + $config = is_array($config) ? $config : array(); + if (class_exists($class)) { + $this->filters[] = new $class($this, $config); + } else { + CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": The filter " . $name . " with the class name " . $class . " was not found")); + } + } + } + // Plugins + foreach ($plugins as $name => $config) { + if ($config !== FALSE) { + $class = "Css" . $name . "MinifierPlugin"; + $config = is_array($config) ? $config : array(); + if (class_exists($class)) { + $this->plugins[] = new $class($this, $config); + } else { + CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": The plugin " . $name . " with the class name " . $class . " was not found")); + } + } + } + // -- + if (!is_null($source)) { + $this->minify($source); + } + } + + /** + * Returns the minified Source. + * + * @return string + */ + public function getMinified() { + return $this->minified; + } + + /** + * Returns a plugin by class name. + * + * @param string $name Class name of the plugin + * @return aCssMinifierPlugin + */ + public function getPlugin($class) { + static $index = NULL; + if (is_null($index)) { + $index = array(); + for ($i = 0, $l = count($this->plugins); $i < $l; $i++) { + $index[get_class($this->plugins[$i])] = $i; + } + } + return isset($index[$class]) ? $this->plugins[$index[$class]] : FALSE; + } + + /** + * Minifies the CSS source. + * + * @param string $source CSS source + * @return string + */ + public function minify($source) { + // Variables + $r = ""; + $parser = new CssParser($source); + $tokens = $parser->getTokens(); + $filters = $this->filters; + $filterCount = count($this->filters); + $plugins = $this->plugins; + $pluginCount = count($plugins); + $pluginIndex = array(); + $pluginTriggerTokens = array(); + $globalTriggerTokens = array(); + for ($i = 0, $l = count($plugins); $i < $l; $i++) { + $tPluginClassName = get_class($plugins[$i]); + $pluginTriggerTokens[$i] = $plugins[$i]->getTriggerTokens(); + foreach ($pluginTriggerTokens[$i] as $v) { + if (!in_array($v, $globalTriggerTokens)) { + $globalTriggerTokens[] = $v; + } + } + $pluginTriggerTokens[$i] = "|" . implode("|", $pluginTriggerTokens[$i]) . "|"; + $pluginIndex[$tPluginClassName] = $i; + } + $globalTriggerTokens = "|" . implode("|", $globalTriggerTokens) . "|"; + /* * Apply filters */ - for($i = 0; $i < $filterCount; $i++) - { - // Apply the filter; if the return value is larger than 0... - if ($filters[$i]->apply($tokens) > 0) - { - // ...then filter null values and rebuild the token array - $tokens = array_values(array_filter($tokens)); - } - } - $tokenCount = count($tokens); - /* + for ($i = 0; $i < $filterCount; $i++) { + // Apply the filter; if the return value is larger than 0... + if ($filters[$i]->apply($tokens) > 0) { + // ...then filter null values and rebuild the token array + $tokens = array_values(array_filter($tokens)); + } + } + $tokenCount = count($tokens); + /* * Apply plugins */ - for($i = 0; $i < $tokenCount; $i++) - { - $triggerToken = "|" . get_class($tokens[$i]) . "|"; - if (strpos($globalTriggerTokens, $triggerToken) !== false) - { - for($ii = 0; $ii < $pluginCount; $ii++) - { - if (strpos($pluginTriggerTokens[$ii], $triggerToken) !== false || $pluginTriggerTokens[$ii] === false) - { - // Apply the plugin; if the return value is TRUE continue to the next token - if ($plugins[$ii]->apply($tokens[$i]) === true) - { - continue 2; - } - } - } - } - } - // Stringify the tokens - for($i = 0; $i < $tokenCount; $i++) - { - $r .= (string) $tokens[$i]; - } - $this->minified = $r; - return $r; - } + for ($i = 0; $i < $tokenCount; $i++) { + $triggerToken = "|" . get_class($tokens[$i]) . "|"; + if (strpos($globalTriggerTokens, $triggerToken) !== FALSE) { + for ($ii = 0; $ii < $pluginCount; $ii++) { + if (strpos($pluginTriggerTokens[$ii], $triggerToken) !== FALSE || $pluginTriggerTokens[$ii] === FALSE) { + // Apply the plugin; if the return value is TRUE continue to the next token + if ($plugins[$ii]->apply($tokens[$i]) === TRUE) { + continue 2; + } + } + } + } + } + // Stringify the tokens + for ($i = 0; $i < $tokenCount; $i++) { + $r .= (string)$tokens[$i]; + } + $this->minified = $r; + return $r; + } } /** @@ -2176,166 +2000,155 @@ class CssMinifier * THE SOFTWARE. * -- * - * @package CssMin - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssMin { - /** - * Index of classes - * - * @var array - */ - private static $classIndex = array(); - /** - * Parse/minify errors - * - * @var array - */ - private static $errors = array(); - /** - * Verbose output. - * - * @var boolean - */ - private static $isVerbose = false; - /** - * {@link http://goo.gl/JrW54 Autoload} function of CssMin. - * - * @param string $class Name of the class - * @return void - */ - public static function autoload($class) - { - if (isset(self::$classIndex[$class])) - { - require(self::$classIndex[$class]); - } - } - /** - * Return errors - * - * @return array of {CssError}. - */ - public static function getErrors() - { - return self::$errors; - } - /** - * Returns if there were errors. - * - * @return boolean - */ - public static function hasErrors() - { - return count(self::$errors) > 0; - } - /** - * Initialises CssMin. - * - * @return void - */ - public static function initialise() - { - // Create the class index for autoloading or including - $paths = array(dirname(__FILE__)); - for ($i = 0; $i < count($paths); $i++) - { - $path = $paths[$i]; - $subDirectorys = glob($path . "*", GLOB_MARK | GLOB_ONLYDIR | GLOB_NOSORT); - if (is_array($subDirectorys)) - { - foreach ($subDirectorys as $subDirectory) - { - $paths[] = $subDirectory; - } - } - $files = glob($path . "*.php", 0); - if (is_array($files)) - { - foreach ($files as $file) - { - $class = substr(basename($file), 0, -4); - self::$classIndex[$class] = $file; - } - } - } - krsort(self::$classIndex); - // Only use autoloading if spl_autoload_register() is available and no __autoload() is defined (because - // __autoload() breaks if spl_autoload_register() is used. - if (function_exists("spl_autoload_register") && !is_callable("__autoload")) - { - spl_autoload_register(array(__CLASS__, "autoload")); - } - // Otherwise include all class files - else - { - foreach (self::$classIndex as $class => $file) - { - if (!class_exists($class)) - { - require_once($file); - } - } - } - } - /** - * Minifies CSS source. - * - * @param string $source CSS source - * @param array $filters Filter configuration [optional] - * @param array $plugins Plugin configuration [optional] - * @return string Minified CSS - */ - public static function minify($source, array $filters = null, array $plugins = null) - { - self::$errors = array(); - $minifier = new CssMinifier($source, $filters, $plugins); - return $minifier->getMinified(); - } - /** - * Parse the CSS source. - * - * @param string $source CSS source - * @param array $plugins Plugin configuration [optional] - * @return array Array of aCssToken - */ - public static function parse($source, array $plugins = null) - { - self::$errors = array(); - $parser = new CssParser($source, $plugins); - return $parser->getTokens(); - } - /** - * -- - * - * @param boolean $to - * @return boolean - */ - public static function setVerbose($to) - { - self::$isVerbose = (boolean) $to; - return self::$isVerbose; - } - /** - * -- - * - * @param CssError $error - * @return void - */ - public static function triggerError(CssError $error) - { - self::$errors[] = $error; - if (self::$isVerbose) - { - trigger_error((string) $error, E_USER_WARNING); - } - } + /** + * Index of classes + * + * @var array + */ + private static $classIndex = array(); + /** + * Parse/minify errors + * + * @var array + */ + private static $errors = array(); + /** + * Verbose output. + * + * @var boolean + */ + private static $isVerbose = FALSE; + + /** + * {@link http://goo.gl/JrW54 Autoload} function of CssMin. + * + * @param string $class Name of the class + * @return void + */ + public static function autoload($class) { + if (isset(self::$classIndex[$class])) { + require(self::$classIndex[$class]); + } + } + + /** + * Return errors + * + * @return array of {CssError}. + */ + public static function getErrors() { + return self::$errors; + } + + /** + * Returns if there were errors. + * + * @return boolean + */ + public static function hasErrors() { + return count(self::$errors) > 0; + } + + /** + * Initialises CssMin. + * + * @return void + */ + public static function initialise() { + // Create the class index for autoloading or including + $paths = array(dirname(__FILE__)); + for ($i = 0; $i < count($paths); $i++) { + $path = $paths[$i]; + $subDirectorys = glob($path . "*", GLOB_MARK | GLOB_ONLYDIR | GLOB_NOSORT); + if (is_array($subDirectorys)) { + foreach ($subDirectorys as $subDirectory) { + $paths[] = $subDirectory; + } + } + $files = glob($path . "*.php", 0); + if (is_array($files)) { + foreach ($files as $file) { + $class = substr(basename($file), 0, -4); + self::$classIndex[$class] = $file; + } + } + } + krsort(self::$classIndex); + // Only use autoloading if spl_autoload_register() is available and no __autoload() is defined (because + // __autoload() breaks if spl_autoload_register() is used. + if (function_exists("spl_autoload_register") && !is_callable("__autoload")) { + spl_autoload_register(array(__CLASS__, "autoload")); + } // Otherwise include all class files + else { + foreach (self::$classIndex as $class => $file) { + if (!class_exists($class)) { + require_once($file); + } + } + } + } + + /** + * Minifies CSS source. + * + * @param string $source CSS source + * @param array $filters Filter configuration [optional] + * @param array $plugins Plugin configuration [optional] + * @return string Minified CSS + */ + public static function minify($source, array $filters = NULL, array $plugins = NULL) { + self::$errors = array(); + $minifier = new CssMinifier($source, $filters, $plugins); + return $minifier->getMinified(); + } + + /** + * Parse the CSS source. + * + * @param string $source CSS source + * @param array $plugins Plugin configuration [optional] + * @return array Array of aCssToken + */ + public static function parse($source, array $plugins = NULL) { + self::$errors = array(); + $parser = new CssParser($source, $plugins); + return $parser->getTokens(); + } + + /** + * -- + * + * @param boolean $to + * @return boolean + */ + public static function setVerbose($to) { + self::$isVerbose = (boolean)$to; + return self::$isVerbose; + } + + /** + * -- + * + * @param CssError $error + * @return void + */ + public static function triggerError(CssError $error) { + self::$errors[] = $error; + if (self::$isVerbose) { + trigger_error((string)$error, E_USER_WARNING); + } + } } + // Initialises CssMin CssMin::initialise(); @@ -2343,203 +2156,164 @@ CssMin::initialise(); * This {@link aCssMinifierFilter minifier filter} import external css files defined with the @import at-rule into the * current stylesheet. * - * @package CssMin/Minifier/Filters - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Filters + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssImportImportsMinifierFilter extends aCssMinifierFilter { - /** - * Array with already imported external stylesheets. - * - * @var array - */ - private $imported = array(); - /** - * Implements {@link aCssMinifierFilter::filter()}. - * - * @param array $tokens Array of objects of type aCssToken - * @return integer Count of added, changed or removed tokens; a return value large than 0 will rebuild the array - */ - public function apply(array &$tokens) - { - if (!isset($this->configuration["BasePath"]) || !is_dir($this->configuration["BasePath"])) - { - CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Base path " . ($this->configuration["BasePath"] ? $this->configuration["BasePath"] : "null"). " is not a directory")); - return 0; - } - for ($i = 0, $l = count($tokens); $i < $l; $i++) - { - if (get_class($tokens[$i]) === "CssAtImportToken") - { - $import = $this->configuration["BasePath"] . "/" . $tokens[$i]->Import; - // Import file was not found/is not a file - if (!is_file($import)) - { - CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Import file " . $import. " was not found.", (string) $tokens[$i])); - } - // Import file already imported; remove this @import at-rule to prevent recursions - elseif (in_array($import, $this->imported)) - { - CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Import file " . $import. " was already imported.", (string) $tokens[$i])); - $tokens[$i] = null; - } - else - { - $this->imported[] = $import; - $parser = new CssParser(file_get_contents($import)); - $import = $parser->getTokens(); - // The @import at-rule has media types defined requiring special handling - if (count($tokens[$i]->MediaTypes) > 0 && !(count($tokens[$i]->MediaTypes) == 1 && $tokens[$i]->MediaTypes[0] == "all")) - { - $blocks = array(); - /* + /** + * Array with already imported external stylesheets. + * + * @var array + */ + private $imported = array(); + + /** + * Implements {@link aCssMinifierFilter::filter()}. + * + * @param array $tokens Array of objects of type aCssToken + * @return integer Count of added, changed or removed tokens; a return value large than 0 will rebuild the array + */ + public function apply(array &$tokens) { + if (!isset($this->configuration["BasePath"]) || !is_dir($this->configuration["BasePath"])) { + CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Base path " . ($this->configuration["BasePath"] ? $this->configuration["BasePath"] : "null") . " is not a directory")); + return 0; + } + for ($i = 0, $l = count($tokens); $i < $l; $i++) { + if (get_class($tokens[$i]) === "CssAtImportToken") { + $import = $this->configuration["BasePath"] . "/" . $tokens[$i]->Import; + // Import file was not found/is not a file + if (!is_file($import)) { + CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Import file " . $import . " was not found.", (string)$tokens[$i])); + } // Import file already imported; remove this @import at-rule to prevent recursions + else if (in_array($import, $this->imported)) { + CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Import file " . $import . " was already imported.", (string)$tokens[$i])); + $tokens[$i] = NULL; + } else { + $this->imported[] = $import; + $parser = new CssParser(file_get_contents($import)); + $import = $parser->getTokens(); + // The @import at-rule has media types defined requiring special handling + if (count($tokens[$i]->MediaTypes) > 0 && !(count($tokens[$i]->MediaTypes) == 1 && $tokens[$i]->MediaTypes[0] == "all")) { + $blocks = array(); + /* * Filter or set media types of @import at-rule or remove the @import at-rule if no media type is matching the parent @import at-rule */ - for($ii = 0, $ll = count($import); $ii < $ll; $ii++) - { - if (get_class($import[$ii]) === "CssAtImportToken") - { - // @import at-rule defines no media type or only the "all" media type; set the media types to the one defined in the parent @import at-rule - if (count($import[$ii]->MediaTypes) == 0 || (count($import[$ii]->MediaTypes) == 1 && $import[$ii]->MediaTypes[0] == "all")) - { - $import[$ii]->MediaTypes = $tokens[$i]->MediaTypes; - } - // @import at-rule defineds one or more media types; filter out media types not matching with the parent @import at-rule - elseif (count($import[$ii]->MediaTypes) > 0) - { - foreach ($import[$ii]->MediaTypes as $index => $mediaType) - { - if (!in_array($mediaType, $tokens[$i]->MediaTypes)) - { - unset($import[$ii]->MediaTypes[$index]); - } - } - $import[$ii]->MediaTypes = array_values($import[$ii]->MediaTypes); - // If there are no media types left in the @import at-rule remove the @import at-rule - if (count($import[$ii]->MediaTypes) == 0) - { - $import[$ii] = null; - } - } - } - } - /* + for ($ii = 0, $ll = count($import); $ii < $ll; $ii++) { + if (get_class($import[$ii]) === "CssAtImportToken") { + // @import at-rule defines no media type or only the "all" media type; set the media types to the one defined in the parent @import at-rule + if (count($import[$ii]->MediaTypes) == 0 || (count($import[$ii]->MediaTypes) == 1 && $import[$ii]->MediaTypes[0] == "all")) { + $import[$ii]->MediaTypes = $tokens[$i]->MediaTypes; + } // @import at-rule defineds one or more media types; filter out media types not matching with the parent @import at-rule + else if (count($import[$ii]->MediaTypes) > 0) { + foreach ($import[$ii]->MediaTypes as $index => $mediaType) { + if (!in_array($mediaType, $tokens[$i]->MediaTypes)) { + unset($import[$ii]->MediaTypes[$index]); + } + } + $import[$ii]->MediaTypes = array_values($import[$ii]->MediaTypes); + // If there are no media types left in the @import at-rule remove the @import at-rule + if (count($import[$ii]->MediaTypes) == 0) { + $import[$ii] = NULL; + } + } + } + } + /* * Remove media types of @media at-rule block not defined in the @import at-rule */ - for($ii = 0, $ll = count($import); $ii < $ll; $ii++) - { - if (get_class($import[$ii]) === "CssAtMediaStartToken") - { - foreach ($import[$ii]->MediaTypes as $index => $mediaType) - { - if (!in_array($mediaType, $tokens[$i]->MediaTypes)) - { - unset($import[$ii]->MediaTypes[$index]); - } - $import[$ii]->MediaTypes = array_values($import[$ii]->MediaTypes); - } - } - } - /* + for ($ii = 0, $ll = count($import); $ii < $ll; $ii++) { + if (get_class($import[$ii]) === "CssAtMediaStartToken") { + foreach ($import[$ii]->MediaTypes as $index => $mediaType) { + if (!in_array($mediaType, $tokens[$i]->MediaTypes)) { + unset($import[$ii]->MediaTypes[$index]); + } + $import[$ii]->MediaTypes = array_values($import[$ii]->MediaTypes); + } + } + } + /* * If no media types left of the @media at-rule block remove the complete block */ - for($ii = 0, $ll = count($import); $ii < $ll; $ii++) - { - if (get_class($import[$ii]) === "CssAtMediaStartToken") - { - if (count($import[$ii]->MediaTypes) === 0) - { - for ($iii = $ii; $iii < $ll; $iii++) - { - if (get_class($import[$iii]) === "CssAtMediaEndToken") - { - break; - } - } - if (get_class($import[$iii]) === "CssAtMediaEndToken") - { - array_splice($import, $ii, $iii - $ii + 1, array()); - $ll = count($import); - } - } - } - } - /* + for ($ii = 0, $ll = count($import); $ii < $ll; $ii++) { + if (get_class($import[$ii]) === "CssAtMediaStartToken") { + if (count($import[$ii]->MediaTypes) === 0) { + for ($iii = $ii; $iii < $ll; $iii++) { + if (get_class($import[$iii]) === "CssAtMediaEndToken") { + break; + } + } + if (get_class($import[$iii]) === "CssAtMediaEndToken") { + array_splice($import, $ii, $iii - $ii + 1, array()); + $ll = count($import); + } + } + } + } + /* * If the media types of the @media at-rule equals the media types defined in the @import * at-rule remove the CssAtMediaStartToken and CssAtMediaEndToken token */ - for($ii = 0, $ll = count($import); $ii < $ll; $ii++) - { - if (get_class($import[$ii]) === "CssAtMediaStartToken" && count(array_diff($tokens[$i]->MediaTypes, $import[$ii]->MediaTypes)) === 0) - { - for ($iii = $ii; $iii < $ll; $iii++) - { - if (get_class($import[$iii]) == "CssAtMediaEndToken") - { - break; - } - } - if (get_class($import[$iii]) == "CssAtMediaEndToken") - { - unset($import[$ii]); - unset($import[$iii]); - $import = array_values($import); - $ll = count($import); - } - } - } - /** - * Extract CssAtImportToken and CssAtCharsetToken tokens - */ - for($ii = 0, $ll = count($import); $ii < $ll; $ii++) - { - $class = get_class($import[$ii]); - if ($class === "CssAtImportToken" || $class === "CssAtCharsetToken") - { - $blocks = array_merge($blocks, array_splice($import, $ii, 1, array())); - $ll = count($import); - } - } - /* + for ($ii = 0, $ll = count($import); $ii < $ll; $ii++) { + if (get_class($import[$ii]) === "CssAtMediaStartToken" && count(array_diff($tokens[$i]->MediaTypes, $import[$ii]->MediaTypes)) === 0) { + for ($iii = $ii; $iii < $ll; $iii++) { + if (get_class($import[$iii]) == "CssAtMediaEndToken") { + break; + } + } + if (get_class($import[$iii]) == "CssAtMediaEndToken") { + unset($import[$ii]); + unset($import[$iii]); + $import = array_values($import); + $ll = count($import); + } + } + } + /** + * Extract CssAtImportToken and CssAtCharsetToken tokens + */ + for ($ii = 0, $ll = count($import); $ii < $ll; $ii++) { + $class = get_class($import[$ii]); + if ($class === "CssAtImportToken" || $class === "CssAtCharsetToken") { + $blocks = array_merge($blocks, array_splice($import, $ii, 1, array())); + $ll = count($import); + } + } + /* * Extract the @font-face, @media and @page at-rule block */ - for($ii = 0, $ll = count($import); $ii < $ll; $ii++) - { - $class = get_class($import[$ii]); - if ($class === "CssAtFontFaceStartToken" || $class === "CssAtMediaStartToken" || $class === "CssAtPageStartToken" || $class === "CssAtVariablesStartToken") - { - for ($iii = $ii; $iii < $ll; $iii++) - { - $class = get_class($import[$iii]); - if ($class === "CssAtFontFaceEndToken" || $class === "CssAtMediaEndToken" || $class === "CssAtPageEndToken" || $class === "CssAtVariablesEndToken") - { - break; - } - } - $class = get_class($import[$iii]); - if (isset($import[$iii]) && ($class === "CssAtFontFaceEndToken" || $class === "CssAtMediaEndToken" || $class === "CssAtPageEndToken" || $class === "CssAtVariablesEndToken")) - { - $blocks = array_merge($blocks, array_splice($import, $ii, $iii - $ii + 1, array())); - $ll = count($import); - } - } - } - // Create the import array with extracted tokens and the rulesets wrapped into a @media at-rule block - $import = array_merge($blocks, array(new CssAtMediaStartToken($tokens[$i]->MediaTypes)), $import, array(new CssAtMediaEndToken())); - } - // Insert the imported tokens - array_splice($tokens, $i, 1, $import); - // Modify parameters of the for-loop - $i--; - $l = count($tokens); - } - } - } - } + for ($ii = 0, $ll = count($import); $ii < $ll; $ii++) { + $class = get_class($import[$ii]); + if ($class === "CssAtFontFaceStartToken" || $class === "CssAtMediaStartToken" || $class === "CssAtPageStartToken" || $class === "CssAtVariablesStartToken") { + for ($iii = $ii; $iii < $ll; $iii++) { + $class = get_class($import[$iii]); + if ($class === "CssAtFontFaceEndToken" || $class === "CssAtMediaEndToken" || $class === "CssAtPageEndToken" || $class === "CssAtVariablesEndToken") { + break; + } + } + $class = get_class($import[$iii]); + if (isset($import[$iii]) && ($class === "CssAtFontFaceEndToken" || $class === "CssAtMediaEndToken" || $class === "CssAtPageEndToken" || $class === "CssAtVariablesEndToken")) { + $blocks = array_merge($blocks, array_splice($import, $ii, $iii - $ii + 1, array())); + $ll = count($import); + } + } + } + // Create the import array with extracted tokens and the rulesets wrapped into a @media at-rule block + $import = array_merge($blocks, array(new CssAtMediaStartToken($tokens[$i]->MediaTypes)), $import, array(new CssAtMediaEndToken())); + } + // Insert the imported tokens + array_splice($tokens, $i, 1, $import); + // Modify parameters of the for-loop + $i--; + $l = count($tokens); + } + } + } + } } /** @@ -2548,145 +2322,136 @@ class CssImportImportsMinifierFilter extends aCssMinifierFilter * This plugin return no {@link aCssToken CssToken} but ensures that expression() declaration values will get parsed * properly. * - * @package CssMin/Parser/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Parser/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssExpressionParserPlugin extends aCssParserPlugin { - /** - * Count of left braces. - * - * @var integer - */ - private $leftBraces = 0; - /** - * Count of right braces. - * - * @var integer - */ - private $rightBraces = 0; - /** - * Implements {@link aCssParserPlugin::getTriggerChars()}. - * - * @return array - */ - public function getTriggerChars() - { - return array("(", ")", ";", "}"); - } - /** - * Implements {@link aCssParserPlugin::getTriggerStates()}. - * - * @return array - */ - public function getTriggerStates() - { - return false; - } - /** - * Implements {@link aCssParserPlugin::parse()}. - * - * @param integer $index Current index - * @param string $char Current char - * @param string $previousChar Previous char - * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing - */ - public function parse($index, $char, $previousChar, $state) - { - // Start of expression - if ($char === "(" && strtolower(substr($this->parser->getSource(), $index - 10, 11)) === "expression(" && $state !== "T_EXPRESSION") - { - $this->parser->pushState("T_EXPRESSION"); - $this->leftBraces++; - } - // Count left braces - elseif ($char === "(" && $state === "T_EXPRESSION") - { - $this->leftBraces++; - } - // Count right braces - elseif ($char === ")" && $state === "T_EXPRESSION") - { - $this->rightBraces++; - } - // Possible end of expression; if left and right braces are equal the expressen ends - elseif (($char === ";" || $char === "}") && $state === "T_EXPRESSION" && $this->leftBraces === $this->rightBraces) - { - $this->leftBraces = $this->rightBraces = 0; - $this->parser->popState(); - return $index - 1; - } - else - { - return false; - } - return true; - } + /** + * Count of left braces. + * + * @var integer + */ + private $leftBraces = 0; + /** + * Count of right braces. + * + * @var integer + */ + private $rightBraces = 0; + + /** + * Implements {@link aCssParserPlugin::getTriggerChars()}. + * + * @return array + */ + public function getTriggerChars() { + return array("(", ")", ";", "}"); + } + + /** + * Implements {@link aCssParserPlugin::getTriggerStates()}. + * + * @return array + */ + public function getTriggerStates() { + return FALSE; + } + + /** + * Implements {@link aCssParserPlugin::parse()}. + * + * @param integer $index Current index + * @param string $char Current char + * @param string $previousChar Previous char + * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing + */ + public function parse($index, $char, $previousChar, $state) { + // Start of expression + if ($char === "(" && strtolower(substr($this->parser->getSource(), $index - 10, 11)) === "expression(" && $state !== "T_EXPRESSION") { + $this->parser->pushState("T_EXPRESSION"); + $this->leftBraces++; + } // Count left braces + else if ($char === "(" && $state === "T_EXPRESSION") { + $this->leftBraces++; + } // Count right braces + else if ($char === ")" && $state === "T_EXPRESSION") { + $this->rightBraces++; + } // Possible end of expression; if left and right braces are equal the expressen ends + else if (($char === ";" || $char === "}") && $state === "T_EXPRESSION" && $this->leftBraces === $this->rightBraces) { + $this->leftBraces = $this->rightBraces = 0; + $this->parser->popState(); + return $index - 1; + } else { + return FALSE; + } + return TRUE; + } } /** * CSS Error. * - * @package CssMin - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssError { - /** - * File. - * - * @var string - */ - public $File = ""; - /** - * Line. - * - * @var integer - */ - public $Line = 0; - /** - * Error message. - * - * @var string - */ - public $Message = ""; - /** - * Source. - * - * @var string - */ - public $Source = ""; - /** - * Constructor triggering the error. - * - * @param string $message Error message - * @param string $source Corresponding line [optional] - * @return void - */ - public function __construct($file, $line, $message, $source = "") - { - $this->File = $file; - $this->Line = $line; - $this->Message = $message; - $this->Source = $source; - } - /** - * Returns the error as formatted string. - * - * @return string - */ - public function __toString() - { - return $this->Message . ($this->Source ? ":
" . $this->Source . "": "") . "
in file " . $this->File . " at line " . $this->Line; - } + /** + * File. + * + * @var string + */ + public $File = ""; + /** + * Line. + * + * @var integer + */ + public $Line = 0; + /** + * Error message. + * + * @var string + */ + public $Message = ""; + /** + * Source. + * + * @var string + */ + public $Source = ""; + + /** + * Constructor triggering the error. + * + * @param string $message Error message + * @param string $source Corresponding line [optional] + * @return void + */ + public function __construct($file, $line, $message, $source = "") { + $this->File = $file; + $this->Line = $line; + $this->Message = $message; + $this->Source = $source; + } + + /** + * Returns the error as formatted string. + * + * @return string + */ + public function __toString() { + return $this->Message . ($this->Source ? ":
" . $this->Source . "" : "") . "
in file " . $this->File . " at line " . $this->Line; + } } /** @@ -2702,58 +2467,55 @@ class CssError * color:#c89905; * * - * @package CssMin/Minifier/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssConvertRgbColorsMinifierPlugin extends aCssMinifierPlugin { - /** - * Regular expression matching the value. - * - * @var string - */ - private $reMatch = "/rgb\s*\(\s*([0-9%]+)\s*,\s*([0-9%]+)\s*,\s*([0-9%]+)\s*\)/iS"; - /** - * Implements {@link aCssMinifierPlugin::minify()}. - * - * @param aCssToken $token Token to process - * @return boolean Return TRUE to break the processing of this token; FALSE to continue - */ - public function apply(aCssToken &$token) - { - if (stripos($token->Value, "rgb") !== false && preg_match($this->reMatch, $token->Value, $m)) - { - for ($i = 1, $l = count($m); $i < $l; $i++) - { - if (strpos("%", $m[$i]) !== false) - { - $m[$i] = substr($m[$i], 0, -1); - $m[$i] = (int) (256 * ($m[$i] / 100)); - } - $m[$i] = str_pad(dechex($m[$i]), 2, "0", STR_PAD_LEFT); - } - $token->Value = str_replace($m[0], "#" . $m[1] . $m[2] . $m[3], $token->Value); - } - return false; - } - /** - * Implements {@link aMinifierPlugin::getTriggerTokens()} - * - * @return array - */ - public function getTriggerTokens() - { - return array - ( - "CssAtFontFaceDeclarationToken", - "CssAtPageDeclarationToken", - "CssRulesetDeclarationToken" - ); - } + /** + * Regular expression matching the value. + * + * @var string + */ + private $reMatch = "/rgb\s*\(\s*([0-9%]+)\s*,\s*([0-9%]+)\s*,\s*([0-9%]+)\s*\)/iS"; + + /** + * Implements {@link aCssMinifierPlugin::minify()}. + * + * @param aCssToken $token Token to process + * @return boolean Return TRUE to break the processing of this token; FALSE to continue + */ + public function apply(aCssToken &$token) { + if (stripos($token->Value, "rgb") !== FALSE && preg_match($this->reMatch, $token->Value, $m)) { + for ($i = 1, $l = count($m); $i < $l; $i++) { + if (strpos("%", $m[$i]) !== FALSE) { + $m[$i] = substr($m[$i], 0, -1); + $m[$i] = (int)(256 * ($m[$i] / 100)); + } + $m[$i] = str_pad(dechex($m[$i]), 2, "0", STR_PAD_LEFT); + } + $token->Value = str_replace($m[0], "#" . $m[1] . $m[2] . $m[3], $token->Value); + } + return FALSE; + } + + /** + * Implements {@link aMinifierPlugin::getTriggerTokens()} + * + * @return array + */ + public function getTriggerTokens() { + return array + ( + "CssAtFontFaceDeclarationToken", + "CssAtPageDeclarationToken", + "CssRulesetDeclarationToken" + ); + } } /** @@ -2771,635 +2533,607 @@ class CssConvertRgbColorsMinifierPlugin extends aCssMinifierPlugin * border:1px solid #4b0082; * * - * @package CssMin/Minifier/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssConvertNamedColorsMinifierPlugin extends aCssMinifierPlugin { - /** - * Regular expression matching the value. - * - * @var string - */ - private $reMatch = null; - /** - * Transformation table used by the {@link CssConvertNamedColorsMinifierPlugin::reReplace() replacement method}. - * - * @var array - */ - private $transformation = array - ( - "aliceblue" => "#f0f8ff", - "antiquewhite" => "#faebd7", - "aqua" => "#0ff", - "aquamarine" => "#7fffd4", - "azure" => "#f0ffff", - "beige" => "#f5f5dc", - "black" => "#000", - "blue" => "#00f", - "blueviolet" => "#8a2be2", - "brown" => "#a52a2a", - "burlywood" => "#deb887", - "cadetblue" => "#5f9ea0", - "chartreuse" => "#7fff00", - "chocolate" => "#d2691e", - "coral" => "#ff7f50", - "cornflowerblue" => "#6495ed", - "cornsilk" => "#fff8dc", - "crimson" => "#dc143c", - "darkblue" => "#00008b", - "darkcyan" => "#008b8b", - "darkgoldenrod" => "#b8860b", - "darkgray" => "#a9a9a9", - "darkgreen" => "#006400", - "darkkhaki" => "#bdb76b", - "darkmagenta" => "#8b008b", - "darkolivegreen" => "#556b2f", - "darkorange" => "#ff8c00", - "darkorchid" => "#9932cc", - "darkred" => "#8b0000", - "darksalmon" => "#e9967a", - "darkseagreen" => "#8fbc8f", - "darkslateblue" => "#483d8b", - "darkslategray" => "#2f4f4f", - "darkturquoise" => "#00ced1", - "darkviolet" => "#9400d3", - "deeppink" => "#ff1493", - "deepskyblue" => "#00bfff", - "dimgray" => "#696969", - "dodgerblue" => "#1e90ff", - "firebrick" => "#b22222", - "floralwhite" => "#fffaf0", - "forestgreen" => "#228b22", - "fuchsia" => "#f0f", - "gainsboro" => "#dcdcdc", - "ghostwhite" => "#f8f8ff", - "gold" => "#ffd700", - "goldenrod" => "#daa520", - "gray" => "#808080", - "green" => "#008000", - "greenyellow" => "#adff2f", - "honeydew" => "#f0fff0", - "hotpink" => "#ff69b4", - "indianred" => "#cd5c5c", - "indigo" => "#4b0082", - "ivory" => "#fffff0", - "khaki" => "#f0e68c", - "lavender" => "#e6e6fa", - "lavenderblush" => "#fff0f5", - "lawngreen" => "#7cfc00", - "lemonchiffon" => "#fffacd", - "lightblue" => "#add8e6", - "lightcoral" => "#f08080", - "lightcyan" => "#e0ffff", - "lightgoldenrodyellow" => "#fafad2", - "lightgreen" => "#90ee90", - "lightgrey" => "#d3d3d3", - "lightpink" => "#ffb6c1", - "lightsalmon" => "#ffa07a", - "lightseagreen" => "#20b2aa", - "lightskyblue" => "#87cefa", - "lightslategray" => "#789", - "lightsteelblue" => "#b0c4de", - "lightyellow" => "#ffffe0", - "lime" => "#0f0", - "limegreen" => "#32cd32", - "linen" => "#faf0e6", - "maroon" => "#800000", - "mediumaquamarine" => "#66cdaa", - "mediumblue" => "#0000cd", - "mediumorchid" => "#ba55d3", - "mediumpurple" => "#9370db", - "mediumseagreen" => "#3cb371", - "mediumslateblue" => "#7b68ee", - "mediumspringgreen" => "#00fa9a", - "mediumturquoise" => "#48d1cc", - "mediumvioletred" => "#c71585", - "midnightblue" => "#191970", - "mintcream" => "#f5fffa", - "mistyrose" => "#ffe4e1", - "moccasin" => "#ffe4b5", - "navajowhite" => "#ffdead", - "navy" => "#000080", - "oldlace" => "#fdf5e6", - "olive" => "#808000", - "olivedrab" => "#6b8e23", - "orange" => "#ffa500", - "orangered" => "#ff4500", - "orchid" => "#da70d6", - "palegoldenrod" => "#eee8aa", - "palegreen" => "#98fb98", - "paleturquoise" => "#afeeee", - "palevioletred" => "#db7093", - "papayawhip" => "#ffefd5", - "peachpuff" => "#ffdab9", - "peru" => "#cd853f", - "pink" => "#ffc0cb", - "plum" => "#dda0dd", - "powderblue" => "#b0e0e6", - "purple" => "#800080", - "red" => "#f00", - "rosybrown" => "#bc8f8f", - "royalblue" => "#4169e1", - "saddlebrown" => "#8b4513", - "salmon" => "#fa8072", - "sandybrown" => "#f4a460", - "seagreen" => "#2e8b57", - "seashell" => "#fff5ee", - "sienna" => "#a0522d", - "silver" => "#c0c0c0", - "skyblue" => "#87ceeb", - "slateblue" => "#6a5acd", - "slategray" => "#708090", - "snow" => "#fffafa", - "springgreen" => "#00ff7f", - "steelblue" => "#4682b4", - "tan" => "#d2b48c", - "teal" => "#008080", - "thistle" => "#d8bfd8", - "tomato" => "#ff6347", - "turquoise" => "#40e0d0", - "violet" => "#ee82ee", - "wheat" => "#f5deb3", - "white" => "#fff", - "whitesmoke" => "#f5f5f5", - "yellow" => "#ff0", - "yellowgreen" => "#9acd32" - ); - /** - * Overwrites {@link aCssMinifierPlugin::__construct()}. - * - * The constructor will create the {@link CssConvertNamedColorsMinifierPlugin::$reMatch replace regular expression} - * based on the {@link CssConvertNamedColorsMinifierPlugin::$transformation transformation table}. - * - * @param CssMinifier $minifier The CssMinifier object of this plugin. - * @param array $configuration Plugin configuration [optional] - * @return void - */ - public function __construct(CssMinifier $minifier, array $configuration = array()) - { - $this->reMatch = "/(^|\s)+(" . implode("|", array_keys($this->transformation)) . ")(\s|$)+/iS"; - parent::__construct($minifier, $configuration); - } - /** - * Implements {@link aCssMinifierPlugin::minify()}. - * - * @param aCssToken $token Token to process - * @return boolean Return TRUE to break the processing of this token; FALSE to continue - */ - public function apply(aCssToken &$token) - { - $lcValue = strtolower($token->Value); - // Declaration value equals a value in the transformation table => simple replace - if (isset($this->transformation[$lcValue])) - { - $token->Value = $this->transformation[$lcValue]; - } - // Declaration value contains a value in the transformation table => regular expression replace - elseif (preg_match($this->reMatch, $token->Value)) - { - $token->Value = preg_replace_callback($this->reMatch, array($this, 'reReplace'), $token->Value); - } - return false; - } - /** - * Callback for replacement value. - * - * @param array $match - * @return string - */ - private function reReplace($match) - { - return $match[1] . $this->transformation[strtolower($match[2])] . $match[3]; - } - /** - * Implements {@link aMinifierPlugin::getTriggerTokens()} - * - * @return array - */ - public function getTriggerTokens() - { - return array - ( - "CssAtFontFaceDeclarationToken", - "CssAtPageDeclarationToken", - "CssRulesetDeclarationToken" - ); - } + /** + * Regular expression matching the value. + * + * @var string + */ + private $reMatch = NULL; + /** + * Transformation table used by the {@link CssConvertNamedColorsMinifierPlugin::reReplace() replacement method}. + * + * @var array + */ + private $transformation = array + ( + "aliceblue" => "#f0f8ff", + "antiquewhite" => "#faebd7", + "aqua" => "#0ff", + "aquamarine" => "#7fffd4", + "azure" => "#f0ffff", + "beige" => "#f5f5dc", + "black" => "#000", + "blue" => "#00f", + "blueviolet" => "#8a2be2", + "brown" => "#a52a2a", + "burlywood" => "#deb887", + "cadetblue" => "#5f9ea0", + "chartreuse" => "#7fff00", + "chocolate" => "#d2691e", + "coral" => "#ff7f50", + "cornflowerblue" => "#6495ed", + "cornsilk" => "#fff8dc", + "crimson" => "#dc143c", + "darkblue" => "#00008b", + "darkcyan" => "#008b8b", + "darkgoldenrod" => "#b8860b", + "darkgray" => "#a9a9a9", + "darkgreen" => "#006400", + "darkkhaki" => "#bdb76b", + "darkmagenta" => "#8b008b", + "darkolivegreen" => "#556b2f", + "darkorange" => "#ff8c00", + "darkorchid" => "#9932cc", + "darkred" => "#8b0000", + "darksalmon" => "#e9967a", + "darkseagreen" => "#8fbc8f", + "darkslateblue" => "#483d8b", + "darkslategray" => "#2f4f4f", + "darkturquoise" => "#00ced1", + "darkviolet" => "#9400d3", + "deeppink" => "#ff1493", + "deepskyblue" => "#00bfff", + "dimgray" => "#696969", + "dodgerblue" => "#1e90ff", + "firebrick" => "#b22222", + "floralwhite" => "#fffaf0", + "forestgreen" => "#228b22", + "fuchsia" => "#f0f", + "gainsboro" => "#dcdcdc", + "ghostwhite" => "#f8f8ff", + "gold" => "#ffd700", + "goldenrod" => "#daa520", + "gray" => "#808080", + "green" => "#008000", + "greenyellow" => "#adff2f", + "honeydew" => "#f0fff0", + "hotpink" => "#ff69b4", + "indianred" => "#cd5c5c", + "indigo" => "#4b0082", + "ivory" => "#fffff0", + "khaki" => "#f0e68c", + "lavender" => "#e6e6fa", + "lavenderblush" => "#fff0f5", + "lawngreen" => "#7cfc00", + "lemonchiffon" => "#fffacd", + "lightblue" => "#add8e6", + "lightcoral" => "#f08080", + "lightcyan" => "#e0ffff", + "lightgoldenrodyellow" => "#fafad2", + "lightgreen" => "#90ee90", + "lightgrey" => "#d3d3d3", + "lightpink" => "#ffb6c1", + "lightsalmon" => "#ffa07a", + "lightseagreen" => "#20b2aa", + "lightskyblue" => "#87cefa", + "lightslategray" => "#789", + "lightsteelblue" => "#b0c4de", + "lightyellow" => "#ffffe0", + "lime" => "#0f0", + "limegreen" => "#32cd32", + "linen" => "#faf0e6", + "maroon" => "#800000", + "mediumaquamarine" => "#66cdaa", + "mediumblue" => "#0000cd", + "mediumorchid" => "#ba55d3", + "mediumpurple" => "#9370db", + "mediumseagreen" => "#3cb371", + "mediumslateblue" => "#7b68ee", + "mediumspringgreen" => "#00fa9a", + "mediumturquoise" => "#48d1cc", + "mediumvioletred" => "#c71585", + "midnightblue" => "#191970", + "mintcream" => "#f5fffa", + "mistyrose" => "#ffe4e1", + "moccasin" => "#ffe4b5", + "navajowhite" => "#ffdead", + "navy" => "#000080", + "oldlace" => "#fdf5e6", + "olive" => "#808000", + "olivedrab" => "#6b8e23", + "orange" => "#ffa500", + "orangered" => "#ff4500", + "orchid" => "#da70d6", + "palegoldenrod" => "#eee8aa", + "palegreen" => "#98fb98", + "paleturquoise" => "#afeeee", + "palevioletred" => "#db7093", + "papayawhip" => "#ffefd5", + "peachpuff" => "#ffdab9", + "peru" => "#cd853f", + "pink" => "#ffc0cb", + "plum" => "#dda0dd", + "powderblue" => "#b0e0e6", + "purple" => "#800080", + "red" => "#f00", + "rosybrown" => "#bc8f8f", + "royalblue" => "#4169e1", + "saddlebrown" => "#8b4513", + "salmon" => "#fa8072", + "sandybrown" => "#f4a460", + "seagreen" => "#2e8b57", + "seashell" => "#fff5ee", + "sienna" => "#a0522d", + "silver" => "#c0c0c0", + "skyblue" => "#87ceeb", + "slateblue" => "#6a5acd", + "slategray" => "#708090", + "snow" => "#fffafa", + "springgreen" => "#00ff7f", + "steelblue" => "#4682b4", + "tan" => "#d2b48c", + "teal" => "#008080", + "thistle" => "#d8bfd8", + "tomato" => "#ff6347", + "turquoise" => "#40e0d0", + "violet" => "#ee82ee", + "wheat" => "#f5deb3", + "white" => "#fff", + "whitesmoke" => "#f5f5f5", + "yellow" => "#ff0", + "yellowgreen" => "#9acd32" + ); + + /** + * Overwrites {@link aCssMinifierPlugin::__construct()}. + * + * The constructor will create the {@link CssConvertNamedColorsMinifierPlugin::$reMatch replace regular expression} + * based on the {@link CssConvertNamedColorsMinifierPlugin::$transformation transformation table}. + * + * @param CssMinifier $minifier The CssMinifier object of this plugin. + * @param array $configuration Plugin configuration [optional] + * @return void + */ + public function __construct(CssMinifier $minifier, array $configuration = array()) { + $this->reMatch = "/(^|\s)+(" . implode("|", array_keys($this->transformation)) . ")(\s|$)+/iS"; + parent::__construct($minifier, $configuration); + } + + /** + * Implements {@link aCssMinifierPlugin::minify()}. + * + * @param aCssToken $token Token to process + * @return boolean Return TRUE to break the processing of this token; FALSE to continue + */ + public function apply(aCssToken &$token) { + $lcValue = strtolower($token->Value); + // Declaration value equals a value in the transformation table => simple replace + if (isset($this->transformation[$lcValue])) { + $token->Value = $this->transformation[$lcValue]; + } // Declaration value contains a value in the transformation table => regular expression replace + else if (preg_match($this->reMatch, $token->Value)) { + $token->Value = preg_replace_callback($this->reMatch, array($this, 'reReplace'), $token->Value); + } + return FALSE; + } + + /** + * Callback for replacement value. + * + * @param array $match + * @return string + */ + private function reReplace($match) { + return $match[1] . $this->transformation[strtolower($match[2])] . $match[3]; + } + + /** + * Implements {@link aMinifierPlugin::getTriggerTokens()} + * + * @return array + */ + public function getTriggerTokens() { + return array + ( + "CssAtFontFaceDeclarationToken", + "CssAtPageDeclarationToken", + "CssRulesetDeclarationToken" + ); + } } /** * This {@link aCssMinifierFilter minifier filter} triggers on CSS Level 3 properties and will add declaration tokens * with browser-specific properties. * - * @package CssMin/Minifier/Filters - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Filters + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssConvertLevel3PropertiesMinifierFilter extends aCssMinifierFilter { - /** - * Css property transformations table. Used to convert CSS3 and proprietary properties to the browser-specific - * counterparts. - * - * @var array - */ - private $transformations = array - ( - // Property Array(Mozilla, Webkit, Opera, Internet Explorer); NULL values are placeholders and will get ignored - "animation" => array(null, "-webkit-animation", null, null), - "animation-delay" => array(null, "-webkit-animation-delay", null, null), - "animation-direction" => array(null, "-webkit-animation-direction", null, null), - "animation-duration" => array(null, "-webkit-animation-duration", null, null), - "animation-fill-mode" => array(null, "-webkit-animation-fill-mode", null, null), - "animation-iteration-count" => array(null, "-webkit-animation-iteration-count", null, null), - "animation-name" => array(null, "-webkit-animation-name", null, null), - "animation-play-state" => array(null, "-webkit-animation-play-state", null, null), - "animation-timing-function" => array(null, "-webkit-animation-timing-function", null, null), - "appearance" => array("-moz-appearance", "-webkit-appearance", null, null), - "backface-visibility" => array(null, "-webkit-backface-visibility", null, null), - "background-clip" => array(null, "-webkit-background-clip", null, null), - "background-composite" => array(null, "-webkit-background-composite", null, null), - "background-inline-policy" => array("-moz-background-inline-policy", null, null, null), - "background-origin" => array(null, "-webkit-background-origin", null, null), - "background-position-x" => array(null, null, null, "-ms-background-position-x"), - "background-position-y" => array(null, null, null, "-ms-background-position-y"), - "background-size" => array(null, "-webkit-background-size", null, null), - "behavior" => array(null, null, null, "-ms-behavior"), - "binding" => array("-moz-binding", null, null, null), - "border-after" => array(null, "-webkit-border-after", null, null), - "border-after-color" => array(null, "-webkit-border-after-color", null, null), - "border-after-style" => array(null, "-webkit-border-after-style", null, null), - "border-after-width" => array(null, "-webkit-border-after-width", null, null), - "border-before" => array(null, "-webkit-border-before", null, null), - "border-before-color" => array(null, "-webkit-border-before-color", null, null), - "border-before-style" => array(null, "-webkit-border-before-style", null, null), - "border-before-width" => array(null, "-webkit-border-before-width", null, null), - "border-border-bottom-colors" => array("-moz-border-bottom-colors", null, null, null), - "border-bottom-left-radius" => array("-moz-border-radius-bottomleft", "-webkit-border-bottom-left-radius", null, null), - "border-bottom-right-radius" => array("-moz-border-radius-bottomright", "-webkit-border-bottom-right-radius", null, null), - "border-end" => array("-moz-border-end", "-webkit-border-end", null, null), - "border-end-color" => array("-moz-border-end-color", "-webkit-border-end-color", null, null), - "border-end-style" => array("-moz-border-end-style", "-webkit-border-end-style", null, null), - "border-end-width" => array("-moz-border-end-width", "-webkit-border-end-width", null, null), - "border-fit" => array(null, "-webkit-border-fit", null, null), - "border-horizontal-spacing" => array(null, "-webkit-border-horizontal-spacing", null, null), - "border-image" => array("-moz-border-image", "-webkit-border-image", null, null), - "border-left-colors" => array("-moz-border-left-colors", null, null, null), - "border-radius" => array("-moz-border-radius", "-webkit-border-radius", null, null), - "border-border-right-colors" => array("-moz-border-right-colors", null, null, null), - "border-start" => array("-moz-border-start", "-webkit-border-start", null, null), - "border-start-color" => array("-moz-border-start-color", "-webkit-border-start-color", null, null), - "border-start-style" => array("-moz-border-start-style", "-webkit-border-start-style", null, null), - "border-start-width" => array("-moz-border-start-width", "-webkit-border-start-width", null, null), - "border-top-colors" => array("-moz-border-top-colors", null, null, null), - "border-top-left-radius" => array("-moz-border-radius-topleft", "-webkit-border-top-left-radius", null, null), - "border-top-right-radius" => array("-moz-border-radius-topright", "-webkit-border-top-right-radius", null, null), - "border-vertical-spacing" => array(null, "-webkit-border-vertical-spacing", null, null), - "box-align" => array("-moz-box-align", "-webkit-box-align", null, null), - "box-direction" => array("-moz-box-direction", "-webkit-box-direction", null, null), - "box-flex" => array("-moz-box-flex", "-webkit-box-flex", null, null), - "box-flex-group" => array(null, "-webkit-box-flex-group", null, null), - "box-flex-lines" => array(null, "-webkit-box-flex-lines", null, null), - "box-ordinal-group" => array("-moz-box-ordinal-group", "-webkit-box-ordinal-group", null, null), - "box-orient" => array("-moz-box-orient", "-webkit-box-orient", null, null), - "box-pack" => array("-moz-box-pack", "-webkit-box-pack", null, null), - "box-reflect" => array(null, "-webkit-box-reflect", null, null), - "box-shadow" => array("-moz-box-shadow", "-webkit-box-shadow", null, null), - "box-sizing" => array("-moz-box-sizing", null, null, null), - "color-correction" => array(null, "-webkit-color-correction", null, null), - "column-break-after" => array(null, "-webkit-column-break-after", null, null), - "column-break-before" => array(null, "-webkit-column-break-before", null, null), - "column-break-inside" => array(null, "-webkit-column-break-inside", null, null), - "column-count" => array("-moz-column-count", "-webkit-column-count", null, null), - "column-gap" => array("-moz-column-gap", "-webkit-column-gap", null, null), - "column-rule" => array("-moz-column-rule", "-webkit-column-rule", null, null), - "column-rule-color" => array("-moz-column-rule-color", "-webkit-column-rule-color", null, null), - "column-rule-style" => array("-moz-column-rule-style", "-webkit-column-rule-style", null, null), - "column-rule-width" => array("-moz-column-rule-width", "-webkit-column-rule-width", null, null), - "column-span" => array(null, "-webkit-column-span", null, null), - "column-width" => array("-moz-column-width", "-webkit-column-width", null, null), - "columns" => array(null, "-webkit-columns", null, null), - "filter" => array(__CLASS__, "filter"), - "float-edge" => array("-moz-float-edge", null, null, null), - "font-feature-settings" => array("-moz-font-feature-settings", null, null, null), - "font-language-override" => array("-moz-font-language-override", null, null, null), - "font-size-delta" => array(null, "-webkit-font-size-delta", null, null), - "font-smoothing" => array(null, "-webkit-font-smoothing", null, null), - "force-broken-image-icon" => array("-moz-force-broken-image-icon", null, null, null), - "highlight" => array(null, "-webkit-highlight", null, null), - "hyphenate-character" => array(null, "-webkit-hyphenate-character", null, null), - "hyphenate-locale" => array(null, "-webkit-hyphenate-locale", null, null), - "hyphens" => array(null, "-webkit-hyphens", null, null), - "force-broken-image-icon" => array("-moz-image-region", null, null, null), - "ime-mode" => array(null, null, null, "-ms-ime-mode"), - "interpolation-mode" => array(null, null, null, "-ms-interpolation-mode"), - "layout-flow" => array(null, null, null, "-ms-layout-flow"), - "layout-grid" => array(null, null, null, "-ms-layout-grid"), - "layout-grid-char" => array(null, null, null, "-ms-layout-grid-char"), - "layout-grid-line" => array(null, null, null, "-ms-layout-grid-line"), - "layout-grid-mode" => array(null, null, null, "-ms-layout-grid-mode"), - "layout-grid-type" => array(null, null, null, "-ms-layout-grid-type"), - "line-break" => array(null, "-webkit-line-break", null, "-ms-line-break"), - "line-clamp" => array(null, "-webkit-line-clamp", null, null), - "line-grid-mode" => array(null, null, null, "-ms-line-grid-mode"), - "logical-height" => array(null, "-webkit-logical-height", null, null), - "logical-width" => array(null, "-webkit-logical-width", null, null), - "margin-after" => array(null, "-webkit-margin-after", null, null), - "margin-after-collapse" => array(null, "-webkit-margin-after-collapse", null, null), - "margin-before" => array(null, "-webkit-margin-before", null, null), - "margin-before-collapse" => array(null, "-webkit-margin-before-collapse", null, null), - "margin-bottom-collapse" => array(null, "-webkit-margin-bottom-collapse", null, null), - "margin-collapse" => array(null, "-webkit-margin-collapse", null, null), - "margin-end" => array("-moz-margin-end", "-webkit-margin-end", null, null), - "margin-start" => array("-moz-margin-start", "-webkit-margin-start", null, null), - "margin-top-collapse" => array(null, "-webkit-margin-top-collapse", null, null), - "marquee " => array(null, "-webkit-marquee", null, null), - "marquee-direction" => array(null, "-webkit-marquee-direction", null, null), - "marquee-increment" => array(null, "-webkit-marquee-increment", null, null), - "marquee-repetition" => array(null, "-webkit-marquee-repetition", null, null), - "marquee-speed" => array(null, "-webkit-marquee-speed", null, null), - "marquee-style" => array(null, "-webkit-marquee-style", null, null), - "mask" => array(null, "-webkit-mask", null, null), - "mask-attachment" => array(null, "-webkit-mask-attachment", null, null), - "mask-box-image" => array(null, "-webkit-mask-box-image", null, null), - "mask-clip" => array(null, "-webkit-mask-clip", null, null), - "mask-composite" => array(null, "-webkit-mask-composite", null, null), - "mask-image" => array(null, "-webkit-mask-image", null, null), - "mask-origin" => array(null, "-webkit-mask-origin", null, null), - "mask-position" => array(null, "-webkit-mask-position", null, null), - "mask-position-x" => array(null, "-webkit-mask-position-x", null, null), - "mask-position-y" => array(null, "-webkit-mask-position-y", null, null), - "mask-repeat" => array(null, "-webkit-mask-repeat", null, null), - "mask-repeat-x" => array(null, "-webkit-mask-repeat-x", null, null), - "mask-repeat-y" => array(null, "-webkit-mask-repeat-y", null, null), - "mask-size" => array(null, "-webkit-mask-size", null, null), - "match-nearest-mail-blockquote-color" => array(null, "-webkit-match-nearest-mail-blockquote-color", null, null), - "max-logical-height" => array(null, "-webkit-max-logical-height", null, null), - "max-logical-width" => array(null, "-webkit-max-logical-width", null, null), - "min-logical-height" => array(null, "-webkit-min-logical-height", null, null), - "min-logical-width" => array(null, "-webkit-min-logical-width", null, null), - "object-fit" => array(null, null, "-o-object-fit", null), - "object-position" => array(null, null, "-o-object-position", null), - "opacity" => array(__CLASS__, "opacity"), - "outline-radius" => array("-moz-outline-radius", null, null, null), - "outline-bottom-left-radius" => array("-moz-outline-radius-bottomleft", null, null, null), - "outline-bottom-right-radius" => array("-moz-outline-radius-bottomright", null, null, null), - "outline-top-left-radius" => array("-moz-outline-radius-topleft", null, null, null), - "outline-top-right-radius" => array("-moz-outline-radius-topright", null, null, null), - "padding-after" => array(null, "-webkit-padding-after", null, null), - "padding-before" => array(null, "-webkit-padding-before", null, null), - "padding-end" => array("-moz-padding-end", "-webkit-padding-end", null, null), - "padding-start" => array("-moz-padding-start", "-webkit-padding-start", null, null), - "perspective" => array(null, "-webkit-perspective", null, null), - "perspective-origin" => array(null, "-webkit-perspective-origin", null, null), - "perspective-origin-x" => array(null, "-webkit-perspective-origin-x", null, null), - "perspective-origin-y" => array(null, "-webkit-perspective-origin-y", null, null), - "rtl-ordering" => array(null, "-webkit-rtl-ordering", null, null), - "scrollbar-3dlight-color" => array(null, null, null, "-ms-scrollbar-3dlight-color"), - "scrollbar-arrow-color" => array(null, null, null, "-ms-scrollbar-arrow-color"), - "scrollbar-base-color" => array(null, null, null, "-ms-scrollbar-base-color"), - "scrollbar-darkshadow-color" => array(null, null, null, "-ms-scrollbar-darkshadow-color"), - "scrollbar-face-color" => array(null, null, null, "-ms-scrollbar-face-color"), - "scrollbar-highlight-color" => array(null, null, null, "-ms-scrollbar-highlight-color"), - "scrollbar-shadow-color" => array(null, null, null, "-ms-scrollbar-shadow-color"), - "scrollbar-track-color" => array(null, null, null, "-ms-scrollbar-track-color"), - "stack-sizing" => array("-moz-stack-sizing", null, null, null), - "svg-shadow" => array(null, "-webkit-svg-shadow", null, null), - "tab-size" => array("-moz-tab-size", null, "-o-tab-size", null), - "table-baseline" => array(null, null, "-o-table-baseline", null), - "text-align-last" => array(null, null, null, "-ms-text-align-last"), - "text-autospace" => array(null, null, null, "-ms-text-autospace"), - "text-combine" => array(null, "-webkit-text-combine", null, null), - "text-decorations-in-effect" => array(null, "-webkit-text-decorations-in-effect", null, null), - "text-emphasis" => array(null, "-webkit-text-emphasis", null, null), - "text-emphasis-color" => array(null, "-webkit-text-emphasis-color", null, null), - "text-emphasis-position" => array(null, "-webkit-text-emphasis-position", null, null), - "text-emphasis-style" => array(null, "-webkit-text-emphasis-style", null, null), - "text-fill-color" => array(null, "-webkit-text-fill-color", null, null), - "text-justify" => array(null, null, null, "-ms-text-justify"), - "text-kashida-space" => array(null, null, null, "-ms-text-kashida-space"), - "text-overflow" => array(null, null, "-o-text-overflow", "-ms-text-overflow"), - "text-security" => array(null, "-webkit-text-security", null, null), - "text-size-adjust" => array(null, "-webkit-text-size-adjust", null, "-ms-text-size-adjust"), - "text-stroke" => array(null, "-webkit-text-stroke", null, null), - "text-stroke-color" => array(null, "-webkit-text-stroke-color", null, null), - "text-stroke-width" => array(null, "-webkit-text-stroke-width", null, null), - "text-underline-position" => array(null, null, null, "-ms-text-underline-position"), - "transform" => array("-moz-transform", "-webkit-transform", "-o-transform", null), - "transform-origin" => array("-moz-transform-origin", "-webkit-transform-origin", "-o-transform-origin", null), - "transform-origin-x" => array(null, "-webkit-transform-origin-x", null, null), - "transform-origin-y" => array(null, "-webkit-transform-origin-y", null, null), - "transform-origin-z" => array(null, "-webkit-transform-origin-z", null, null), - "transform-style" => array(null, "-webkit-transform-style", null, null), - "transition" => array("-moz-transition", "-webkit-transition", "-o-transition", null), - "transition-delay" => array("-moz-transition-delay", "-webkit-transition-delay", "-o-transition-delay", null), - "transition-duration" => array("-moz-transition-duration", "-webkit-transition-duration", "-o-transition-duration", null), - "transition-property" => array("-moz-transition-property", "-webkit-transition-property", "-o-transition-property", null), - "transition-timing-function" => array("-moz-transition-timing-function", "-webkit-transition-timing-function", "-o-transition-timing-function", null), - "user-drag" => array(null, "-webkit-user-drag", null, null), - "user-focus" => array("-moz-user-focus", null, null, null), - "user-input" => array("-moz-user-input", null, null, null), - "user-modify" => array("-moz-user-modify", "-webkit-user-modify", null, null), - "user-select" => array("-moz-user-select", "-webkit-user-select", null, null), - "white-space" => array(__CLASS__, "whiteSpace"), - "window-shadow" => array("-moz-window-shadow", null, null, null), - "word-break" => array(null, null, null, "-ms-word-break"), - "word-wrap" => array(null, null, null, "-ms-word-wrap"), - "writing-mode" => array(null, "-webkit-writing-mode", null, "-ms-writing-mode"), - "zoom" => array(null, null, null, "-ms-zoom") - ); - /** - * Implements {@link aCssMinifierFilter::filter()}. - * - * @param array $tokens Array of objects of type aCssToken - * @return integer Count of added, changed or removed tokens; a return value large than 0 will rebuild the array - */ - public function apply(array &$tokens) - { - $r = 0; - $transformations = &$this->transformations; - for ($i = 0, $l = count($tokens); $i < $l; $i++) - { - if (get_class($tokens[$i]) === "CssRulesetDeclarationToken") - { - $tProperty = $tokens[$i]->Property; - if (isset($transformations[$tProperty])) - { - $result = array(); - if (is_callable($transformations[$tProperty])) - { - $result = call_user_func_array($transformations[$tProperty], array($tokens[$i])); - if (!is_array($result) && is_object($result)) - { - $result = array($result); - } - } - else - { - $tValue = $tokens[$i]->Value; - $tMediaTypes = $tokens[$i]->MediaTypes; - foreach ($transformations[$tProperty] as $property) - { - if ($property !== null) - { - $result[] = new CssRulesetDeclarationToken($property, $tValue, $tMediaTypes); - } - } - } - if (count($result) > 0) - { - array_splice($tokens, $i + 1, 0, $result); - $i += count($result); - $l += count($result); - } - } - } - } - return $r; - } - /** - * Transforms the Internet Explorer specific declaration property "filter" to Internet Explorer 8+ compatible - * declaratiopn property "-ms-filter". - * - * @param aCssToken $token - * @return array - */ - private static function filter($token) - { - $r = array - ( - new CssRulesetDeclarationToken("-ms-filter", "\"" . $token->Value . "\"", $token->MediaTypes), - ); - return $r; - } - /** - * Transforms "opacity: {value}" into browser specific counterparts. - * - * @param aCssToken $token - * @return array - */ - private static function opacity($token) - { - // Calculate the value for Internet Explorer filter statement - $ieValue = (int) ((float) $token->Value * 100); - $r = array - ( - // Internet Explorer >= 8 - new CssRulesetDeclarationToken("-ms-filter", "\"alpha(opacity=" . $ieValue . ")\"", $token->MediaTypes), - // Internet Explorer >= 4 <= 7 - new CssRulesetDeclarationToken("filter", "alpha(opacity=" . $ieValue . ")", $token->MediaTypes), - new CssRulesetDeclarationToken("zoom", "1", $token->MediaTypes) - ); - return $r; - } - /** - * Transforms "white-space: pre-wrap" into browser specific counterparts. - * - * @param aCssToken $token - * @return array - */ - private static function whiteSpace($token) - { - if (strtolower($token->Value) === "pre-wrap") - { - $r = array - ( - // Firefox < 3 - new CssRulesetDeclarationToken("white-space", "-moz-pre-wrap", $token->MediaTypes), - // Webkit - new CssRulesetDeclarationToken("white-space", "-webkit-pre-wrap", $token->MediaTypes), - // Opera >= 4 <= 6 - new CssRulesetDeclarationToken("white-space", "-pre-wrap", $token->MediaTypes), - // Opera >= 7 - new CssRulesetDeclarationToken("white-space", "-o-pre-wrap", $token->MediaTypes), - // Internet Explorer >= 5.5 - new CssRulesetDeclarationToken("word-wrap", "break-word", $token->MediaTypes) - ); - return $r; - } - else - { - return array(); - } - } + /** + * Css property transformations table. Used to convert CSS3 and proprietary properties to the browser-specific + * counterparts. + * + * @var array + */ + private $transformations = array + ( + // Property Array(Mozilla, Webkit, Opera, Internet Explorer); NULL values are placeholders and will get ignored + "animation" => array(NULL, "-webkit-animation", NULL, NULL), + "animation-delay" => array(NULL, "-webkit-animation-delay", NULL, NULL), + "animation-direction" => array(NULL, "-webkit-animation-direction", NULL, NULL), + "animation-duration" => array(NULL, "-webkit-animation-duration", NULL, NULL), + "animation-fill-mode" => array(NULL, "-webkit-animation-fill-mode", NULL, NULL), + "animation-iteration-count" => array(NULL, "-webkit-animation-iteration-count", NULL, NULL), + "animation-name" => array(NULL, "-webkit-animation-name", NULL, NULL), + "animation-play-state" => array(NULL, "-webkit-animation-play-state", NULL, NULL), + "animation-timing-function" => array(NULL, "-webkit-animation-timing-function", NULL, NULL), + "appearance" => array("-moz-appearance", "-webkit-appearance", NULL, NULL), + "backface-visibility" => array(NULL, "-webkit-backface-visibility", NULL, NULL), + "background-clip" => array(NULL, "-webkit-background-clip", NULL, NULL), + "background-composite" => array(NULL, "-webkit-background-composite", NULL, NULL), + "background-inline-policy" => array("-moz-background-inline-policy", NULL, NULL, NULL), + "background-origin" => array(NULL, "-webkit-background-origin", NULL, NULL), + "background-position-x" => array(NULL, NULL, NULL, "-ms-background-position-x"), + "background-position-y" => array(NULL, NULL, NULL, "-ms-background-position-y"), + "background-size" => array(NULL, "-webkit-background-size", NULL, NULL), + "behavior" => array(NULL, NULL, NULL, "-ms-behavior"), + "binding" => array("-moz-binding", NULL, NULL, NULL), + "border-after" => array(NULL, "-webkit-border-after", NULL, NULL), + "border-after-color" => array(NULL, "-webkit-border-after-color", NULL, NULL), + "border-after-style" => array(NULL, "-webkit-border-after-style", NULL, NULL), + "border-after-width" => array(NULL, "-webkit-border-after-width", NULL, NULL), + "border-before" => array(NULL, "-webkit-border-before", NULL, NULL), + "border-before-color" => array(NULL, "-webkit-border-before-color", NULL, NULL), + "border-before-style" => array(NULL, "-webkit-border-before-style", NULL, NULL), + "border-before-width" => array(NULL, "-webkit-border-before-width", NULL, NULL), + "border-border-bottom-colors" => array("-moz-border-bottom-colors", NULL, NULL, NULL), + "border-bottom-left-radius" => array("-moz-border-radius-bottomleft", "-webkit-border-bottom-left-radius", NULL, NULL), + "border-bottom-right-radius" => array("-moz-border-radius-bottomright", "-webkit-border-bottom-right-radius", NULL, NULL), + "border-end" => array("-moz-border-end", "-webkit-border-end", NULL, NULL), + "border-end-color" => array("-moz-border-end-color", "-webkit-border-end-color", NULL, NULL), + "border-end-style" => array("-moz-border-end-style", "-webkit-border-end-style", NULL, NULL), + "border-end-width" => array("-moz-border-end-width", "-webkit-border-end-width", NULL, NULL), + "border-fit" => array(NULL, "-webkit-border-fit", NULL, NULL), + "border-horizontal-spacing" => array(NULL, "-webkit-border-horizontal-spacing", NULL, NULL), + "border-image" => array("-moz-border-image", "-webkit-border-image", NULL, NULL), + "border-left-colors" => array("-moz-border-left-colors", NULL, NULL, NULL), + "border-radius" => array("-moz-border-radius", "-webkit-border-radius", NULL, NULL), + "border-border-right-colors" => array("-moz-border-right-colors", NULL, NULL, NULL), + "border-start" => array("-moz-border-start", "-webkit-border-start", NULL, NULL), + "border-start-color" => array("-moz-border-start-color", "-webkit-border-start-color", NULL, NULL), + "border-start-style" => array("-moz-border-start-style", "-webkit-border-start-style", NULL, NULL), + "border-start-width" => array("-moz-border-start-width", "-webkit-border-start-width", NULL, NULL), + "border-top-colors" => array("-moz-border-top-colors", NULL, NULL, NULL), + "border-top-left-radius" => array("-moz-border-radius-topleft", "-webkit-border-top-left-radius", NULL, NULL), + "border-top-right-radius" => array("-moz-border-radius-topright", "-webkit-border-top-right-radius", NULL, NULL), + "border-vertical-spacing" => array(NULL, "-webkit-border-vertical-spacing", NULL, NULL), + "box-align" => array("-moz-box-align", "-webkit-box-align", NULL, NULL), + "box-direction" => array("-moz-box-direction", "-webkit-box-direction", NULL, NULL), + "box-flex" => array("-moz-box-flex", "-webkit-box-flex", NULL, NULL), + "box-flex-group" => array(NULL, "-webkit-box-flex-group", NULL, NULL), + "box-flex-lines" => array(NULL, "-webkit-box-flex-lines", NULL, NULL), + "box-ordinal-group" => array("-moz-box-ordinal-group", "-webkit-box-ordinal-group", NULL, NULL), + "box-orient" => array("-moz-box-orient", "-webkit-box-orient", NULL, NULL), + "box-pack" => array("-moz-box-pack", "-webkit-box-pack", NULL, NULL), + "box-reflect" => array(NULL, "-webkit-box-reflect", NULL, NULL), + "box-shadow" => array("-moz-box-shadow", "-webkit-box-shadow", NULL, NULL), + "box-sizing" => array("-moz-box-sizing", NULL, NULL, NULL), + "color-correction" => array(NULL, "-webkit-color-correction", NULL, NULL), + "column-break-after" => array(NULL, "-webkit-column-break-after", NULL, NULL), + "column-break-before" => array(NULL, "-webkit-column-break-before", NULL, NULL), + "column-break-inside" => array(NULL, "-webkit-column-break-inside", NULL, NULL), + "column-count" => array("-moz-column-count", "-webkit-column-count", NULL, NULL), + "column-gap" => array("-moz-column-gap", "-webkit-column-gap", NULL, NULL), + "column-rule" => array("-moz-column-rule", "-webkit-column-rule", NULL, NULL), + "column-rule-color" => array("-moz-column-rule-color", "-webkit-column-rule-color", NULL, NULL), + "column-rule-style" => array("-moz-column-rule-style", "-webkit-column-rule-style", NULL, NULL), + "column-rule-width" => array("-moz-column-rule-width", "-webkit-column-rule-width", NULL, NULL), + "column-span" => array(NULL, "-webkit-column-span", NULL, NULL), + "column-width" => array("-moz-column-width", "-webkit-column-width", NULL, NULL), + "columns" => array(NULL, "-webkit-columns", NULL, NULL), + "filter" => array(__CLASS__, "filter"), + "float-edge" => array("-moz-float-edge", NULL, NULL, NULL), + "font-feature-settings" => array("-moz-font-feature-settings", NULL, NULL, NULL), + "font-language-override" => array("-moz-font-language-override", NULL, NULL, NULL), + "font-size-delta" => array(NULL, "-webkit-font-size-delta", NULL, NULL), + "font-smoothing" => array(NULL, "-webkit-font-smoothing", NULL, NULL), + "force-broken-image-icon" => array("-moz-force-broken-image-icon", NULL, NULL, NULL), + "highlight" => array(NULL, "-webkit-highlight", NULL, NULL), + "hyphenate-character" => array(NULL, "-webkit-hyphenate-character", NULL, NULL), + "hyphenate-locale" => array(NULL, "-webkit-hyphenate-locale", NULL, NULL), + "hyphens" => array(NULL, "-webkit-hyphens", NULL, NULL), + "force-broken-image-icon" => array("-moz-image-region", NULL, NULL, NULL), + "ime-mode" => array(NULL, NULL, NULL, "-ms-ime-mode"), + "interpolation-mode" => array(NULL, NULL, NULL, "-ms-interpolation-mode"), + "layout-flow" => array(NULL, NULL, NULL, "-ms-layout-flow"), + "layout-grid" => array(NULL, NULL, NULL, "-ms-layout-grid"), + "layout-grid-char" => array(NULL, NULL, NULL, "-ms-layout-grid-char"), + "layout-grid-line" => array(NULL, NULL, NULL, "-ms-layout-grid-line"), + "layout-grid-mode" => array(NULL, NULL, NULL, "-ms-layout-grid-mode"), + "layout-grid-type" => array(NULL, NULL, NULL, "-ms-layout-grid-type"), + "line-break" => array(NULL, "-webkit-line-break", NULL, "-ms-line-break"), + "line-clamp" => array(NULL, "-webkit-line-clamp", NULL, NULL), + "line-grid-mode" => array(NULL, NULL, NULL, "-ms-line-grid-mode"), + "logical-height" => array(NULL, "-webkit-logical-height", NULL, NULL), + "logical-width" => array(NULL, "-webkit-logical-width", NULL, NULL), + "margin-after" => array(NULL, "-webkit-margin-after", NULL, NULL), + "margin-after-collapse" => array(NULL, "-webkit-margin-after-collapse", NULL, NULL), + "margin-before" => array(NULL, "-webkit-margin-before", NULL, NULL), + "margin-before-collapse" => array(NULL, "-webkit-margin-before-collapse", NULL, NULL), + "margin-bottom-collapse" => array(NULL, "-webkit-margin-bottom-collapse", NULL, NULL), + "margin-collapse" => array(NULL, "-webkit-margin-collapse", NULL, NULL), + "margin-end" => array("-moz-margin-end", "-webkit-margin-end", NULL, NULL), + "margin-start" => array("-moz-margin-start", "-webkit-margin-start", NULL, NULL), + "margin-top-collapse" => array(NULL, "-webkit-margin-top-collapse", NULL, NULL), + "marquee " => array(NULL, "-webkit-marquee", NULL, NULL), + "marquee-direction" => array(NULL, "-webkit-marquee-direction", NULL, NULL), + "marquee-increment" => array(NULL, "-webkit-marquee-increment", NULL, NULL), + "marquee-repetition" => array(NULL, "-webkit-marquee-repetition", NULL, NULL), + "marquee-speed" => array(NULL, "-webkit-marquee-speed", NULL, NULL), + "marquee-style" => array(NULL, "-webkit-marquee-style", NULL, NULL), + "mask" => array(NULL, "-webkit-mask", NULL, NULL), + "mask-attachment" => array(NULL, "-webkit-mask-attachment", NULL, NULL), + "mask-box-image" => array(NULL, "-webkit-mask-box-image", NULL, NULL), + "mask-clip" => array(NULL, "-webkit-mask-clip", NULL, NULL), + "mask-composite" => array(NULL, "-webkit-mask-composite", NULL, NULL), + "mask-image" => array(NULL, "-webkit-mask-image", NULL, NULL), + "mask-origin" => array(NULL, "-webkit-mask-origin", NULL, NULL), + "mask-position" => array(NULL, "-webkit-mask-position", NULL, NULL), + "mask-position-x" => array(NULL, "-webkit-mask-position-x", NULL, NULL), + "mask-position-y" => array(NULL, "-webkit-mask-position-y", NULL, NULL), + "mask-repeat" => array(NULL, "-webkit-mask-repeat", NULL, NULL), + "mask-repeat-x" => array(NULL, "-webkit-mask-repeat-x", NULL, NULL), + "mask-repeat-y" => array(NULL, "-webkit-mask-repeat-y", NULL, NULL), + "mask-size" => array(NULL, "-webkit-mask-size", NULL, NULL), + "match-nearest-mail-blockquote-color" => array(NULL, "-webkit-match-nearest-mail-blockquote-color", NULL, NULL), + "max-logical-height" => array(NULL, "-webkit-max-logical-height", NULL, NULL), + "max-logical-width" => array(NULL, "-webkit-max-logical-width", NULL, NULL), + "min-logical-height" => array(NULL, "-webkit-min-logical-height", NULL, NULL), + "min-logical-width" => array(NULL, "-webkit-min-logical-width", NULL, NULL), + "object-fit" => array(NULL, NULL, "-o-object-fit", NULL), + "object-position" => array(NULL, NULL, "-o-object-position", NULL), + "opacity" => array(__CLASS__, "opacity"), + "outline-radius" => array("-moz-outline-radius", NULL, NULL, NULL), + "outline-bottom-left-radius" => array("-moz-outline-radius-bottomleft", NULL, NULL, NULL), + "outline-bottom-right-radius" => array("-moz-outline-radius-bottomright", NULL, NULL, NULL), + "outline-top-left-radius" => array("-moz-outline-radius-topleft", NULL, NULL, NULL), + "outline-top-right-radius" => array("-moz-outline-radius-topright", NULL, NULL, NULL), + "padding-after" => array(NULL, "-webkit-padding-after", NULL, NULL), + "padding-before" => array(NULL, "-webkit-padding-before", NULL, NULL), + "padding-end" => array("-moz-padding-end", "-webkit-padding-end", NULL, NULL), + "padding-start" => array("-moz-padding-start", "-webkit-padding-start", NULL, NULL), + "perspective" => array(NULL, "-webkit-perspective", NULL, NULL), + "perspective-origin" => array(NULL, "-webkit-perspective-origin", NULL, NULL), + "perspective-origin-x" => array(NULL, "-webkit-perspective-origin-x", NULL, NULL), + "perspective-origin-y" => array(NULL, "-webkit-perspective-origin-y", NULL, NULL), + "rtl-ordering" => array(NULL, "-webkit-rtl-ordering", NULL, NULL), + "scrollbar-3dlight-color" => array(NULL, NULL, NULL, "-ms-scrollbar-3dlight-color"), + "scrollbar-arrow-color" => array(NULL, NULL, NULL, "-ms-scrollbar-arrow-color"), + "scrollbar-base-color" => array(NULL, NULL, NULL, "-ms-scrollbar-base-color"), + "scrollbar-darkshadow-color" => array(NULL, NULL, NULL, "-ms-scrollbar-darkshadow-color"), + "scrollbar-face-color" => array(NULL, NULL, NULL, "-ms-scrollbar-face-color"), + "scrollbar-highlight-color" => array(NULL, NULL, NULL, "-ms-scrollbar-highlight-color"), + "scrollbar-shadow-color" => array(NULL, NULL, NULL, "-ms-scrollbar-shadow-color"), + "scrollbar-track-color" => array(NULL, NULL, NULL, "-ms-scrollbar-track-color"), + "stack-sizing" => array("-moz-stack-sizing", NULL, NULL, NULL), + "svg-shadow" => array(NULL, "-webkit-svg-shadow", NULL, NULL), + "tab-size" => array("-moz-tab-size", NULL, "-o-tab-size", NULL), + "table-baseline" => array(NULL, NULL, "-o-table-baseline", NULL), + "text-align-last" => array(NULL, NULL, NULL, "-ms-text-align-last"), + "text-autospace" => array(NULL, NULL, NULL, "-ms-text-autospace"), + "text-combine" => array(NULL, "-webkit-text-combine", NULL, NULL), + "text-decorations-in-effect" => array(NULL, "-webkit-text-decorations-in-effect", NULL, NULL), + "text-emphasis" => array(NULL, "-webkit-text-emphasis", NULL, NULL), + "text-emphasis-color" => array(NULL, "-webkit-text-emphasis-color", NULL, NULL), + "text-emphasis-position" => array(NULL, "-webkit-text-emphasis-position", NULL, NULL), + "text-emphasis-style" => array(NULL, "-webkit-text-emphasis-style", NULL, NULL), + "text-fill-color" => array(NULL, "-webkit-text-fill-color", NULL, NULL), + "text-justify" => array(NULL, NULL, NULL, "-ms-text-justify"), + "text-kashida-space" => array(NULL, NULL, NULL, "-ms-text-kashida-space"), + "text-overflow" => array(NULL, NULL, "-o-text-overflow", "-ms-text-overflow"), + "text-security" => array(NULL, "-webkit-text-security", NULL, NULL), + "text-size-adjust" => array(NULL, "-webkit-text-size-adjust", NULL, "-ms-text-size-adjust"), + "text-stroke" => array(NULL, "-webkit-text-stroke", NULL, NULL), + "text-stroke-color" => array(NULL, "-webkit-text-stroke-color", NULL, NULL), + "text-stroke-width" => array(NULL, "-webkit-text-stroke-width", NULL, NULL), + "text-underline-position" => array(NULL, NULL, NULL, "-ms-text-underline-position"), + "transform" => array("-moz-transform", "-webkit-transform", "-o-transform", NULL), + "transform-origin" => array("-moz-transform-origin", "-webkit-transform-origin", "-o-transform-origin", NULL), + "transform-origin-x" => array(NULL, "-webkit-transform-origin-x", NULL, NULL), + "transform-origin-y" => array(NULL, "-webkit-transform-origin-y", NULL, NULL), + "transform-origin-z" => array(NULL, "-webkit-transform-origin-z", NULL, NULL), + "transform-style" => array(NULL, "-webkit-transform-style", NULL, NULL), + "transition" => array("-moz-transition", "-webkit-transition", "-o-transition", NULL), + "transition-delay" => array("-moz-transition-delay", "-webkit-transition-delay", "-o-transition-delay", NULL), + "transition-duration" => array("-moz-transition-duration", "-webkit-transition-duration", "-o-transition-duration", NULL), + "transition-property" => array("-moz-transition-property", "-webkit-transition-property", "-o-transition-property", NULL), + "transition-timing-function" => array("-moz-transition-timing-function", "-webkit-transition-timing-function", "-o-transition-timing-function", NULL), + "user-drag" => array(NULL, "-webkit-user-drag", NULL, NULL), + "user-focus" => array("-moz-user-focus", NULL, NULL, NULL), + "user-input" => array("-moz-user-input", NULL, NULL, NULL), + "user-modify" => array("-moz-user-modify", "-webkit-user-modify", NULL, NULL), + "user-select" => array("-moz-user-select", "-webkit-user-select", NULL, NULL), + "white-space" => array(__CLASS__, "whiteSpace"), + "window-shadow" => array("-moz-window-shadow", NULL, NULL, NULL), + "word-break" => array(NULL, NULL, NULL, "-ms-word-break"), + "word-wrap" => array(NULL, NULL, NULL, "-ms-word-wrap"), + "writing-mode" => array(NULL, "-webkit-writing-mode", NULL, "-ms-writing-mode"), + "zoom" => array(NULL, NULL, NULL, "-ms-zoom") + ); + + /** + * Implements {@link aCssMinifierFilter::filter()}. + * + * @param array $tokens Array of objects of type aCssToken + * @return integer Count of added, changed or removed tokens; a return value large than 0 will rebuild the array + */ + public function apply(array &$tokens) { + $r = 0; + $transformations = &$this->transformations; + for ($i = 0, $l = count($tokens); $i < $l; $i++) { + if (get_class($tokens[$i]) === "CssRulesetDeclarationToken") { + $tProperty = $tokens[$i]->Property; + if (isset($transformations[$tProperty])) { + $result = array(); + if (is_callable($transformations[$tProperty])) { + $result = call_user_func_array($transformations[$tProperty], array($tokens[$i])); + if (!is_array($result) && is_object($result)) { + $result = array($result); + } + } else { + $tValue = $tokens[$i]->Value; + $tMediaTypes = $tokens[$i]->MediaTypes; + foreach ($transformations[$tProperty] as $property) { + if ($property !== NULL) { + $result[] = new CssRulesetDeclarationToken($property, $tValue, $tMediaTypes); + } + } + } + if (count($result) > 0) { + array_splice($tokens, $i + 1, 0, $result); + $i += count($result); + $l += count($result); + } + } + } + } + return $r; + } + + /** + * Transforms the Internet Explorer specific declaration property "filter" to Internet Explorer 8+ compatible + * declaratiopn property "-ms-filter". + * + * @param aCssToken $token + * @return array + */ + private static function filter($token) { + $r = array + ( + new CssRulesetDeclarationToken("-ms-filter", "\"" . $token->Value . "\"", $token->MediaTypes), + ); + return $r; + } + + /** + * Transforms "opacity: {value}" into browser specific counterparts. + * + * @param aCssToken $token + * @return array + */ + private static function opacity($token) { + // Calculate the value for Internet Explorer filter statement + $ieValue = (int)((float)$token->Value * 100); + $r = array + ( + // Internet Explorer >= 8 + new CssRulesetDeclarationToken("-ms-filter", "\"alpha(opacity=" . $ieValue . ")\"", $token->MediaTypes), + // Internet Explorer >= 4 <= 7 + new CssRulesetDeclarationToken("filter", "alpha(opacity=" . $ieValue . ")", $token->MediaTypes), + new CssRulesetDeclarationToken("zoom", "1", $token->MediaTypes) + ); + return $r; + } + + /** + * Transforms "white-space: pre-wrap" into browser specific counterparts. + * + * @param aCssToken $token + * @return array + */ + private static function whiteSpace($token) { + if (strtolower($token->Value) === "pre-wrap") { + $r = array + ( + // Firefox < 3 + new CssRulesetDeclarationToken("white-space", "-moz-pre-wrap", $token->MediaTypes), + // Webkit + new CssRulesetDeclarationToken("white-space", "-webkit-pre-wrap", $token->MediaTypes), + // Opera >= 4 <= 6 + new CssRulesetDeclarationToken("white-space", "-pre-wrap", $token->MediaTypes), + // Opera >= 7 + new CssRulesetDeclarationToken("white-space", "-o-pre-wrap", $token->MediaTypes), + // Internet Explorer >= 5.5 + new CssRulesetDeclarationToken("word-wrap", "break-word", $token->MediaTypes) + ); + return $r; + } else { + return array(); + } + } } /** * This {@link aCssMinifierFilter minifier filter} will convert @keyframes at-rule block to browser specific counterparts. * - * @package CssMin/Minifier/Filters - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Filters + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssConvertLevel3AtKeyframesMinifierFilter extends aCssMinifierFilter { - /** - * Implements {@link aCssMinifierFilter::filter()}. - * - * @param array $tokens Array of objects of type aCssToken - * @return integer Count of added, changed or removed tokens; a return value larger than 0 will rebuild the array - */ - public function apply(array &$tokens) - { - $r = 0; - $transformations = array("-moz-keyframes", "-webkit-keyframes"); - for ($i = 0, $l = count($tokens); $i < $l; $i++) - { - if (get_class($tokens[$i]) === "CssAtKeyframesStartToken") - { - for ($ii = $i; $ii < $l; $ii++) - { - if (get_class($tokens[$ii]) === "CssAtKeyframesEndToken") - { - break; - } - } - if (get_class($tokens[$ii]) === "CssAtKeyframesEndToken") - { - $add = array(); - $source = array(); - for ($iii = $i; $iii <= $ii; $iii++) - { - $source[] = clone($tokens[$iii]); - } - foreach ($transformations as $transformation) - { - $t = array(); - foreach ($source as $token) - { - $t[] = clone($token); - } - $t[0]->AtRuleName = $transformation; - $add = array_merge($add, $t); - } - if (isset($this->configuration["RemoveSource"]) && $this->configuration["RemoveSource"] === true) - { - array_splice($tokens, $i, $ii - $i + 1, $add); - } - else - { - array_splice($tokens, $ii + 1, 0, $add); - } - $l = count($tokens); - $i = $ii + count($add); - $r += count($add); - } - } - } - return $r; - } + /** + * Implements {@link aCssMinifierFilter::filter()}. + * + * @param array $tokens Array of objects of type aCssToken + * @return integer Count of added, changed or removed tokens; a return value larger than 0 will rebuild the array + */ + public function apply(array &$tokens) { + $r = 0; + $transformations = array("-moz-keyframes", "-webkit-keyframes"); + for ($i = 0, $l = count($tokens); $i < $l; $i++) { + if (get_class($tokens[$i]) === "CssAtKeyframesStartToken") { + for ($ii = $i; $ii < $l; $ii++) { + if (get_class($tokens[$ii]) === "CssAtKeyframesEndToken") { + break; + } + } + if (get_class($tokens[$ii]) === "CssAtKeyframesEndToken") { + $add = array(); + $source = array(); + for ($iii = $i; $iii <= $ii; $iii++) { + $source[] = clone($tokens[$iii]); + } + foreach ($transformations as $transformation) { + $t = array(); + foreach ($source as $token) { + $t[] = clone($token); + } + $t[0]->AtRuleName = $transformation; + $add = array_merge($add, $t); + } + if (isset($this->configuration["RemoveSource"]) && $this->configuration["RemoveSource"] === TRUE) { + array_splice($tokens, $i, $ii - $i + 1, $add); + } else { + array_splice($tokens, $ii + 1, 0, $add); + } + $l = count($tokens); + $i = $ii + count($add); + $r += count($add); + } + } + } + return $r; + } } /** @@ -3415,119 +3149,107 @@ class CssConvertLevel3AtKeyframesMinifierFilter extends aCssMinifierFilter * color:#4e5aa7; * * - * @package CssMin/Minifier/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssConvertHslColorsMinifierPlugin extends aCssMinifierPlugin { - /** - * Regular expression matching the value. - * - * @var string - */ - private $reMatch = "/^hsl\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*%\s*,\s*([0-9]+)\s*%\s*\)/iS"; - /** - * Implements {@link aCssMinifierPlugin::minify()}. - * - * @param aCssToken $token Token to process - * @return boolean Return TRUE to break the processing of this token; FALSE to continue - */ - public function apply(aCssToken &$token) - { - if (stripos($token->Value, "hsl") !== false && preg_match($this->reMatch, $token->Value, $m)) - { - $token->Value = str_replace($m[0], $this->hsl2hex($m[1], $m[2], $m[3]), $token->Value); - } - return false; - } - /** - * Implements {@link aMinifierPlugin::getTriggerTokens()} - * - * @return array - */ - public function getTriggerTokens() - { - return array - ( - "CssAtFontFaceDeclarationToken", - "CssAtPageDeclarationToken", - "CssRulesetDeclarationToken" - ); - } - /** - * Convert a HSL value to hexadecimal notation. - * - * Based on: {@link http://www.easyrgb.com/index.php?X=MATH&H=19#text19}. - * - * @param integer $hue Hue - * @param integer $saturation Saturation - * @param integer $lightness Lightnesss - * @return string - */ - private function hsl2hex($hue, $saturation, $lightness) - { - $hue = $hue / 360; - $saturation = $saturation / 100; - $lightness = $lightness / 100; - if ($saturation == 0) - { - $red = $lightness * 255; - $green = $lightness * 255; - $blue = $lightness * 255; - } - else - { - if ($lightness < 0.5 ) - { - $v2 = $lightness * (1 + $saturation); - } - else - { - $v2 = ($lightness + $saturation) - ($saturation * $lightness); - } - $v1 = 2 * $lightness - $v2; - $red = 255 * self::hue2rgb($v1, $v2, $hue + (1 / 3)); - $green = 255 * self::hue2rgb($v1, $v2, $hue); - $blue = 255 * self::hue2rgb($v1, $v2, $hue - (1 / 3)); - } - return "#" . str_pad(dechex(round($red)), 2, "0", STR_PAD_LEFT) . str_pad(dechex(round($green)), 2, "0", STR_PAD_LEFT) . str_pad(dechex(round($blue)), 2, "0", STR_PAD_LEFT); - } - /** - * Apply hue to a rgb color value. - * - * @param integer $v1 Value 1 - * @param integer $v2 Value 2 - * @param integer $hue Hue - * @return integer - */ - private function hue2rgb($v1, $v2, $hue) - { - if ($hue < 0) - { - $hue += 1; - } - if ($hue > 1) - { - $hue -= 1; - } - if ((6 * $hue) < 1) - { - return ($v1 + ($v2 - $v1) * 6 * $hue); - } - if ((2 * $hue) < 1) - { - return ($v2); - } - if ((3 * $hue) < 2) - { - return ($v1 + ($v2 - $v1) * (( 2 / 3) - $hue) * 6); - } - return $v1; - } + /** + * Regular expression matching the value. + * + * @var string + */ + private $reMatch = "/^hsl\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*%\s*,\s*([0-9]+)\s*%\s*\)/iS"; + + /** + * Implements {@link aCssMinifierPlugin::minify()}. + * + * @param aCssToken $token Token to process + * @return boolean Return TRUE to break the processing of this token; FALSE to continue + */ + public function apply(aCssToken &$token) { + if (stripos($token->Value, "hsl") !== FALSE && preg_match($this->reMatch, $token->Value, $m)) { + $token->Value = str_replace($m[0], $this->hsl2hex($m[1], $m[2], $m[3]), $token->Value); + } + return FALSE; + } + + /** + * Implements {@link aMinifierPlugin::getTriggerTokens()} + * + * @return array + */ + public function getTriggerTokens() { + return array + ( + "CssAtFontFaceDeclarationToken", + "CssAtPageDeclarationToken", + "CssRulesetDeclarationToken" + ); + } + + /** + * Convert a HSL value to hexadecimal notation. + * + * Based on: {@link http://www.easyrgb.com/index.php?X=MATH&H=19#text19}. + * + * @param integer $hue Hue + * @param integer $saturation Saturation + * @param integer $lightness Lightnesss + * @return string + */ + private function hsl2hex($hue, $saturation, $lightness) { + $hue = $hue / 360; + $saturation = $saturation / 100; + $lightness = $lightness / 100; + if ($saturation == 0) { + $red = $lightness * 255; + $green = $lightness * 255; + $blue = $lightness * 255; + } else { + if ($lightness < 0.5) { + $v2 = $lightness * (1 + $saturation); + } else { + $v2 = ($lightness + $saturation) - ($saturation * $lightness); + } + $v1 = 2 * $lightness - $v2; + $red = 255 * self::hue2rgb($v1, $v2, $hue + (1 / 3)); + $green = 255 * self::hue2rgb($v1, $v2, $hue); + $blue = 255 * self::hue2rgb($v1, $v2, $hue - (1 / 3)); + } + return "#" . str_pad(dechex(round($red)), 2, "0", STR_PAD_LEFT) . str_pad(dechex(round($green)), 2, "0", STR_PAD_LEFT) . str_pad(dechex(round($blue)), 2, "0", STR_PAD_LEFT); + } + + /** + * Apply hue to a rgb color value. + * + * @param integer $v1 Value 1 + * @param integer $v2 Value 2 + * @param integer $hue Hue + * @return integer + */ + private function hue2rgb($v1, $v2, $hue) { + if ($hue < 0) { + $hue += 1; + } + if ($hue > 1) { + $hue -= 1; + } + if ((6 * $hue) < 1) { + return ($v1 + ($v2 - $v1) * 6 * $hue); + } + if ((2 * $hue) < 1) { + return ($v2); + } + if ((3 * $hue) < 2) { + return ($v1 + ($v2 - $v1) * ((2 / 3) - $hue) * 6); + } + return $v1; + } } /** @@ -3545,94 +3267,93 @@ class CssConvertHslColorsMinifierPlugin extends aCssMinifierPlugin * font:700 11px monospace; * * - * @package CssMin/Minifier/Pluginsn - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Pluginsn + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssConvertFontWeightMinifierPlugin extends aCssMinifierPlugin { - /** - * Array of included declaration properties this plugin will process; others declaration properties will get - * ignored. - * - * @var array - */ - private $include = array - ( - "font", - "font-weight" - ); - /** - * Regular expression matching the value. - * - * @var string - */ - private $reMatch = null; - /** - * Transformation table used by the {@link CssConvertFontWeightMinifierPlugin::reReplace() replacement method}. - * - * @var array - */ - private $transformation = array - ( - "normal" => "400", - "bold" => "700" - ); - /** - * Overwrites {@link aCssMinifierPlugin::__construct()}. - * - * The constructor will create the {@link CssConvertFontWeightMinifierPlugin::$reMatch replace regular expression} - * based on the {@link CssConvertFontWeightMinifierPlugin::$transformation transformation table}. - * - * @param CssMinifier $minifier The CssMinifier object of this plugin. - * @return void - */ - public function __construct(CssMinifier $minifier) - { - $this->reMatch = "/(^|\s)+(" . implode("|", array_keys($this->transformation)). ")(\s|$)+/iS"; - parent::__construct($minifier); - } - /** - * Implements {@link aCssMinifierPlugin::minify()}. - * - * @param aCssToken $token Token to process - * @return boolean Return TRUE to break the processing of this token; FALSE to continue - */ - public function apply(aCssToken &$token) - { - if (in_array($token->Property, $this->include) && preg_match($this->reMatch, $token->Value, $m)) - { - $token->Value = preg_replace_callback($this->reMatch, array($this, 'reReplace'), $token->Value); - } - return false; - } - /** - * Callback for replacement value. - * - * @param array $match - * @return string - */ - private function reReplace($match) - { - return $match[1] . $this->transformation[strtolower($match[2])] . $match[3]; - } - /** - * Implements {@link aMinifierPlugin::getTriggerTokens()} - * - * @return array - */ - public function getTriggerTokens() - { - return array - ( - "CssAtFontFaceDeclarationToken", - "CssAtPageDeclarationToken", - "CssRulesetDeclarationToken" - ); - } + /** + * Array of included declaration properties this plugin will process; others declaration properties will get + * ignored. + * + * @var array + */ + private $include = array + ( + "font", + "font-weight" + ); + /** + * Regular expression matching the value. + * + * @var string + */ + private $reMatch = NULL; + /** + * Transformation table used by the {@link CssConvertFontWeightMinifierPlugin::reReplace() replacement method}. + * + * @var array + */ + private $transformation = array + ( + "normal" => "400", + "bold" => "700" + ); + + /** + * Overwrites {@link aCssMinifierPlugin::__construct()}. + * + * The constructor will create the {@link CssConvertFontWeightMinifierPlugin::$reMatch replace regular expression} + * based on the {@link CssConvertFontWeightMinifierPlugin::$transformation transformation table}. + * + * @param CssMinifier $minifier The CssMinifier object of this plugin. + * @return void + */ + public function __construct(CssMinifier $minifier) { + $this->reMatch = "/(^|\s)+(" . implode("|", array_keys($this->transformation)) . ")(\s|$)+/iS"; + parent::__construct($minifier); + } + + /** + * Implements {@link aCssMinifierPlugin::minify()}. + * + * @param aCssToken $token Token to process + * @return boolean Return TRUE to break the processing of this token; FALSE to continue + */ + public function apply(aCssToken &$token) { + if (in_array($token->Property, $this->include) && preg_match($this->reMatch, $token->Value, $m)) { + $token->Value = preg_replace_callback($this->reMatch, array($this, 'reReplace'), $token->Value); + } + return FALSE; + } + + /** + * Callback for replacement value. + * + * @param array $match + * @return string + */ + private function reReplace($match) { + return $match[1] . $this->transformation[strtolower($match[2])] . $match[3]; + } + + /** + * Implements {@link aMinifierPlugin::getTriggerTokens()} + * + * @return array + */ + public function getTriggerTokens() { + return array + ( + "CssAtFontFaceDeclarationToken", + "CssAtPageDeclarationToken", + "CssRulesetDeclarationToken" + ); + } } /** @@ -3654,83 +3375,79 @@ class CssConvertFontWeightMinifierPlugin extends aCssMinifierPlugin * * -- * - * @package CssMin/Minifier/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssCompressUnitValuesMinifierPlugin extends aCssMinifierPlugin { - /** - * Regular expression used for matching and replacing unit values. - * - * @var array - */ - private $re = array - ( - "/(^| |-)0\.([0-9]+?)(0+)?(%|em|ex|px|in|cm|mm|pt|pc)/iS" => "\${1}.\${2}\${4}", - "/(^| )-?(\.?)0(%|em|ex|px|in|cm|mm|pt|pc)/iS" => "\${1}0", - ); - /** - * Regular expression used for matching and replacing unit values only for non-blacklisted declarations. - * - * @var array - */ - private $reBlacklisted = array( - "/(^0\s0\s0\s0)|(^0\s0\s0$)|(^0\s0$)/iS" => "0", - ); - /** - * Blacklisted properties for the above regular expression. - * - * @var array - */ - private $propertiesBlacklist = array('background-position'); - /** - * Regular expression matching the value. - * - * @var string - */ - private $reMatch = "/(^| |-)0\.([0-9]+?)(0+)?(%|em|ex|px|in|cm|mm|pt|pc)|(^| )-?(\.?)0(%|em|ex|px|in|cm|mm|pt|pc)|(^0\s0\s0\s0$)|(^0\s0\s0$)|(^0\s0$)/iS"; - /** - * Implements {@link aCssMinifierPlugin::minify()}. - * - * @param aCssToken $token Token to process - * @return boolean Return TRUE to break the processing of this token; FALSE to continue - */ - public function apply(aCssToken &$token) - { - if (preg_match($this->reMatch, $token->Value)) - { - foreach ($this->re as $reMatch => $reReplace) - { - $token->Value = preg_replace($reMatch, $reReplace, $token->Value); - } - if (!in_array($token->Property, $this->propertiesBlacklist)) - { - foreach ($this->reBlacklisted as $reMatch => $reReplace) - { - $token->Value = preg_replace($reMatch, $reReplace, $token->Value); - } - } - } - return false; - } - /** - * Implements {@link aMinifierPlugin::getTriggerTokens()} - * - * @return array - */ - public function getTriggerTokens() - { - return array - ( - "CssAtFontFaceDeclarationToken", - "CssAtPageDeclarationToken", - "CssRulesetDeclarationToken" - ); - } + /** + * Regular expression used for matching and replacing unit values. + * + * @var array + */ + private $re = array + ( + "/(^| |-)0\.([0-9]+?)(0+)?(%|em|ex|px|in|cm|mm|pt|pc)/iS" => "\${1}.\${2}\${4}", + "/(^| )-?(\.?)0(%|em|ex|px|in|cm|mm|pt|pc)/iS" => "\${1}0", + ); + /** + * Regular expression used for matching and replacing unit values only for non-blacklisted declarations. + * + * @var array + */ + private $reBlacklisted = array( + "/(^0\s0\s0\s0)|(^0\s0\s0$)|(^0\s0$)/iS" => "0", + ); + /** + * Blacklisted properties for the above regular expression. + * + * @var array + */ + private $propertiesBlacklist = array('background-position'); + /** + * Regular expression matching the value. + * + * @var string + */ + private $reMatch = "/(^| |-)0\.([0-9]+?)(0+)?(%|em|ex|px|in|cm|mm|pt|pc)|(^| )-?(\.?)0(%|em|ex|px|in|cm|mm|pt|pc)|(^0\s0\s0\s0$)|(^0\s0\s0$)|(^0\s0$)/iS"; + + /** + * Implements {@link aCssMinifierPlugin::minify()}. + * + * @param aCssToken $token Token to process + * @return boolean Return TRUE to break the processing of this token; FALSE to continue + */ + public function apply(aCssToken &$token) { + if (preg_match($this->reMatch, $token->Value)) { + foreach ($this->re as $reMatch => $reReplace) { + $token->Value = preg_replace($reMatch, $reReplace, $token->Value); + } + if (!in_array($token->Property, $this->propertiesBlacklist)) { + foreach ($this->reBlacklisted as $reMatch => $reReplace) { + $token->Value = preg_replace($reMatch, $reReplace, $token->Value); + } + } + } + return FALSE; + } + + /** + * Implements {@link aMinifierPlugin::getTriggerTokens()} + * + * @return array + */ + public function getTriggerTokens() { + return array + ( + "CssAtFontFaceDeclarationToken", + "CssAtPageDeclarationToken", + "CssRulesetDeclarationToken" + ); + } } /** @@ -3739,46 +3456,44 @@ class CssCompressUnitValuesMinifierPlugin extends aCssMinifierPlugin * For compression of expressions {@link https://github.com/rgrove/jsmin-php/ JSMin} will get used. JSMin have to be * already included or loadable via {@link http://goo.gl/JrW54 PHP autoloading}. * - * @package CssMin/Minifier/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssCompressExpressionValuesMinifierPlugin extends aCssMinifierPlugin { - /** - * Implements {@link aCssMinifierPlugin::minify()}. - * - * @param aCssToken $token Token to process - * @return boolean Return TRUE to break the processing of this token; FALSE to continue - */ - public function apply(aCssToken &$token) - { - if (class_exists("JSMin") && stripos($token->Value, "expression(") !== false) - { - $value = $token->Value; - $value = substr($token->Value, stripos($token->Value, "expression(") + 10); - $value = trim(JSMin::minify($value)); - $token->Value = "expression(" . $value . ")"; - } - return false; - } - /** - * Implements {@link aMinifierPlugin::getTriggerTokens()} - * - * @return array - */ - public function getTriggerTokens() - { - return array - ( - "CssAtFontFaceDeclarationToken", - "CssAtPageDeclarationToken", - "CssRulesetDeclarationToken" - ); - } + /** + * Implements {@link aCssMinifierPlugin::minify()}. + * + * @param aCssToken $token Token to process + * @return boolean Return TRUE to break the processing of this token; FALSE to continue + */ + public function apply(aCssToken &$token) { + if (class_exists("JSMin") && stripos($token->Value, "expression(") !== FALSE) { + $value = $token->Value; + $value = substr($token->Value, stripos($token->Value, "expression(") + 10); + $value = trim(JSMin::minify($value)); + $token->Value = "expression(" . $value . ")"; + } + return FALSE; + } + + /** + * Implements {@link aMinifierPlugin::getTriggerTokens()} + * + * @return array + */ + public function getTriggerTokens() { + return array + ( + "CssAtFontFaceDeclarationToken", + "CssAtPageDeclarationToken", + "CssRulesetDeclarationToken" + ); + } } /** @@ -3795,92 +3510,90 @@ class CssCompressExpressionValuesMinifierPlugin extends aCssMinifierPlugin * color:#abc; * * - * @package CssMin/Minifier/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Minifier/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssCompressColorValuesMinifierPlugin extends aCssMinifierPlugin { - /** - * Regular expression matching 6 char hexadecimal color values. - * - * @var string - */ - private $reMatch = "/\#([0-9a-f]{6})/iS"; - /** - * Implements {@link aCssMinifierPlugin::minify()}. - * - * @param aCssToken $token Token to process - * @return boolean Return TRUE to break the processing of this token; FALSE to continue - */ - public function apply(aCssToken &$token) - { - if (strpos($token->Value, "#") !== false && preg_match($this->reMatch, $token->Value, $m)) - { - $value = strtolower($m[1]); - if ($value[0] == $value[1] && $value[2] == $value[3] && $value[4] == $value[5]) - { - $token->Value = str_replace($m[0], "#" . $value[0] . $value[2] . $value[4], $token->Value); - } - } - return false; - } - /** - * Implements {@link aMinifierPlugin::getTriggerTokens()} - * - * @return array - */ - public function getTriggerTokens() - { - return array - ( - "CssAtFontFaceDeclarationToken", - "CssAtPageDeclarationToken", - "CssRulesetDeclarationToken" - ); - } + /** + * Regular expression matching 6 char hexadecimal color values. + * + * @var string + */ + private $reMatch = "/\#([0-9a-f]{6})/iS"; + + /** + * Implements {@link aCssMinifierPlugin::minify()}. + * + * @param aCssToken $token Token to process + * @return boolean Return TRUE to break the processing of this token; FALSE to continue + */ + public function apply(aCssToken &$token) { + if (strpos($token->Value, "#") !== FALSE && preg_match($this->reMatch, $token->Value, $m)) { + $value = strtolower($m[1]); + if ($value[0] == $value[1] && $value[2] == $value[3] && $value[4] == $value[5]) { + $token->Value = str_replace($m[0], "#" . $value[0] . $value[2] . $value[4], $token->Value); + } + } + return FALSE; + } + + /** + * Implements {@link aMinifierPlugin::getTriggerTokens()} + * + * @return array + */ + public function getTriggerTokens() { + return array + ( + "CssAtFontFaceDeclarationToken", + "CssAtPageDeclarationToken", + "CssRulesetDeclarationToken" + ); + } } /** * This {@link aCssToken CSS token} represents a CSS comment. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssCommentToken extends aCssToken { - /** - * Comment as Text. - * - * @var string - */ - public $Comment = ""; - /** - * Set the properties of a comment token. - * - * @param string $comment Comment including comment delimiters - * @return void - */ - public function __construct($comment) - { - $this->Comment = $comment; - } - /** - * Implements {@link aCssToken::__toString()}. - * - * @return string - */ - public function __toString() - { - return $this->Comment; - } + /** + * Comment as Text. + * + * @var string + */ + public $Comment = ""; + + /** + * Set the properties of a comment token. + * + * @param string $comment Comment including comment delimiters + * @return void + */ + public function __construct($comment) { + $this->Comment = $comment; + } + + /** + * Implements {@link aCssToken::__toString()}. + * + * @return string + */ + public function __toString() { + return $this->Comment; + } } /** @@ -3888,107 +3601,102 @@ class CssCommentToken extends aCssToken * * Adds a {@link CssCommentToken} to the parser if a comment was found. * - * @package CssMin/Parser/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Parser/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssCommentParserPlugin extends aCssParserPlugin { - /** - * Implements {@link aCssParserPlugin::getTriggerChars()}. - * - * @return array - */ - public function getTriggerChars() - { - return array("*", "/"); - } - /** - * Implements {@link aCssParserPlugin::getTriggerStates()}. - * - * @return array - */ - public function getTriggerStates() - { - return false; - } - /** - * Stored buffer for restore. - * - * @var string - */ - private $restoreBuffer = ""; - /** - * Implements {@link aCssParserPlugin::parse()}. - * - * @param integer $index Current index - * @param string $char Current char - * @param string $previousChar Previous char - * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing - */ - public function parse($index, $char, $previousChar, $state) - { - if ($char === "*" && $previousChar === "/" && $state !== "T_COMMENT") - { - $this->parser->pushState("T_COMMENT"); - $this->parser->setExclusive(__CLASS__); - $this->restoreBuffer = substr($this->parser->getAndClearBuffer(), 0, -2); - } - elseif ($char === "/" && $previousChar === "*" && $state === "T_COMMENT") - { - $this->parser->popState(); - $this->parser->unsetExclusive(); - $this->parser->appendToken(new CssCommentToken("/*" . $this->parser->getAndClearBuffer())); - $this->parser->setBuffer($this->restoreBuffer); - } - else - { - return false; - } - return true; - } + /** + * Implements {@link aCssParserPlugin::getTriggerChars()}. + * + * @return array + */ + public function getTriggerChars() { + return array("*", "/"); + } + + /** + * Implements {@link aCssParserPlugin::getTriggerStates()}. + * + * @return array + */ + public function getTriggerStates() { + return FALSE; + } + + /** + * Stored buffer for restore. + * + * @var string + */ + private $restoreBuffer = ""; + + /** + * Implements {@link aCssParserPlugin::parse()}. + * + * @param integer $index Current index + * @param string $char Current char + * @param string $previousChar Previous char + * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing + */ + public function parse($index, $char, $previousChar, $state) { + if ($char === "*" && $previousChar === "/" && $state !== "T_COMMENT") { + $this->parser->pushState("T_COMMENT"); + $this->parser->setExclusive(__CLASS__); + $this->restoreBuffer = substr($this->parser->getAndClearBuffer(), 0, -2); + } else if ($char === "/" && $previousChar === "*" && $state === "T_COMMENT") { + $this->parser->popState(); + $this->parser->unsetExclusive(); + $this->parser->appendToken(new CssCommentToken("/*" . $this->parser->getAndClearBuffer())); + $this->parser->setBuffer($this->restoreBuffer); + } else { + return FALSE; + } + return TRUE; + } } /** * This {@link aCssToken CSS token} represents the start of a @variables at-rule block. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtVariablesStartToken extends aCssAtBlockStartToken { - /** - * Media types of the @variables at-rule block. - * - * @var array - */ - public $MediaTypes = array(); - /** - * Set the properties of a @variables at-rule token. - * - * @param array $mediaTypes Media types - * @return void - */ - public function __construct($mediaTypes = null) - { - $this->MediaTypes = $mediaTypes ? $mediaTypes : array("all"); - } - /** - * Implements {@link aCssToken::__toString()}. - * - * @return string - */ - public function __toString() - { - return ""; - } + /** + * Media types of the @variables at-rule block. + * + * @var array + */ + public $MediaTypes = array(); + + /** + * Set the properties of a @variables at-rule token. + * + * @param array $mediaTypes Media types + * @return void + */ + public function __construct($mediaTypes = NULL) { + $this->MediaTypes = $mediaTypes ? $mediaTypes : array("all"); + } + + /** + * Implements {@link aCssToken::__toString()}. + * + * @return string + */ + public function __toString() { + return ""; + } } /** @@ -3997,188 +3705,169 @@ class CssAtVariablesStartToken extends aCssAtBlockStartToken * Found @variables at-rule blocks will add a {@link CssAtVariablesStartToken} and {@link CssAtVariablesEndToken} to the * parser; including declarations as {@link CssAtVariablesDeclarationToken}. * - * @package CssMin/Parser/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Parser/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtVariablesParserPlugin extends aCssParserPlugin { - /** - * Implements {@link aCssParserPlugin::getTriggerChars()}. - * - * @return array - */ - public function getTriggerChars() - { - return array("@", "{", "}", ":", ";"); - } - /** - * Implements {@link aCssParserPlugin::getTriggerStates()}. - * - * @return array - */ - public function getTriggerStates() - { - return array("T_DOCUMENT", "T_AT_VARIABLES::PREPARE", "T_AT_VARIABLES", "T_AT_VARIABLES_DECLARATION"); - } - /** - * Implements {@link aCssParserPlugin::parse()}. - * - * @param integer $index Current index - * @param string $char Current char - * @param string $previousChar Previous char - * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing - */ - public function parse($index, $char, $previousChar, $state) - { - // Start of @variables at-rule block - if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 10)) === "@variables") - { - $this->parser->pushState("T_AT_VARIABLES::PREPARE"); - $this->parser->clearBuffer(); - return $index + 10; - } - // Start of @variables declarations - elseif ($char === "{" && $state === "T_AT_VARIABLES::PREPARE") - { - $this->parser->setState("T_AT_VARIABLES"); - $mediaTypes = array_filter(array_map("trim", explode(",", $this->parser->getAndClearBuffer("{")))); - $this->parser->appendToken(new CssAtVariablesStartToken($mediaTypes)); - } - // Start of @variables declaration - if ($char === ":" && $state === "T_AT_VARIABLES") - { - $this->buffer = $this->parser->getAndClearBuffer(":"); - $this->parser->pushState("T_AT_VARIABLES_DECLARATION"); - } - // Unterminated @variables declaration - elseif ($char === ":" && $state === "T_AT_VARIABLES_DECLARATION") - { - // Ignore Internet Explorer filter declarations - if ($this->buffer === "filter") - { - return false; - } - CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Unterminated @variables declaration", $this->buffer . ":" . $this->parser->getBuffer() . "_")); - } - // End of @variables declaration - elseif (($char === ";" || $char === "}") && $state === "T_AT_VARIABLES_DECLARATION") - { - $value = $this->parser->getAndClearBuffer(";}"); - if (strtolower(substr($value, -10, 10)) === "!important") - { - $value = trim(substr($value, 0, -10)); - $isImportant = true; - } - else - { - $isImportant = false; - } - $this->parser->popState(); - $this->parser->appendToken(new CssAtVariablesDeclarationToken($this->buffer, $value, $isImportant)); - $this->buffer = ""; - } - // End of @variables at-rule block - elseif ($char === "}" && $state === "T_AT_VARIABLES") - { - $this->parser->popState(); - $this->parser->clearBuffer(); - $this->parser->appendToken(new CssAtVariablesEndToken()); - } - else - { - return false; - } - return true; - } + /** + * Implements {@link aCssParserPlugin::getTriggerChars()}. + * + * @return array + */ + public function getTriggerChars() { + return array("@", "{", "}", ":", ";"); + } + + /** + * Implements {@link aCssParserPlugin::getTriggerStates()}. + * + * @return array + */ + public function getTriggerStates() { + return array("T_DOCUMENT", "T_AT_VARIABLES::PREPARE", "T_AT_VARIABLES", "T_AT_VARIABLES_DECLARATION"); + } + + /** + * Implements {@link aCssParserPlugin::parse()}. + * + * @param integer $index Current index + * @param string $char Current char + * @param string $previousChar Previous char + * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing + */ + public function parse($index, $char, $previousChar, $state) { + // Start of @variables at-rule block + if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 10)) === "@variables") { + $this->parser->pushState("T_AT_VARIABLES::PREPARE"); + $this->parser->clearBuffer(); + return $index + 10; + } // Start of @variables declarations + else if ($char === "{" && $state === "T_AT_VARIABLES::PREPARE") { + $this->parser->setState("T_AT_VARIABLES"); + $mediaTypes = array_filter(array_map("trim", explode(",", $this->parser->getAndClearBuffer("{")))); + $this->parser->appendToken(new CssAtVariablesStartToken($mediaTypes)); + } + // Start of @variables declaration + if ($char === ":" && $state === "T_AT_VARIABLES") { + $this->buffer = $this->parser->getAndClearBuffer(":"); + $this->parser->pushState("T_AT_VARIABLES_DECLARATION"); + } // Unterminated @variables declaration + else if ($char === ":" && $state === "T_AT_VARIABLES_DECLARATION") { + // Ignore Internet Explorer filter declarations + if ($this->buffer === "filter") { + return FALSE; + } + CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Unterminated @variables declaration", $this->buffer . ":" . $this->parser->getBuffer() . "_")); + } // End of @variables declaration + else if (($char === ";" || $char === "}") && $state === "T_AT_VARIABLES_DECLARATION") { + $value = $this->parser->getAndClearBuffer(";}"); + if (strtolower(substr($value, -10, 10)) === "!important") { + $value = trim(substr($value, 0, -10)); + $isImportant = TRUE; + } else { + $isImportant = FALSE; + } + $this->parser->popState(); + $this->parser->appendToken(new CssAtVariablesDeclarationToken($this->buffer, $value, $isImportant)); + $this->buffer = ""; + } // End of @variables at-rule block + else if ($char === "}" && $state === "T_AT_VARIABLES") { + $this->parser->popState(); + $this->parser->clearBuffer(); + $this->parser->appendToken(new CssAtVariablesEndToken()); + } else { + return FALSE; + } + return TRUE; + } } /** * This {@link aCssToken CSS token} represents the end of a @variables at-rule block. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtVariablesEndToken extends aCssAtBlockEndToken { - /** - * Implements {@link aCssToken::__toString()}. - * - * @return string - */ - public function __toString() - { - return ""; - } + /** + * Implements {@link aCssToken::__toString()}. + * + * @return string + */ + public function __toString() { + return ""; + } } /** * This {@link aCssToken CSS token} represents a declaration of a @variables at-rule block. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtVariablesDeclarationToken extends aCssDeclarationToken { - /** - * Implements {@link aCssToken::__toString()}. - * - * @return string - */ - public function __toString() - { - return ""; - } + /** + * Implements {@link aCssToken::__toString()}. + * + * @return string + */ + public function __toString() { + return ""; + } } /** * This {@link aCssToken CSS token} represents the start of a @page at-rule block. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtPageStartToken extends aCssAtBlockStartToken { - /** - * Selector. - * - * @var string - */ - public $Selector = ""; - /** - * Sets the properties of the @page at-rule. - * - * @param string $selector Selector - * @return void - */ - public function __construct($selector = "") - { - $this->Selector = $selector; - } - /** - * Implements {@link aCssToken::__toString()}. - * - * @return string - */ - public function __toString() - { - return "@page" . ($this->Selector ? " " . $this->Selector : "") . "{"; - } + /** + * Selector. + * + * @var string + */ + public $Selector = ""; + + /** + * Sets the properties of the @page at-rule. + * + * @param string $selector Selector + * @return void + */ + public function __construct($selector = "") { + $this->Selector = $selector; + } + + /** + * Implements {@link aCssToken::__toString()}. + * + * @return string + */ + public function __toString() { + return "@page" . ($this->Selector ? " " . $this->Selector : "") . "{"; + } } /** @@ -4187,121 +3876,102 @@ class CssAtPageStartToken extends aCssAtBlockStartToken * Found @page at-rule blocks will add a {@link CssAtPageStartToken} and {@link CssAtPageEndToken} to the * parser; including declarations as {@link CssAtPageDeclarationToken}. * - * @package CssMin/Parser/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Parser/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtPageParserPlugin extends aCssParserPlugin { - /** - * Implements {@link aCssParserPlugin::getTriggerChars()}. - * - * @return array - */ - public function getTriggerChars() - { - return array("@", "{", "}", ":", ";"); - } - /** - * Implements {@link aCssParserPlugin::getTriggerStates()}. - * - * @return array - */ - public function getTriggerStates() - { - return array("T_DOCUMENT", "T_AT_PAGE::SELECTOR", "T_AT_PAGE", "T_AT_PAGE_DECLARATION"); - } - /** - * Implements {@link aCssParserPlugin::parse()}. - * - * @param integer $index Current index - * @param string $char Current char - * @param string $previousChar Previous char - * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing - */ - public function parse($index, $char, $previousChar, $state) - { - // Start of @page at-rule block - if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 5)) === "@page") - { - $this->parser->pushState("T_AT_PAGE::SELECTOR"); - $this->parser->clearBuffer(); - return $index + 5; - } - // Start of @page declarations - elseif ($char === "{" && $state === "T_AT_PAGE::SELECTOR") - { - $selector = $this->parser->getAndClearBuffer("{"); - $this->parser->setState("T_AT_PAGE"); - $this->parser->clearBuffer(); - $this->parser->appendToken(new CssAtPageStartToken($selector)); - } - // Start of @page declaration - elseif ($char === ":" && $state === "T_AT_PAGE") - { - $this->parser->pushState("T_AT_PAGE_DECLARATION"); - $this->buffer = $this->parser->getAndClearBuffer(":", true); - } - // Unterminated @font-face declaration - elseif ($char === ":" && $state === "T_AT_PAGE_DECLARATION") - { - // Ignore Internet Explorer filter declarations - if ($this->buffer === "filter") - { - return false; - } - CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Unterminated @page declaration", $this->buffer . ":" . $this->parser->getBuffer() . "_")); - } - // End of @page declaration - elseif (($char === ";" || $char === "}") && $state == "T_AT_PAGE_DECLARATION") - { - $value = $this->parser->getAndClearBuffer(";}"); - if (strtolower(substr($value, -10, 10)) == "!important") - { - $value = trim(substr($value, 0, -10)); - $isImportant = true; - } - else - { - $isImportant = false; - } - $this->parser->popState(); - $this->parser->appendToken(new CssAtPageDeclarationToken($this->buffer, $value, $isImportant)); - // -- - if ($char === "}") - { - $this->parser->popState(); - $this->parser->appendToken(new CssAtPageEndToken()); - } - $this->buffer = ""; - } - // End of @page at-rule block - elseif ($char === "}" && $state === "T_AT_PAGE") - { - $this->parser->popState(); - $this->parser->clearBuffer(); - $this->parser->appendToken(new CssAtPageEndToken()); - } - else - { - return false; - } - return true; - } + /** + * Implements {@link aCssParserPlugin::getTriggerChars()}. + * + * @return array + */ + public function getTriggerChars() { + return array("@", "{", "}", ":", ";"); + } + + /** + * Implements {@link aCssParserPlugin::getTriggerStates()}. + * + * @return array + */ + public function getTriggerStates() { + return array("T_DOCUMENT", "T_AT_PAGE::SELECTOR", "T_AT_PAGE", "T_AT_PAGE_DECLARATION"); + } + + /** + * Implements {@link aCssParserPlugin::parse()}. + * + * @param integer $index Current index + * @param string $char Current char + * @param string $previousChar Previous char + * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing + */ + public function parse($index, $char, $previousChar, $state) { + // Start of @page at-rule block + if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 5)) === "@page") { + $this->parser->pushState("T_AT_PAGE::SELECTOR"); + $this->parser->clearBuffer(); + return $index + 5; + } // Start of @page declarations + else if ($char === "{" && $state === "T_AT_PAGE::SELECTOR") { + $selector = $this->parser->getAndClearBuffer("{"); + $this->parser->setState("T_AT_PAGE"); + $this->parser->clearBuffer(); + $this->parser->appendToken(new CssAtPageStartToken($selector)); + } // Start of @page declaration + else if ($char === ":" && $state === "T_AT_PAGE") { + $this->parser->pushState("T_AT_PAGE_DECLARATION"); + $this->buffer = $this->parser->getAndClearBuffer(":", TRUE); + } // Unterminated @font-face declaration + else if ($char === ":" && $state === "T_AT_PAGE_DECLARATION") { + // Ignore Internet Explorer filter declarations + if ($this->buffer === "filter") { + return FALSE; + } + CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Unterminated @page declaration", $this->buffer . ":" . $this->parser->getBuffer() . "_")); + } // End of @page declaration + else if (($char === ";" || $char === "}") && $state == "T_AT_PAGE_DECLARATION") { + $value = $this->parser->getAndClearBuffer(";}"); + if (strtolower(substr($value, -10, 10)) == "!important") { + $value = trim(substr($value, 0, -10)); + $isImportant = TRUE; + } else { + $isImportant = FALSE; + } + $this->parser->popState(); + $this->parser->appendToken(new CssAtPageDeclarationToken($this->buffer, $value, $isImportant)); + // -- + if ($char === "}") { + $this->parser->popState(); + $this->parser->appendToken(new CssAtPageEndToken()); + } + $this->buffer = ""; + } // End of @page at-rule block + else if ($char === "}" && $state === "T_AT_PAGE") { + $this->parser->popState(); + $this->parser->clearBuffer(); + $this->parser->appendToken(new CssAtPageEndToken()); + } else { + return FALSE; + } + return TRUE; + } } /** * This {@link aCssToken CSS token} represents the end of a @page at-rule block. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtPageEndToken extends aCssAtBlockEndToken { @@ -4311,12 +3981,12 @@ class CssAtPageEndToken extends aCssAtBlockEndToken /** * This {@link aCssToken CSS token} represents a declaration of a @page at-rule block. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtPageDeclarationToken extends aCssDeclarationToken { @@ -4326,34 +3996,33 @@ class CssAtPageDeclarationToken extends aCssDeclarationToken /** * This {@link aCssToken CSS token} represents the start of a @media at-rule block. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtMediaStartToken extends aCssAtBlockStartToken { - /** - * Sets the properties of the @media at-rule. - * - * @param array $mediaTypes Media types - * @return void - */ - public function __construct(array $mediaTypes = array()) - { - $this->MediaTypes = $mediaTypes; - } - /** - * Implements {@link aCssToken::__toString()}. - * - * @return string - */ - public function __toString() - { - return "@media " . implode(",", $this->MediaTypes) . "{"; - } + /** + * Sets the properties of the @media at-rule. + * + * @param array $mediaTypes Media types + * @return void + */ + public function __construct(array $mediaTypes = array()) { + $this->MediaTypes = $mediaTypes; + } + + /** + * Implements {@link aCssToken::__toString()}. + * + * @return string + */ + public function __toString() { + return "@media " . implode(",", $this->MediaTypes) . "{"; + } } /** @@ -4363,80 +4032,72 @@ class CssAtMediaStartToken extends aCssAtBlockStartToken * This plugin will also set the the current media types using {@link CssParser::setMediaTypes()} and * {@link CssParser::unsetMediaTypes()}. * - * @package CssMin/Parser/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Parser/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtMediaParserPlugin extends aCssParserPlugin { - /** - * Implements {@link aCssParserPlugin::getTriggerChars()}. - * - * @return array - */ - public function getTriggerChars() - { - return array("@", "{", "}"); - } - /** - * Implements {@link aCssParserPlugin::getTriggerStates()}. - * - * @return array - */ - public function getTriggerStates() - { - return array("T_DOCUMENT", "T_AT_MEDIA::PREPARE", "T_AT_MEDIA"); - } - /** - * Implements {@link aCssParserPlugin::parse()}. - * - * @param integer $index Current index - * @param string $char Current char - * @param string $previousChar Previous char - * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing - */ - public function parse($index, $char, $previousChar, $state) - { - if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 6)) === "@media") - { - $this->parser->pushState("T_AT_MEDIA::PREPARE"); - $this->parser->clearBuffer(); - return $index + 6; - } - elseif ($char === "{" && $state === "T_AT_MEDIA::PREPARE") - { - $mediaTypes = array_filter(array_map("trim", explode(",", $this->parser->getAndClearBuffer("{")))); - $this->parser->setMediaTypes($mediaTypes); - $this->parser->setState("T_AT_MEDIA"); - $this->parser->appendToken(new CssAtMediaStartToken($mediaTypes)); - } - elseif ($char === "}" && $state === "T_AT_MEDIA") - { - $this->parser->appendToken(new CssAtMediaEndToken()); - $this->parser->clearBuffer(); - $this->parser->unsetMediaTypes(); - $this->parser->popState(); - } - else - { - return false; - } - return true; - } + /** + * Implements {@link aCssParserPlugin::getTriggerChars()}. + * + * @return array + */ + public function getTriggerChars() { + return array("@", "{", "}"); + } + + /** + * Implements {@link aCssParserPlugin::getTriggerStates()}. + * + * @return array + */ + public function getTriggerStates() { + return array("T_DOCUMENT", "T_AT_MEDIA::PREPARE", "T_AT_MEDIA"); + } + + /** + * Implements {@link aCssParserPlugin::parse()}. + * + * @param integer $index Current index + * @param string $char Current char + * @param string $previousChar Previous char + * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing + */ + public function parse($index, $char, $previousChar, $state) { + if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 6)) === "@media") { + $this->parser->pushState("T_AT_MEDIA::PREPARE"); + $this->parser->clearBuffer(); + return $index + 6; + } else if ($char === "{" && $state === "T_AT_MEDIA::PREPARE") { + $mediaTypes = array_filter(array_map("trim", explode(",", $this->parser->getAndClearBuffer("{")))); + $this->parser->setMediaTypes($mediaTypes); + $this->parser->setState("T_AT_MEDIA"); + $this->parser->appendToken(new CssAtMediaStartToken($mediaTypes)); + } else if ($char === "}" && $state === "T_AT_MEDIA") { + $this->parser->appendToken(new CssAtMediaEndToken()); + $this->parser->clearBuffer(); + $this->parser->unsetMediaTypes(); + $this->parser->popState(); + } else { + return FALSE; + } + return TRUE; + } } /** * This {@link aCssToken CSS token} represents the end of a @media at-rule block. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtMediaEndToken extends aCssAtBlockEndToken { @@ -4446,104 +4107,102 @@ class CssAtMediaEndToken extends aCssAtBlockEndToken /** * This {@link aCssToken CSS token} represents the start of a @keyframes at-rule block. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtKeyframesStartToken extends aCssAtBlockStartToken { - /** - * Name of the at-rule. - * - * @var string - */ - public $AtRuleName = "keyframes"; - /** - * Name - * - * @var string - */ - public $Name = ""; - /** - * Sets the properties of the @page at-rule. - * - * @param string $selector Selector - * @return void - */ - public function __construct($name, $atRuleName = null) - { - $this->Name = $name; - if (!is_null($atRuleName)) - { - $this->AtRuleName = $atRuleName; - } - } - /** - * Implements {@link aCssToken::__toString()}. - * - * @return string - */ - public function __toString() - { - if ($this->AtRuleName === "-moz-keyframes") - { - return "@-moz-keyframes " . $this->Name . " {"; - } - return "@" . $this->AtRuleName . " " . $this->Name . "{"; - } + /** + * Name of the at-rule. + * + * @var string + */ + public $AtRuleName = "keyframes"; + /** + * Name + * + * @var string + */ + public $Name = ""; + + /** + * Sets the properties of the @page at-rule. + * + * @param string $selector Selector + * @return void + */ + public function __construct($name, $atRuleName = NULL) { + $this->Name = $name; + if (!is_null($atRuleName)) { + $this->AtRuleName = $atRuleName; + } + } + + /** + * Implements {@link aCssToken::__toString()}. + * + * @return string + */ + public function __toString() { + if ($this->AtRuleName === "-moz-keyframes") { + return "@-moz-keyframes " . $this->Name . " {"; + } + return "@" . $this->AtRuleName . " " . $this->Name . "{"; + } } /** * This {@link aCssToken CSS token} represents the start of a ruleset of a @keyframes at-rule block. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtKeyframesRulesetStartToken extends aCssRulesetStartToken { - /** - * Array of selectors. - * - * @var array - */ - public $Selectors = array(); - /** - * Set the properties of a ruleset token. - * - * @param array $selectors Selectors of the ruleset - * @return void - */ - public function __construct(array $selectors = array()) - { - $this->Selectors = $selectors; - } - /** - * Implements {@link aCssToken::__toString()}. - * - * @return string - */ - public function __toString() - { - return implode(",", $this->Selectors) . "{"; - } + /** + * Array of selectors. + * + * @var array + */ + public $Selectors = array(); + + /** + * Set the properties of a ruleset token. + * + * @param array $selectors Selectors of the ruleset + * @return void + */ + public function __construct(array $selectors = array()) { + $this->Selectors = $selectors; + } + + /** + * Implements {@link aCssToken::__toString()}. + * + * @return string + */ + public function __toString() { + return implode(",", $this->Selectors) . "{"; + } } /** * This {@link aCssToken CSS token} represents the end of a ruleset of a @keyframes at-rule block. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtKeyframesRulesetEndToken extends aCssRulesetEndToken { @@ -4553,12 +4212,12 @@ class CssAtKeyframesRulesetEndToken extends aCssRulesetEndToken /** * This {@link aCssToken CSS token} represents a ruleset declaration of a @keyframes at-rule block. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtKeyframesRulesetDeclarationToken extends aCssDeclarationToken { @@ -4568,188 +4227,156 @@ class CssAtKeyframesRulesetDeclarationToken extends aCssDeclarationToken /** * {@link aCssParserPlugin Parser plugin} for parsing @keyframes at-rule blocks, rulesets and declarations. * - * @package CssMin/Parser/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Parser/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtKeyframesParserPlugin extends aCssParserPlugin { - /** - * @var string Keyword - */ - private $atRuleName = ""; - /** - * Selectors. - * - * @var array - */ - private $selectors = array(); - /** - * Implements {@link aCssParserPlugin::getTriggerChars()}. - * - * @return array - */ - public function getTriggerChars() - { - return array("@", "{", "}", ":", ",", ";"); - } - /** - * Implements {@link aCssParserPlugin::getTriggerStates()}. - * - * @return array - */ - public function getTriggerStates() - { - return array("T_DOCUMENT", "T_AT_KEYFRAMES::NAME", "T_AT_KEYFRAMES", "T_AT_KEYFRAMES_RULESETS", "T_AT_KEYFRAMES_RULESET", "T_AT_KEYFRAMES_RULESET_DECLARATION"); - } - /** - * Implements {@link aCssParserPlugin::parse()}. - * - * @param integer $index Current index - * @param string $char Current char - * @param string $previousChar Previous char - * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing - */ - public function parse($index, $char, $previousChar, $state) - { - // Start of @keyframes at-rule block - if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 10)) === "@keyframes") - { - $this->atRuleName = "keyframes"; - $this->parser->pushState("T_AT_KEYFRAMES::NAME"); - $this->parser->clearBuffer(); - return $index + 10; - } - // Start of @keyframes at-rule block (@-moz-keyframes) - elseif ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 15)) === "@-moz-keyframes") - { - $this->atRuleName = "-moz-keyframes"; - $this->parser->pushState("T_AT_KEYFRAMES::NAME"); - $this->parser->clearBuffer(); - return $index + 15; - } - // Start of @keyframes at-rule block (@-webkit-keyframes) - elseif ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 18)) === "@-webkit-keyframes") - { - $this->atRuleName = "-webkit-keyframes"; - $this->parser->pushState("T_AT_KEYFRAMES::NAME"); - $this->parser->clearBuffer(); - return $index + 18; - } - // Start of @keyframes at-rule block (@-o-keyframes) - elseif ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 13)) === "@-o-keyframes") - { - $this->atRuleName = "-o-keyframes"; - $this->parser->pushState("T_AT_KEYFRAMES::NAME"); - $this->parser->clearBuffer(); - return $index + 13; - } - // Start of @keyframes at-rule block (@-ms-keyframes) - elseif ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 14)) === "@-ms-keyframes") - { - $this->atRuleName = "-ms-keyframes"; - $this->parser->pushState("T_AT_KEYFRAMES::NAME"); - $this->parser->clearBuffer(); - return $index + 14; - } - // Start of @keyframes rulesets - elseif ($char === "{" && $state === "T_AT_KEYFRAMES::NAME") - { - $name = $this->parser->getAndClearBuffer("{\"'"); - $this->parser->setState("T_AT_KEYFRAMES_RULESETS"); - $this->parser->clearBuffer(); - $this->parser->appendToken(new CssAtKeyframesStartToken($name, $this->atRuleName)); - } - // Start of @keyframe ruleset and selectors - if ($char === "," && $state === "T_AT_KEYFRAMES_RULESETS") - { - $this->selectors[] = $this->parser->getAndClearBuffer(",{"); - } - // Start of a @keyframes ruleset - elseif ($char === "{" && $state === "T_AT_KEYFRAMES_RULESETS") - { - if ($this->parser->getBuffer() !== "") - { - $this->selectors[] = $this->parser->getAndClearBuffer(",{"); - $this->parser->pushState("T_AT_KEYFRAMES_RULESET"); - $this->parser->appendToken(new CssAtKeyframesRulesetStartToken($this->selectors)); - $this->selectors = array(); - } - } - // Start of @keyframes ruleset declaration - elseif ($char === ":" && $state === "T_AT_KEYFRAMES_RULESET") - { - $this->parser->pushState("T_AT_KEYFRAMES_RULESET_DECLARATION"); - $this->buffer = $this->parser->getAndClearBuffer(":;", true); - } - // Unterminated @keyframes ruleset declaration - elseif ($char === ":" && $state === "T_AT_KEYFRAMES_RULESET_DECLARATION") - { - // Ignore Internet Explorer filter declarations - if ($this->buffer === "filter") - { - return false; - } - CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Unterminated @keyframes ruleset declaration", $this->buffer . ":" . $this->parser->getBuffer() . "_")); - } - // End of declaration - elseif (($char === ";" || $char === "}") && $state === "T_AT_KEYFRAMES_RULESET_DECLARATION") - { - $value = $this->parser->getAndClearBuffer(";}"); - if (strtolower(substr($value, -10, 10)) === "!important") - { - $value = trim(substr($value, 0, -10)); - $isImportant = true; - } - else - { - $isImportant = false; - } - $this->parser->popState(); - $this->parser->appendToken(new CssAtKeyframesRulesetDeclarationToken($this->buffer, $value, $isImportant)); - // Declaration ends with a right curly brace; so we have to end the ruleset - if ($char === "}") - { - $this->parser->appendToken(new CssAtKeyframesRulesetEndToken()); - $this->parser->popState(); - } - $this->buffer = ""; - } - // End of @keyframes ruleset - elseif ($char === "}" && $state === "T_AT_KEYFRAMES_RULESET") - { - $this->parser->clearBuffer(); - - $this->parser->popState(); - $this->parser->appendToken(new CssAtKeyframesRulesetEndToken()); - } - // End of @keyframes rulesets - elseif ($char === "}" && $state === "T_AT_KEYFRAMES_RULESETS") - { - $this->parser->clearBuffer(); - $this->parser->popState(); - $this->parser->appendToken(new CssAtKeyframesEndToken()); - } - else - { - return false; - } - return true; - } + /** + * @var string Keyword + */ + private $atRuleName = ""; + /** + * Selectors. + * + * @var array + */ + private $selectors = array(); + + /** + * Implements {@link aCssParserPlugin::getTriggerChars()}. + * + * @return array + */ + public function getTriggerChars() { + return array("@", "{", "}", ":", ",", ";"); + } + + /** + * Implements {@link aCssParserPlugin::getTriggerStates()}. + * + * @return array + */ + public function getTriggerStates() { + return array("T_DOCUMENT", "T_AT_KEYFRAMES::NAME", "T_AT_KEYFRAMES", "T_AT_KEYFRAMES_RULESETS", "T_AT_KEYFRAMES_RULESET", "T_AT_KEYFRAMES_RULESET_DECLARATION"); + } + + /** + * Implements {@link aCssParserPlugin::parse()}. + * + * @param integer $index Current index + * @param string $char Current char + * @param string $previousChar Previous char + * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing + */ + public function parse($index, $char, $previousChar, $state) { + // Start of @keyframes at-rule block + if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 10)) === "@keyframes") { + $this->atRuleName = "keyframes"; + $this->parser->pushState("T_AT_KEYFRAMES::NAME"); + $this->parser->clearBuffer(); + return $index + 10; + } // Start of @keyframes at-rule block (@-moz-keyframes) + else if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 15)) === "@-moz-keyframes") { + $this->atRuleName = "-moz-keyframes"; + $this->parser->pushState("T_AT_KEYFRAMES::NAME"); + $this->parser->clearBuffer(); + return $index + 15; + } // Start of @keyframes at-rule block (@-webkit-keyframes) + else if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 18)) === "@-webkit-keyframes") { + $this->atRuleName = "-webkit-keyframes"; + $this->parser->pushState("T_AT_KEYFRAMES::NAME"); + $this->parser->clearBuffer(); + return $index + 18; + } // Start of @keyframes at-rule block (@-o-keyframes) + else if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 13)) === "@-o-keyframes") { + $this->atRuleName = "-o-keyframes"; + $this->parser->pushState("T_AT_KEYFRAMES::NAME"); + $this->parser->clearBuffer(); + return $index + 13; + } // Start of @keyframes at-rule block (@-ms-keyframes) + else if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 14)) === "@-ms-keyframes") { + $this->atRuleName = "-ms-keyframes"; + $this->parser->pushState("T_AT_KEYFRAMES::NAME"); + $this->parser->clearBuffer(); + return $index + 14; + } // Start of @keyframes rulesets + else if ($char === "{" && $state === "T_AT_KEYFRAMES::NAME") { + $name = $this->parser->getAndClearBuffer("{\"'"); + $this->parser->setState("T_AT_KEYFRAMES_RULESETS"); + $this->parser->clearBuffer(); + $this->parser->appendToken(new CssAtKeyframesStartToken($name, $this->atRuleName)); + } + // Start of @keyframe ruleset and selectors + if ($char === "," && $state === "T_AT_KEYFRAMES_RULESETS") { + $this->selectors[] = $this->parser->getAndClearBuffer(",{"); + } // Start of a @keyframes ruleset + else if ($char === "{" && $state === "T_AT_KEYFRAMES_RULESETS") { + if ($this->parser->getBuffer() !== "") { + $this->selectors[] = $this->parser->getAndClearBuffer(",{"); + $this->parser->pushState("T_AT_KEYFRAMES_RULESET"); + $this->parser->appendToken(new CssAtKeyframesRulesetStartToken($this->selectors)); + $this->selectors = array(); + } + } // Start of @keyframes ruleset declaration + else if ($char === ":" && $state === "T_AT_KEYFRAMES_RULESET") { + $this->parser->pushState("T_AT_KEYFRAMES_RULESET_DECLARATION"); + $this->buffer = $this->parser->getAndClearBuffer(":;", TRUE); + } // Unterminated @keyframes ruleset declaration + else if ($char === ":" && $state === "T_AT_KEYFRAMES_RULESET_DECLARATION") { + // Ignore Internet Explorer filter declarations + if ($this->buffer === "filter") { + return FALSE; + } + CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Unterminated @keyframes ruleset declaration", $this->buffer . ":" . $this->parser->getBuffer() . "_")); + } // End of declaration + else if (($char === ";" || $char === "}") && $state === "T_AT_KEYFRAMES_RULESET_DECLARATION") { + $value = $this->parser->getAndClearBuffer(";}"); + if (strtolower(substr($value, -10, 10)) === "!important") { + $value = trim(substr($value, 0, -10)); + $isImportant = TRUE; + } else { + $isImportant = FALSE; + } + $this->parser->popState(); + $this->parser->appendToken(new CssAtKeyframesRulesetDeclarationToken($this->buffer, $value, $isImportant)); + // Declaration ends with a right curly brace; so we have to end the ruleset + if ($char === "}") { + $this->parser->appendToken(new CssAtKeyframesRulesetEndToken()); + $this->parser->popState(); + } + $this->buffer = ""; + } // End of @keyframes ruleset + else if ($char === "}" && $state === "T_AT_KEYFRAMES_RULESET") { + $this->parser->clearBuffer(); + + $this->parser->popState(); + $this->parser->appendToken(new CssAtKeyframesRulesetEndToken()); + } // End of @keyframes rulesets + else if ($char === "}" && $state === "T_AT_KEYFRAMES_RULESETS") { + $this->parser->clearBuffer(); + $this->parser->popState(); + $this->parser->appendToken(new CssAtKeyframesEndToken()); + } else { + return FALSE; + } + return TRUE; + } } /** * This {@link aCssToken CSS token} represents the end of a @keyframes at-rule block. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtKeyframesEndToken extends aCssAtBlockEndToken { @@ -4759,48 +4386,48 @@ class CssAtKeyframesEndToken extends aCssAtBlockEndToken /** * This {@link aCssToken CSS token} represents a @import at-rule. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1.b1 (2001-02-22) + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1.b1 (2001-02-22) */ class CssAtImportToken extends aCssToken { - /** - * Import path of the @import at-rule. - * - * @var string - */ - public $Import = ""; - /** - * Media types of the @import at-rule. - * - * @var array - */ - public $MediaTypes = array(); - /** - * Set the properties of a @import at-rule token. - * - * @param string $import Import path - * @param array $mediaTypes Media types - * @return void - */ - public function __construct($import, $mediaTypes) - { - $this->Import = $import; - $this->MediaTypes = $mediaTypes ? $mediaTypes : array(); - } - /** - * Implements {@link aCssToken::__toString()}. - * - * @return string - */ - public function __toString() - { - return "@import \"" . $this->Import . "\"" . (count($this->MediaTypes) > 0 ? " " . implode(",", $this->MediaTypes) : ""). ";"; - } + /** + * Import path of the @import at-rule. + * + * @var string + */ + public $Import = ""; + /** + * Media types of the @import at-rule. + * + * @var array + */ + public $MediaTypes = array(); + + /** + * Set the properties of a @import at-rule token. + * + * @param string $import Import path + * @param array $mediaTypes Media types + * @return void + */ + public function __construct($import, $mediaTypes) { + $this->Import = $import; + $this->MediaTypes = $mediaTypes ? $mediaTypes : array(); + } + + /** + * Implements {@link aCssToken::__toString()}. + * + * @return string + */ + public function __toString() { + return "@import \"" . $this->Import . "\"" . (count($this->MediaTypes) > 0 ? " " . implode(",", $this->MediaTypes) : "") . ";"; + } } /** @@ -4808,106 +4435,93 @@ class CssAtImportToken extends aCssToken * * If a @import at-rule was found this plugin will add a {@link CssAtImportToken} to the parser. * - * @package CssMin/Parser/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Parser/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtImportParserPlugin extends aCssParserPlugin { - /** - * Implements {@link aCssParserPlugin::getTriggerChars()}. - * - * @return array - */ - public function getTriggerChars() - { - return array("@", ";", ",", "\n"); - } - /** - * Implements {@link aCssParserPlugin::getTriggerStates()}. - * - * @return array - */ - public function getTriggerStates() - { - return array("T_DOCUMENT", "T_AT_IMPORT"); - } - /** - * Implements {@link aCssParserPlugin::parse()}. - * - * @param integer $index Current index - * @param string $char Current char - * @param string $previousChar Previous char - * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing - */ - public function parse($index, $char, $previousChar, $state) - { - if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 7)) === "@import") - { - $this->parser->pushState("T_AT_IMPORT"); - $this->parser->clearBuffer(); - return $index + 7; - } - elseif (($char === ";" || $char === "\n") && $state === "T_AT_IMPORT") - { - $this->buffer = $this->parser->getAndClearBuffer(";"); - $pos = false; - foreach (array(")", "\"", "'") as $needle) - { - if (($pos = strrpos($this->buffer, $needle)) !== false) - { - break; - } - } - $import = substr($this->buffer, 0, $pos + 1); - if (stripos($import, "url(") === 0) - { - $import = substr($import, 4, -1); - } - $import = trim($import, " \t\n\r\0\x0B'\""); - $mediaTypes = array_filter(array_map("trim", explode(",", trim(substr($this->buffer, $pos + 1), " \t\n\r\0\x0B{")))); - if ($pos) - { - $this->parser->appendToken(new CssAtImportToken($import, $mediaTypes)); - } - else - { - CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Invalid @import at-rule syntax", $this->buffer)); - } - $this->parser->popState(); - } - else - { - return false; - } - return true; - } + /** + * Implements {@link aCssParserPlugin::getTriggerChars()}. + * + * @return array + */ + public function getTriggerChars() { + return array("@", ";", ",", "\n"); + } + + /** + * Implements {@link aCssParserPlugin::getTriggerStates()}. + * + * @return array + */ + public function getTriggerStates() { + return array("T_DOCUMENT", "T_AT_IMPORT"); + } + + /** + * Implements {@link aCssParserPlugin::parse()}. + * + * @param integer $index Current index + * @param string $char Current char + * @param string $previousChar Previous char + * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing + */ + public function parse($index, $char, $previousChar, $state) { + if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 7)) === "@import") { + $this->parser->pushState("T_AT_IMPORT"); + $this->parser->clearBuffer(); + return $index + 7; + } else if (($char === ";" || $char === "\n") && $state === "T_AT_IMPORT") { + $this->buffer = $this->parser->getAndClearBuffer(";"); + $pos = FALSE; + foreach (array(")", "\"", "'") as $needle) { + if (($pos = strrpos($this->buffer, $needle)) !== FALSE) { + break; + } + } + $import = substr($this->buffer, 0, $pos + 1); + if (stripos($import, "url(") === 0) { + $import = substr($import, 4, -1); + } + $import = trim($import, " \t\n\r\0\x0B'\""); + $mediaTypes = array_filter(array_map("trim", explode(",", trim(substr($this->buffer, $pos + 1), " \t\n\r\0\x0B{")))); + if ($pos) { + $this->parser->appendToken(new CssAtImportToken($import, $mediaTypes)); + } else { + CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Invalid @import at-rule syntax", $this->buffer)); + } + $this->parser->popState(); + } else { + return FALSE; + } + return TRUE; + } } /** * This {@link aCssToken CSS token} represents the start of a @font-face at-rule block. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtFontFaceStartToken extends aCssAtBlockStartToken { - /** - * Implements {@link aCssToken::__toString()}. - * - * @return string - */ - public function __toString() - { - return "@font-face{"; - } + /** + * Implements {@link aCssToken::__toString()}. + * + * @return string + */ + public function __toString() { + return "@font-face{"; + } } /** @@ -4916,120 +4530,101 @@ class CssAtFontFaceStartToken extends aCssAtBlockStartToken * Found @font-face at-rule blocks will add a {@link CssAtFontFaceStartToken} and {@link CssAtFontFaceEndToken} to the * parser; including declarations as {@link CssAtFontFaceDeclarationToken}. * - * @package CssMin/Parser/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Parser/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtFontFaceParserPlugin extends aCssParserPlugin { - /** - * Implements {@link aCssParserPlugin::getTriggerChars()}. - * - * @return array - */ - public function getTriggerChars() - { - return array("@", "{", "}", ":", ";"); - } - /** - * Implements {@link aCssParserPlugin::getTriggerStates()}. - * - * @return array - */ - public function getTriggerStates() - { - return array("T_DOCUMENT", "T_AT_FONT_FACE::PREPARE", "T_AT_FONT_FACE", "T_AT_FONT_FACE_DECLARATION"); - } - /** - * Implements {@link aCssParserPlugin::parse()}. - * - * @param integer $index Current index - * @param string $char Current char - * @param string $previousChar Previous char - * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing - */ - public function parse($index, $char, $previousChar, $state) - { - // Start of @font-face at-rule block - if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 10)) === "@font-face") - { - $this->parser->pushState("T_AT_FONT_FACE::PREPARE"); - $this->parser->clearBuffer(); - return $index + 10 - 1; - } - // Start of @font-face declarations - elseif ($char === "{" && $state === "T_AT_FONT_FACE::PREPARE") - { - $this->parser->setState("T_AT_FONT_FACE"); - $this->parser->clearBuffer(); - $this->parser->appendToken(new CssAtFontFaceStartToken()); - } - // Start of @font-face declaration - elseif ($char === ":" && $state === "T_AT_FONT_FACE") - { - $this->parser->pushState("T_AT_FONT_FACE_DECLARATION"); - $this->buffer = $this->parser->getAndClearBuffer(":", true); - } - // Unterminated @font-face declaration - elseif ($char === ":" && $state === "T_AT_FONT_FACE_DECLARATION") - { - // Ignore Internet Explorer filter declarations - if ($this->buffer === "filter") - { - return false; - } - CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Unterminated @font-face declaration", $this->buffer . ":" . $this->parser->getBuffer() . "_")); - } - // End of @font-face declaration - elseif (($char === ";" || $char === "}") && $state === "T_AT_FONT_FACE_DECLARATION") - { - $value = $this->parser->getAndClearBuffer(";}"); - if (strtolower(substr($value, -10, 10)) === "!important") - { - $value = trim(substr($value, 0, -10)); - $isImportant = true; - } - else - { - $isImportant = false; - } - $this->parser->popState(); - $this->parser->appendToken(new CssAtFontFaceDeclarationToken($this->buffer, $value, $isImportant)); - $this->buffer = ""; - // -- - if ($char === "}") - { - $this->parser->appendToken(new CssAtFontFaceEndToken()); - $this->parser->popState(); - } - } - // End of @font-face at-rule block - elseif ($char === "}" && $state === "T_AT_FONT_FACE") - { - $this->parser->appendToken(new CssAtFontFaceEndToken()); - $this->parser->clearBuffer(); - $this->parser->popState(); - } - else - { - return false; - } - return true; - } + /** + * Implements {@link aCssParserPlugin::getTriggerChars()}. + * + * @return array + */ + public function getTriggerChars() { + return array("@", "{", "}", ":", ";"); + } + + /** + * Implements {@link aCssParserPlugin::getTriggerStates()}. + * + * @return array + */ + public function getTriggerStates() { + return array("T_DOCUMENT", "T_AT_FONT_FACE::PREPARE", "T_AT_FONT_FACE", "T_AT_FONT_FACE_DECLARATION"); + } + + /** + * Implements {@link aCssParserPlugin::parse()}. + * + * @param integer $index Current index + * @param string $char Current char + * @param string $previousChar Previous char + * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing + */ + public function parse($index, $char, $previousChar, $state) { + // Start of @font-face at-rule block + if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 10)) === "@font-face") { + $this->parser->pushState("T_AT_FONT_FACE::PREPARE"); + $this->parser->clearBuffer(); + return $index + 10 - 1; + } // Start of @font-face declarations + else if ($char === "{" && $state === "T_AT_FONT_FACE::PREPARE") { + $this->parser->setState("T_AT_FONT_FACE"); + $this->parser->clearBuffer(); + $this->parser->appendToken(new CssAtFontFaceStartToken()); + } // Start of @font-face declaration + else if ($char === ":" && $state === "T_AT_FONT_FACE") { + $this->parser->pushState("T_AT_FONT_FACE_DECLARATION"); + $this->buffer = $this->parser->getAndClearBuffer(":", TRUE); + } // Unterminated @font-face declaration + else if ($char === ":" && $state === "T_AT_FONT_FACE_DECLARATION") { + // Ignore Internet Explorer filter declarations + if ($this->buffer === "filter") { + return FALSE; + } + CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Unterminated @font-face declaration", $this->buffer . ":" . $this->parser->getBuffer() . "_")); + } // End of @font-face declaration + else if (($char === ";" || $char === "}") && $state === "T_AT_FONT_FACE_DECLARATION") { + $value = $this->parser->getAndClearBuffer(";}"); + if (strtolower(substr($value, -10, 10)) === "!important") { + $value = trim(substr($value, 0, -10)); + $isImportant = TRUE; + } else { + $isImportant = FALSE; + } + $this->parser->popState(); + $this->parser->appendToken(new CssAtFontFaceDeclarationToken($this->buffer, $value, $isImportant)); + $this->buffer = ""; + // -- + if ($char === "}") { + $this->parser->appendToken(new CssAtFontFaceEndToken()); + $this->parser->popState(); + } + } // End of @font-face at-rule block + else if ($char === "}" && $state === "T_AT_FONT_FACE") { + $this->parser->appendToken(new CssAtFontFaceEndToken()); + $this->parser->clearBuffer(); + $this->parser->popState(); + } else { + return FALSE; + } + return TRUE; + } } /** * This {@link aCssToken CSS token} represents the end of a @font-face at-rule block. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtFontFaceEndToken extends aCssAtBlockEndToken { @@ -5039,12 +4634,12 @@ class CssAtFontFaceEndToken extends aCssAtBlockEndToken /** * This {@link aCssToken CSS token} represents a declaration of a @font-face at-rule block. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtFontFaceDeclarationToken extends aCssDeclarationToken { @@ -5054,40 +4649,40 @@ class CssAtFontFaceDeclarationToken extends aCssDeclarationToken /** * This {@link aCssToken CSS token} represents a @charset at-rule. * - * @package CssMin/Tokens - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Tokens + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtCharsetToken extends aCssToken { - /** - * Charset of the @charset at-rule. - * - * @var string - */ - public $Charset = ""; - /** - * Set the properties of @charset at-rule token. - * - * @param string $charset Charset of the @charset at-rule token - * @return void - */ - public function __construct($charset) - { - $this->Charset = $charset; - } - /** - * Implements {@link aCssToken::__toString()}. - * - * @return string - */ - public function __toString() - { - return "@charset " . $this->Charset . ";"; - } + /** + * Charset of the @charset at-rule. + * + * @var string + */ + public $Charset = ""; + + /** + * Set the properties of @charset at-rule token. + * + * @param string $charset Charset of the @charset at-rule token + * @return void + */ + public function __construct($charset) { + $this->Charset = $charset; + } + + /** + * Implements {@link aCssToken::__toString()}. + * + * @return string + */ + public function __toString() { + return "@charset " . $this->Charset . ";"; + } } /** @@ -5095,61 +4690,55 @@ class CssAtCharsetToken extends aCssToken * * If a @charset at-rule was found this plugin will add a {@link CssAtCharsetToken} to the parser. * - * @package CssMin/Parser/Plugins - * @link http://code.google.com/p/cssmin/ - * @author Joe Scylla - * @copyright 2008 - 2011 Joe Scylla - * @license http://opensource.org/licenses/mit-license.php MIT License - * @version 3.0.1 + * @package CssMin/Parser/Plugins + * @link http://code.google.com/p/cssmin/ + * @author Joe Scylla + * @copyright 2008 - 2011 Joe Scylla + * @license http://opensource.org/licenses/mit-license.php MIT License + * @version 3.0.1 */ class CssAtCharsetParserPlugin extends aCssParserPlugin { - /** - * Implements {@link aCssParserPlugin::getTriggerChars()}. - * - * @return array - */ - public function getTriggerChars() - { - return array("@", ";", "\n"); - } - /** - * Implements {@link aCssParserPlugin::getTriggerStates()}. - * - * @return array - */ - public function getTriggerStates() - { - return array("T_DOCUMENT", "T_AT_CHARSET"); - } - /** - * Implements {@link aCssParserPlugin::parse()}. - * - * @param integer $index Current index - * @param string $char Current char - * @param string $previousChar Previous char - * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing - */ - public function parse($index, $char, $previousChar, $state) - { - if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 8)) === "@charset") - { - $this->parser->pushState("T_AT_CHARSET"); - $this->parser->clearBuffer(); - return $index + 8; - } - elseif (($char === ";" || $char === "\n") && $state === "T_AT_CHARSET") - { - $charset = $this->parser->getAndClearBuffer(";"); - $this->parser->popState(); - $this->parser->appendToken(new CssAtCharsetToken($charset)); - } - else - { - return false; - } - return true; - } + /** + * Implements {@link aCssParserPlugin::getTriggerChars()}. + * + * @return array + */ + public function getTriggerChars() { + return array("@", ";", "\n"); + } + + /** + * Implements {@link aCssParserPlugin::getTriggerStates()}. + * + * @return array + */ + public function getTriggerStates() { + return array("T_DOCUMENT", "T_AT_CHARSET"); + } + + /** + * Implements {@link aCssParserPlugin::parse()}. + * + * @param integer $index Current index + * @param string $char Current char + * @param string $previousChar Previous char + * @return mixed TRUE will break the processing; FALSE continue with the next plugin; integer set a new index and break the processing + */ + public function parse($index, $char, $previousChar, $state) { + if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 8)) === "@charset") { + $this->parser->pushState("T_AT_CHARSET"); + $this->parser->clearBuffer(); + return $index + 8; + } else if (($char === ";" || $char === "\n") && $state === "T_AT_CHARSET") { + $charset = $this->parser->getAndClearBuffer(";"); + $this->parser->popState(); + $this->parser->appendToken(new CssAtCharsetToken($charset)); + } else { + return FALSE; + } + return TRUE; + } } ?> diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/build.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/build.php index f285d55..79f341a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/build.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/build.php @@ -11,7 +11,7 @@ if ($phpcsViolations > 0) { $phpunitConfiguration = PHPUnit_Util_Configuration::getInstance(__DIR__ . '/phpunit.xml'); $phpunitArguments = ['coverageHtml' => __DIR__ . '/coverage', 'configuration' => $phpunitConfiguration]; $testRunner = new PHPUnit_TextUI_TestRunner(); -$result = $testRunner->doRun($phpunitConfiguration->getTestSuiteConfiguration(), $phpunitArguments, false); +$result = $testRunner->doRun($phpunitConfiguration->getTestSuiteConfiguration(), $phpunitArguments, FALSE); if (!$result->wasSuccessful()) { exit(1); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/composer.json index d91fbff..25d7f96 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/composer.json @@ -1,30 +1,35 @@ { - "name": "nubs/random-name-generator", - "description": "A library to create interesting, sometimes entertaining, random names.", - "keywords": ["random", "generator", "video game", "alliteration"], - "authors": [ - { - "name": "Spencer Rinehart", - "email": "anubis@overthemonkey.com", - "role": "Developer" - } - ], - "license": "MIT", - "require": { - "php": "~5.6 || ~7.0" - }, - "require-dev": { - "phpunit/phpunit": "~5.0", - "satooshi/php-coveralls": "~1.0", - "cinam/randomizer": ">=1.1.1,<2.0", - "squizlabs/php_codesniffer": "~2.3" - }, - "autoload": { - "psr-4": { - "Nubs\\RandomNameGenerator\\": "src" - } - }, - "scripts": { - "test": "./build.php" + "name": "nubs/random-name-generator", + "description": "A library to create interesting, sometimes entertaining, random names.", + "keywords": [ + "random", + "generator", + "video game", + "alliteration" + ], + "authors": [ + { + "name": "Spencer Rinehart", + "email": "anubis@overthemonkey.com", + "role": "Developer" } + ], + "license": "MIT", + "require": { + "php": "~5.6 || ~7.0" + }, + "require-dev": { + "phpunit/phpunit": "~5.0", + "satooshi/php-coveralls": "~1.0", + "cinam/randomizer": ">=1.1.1,<2.0", + "squizlabs/php_codesniffer": "~2.3" + }, + "autoload": { + "psr-4": { + "Nubs\\RandomNameGenerator\\": "src" + } + }, + "scripts": { + "test": "./build.php" + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/src/AbstractGenerator.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/src/AbstractGenerator.php index abfae12..78ef09a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/src/AbstractGenerator.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/src/AbstractGenerator.php @@ -1,4 +1,5 @@ getName(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/src/All.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/src/All.php index d044c74..48974a8 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/src/All.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/src/All.php @@ -1,4 +1,5 @@ _generators = $generators; $this->_randomizer = $randomizer; } @@ -34,8 +34,7 @@ class All extends AbstractGenerator implements Generator * @param \Cinam\Randomizer\Randomizer $randomizer The random number generator. * @return \Nubs\RandomNameGenerator\All The constructed generator. */ - public static function create(Randomizer $randomizer = null) - { + public static function create(Randomizer $randomizer = NULL) { return new self([new Alliteration($randomizer), new Vgng($randomizer)], $randomizer); } @@ -45,8 +44,7 @@ class All extends AbstractGenerator implements Generator * @api * @return string A random name. */ - public function getName() - { + public function getName() { return $this->_getRandomGenerator()->getName(); } @@ -55,8 +53,7 @@ class All extends AbstractGenerator implements Generator * * @return \Nubs\RandomNameGenerator\Generator A random generator. */ - protected function _getRandomGenerator() - { + protected function _getRandomGenerator() { return $this->_randomizer ? $this->_randomizer->getArrayValue($this->_generators) : $this->_generators[array_rand($this->_generators)]; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/src/Alliteration.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/src/Alliteration.php index 68ef3a2..fa6bc0d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/src/Alliteration.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/src/Alliteration.php @@ -1,4 +1,5 @@ _randomizer = $randomizer; $this->_adjectives = file(__DIR__ . '/adjectives.txt', FILE_IGNORE_NEW_LINES); $this->_nouns = file(__DIR__ . '/nouns.txt', FILE_IGNORE_NEW_LINES); @@ -36,8 +36,7 @@ class Alliteration extends AbstractGenerator implements Generator * @api * @return string A random alliterative name. */ - public function getName() - { + public function getName() { $adjective = $this->_getRandomWord($this->_adjectives); $noun = $this->_getRandomWord($this->_nouns, $adjective[0]); @@ -51,9 +50,8 @@ class Alliteration extends AbstractGenerator implements Generator * @param string $startingLetter The desired starting letter of the word. * @return string The random word. */ - protected function _getRandomWord(array $words, $startingLetter = null) - { - $wordsToSearch = $startingLetter === null ? $words : preg_grep("/^{$startingLetter}/", $words); + protected function _getRandomWord(array $words, $startingLetter = NULL) { + $wordsToSearch = $startingLetter === NULL ? $words : preg_grep("/^{$startingLetter}/", $words); return $this->_randomizer ? $this->_randomizer->getArrayValue($wordsToSearch) : $wordsToSearch[array_rand($wordsToSearch)]; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/src/Generator.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/src/Generator.php index 572c990..715b0f0 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/src/Generator.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/src/Generator.php @@ -1,4 +1,5 @@ _randomizer = $randomizer; $this->_definitionSets = array_map( [$this, '_parseSection'], @@ -37,8 +37,7 @@ class Vgng extends AbstractGenerator implements Generator * @api * @return string A random video game name. */ - public function getName() - { + public function getName() { $similarWords = []; $words = []; @@ -59,11 +58,10 @@ class Vgng extends AbstractGenerator implements Generator * @param array $existingWords The already-chosen words to avoid. * @return array The definition of a previously unchosen word. */ - protected function _getUniqueWord(array $definitions, array $existingWords) - { + protected function _getUniqueWord(array $definitions, array $existingWords) { $definition = $this->_randomizer ? $this->_randomizer->getArrayValue($definitions) : $definitions[array_rand($definitions)]; - if (array_search($definition['word'], $existingWords) === false) { + if (array_search($definition['word'], $existingWords) === FALSE) { return $definition; } @@ -75,8 +73,7 @@ class Vgng extends AbstractGenerator implements Generator * * @return string The video_game_names.txt contents. */ - protected function _getFileContents() - { + protected function _getFileContents() { return file_get_contents(__DIR__ . '/video_game_names.txt'); } @@ -90,8 +87,7 @@ class Vgng extends AbstractGenerator implements Generator * @param string $contents The file contents. * @return array Each section split into its own string. */ - protected function _getSections($contents) - { + protected function _getSections($contents) { return array_map('trim', explode('----', $contents)); } @@ -101,8 +97,7 @@ class Vgng extends AbstractGenerator implements Generator * @param string $section The newline-separated list of words in a section. * @return array The parsed section into its final form. */ - protected function _parseSection($section) - { + protected function _parseSection($section) { return array_map( [$this, '_parseDefinition'], $this->_getDefinitionsFromSection($section) @@ -115,8 +110,7 @@ class Vgng extends AbstractGenerator implements Generator * @param string $section The newline-separated list of words in a section. * @return array Each word split out, but unparsed. */ - protected function _getDefinitionsFromSection($section) - { + protected function _getDefinitionsFromSection($section) { return array_map('trim', explode("\n", $section)); } @@ -128,8 +122,7 @@ class Vgng extends AbstractGenerator implements Generator * @param string $definition The definition. * @return array The formatted definition. */ - protected function _parseDefinition($definition) - { + protected function _parseDefinition($definition) { $word = strtok($definition, '^'); $similarWords = array_filter(explode('|', strtok('^'))); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/tests/AllTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/tests/AllTest.php index 8049ab7..6c148af 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/tests/AllTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/tests/AllTest.php @@ -1,4 +1,5 @@ getName(); $this->assertRegexp('/.+/', $name); @@ -40,8 +40,7 @@ class AllTest extends PHPUnit_Framework_TestCase * * @return void */ - public function getNameForced() - { + public function getNameForced() { $numberGenerator = $this->createMock('\Cinam\Randomizer\NumberGenerator'); $numberGenerator->expects($this->exactly(2))->method('getInt')->will($this->onConsecutiveCalls(20, 5)); $randomizer = new Randomizer($numberGenerator); @@ -63,8 +62,7 @@ class AllTest extends PHPUnit_Framework_TestCase * * @return void */ - public function toStringBasic() - { + public function toStringBasic() { $generator = All::create(); $name = (string)$generator; $this->assertRegexp('/.+/', $name); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/tests/AlliterationTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/tests/AlliterationTest.php index 0b47343..51a4635 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/tests/AlliterationTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/tests/AlliterationTest.php @@ -1,4 +1,5 @@ getName()); $this->assertSame(2, count($parts)); @@ -36,8 +36,7 @@ class AlliterationTest extends PHPUnit_Framework_TestCase * * @return void */ - public function getNameForced() - { + public function getNameForced() { $numberGenerator = $this->createMock('\Cinam\Randomizer\NumberGenerator'); $numberGenerator->expects($this->exactly(2))->method('getInt')->will($this->onConsecutiveCalls(20, 5)); $randomizer = new Randomizer($numberGenerator); @@ -56,8 +55,7 @@ class AlliterationTest extends PHPUnit_Framework_TestCase * * @return void */ - public function toStringBasic() - { + public function toStringBasic() { $generator = new Alliteration(); $parts = explode(' ', (string)$generator); $this->assertSame(2, count($parts)); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/tests/VgngTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/tests/VgngTest.php index a301b81..8d38fa6 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/tests/VgngTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/nubs/random-name-generator/tests/VgngTest.php @@ -1,4 +1,5 @@ createMock('\Cinam\Randomizer\NumberGenerator'); $numberGenerator->expects($this->exactly(3))->method('getInt')->will($this->returnValue(1)); $randomizer = new Randomizer($numberGenerator); @@ -35,8 +35,7 @@ class VgngTest extends PHPUnit_Framework_TestCase * @covers ::__construct * @covers ::getName */ - public function getNameSimilarName() - { + public function getNameSimilarName() { $numberGenerator = $this->createMock('\Cinam\Randomizer\NumberGenerator'); $numberGenerator->expects($this->exactly(4))->method('getInt')->will($this->onConsecutiveCalls(0, 0, 2, 10)); $randomizer = new Randomizer($numberGenerator); @@ -54,8 +53,7 @@ class VgngTest extends PHPUnit_Framework_TestCase * @covers ::__toString * @covers ::getName */ - public function toStringBasic() - { + public function toStringBasic() { $numberGenerator = $this->createMock('\Cinam\Randomizer\NumberGenerator'); $numberGenerator->expects($this->exactly(3))->method('getInt')->will($this->returnValue(1)); $randomizer = new Randomizer($numberGenerator); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/composer.json index 1c5978c..60de6cd 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/composer.json @@ -1,24 +1,24 @@ { - "name": "paragonie/random_compat", - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "name": "paragonie/random_compat", + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", "keywords": [ "csprng", "random", "pseudorandom" ], - "license": "MIT", - "type": "library", + "license": "MIT", + "type": "library", "authors": [ { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", "homepage": "https://paragonie.com" } ], "support": { - "issues": "https://github.com/paragonie/random_compat/issues", - "email": "info@paragonie.com", - "source": "https://github.com/paragonie/random_compat" + "issues": "https://github.com/paragonie/random_compat/issues", + "email": "info@paragonie.com", + "source": "https://github.com/paragonie/random_compat" }, "require": { "php": ">=5.2.0" diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/byte_safe_strings.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/byte_safe_strings.php index 3de86b2..56ec782 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/byte_safe_strings.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/byte_safe_strings.php @@ -43,15 +43,14 @@ if (!is_callable('RandomCompat_strlen')) { * * @return int */ - function RandomCompat_strlen($binary_string) - { + function RandomCompat_strlen($binary_string) { if (!is_string($binary_string)) { throw new TypeError( 'RandomCompat_strlen() expects a string' ); } - return (int) mb_strlen($binary_string, '8bit'); + return (int)mb_strlen($binary_string, '8bit'); } } else { @@ -66,14 +65,13 @@ if (!is_callable('RandomCompat_strlen')) { * * @return int */ - function RandomCompat_strlen($binary_string) - { + function RandomCompat_strlen($binary_string) { if (!is_string($binary_string)) { throw new TypeError( 'RandomCompat_strlen() expects a string' ); } - return (int) strlen($binary_string); + return (int)strlen($binary_string); } } } @@ -99,8 +97,7 @@ if (!is_callable('RandomCompat_substr')) { * * @return string */ - function RandomCompat_substr($binary_string, $start, $length = null) - { + function RandomCompat_substr($binary_string, $start, $length = NULL) { if (!is_string($binary_string)) { throw new TypeError( 'RandomCompat_substr(): First argument should be a string' @@ -113,13 +110,13 @@ if (!is_callable('RandomCompat_substr')) { ); } - if ($length === null) { + if ($length === NULL) { /** * mb_substr($str, 0, NULL, '8bit') returns an empty string on * PHP 5.3, so we have to find the length ourselves. */ $length = RandomCompat_strlen($binary_string) - $start; - } elseif (!is_int($length)) { + } else if (!is_int($length)) { throw new TypeError( 'RandomCompat_substr(): Third argument should be an integer, or omitted' ); @@ -133,7 +130,7 @@ if (!is_callable('RandomCompat_substr')) { return ''; } - return (string) mb_substr($binary_string, $start, $length, '8bit'); + return (string)mb_substr($binary_string, $start, $length, '8bit'); } } else { @@ -151,8 +148,7 @@ if (!is_callable('RandomCompat_substr')) { * * @return string */ - function RandomCompat_substr($binary_string, $start, $length = null) - { + function RandomCompat_substr($binary_string, $start, $length = NULL) { if (!is_string($binary_string)) { throw new TypeError( 'RandomCompat_substr(): First argument should be a string' @@ -165,17 +161,17 @@ if (!is_callable('RandomCompat_substr')) { ); } - if ($length !== null) { + if ($length !== NULL) { if (!is_int($length)) { throw new TypeError( 'RandomCompat_substr(): Third argument should be an integer, or omitted' ); } - return (string) substr($binary_string, $start, $length); + return (string)substr($binary_string, $start, $length); } - return (string) substr($binary_string, $start); + return (string)substr($binary_string, $start); } } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/cast_to_int.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/cast_to_int.php index 9a4fab9..1e61a39 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/cast_to_int.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/cast_to_int.php @@ -27,29 +27,28 @@ */ if (!is_callable('RandomCompat_intval')) { - + /** * Cast to an integer if we can, safely. - * + * * If you pass it a float in the range (~PHP_INT_MAX, PHP_INT_MAX) * (non-inclusive), it will sanely cast it to an int. If you it's equal to - * ~PHP_INT_MAX or PHP_INT_MAX, we let it fail as not an integer. Floats + * ~PHP_INT_MAX or PHP_INT_MAX, we let it fail as not an integer. Floats * lose precision, so the <= and => operators might accidentally let a float * through. - * - * @param int|float $number The number we want to convert to an int - * @param bool $fail_open Set to true to not throw an exception - * + * + * @param int|float $number The number we want to convert to an int + * @param bool $fail_open Set to true to not throw an exception + * * @return float|int * @psalm-suppress InvalidReturnType * * @throws TypeError */ - function RandomCompat_intval($number, $fail_open = false) - { + function RandomCompat_intval($number, $fail_open = FALSE) { if (is_int($number) || is_float($number)) { $number += 0; - } elseif (is_numeric($number)) { + } else if (is_numeric($number)) { $number += 0; } @@ -60,12 +59,12 @@ if (!is_callable('RandomCompat_intval')) { && $number < PHP_INT_MAX ) { - $number = (int) $number; + $number = (int)$number; } if (is_int($number)) { - return (int) $number; - } elseif (!$fail_open) { + return (int)$number; + } else if (!$fail_open) { throw new TypeError( 'Expected an integer.' ); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/error_polyfill.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/error_polyfill.php index 6a91990..e31ec29 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/error_polyfill.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/error_polyfill.php @@ -1,22 +1,22 @@ = 50300 && is_callable('\\Sodium\\randombytes_buf')) { require_once $RandomCompatDIR . '/random_bytes_libsodium.php'; - } elseif (method_exists('Sodium', 'randombytes_buf')) { + } else if (method_exists('Sodium', 'randombytes_buf')) { require_once $RandomCompatDIR . '/random_bytes_libsodium_legacy.php'; } } @@ -88,7 +88,7 @@ if (!is_callable('random_bytes')) { if (DIRECTORY_SEPARATOR === '/') { // DIRECTORY_SEPARATOR === '/' on Unix-like OSes -- this is a fast // way to exclude Windows. - $RandomCompatUrandom = true; + $RandomCompatUrandom = TRUE; $RandomCompat_basedir = ini_get('open_basedir'); if (!empty($RandomCompat_basedir)) { @@ -97,10 +97,10 @@ if (!is_callable('random_bytes')) { strtolower($RandomCompat_basedir) ); $RandomCompatUrandom = (array() !== array_intersect( - array('/dev', '/dev/', '/dev/urandom'), - $RandomCompat_open_basedir - )); - $RandomCompat_open_basedir = null; + array('/dev', '/dev/', '/dev/urandom'), + $RandomCompat_open_basedir + )); + $RandomCompat_open_basedir = NULL; } if ( @@ -120,9 +120,9 @@ if (!is_callable('random_bytes')) { require_once $RandomCompatDIR . '/random_bytes_dev_urandom.php'; } // Unset variables after use - $RandomCompat_basedir = null; + $RandomCompat_basedir = NULL; } else { - $RandomCompatUrandom = false; + $RandomCompatUrandom = FALSE; } /** @@ -161,7 +161,7 @@ if (!is_callable('random_bytes')) { // See random_bytes_mcrypt.php require_once $RandomCompatDIR . '/random_bytes_mcrypt.php'; } - $RandomCompatUrandom = null; + $RandomCompatUrandom = NULL; /** * This is a Windows-specific fallback, for when the mcrypt extension @@ -190,8 +190,8 @@ if (!is_callable('random_bytes')) { // Don't try to use it. } } - $RandomCompat_disabled_classes = null; - $RandomCompatCOMtest = null; + $RandomCompat_disabled_classes = NULL; + $RandomCompatCOMtest = NULL; } /** @@ -207,8 +207,7 @@ if (!is_callable('random_bytes')) { * @throws Exception * @return string */ - function random_bytes($length) - { + function random_bytes($length) { unset($length); // Suppress "variable not used" warnings. throw new Exception( 'There is no suitable CSPRNG installed on your system' @@ -222,4 +221,4 @@ if (!is_callable('random_int')) { require_once $RandomCompatDIR . '/random_int.php'; } -$RandomCompatDIR = null; +$RandomCompatDIR = NULL; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/random_bytes_com_dotnet.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/random_bytes_com_dotnet.php index fc1926e..f4b1005 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/random_bytes_com_dotnet.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/random_bytes_com_dotnet.php @@ -1,22 +1,22 @@ 1073741824 ? 1073741824 : $bytes - $i; - $buf .= Sodium::randombytes_buf((int) $n); + $buf .= Sodium::randombytes_buf((int)$n); } } else { - $buf .= Sodium::randombytes_buf((int) $bytes); + $buf .= Sodium::randombytes_buf((int)$bytes); } if (is_string($buf)) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/random_bytes_mcrypt.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/random_bytes_mcrypt.php index aac9c01..241f2a1 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/random_bytes_mcrypt.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/lib/random_bytes_mcrypt.php @@ -1,22 +1,22 @@ $max || $val < $min); - return (int) $val; + return (int)$val; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/other/build_phar.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/other/build_phar.php index 70ef4b2..6d1136f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/other/build_phar.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/other/build_phar.php @@ -1,30 +1,30 @@ buildFromDirectory(dirname(__DIR__).'/lib'); +$phar->buildFromDirectory(dirname(__DIR__) . '/lib'); rename( - dirname(__DIR__).'/lib/index.php', - dirname(__DIR__).'/lib/random.php' + dirname(__DIR__) . '/lib/index.php', + dirname(__DIR__) . '/lib/random.php' ); /** * If we pass an (optional) path to a private key as a second argument, we will * sign the Phar with OpenSSL. - * + * * If you leave this out, it will produce an unsigned .phar! */ if ($argc > 1) { @@ -33,20 +33,20 @@ if ($argc > 1) { exit(255); } $pkeyFile = file_get_contents($argv[1]); - + $private = openssl_get_privatekey($pkeyFile); - if ($private !== false) { + if ($private !== FALSE) { $pkey = ''; openssl_pkey_export($private, $pkey); $phar->setSignatureAlgorithm(Phar::OPENSSL, $pkey); - + /** * Save the corresponding public key to the file */ - if (!@is_readable($dist.'/random_compat.phar.pubkey')) { + if (!@is_readable($dist . '/random_compat.phar.pubkey')) { $details = openssl_pkey_get_details($private); file_put_contents( - $dist.'/random_compat.phar.pubkey', + $dist . '/random_compat.phar.pubkey', $details['key'] ); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/psalm.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/psalm.xml index ee072a9..3bd6966 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/psalm.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/paragonie/random_compat/psalm.xml @@ -1,18 +1,18 @@ - + - - - - - - + + + + + + diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/composer.json index b0d2937..da18172 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/composer.json @@ -1,26 +1,33 @@ { - "name": "psr/http-message", - "description": "Common interface for HTTP messages", - "keywords": ["psr", "psr-7", "http", "http-message", "request", "response"], - "homepage": "https://github.com/php-fig/http-message", - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "require": { - "php": ">=5.3.0" - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } + "name": "psr/http-message", + "description": "Common interface for HTTP messages", + "keywords": [ + "psr", + "psr-7", + "http", + "http-message", + "request", + "response" + ], + "homepage": "https://github.com/php-fig/http-message", + "license": "MIT", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } + ], + "require": { + "php": ">=5.3.0" + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/RequestInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/RequestInterface.php index a96d4fd..01b64a4 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/RequestInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/RequestInterface.php @@ -125,5 +125,5 @@ interface RequestInterface extends MessageInterface * @param bool $preserveHost Preserve the original state of the Host header. * @return static */ - public function withUri(UriInterface $uri, $preserveHost = false); + public function withUri(UriInterface $uri, $preserveHost = FALSE); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/ServerRequestInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/ServerRequestInterface.php index 0251234..361f756 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/ServerRequestInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/ServerRequestInterface.php @@ -224,7 +224,7 @@ interface ServerRequestInterface extends RequestInterface * @param mixed $default Default value to return if the attribute does not exist. * @return mixed */ - public function getAttribute($name, $default = null); + public function getAttribute($name, $default = NULL); /** * Return an instance with the specified derived request attribute. diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/StreamInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/StreamInterface.php index f68f391..ffdd422 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/StreamInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/StreamInterface.php @@ -154,5 +154,5 @@ interface StreamInterface * provided. Returns a specific key value if a key is provided and the * value is found, or null if the key is not found. */ - public function getMetadata($key = null); + public function getMetadata($key = NULL); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/UploadedFileInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/UploadedFileInterface.php index f8a6901..61ae503 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/UploadedFileInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/UploadedFileInterface.php @@ -63,7 +63,7 @@ interface UploadedFileInterface * the second or subsequent call to the method. */ public function moveTo($targetPath); - + /** * Retrieve the file size. * @@ -74,7 +74,7 @@ interface UploadedFileInterface * @return int|null The file size in bytes or null if unknown. */ public function getSize(); - + /** * Retrieve the error associated with the uploaded file. * @@ -90,7 +90,7 @@ interface UploadedFileInterface * @return int One of PHP's UPLOAD_ERR_XXX constants. */ public function getError(); - + /** * Retrieve the filename sent by the client. * @@ -105,7 +105,7 @@ interface UploadedFileInterface * was provided. */ public function getClientFilename(); - + /** * Retrieve the media type sent by the client. * diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/UriInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/UriInterface.php index 9d7ab9e..271bcf9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/UriInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/psr/http-message/src/UriInterface.php @@ -1,4 +1,5 @@ =5.4.2", - "guzzlehttp/psr7": "^1.0" - }, - "require-dev": { - "react/http": "^0.4.1", - "react/socket-client": "^0.4.3", - "phpunit/phpunit": "4.8.*" + "name": "ratchet/rfc6455", + "type": "library", + "description": "RFC6455 WebSocket protocol handler", + "keywords": [ + "WebSockets", + "websocket", + "RFC6455" + ], + "homepage": "http://socketo.me", + "license": "MIT", + "authors": [ + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "role": "Developer" } + ], + "support": { + "forum": "https://groups.google.com/forum/#!forum/ratchet-php", + "issues": "https://github.com/ratchetphp/RFC6455/issues", + "irc": "irc://irc.freenode.org/reactphp" + }, + "autoload": { + "psr-4": { + "Ratchet\\RFC6455\\": "src" + } + }, + "require": { + "php": ">=5.4.2", + "guzzlehttp/psr7": "^1.0" + }, + "require-dev": { + "react/http": "^0.4.1", + "react/socket-client": "^0.4.3", + "phpunit/phpunit": "4.8.*" + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/phpunit.xml.dist b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/phpunit.xml.dist index 8f2e7d1..d59a6f6 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/phpunit.xml.dist +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/phpunit.xml.dist @@ -8,7 +8,7 @@ backupStaticAttributes="false" syntaxCheck="false" stopOnError="false" - > +> diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/ClientNegotiator.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/ClientNegotiator.php index 70856df..8623e73 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/ClientNegotiator.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/ClientNegotiator.php @@ -1,11 +1,14 @@ verifier = new ResponseVerifier; $this->defaultHeader = new Request('GET', '', [ - 'Connection' => 'Upgrade' - , 'Upgrade' => 'websocket' - , 'Sec-WebSocket-Version' => $this->getVersion() - , 'User-Agent' => "Ratchet" + 'Connection' => 'Upgrade' + , 'Upgrade' => 'websocket' + , 'Sec-WebSocket-Version' => $this->getVersion() + , 'User-Agent' => "Ratchet" ]); } @@ -37,9 +40,9 @@ class ClientNegotiator { } public function generateKey() { - $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwzyz1234567890+/='; + $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwzyz1234567890+/='; $charRange = strlen($chars) - 1; - $key = ''; + $key = ''; for ($i = 0; $i < 16; $i++) { $key .= $chars[mt_rand(0, $charRange)]; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/NegotiatorInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/NegotiatorInterface.php index c152eca..0f0b58e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/NegotiatorInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/NegotiatorInterface.php @@ -1,12 +1,15 @@ 0) { - return true; + return TRUE; } } - return false; + return FALSE; } /** diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/ResponseVerifier.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/ResponseVerifier.php index de03f53..bf80ec7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/ResponseVerifier.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/ResponseVerifier.php @@ -1,9 +1,12 @@ verifyConnection($response->getHeader('Connection')); $passes += (int)$this->verifySecWebSocketAccept( $response->getHeader('Sec-WebSocket-Accept') - , $request->getHeader('Sec-WebSocket-Key') + , $request->getHeader('Sec-WebSocket-Key') ); $passes += (int)$this->verifySubProtocol( $request->getHeader('Sec-WebSocket-Protocol') - , $response->getHeader('Sec-WebSocket-Protocol') + , $response->getHeader('Sec-WebSocket-Protocol') ); return (5 === $passes); @@ -43,7 +46,7 @@ class ResponseVerifier { } public function sign($key) { - return base64_encode(sha1($key . NegotiatorInterface::GUID, true)); + return base64_encode(sha1($key . NegotiatorInterface::GUID, TRUE)); } public function verifySubProtocol(array $requestHeader, array $responseHeader) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/ServerNegotiator.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/ServerNegotiator.php index 5a0073b..8ef854c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/ServerNegotiator.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Handshake/ServerNegotiator.php @@ -1,5 +1,7 @@ verifier = $requestVerifier; @@ -39,43 +42,43 @@ class ServerNegotiator implements NegotiatorInterface { * {@inheritdoc} */ public function handshake(RequestInterface $request) { - if (true !== $this->verifier->verifyMethod($request->getMethod())) { + if (TRUE !== $this->verifier->verifyMethod($request->getMethod())) { return new Response(405, ['Allow' => 'GET']); } - if (true !== $this->verifier->verifyHTTPVersion($request->getProtocolVersion())) { + if (TRUE !== $this->verifier->verifyHTTPVersion($request->getProtocolVersion())) { return new Response(505); } - if (true !== $this->verifier->verifyRequestURI($request->getUri()->getPath())) { + if (TRUE !== $this->verifier->verifyRequestURI($request->getUri()->getPath())) { return new Response(400); } - if (true !== $this->verifier->verifyHost($request->getHeader('Host'))) { + if (TRUE !== $this->verifier->verifyHost($request->getHeader('Host'))) { return new Response(400); } $upgradeSuggestion = [ - 'Connection' => 'Upgrade', - 'Upgrade' => 'websocket', - 'Sec-WebSocket-Version' => $this->getVersionNumber() + 'Connection' => 'Upgrade', + 'Upgrade' => 'websocket', + 'Sec-WebSocket-Version' => $this->getVersionNumber() ]; if (count($this->_supportedSubProtocols) > 0) { $upgradeSuggestion['Sec-WebSocket-Protocol'] = implode(', ', $this->_supportedSubProtocols); } - if (true !== $this->verifier->verifyUpgradeRequest($request->getHeader('Upgrade'))) { - return new Response(426, $upgradeSuggestion, null, '1.1', 'Upgrade header MUST be provided'); + if (TRUE !== $this->verifier->verifyUpgradeRequest($request->getHeader('Upgrade'))) { + return new Response(426, $upgradeSuggestion, NULL, '1.1', 'Upgrade header MUST be provided'); } - if (true !== $this->verifier->verifyConnection($request->getHeader('Connection'))) { - return new Response(400, [], null, '1.1', 'Connection Upgrade MUST be requested'); + if (TRUE !== $this->verifier->verifyConnection($request->getHeader('Connection'))) { + return new Response(400, [], NULL, '1.1', 'Connection Upgrade MUST be requested'); } - if (true !== $this->verifier->verifyKey($request->getHeader('Sec-WebSocket-Key'))) { - return new Response(400, [], null, '1.1', 'Invalid Sec-WebSocket-Key'); + if (TRUE !== $this->verifier->verifyKey($request->getHeader('Sec-WebSocket-Key'))) { + return new Response(400, [], NULL, '1.1', 'Invalid Sec-WebSocket-Key'); } - if (true !== $this->verifier->verifyVersion($request->getHeader('Sec-WebSocket-Version'))) { + if (TRUE !== $this->verifier->verifyVersion($request->getHeader('Sec-WebSocket-Version'))) { return new Response(426, $upgradeSuggestion); } @@ -84,24 +87,24 @@ class ServerNegotiator implements NegotiatorInterface { if (count($subProtocols) > 0 || (count($this->_supportedSubProtocols) > 0 && $this->_strictSubProtocols)) { $subProtocols = array_map('trim', explode(',', implode(',', $subProtocols))); - $match = array_reduce($subProtocols, function($accumulator, $protocol) { - return $accumulator ?: (isset($this->_supportedSubProtocols[$protocol]) ? $protocol : null); - }, null); + $match = array_reduce($subProtocols, function ($accumulator, $protocol) { + return $accumulator ?: (isset($this->_supportedSubProtocols[$protocol]) ? $protocol : NULL); + }, NULL); - if ($this->_strictSubProtocols && null === $match) { - return new Response(426, $upgradeSuggestion, null, '1.1', 'No Sec-WebSocket-Protocols requested supported'); + if ($this->_strictSubProtocols && NULL === $match) { + return new Response(426, $upgradeSuggestion, NULL, '1.1', 'No Sec-WebSocket-Protocols requested supported'); } - if (null !== $match) { + if (NULL !== $match) { $headers['Sec-WebSocket-Protocol'] = $match; } } return new Response(101, array_merge($headers, [ - 'Upgrade' => 'websocket' - , 'Connection' => 'Upgrade' - , 'Sec-WebSocket-Accept' => $this->sign((string)$request->getHeader('Sec-WebSocket-Key')[0]) - , 'X-Powered-By' => 'Ratchet' + 'Upgrade' => 'websocket' + , 'Connection' => 'Upgrade' + , 'Sec-WebSocket-Accept' => $this->sign((string)$request->getHeader('Sec-WebSocket-Key')[0]) + , 'X-Powered-By' => 'Ratchet' ])); } @@ -112,7 +115,7 @@ class ServerNegotiator implements NegotiatorInterface { * @internal */ public function sign($key) { - return base64_encode(sha1($key . static::GUID, true)); + return base64_encode(sha1($key . static::GUID, TRUE)); } /** diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/CloseFrameChecker.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/CloseFrameChecker.php index 3d800e5..ab4a991 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/CloseFrameChecker.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/CloseFrameChecker.php @@ -1,7 +1,9 @@ $ufExceptionFactory */ - public function __construct($payload = null, $final = true, $opcode = 1, callable $ufExceptionFactory = null) { - $this->ufeg = $ufExceptionFactory ?: function($msg = '') { + public function __construct($payload = NULL, $final = TRUE, $opcode = 1, callable $ufExceptionFactory = NULL) { + $this->ufeg = $ufExceptionFactory ?: function ($msg = '') { return new \UnderflowException($msg); }; - if (null === $payload) { + if (NULL === $payload) { return; } - $this->defPayLen = strlen($payload); - $this->firstByte = ($final ? 128 : 0) + $opcode; - $this->secondByte = $this->defPayLen; - $this->isCoalesced = true; + $this->defPayLen = strlen($payload); + $this->firstByte = ($final ? 128 : 0) + $opcode; + $this->secondByte = $this->defPayLen; + $this->isCoalesced = TRUE; $ext = ''; if ($this->defPayLen > 65535) { $ext = pack('NN', 0, $this->defPayLen); $this->secondByte = 127; - } elseif ($this->defPayLen > 125) { + } else if ($this->defPayLen > 125) { $ext = pack('n', $this->defPayLen); $this->secondByte = 126; } - $this->data = chr($this->firstByte) . chr($this->secondByte) . $ext . $payload; + $this->data = chr($this->firstByte) . chr($this->secondByte) . $ext . $payload; $this->bytesRecvd = 2 + strlen($ext) + $this->defPayLen; } @@ -104,15 +106,15 @@ class Frame implements FrameInterface { * {@inheritdoc} */ public function isCoalesced() { - if (true === $this->isCoalesced) { - return true; + if (TRUE === $this->isCoalesced) { + return TRUE; } try { $payload_length = $this->getPayloadLength(); - $payload_start = $this->getPayloadStartingByte(); + $payload_start = $this->getPayloadStartingByte(); } catch (\UnderflowException $e) { - return false; + return FALSE; } $this->isCoalesced = $this->bytesRecvd >= $payload_length + $payload_start; @@ -126,7 +128,7 @@ class Frame implements FrameInterface { public function addBuffer($buf) { $len = strlen($buf); - $this->data .= $buf; + $this->data .= $buf; $this->bytesRecvd += $len; if ($this->firstByte === -1 && $this->bytesRecvd !== 0) { @@ -204,7 +206,7 @@ class Frame implements FrameInterface { return ''; } - $start = 1 + $this->getNumPayloadBytes(); + $start = 1 + $this->getNumPayloadBytes(); if ($this->bytesRecvd < $start + static::MASK_LENGTH) { throw call_user_func($this->ufeg, 'Not enough data buffered to calculate the masking key'); @@ -234,28 +236,28 @@ class Frame implements FrameInterface { * @throws \InvalidArgumentException If there is an issue with the given masking key * @return Frame */ - public function maskPayload($maskingKey = null) { - if (null === $maskingKey) { + public function maskPayload($maskingKey = NULL) { + if (NULL === $maskingKey) { $maskingKey = $this->generateMaskingKey(); } if (static::MASK_LENGTH !== strlen($maskingKey)) { - throw new \InvalidArgumentException("Masking key must be " . static::MASK_LENGTH ." characters"); + throw new \InvalidArgumentException("Masking key must be " . static::MASK_LENGTH . " characters"); } - if (extension_loaded('mbstring') && true !== mb_check_encoding($maskingKey, 'US-ASCII')) { + if (extension_loaded('mbstring') && TRUE !== mb_check_encoding($maskingKey, 'US-ASCII')) { throw new \OutOfBoundsException("Masking key MUST be ASCII"); } $this->unMaskPayload(); $this->secondByte = $this->secondByte | 128; - $this->data[1] = chr($this->secondByte); + $this->data[1] = chr($this->secondByte); $this->data = substr_replace($this->data, $maskingKey, $this->getNumPayloadBytes() + 1, 0); $this->bytesRecvd += static::MASK_LENGTH; - $this->data = substr_replace($this->data, $this->applyMask($maskingKey), $this->getPayloadStartingByte(), $this->getPayloadLength()); + $this->data = substr_replace($this->data, $this->applyMask($maskingKey), $this->getPayloadStartingByte(), $this->getPayloadLength()); return $this; } @@ -282,20 +284,20 @@ class Frame implements FrameInterface { $this->data = substr_replace($this->data, '', $this->getNumPayloadBytes() + 1, static::MASK_LENGTH); $this->bytesRecvd -= static::MASK_LENGTH; - $this->data = substr_replace($this->data, $this->applyMask($maskingKey), $this->getPayloadStartingByte(), $this->getPayloadLength()); + $this->data = substr_replace($this->data, $this->applyMask($maskingKey), $this->getPayloadStartingByte(), $this->getPayloadLength()); return $this; } /** * Apply a mask to a string or the payload of the instance - * @param string $maskingKey The 4 character masking key to be applied + * @param string $maskingKey The 4 character masking key to be applied * @param string|null $payload A string to mask or null to use the payload * @throws \UnderflowException If using the payload but enough hasn't been buffered * @return string The masked string */ - public function applyMask($maskingKey, $payload = null) { - if (null === $payload) { + public function applyMask($maskingKey, $payload = NULL) { + if (NULL === $payload) { if (!$this->isCoalesced()) { throw call_user_func($this->ufeg, 'Frame must be coalesced to apply a mask'); } @@ -405,7 +407,7 @@ class Frame implements FrameInterface { $len = 0; for ($i = 2; $i <= $byte_length; $i++) { $len <<= 8; - $len += ord($this->data[$i]); + $len += ord($this->data[$i]); } $this->defPayLen = $len; @@ -457,11 +459,11 @@ class Frame implements FrameInterface { */ public function extractOverflow() { if ($this->isCoalesced()) { - $endPoint = $this->getPayloadLength(); + $endPoint = $this->getPayloadLength(); $endPoint += $this->getPayloadStartingByte(); if ($this->bytesRecvd > $endPoint) { - $overflow = substr($this->data, $endPoint); + $overflow = substr($this->data, $endPoint); $this->data = substr($this->data, 0, $endPoint); return $overflow; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/FrameInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/FrameInterface.php index dc24091..d147bc8 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/FrameInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/FrameInterface.php @@ -1,7 +1,9 @@ _frames) == 0) { - return false; + return FALSE; } $last = $this->_frames->top(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/MessageBuffer.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/MessageBuffer.php index 07ff4f1..4e6e5b6 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/MessageBuffer.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/MessageBuffer.php @@ -1,7 +1,9 @@ closeFrameChecker = $frameChecker; $this->checkForMask = (bool)$expectMask; - $this->exceptionFactory ?: $this->exceptionFactory = function($msg) { + $this->exceptionFactory ?: $this->exceptionFactory = function ($msg) { return new \UnderflowException($msg); }; $this->onMessage = $onMessage; - $this->onControl = $onControl ?: function() {}; + $this->onControl = $onControl ?: function () { + }; } public function onData($data) { @@ -67,7 +70,7 @@ class MessageBuffer { */ private function processData($data) { $this->messageBuffer ?: $this->messageBuffer = $this->newMessage(); - $this->frameBuffer ?: $this->frameBuffer = $this->newFrame(); + $this->frameBuffer ?: $this->frameBuffer = $this->newFrame(); $this->frameBuffer->addBuffer($data); if (!$this->frameBuffer->isCoalesced()) { @@ -94,17 +97,17 @@ class MessageBuffer { $this->messageBuffer->addFrame($this->frameBuffer); } - $this->frameBuffer = null; + $this->frameBuffer = NULL; if ($this->messageBuffer->isCoalesced()) { $msgCheck = $this->checkMessage($this->messageBuffer); - if (true !== $msgCheck) { + if (TRUE !== $msgCheck) { $onControl($this->newCloseFrame($msgCheck, 'Ratchet detected an invalid UTF-8 payload')); } else { $onMessage($this->messageBuffer); } - $this->messageBuffer = null; + $this->messageBuffer = NULL; } return $overflow; @@ -116,9 +119,9 @@ class MessageBuffer { * @return \Ratchet\RFC6455\Messaging\FrameInterface|FrameInterface */ public function frameCheck(FrameInterface $frame) { - if (false !== $frame->getRsv1() || - false !== $frame->getRsv2() || - false !== $frame->getRsv3() + if (FALSE !== $frame->getRsv1() || + FALSE !== $frame->getRsv2() || + FALSE !== $frame->getRsv3() ) { return $this->newCloseFrame(Frame::CLOSE_PROTOCOL, 'Ratchet detected an invalid reserve code'); } @@ -197,7 +200,7 @@ class MessageBuffer { } } - return true; + return TRUE; } private function checkUtf8($string) { @@ -217,15 +220,15 @@ class MessageBuffer { /** * @param string|null $payload - * @param bool|null $final - * @param int|null $opcode + * @param bool|null $final + * @param int|null $opcode * @return \Ratchet\RFC6455\Messaging\FrameInterface */ - public function newFrame($payload = null, $final = null, $opcode = null) { + public function newFrame($payload = NULL, $final = NULL, $opcode = NULL) { return new Frame($payload, $final, $opcode, $this->exceptionFactory); } public function newCloseFrame($code, $reason = '') { - return $this->newFrame(pack('n', $code) . $reason, true, Frame::OP_CLOSE); + return $this->newFrame(pack('n', $code) . $reason, TRUE, Frame::OP_CLOSE); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/MessageInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/MessageInterface.php index fd7212e..e03ac3d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/MessageInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/src/Messaging/MessageInterface.php @@ -1,7 +1,9 @@ markTestSkipped('Autobahn TestSuite results not found'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/ab/clientRunner.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/ab/clientRunner.php index 0c5578a..d281dbf 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/ab/clientRunner.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/ab/clientRunner.php @@ -1,4 +1,5 @@ createCached('8.8.8.8', $loop); $factory = new \React\SocketClient\Connector($loop, $dnsResolver); -function echoStreamerFactory($conn) -{ +function echoStreamerFactory($conn) { return new \Ratchet\RFC6455\Messaging\MessageBuffer( new \Ratchet\RFC6455\Messaging\CloseFrameChecker, function (\Ratchet\RFC6455\Messaging\MessageInterface $msg) use ($conn) { @@ -30,14 +30,14 @@ function echoStreamerFactory($conn) function (\Ratchet\RFC6455\Messaging\FrameInterface $frame) use ($conn) { switch ($frame->getOpcode()) { case Frame::OP_PING: - return $conn->write((new Frame($frame->getPayload(), true, Frame::OP_PONG))->maskPayload()->getContents()); + return $conn->write((new Frame($frame->getPayload(), TRUE, Frame::OP_PONG))->maskPayload()->getContents()); break; case Frame::OP_CLOSE: - return $conn->end((new Frame($frame->getPayload(), true, Frame::OP_CLOSE))->maskPayload()->getContents()); + return $conn->end((new Frame($frame->getPayload(), TRUE, Frame::OP_CLOSE))->maskPayload()->getContents()); break; } }, - false + FALSE ); } @@ -52,13 +52,13 @@ function getTestCases() { $cnRequest = $cn->generateRequest(new Uri('ws://127.0.0.1:9001/getCaseCount')); $rawResponse = ""; - $response = null; + $response = NULL; /** @var \Ratchet\RFC6455\Messaging\Streaming\MessageBuffer $ms */ - $ms = null; + $ms = NULL; $stream->on('data', function ($data) use ($stream, &$rawResponse, &$response, &$ms, $cn, $deferred, &$context, $cnRequest) { - if ($response === null) { + if ($response === NULL) { $rawResponse .= $data; $pos = strpos($rawResponse, "\r\n\r\n"); if ($pos) { @@ -76,8 +76,8 @@ function getTestCases() { $deferred->resolve($msg->getPayload()); $stream->close(); }, - null, - false + NULL, + FALSE ); } } @@ -95,8 +95,7 @@ function getTestCases() { return $deferred->promise(); } -function runTest($case) -{ +function runTest($case) { global $factory; global $testServer; @@ -109,12 +108,12 @@ function runTest($case) $cnRequest = $cn->generateRequest(new Uri('ws://127.0.0.1:9001' . $casePath)); $rawResponse = ""; - $response = null; + $response = NULL; - $ms = null; + $ms = NULL; $stream->on('data', function ($data) use ($stream, &$rawResponse, &$response, &$ms, $cn, $deferred, &$context, $cnRequest) { - if ($response === null) { + if ($response === NULL) { $rawResponse .= $data; $pos = strpos($rawResponse, "\r\n\r\n"); if ($pos) { @@ -159,13 +158,13 @@ function createReport() { $cnRequest = $cn->generateRequest(new Uri('ws://127.0.0.1:9001' . $reportPath)); $rawResponse = ""; - $response = null; + $response = NULL; /** @var \Ratchet\RFC6455\Messaging\MessageBuffer $ms */ - $ms = null; + $ms = NULL; $stream->on('data', function ($data) use ($stream, &$rawResponse, &$response, &$ms, $cn, $deferred, &$context, $cnRequest) { - if ($response === null) { + if ($response === NULL) { $rawResponse .= $data; $pos = strpos($rawResponse, "\r\n\r\n"); if ($pos) { @@ -183,8 +182,8 @@ function createReport() { $deferred->resolve($msg->getPayload()); $stream->close(); }, - null, - false + NULL, + FALSE ); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/ab/fuzzingclient.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/ab/fuzzingclient.json index d2fd0d0..cc64f26 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/ab/fuzzingclient.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/ab/fuzzingclient.json @@ -1,14 +1,24 @@ { - "options": { - "failByDrop": false + "options": { + "failByDrop": false + }, + "outdir": "./reports/servers", + "servers": [ + { + "agent": "RatchetRFC/0.1.0", + "url": "ws://localhost:9001", + "options": { + "version": 18 + } } - , "outdir": "./reports/servers" - , "servers": [{ - "agent": "RatchetRFC/0.1.0" - , "url": "ws://localhost:9001" - , "options": {"version": 18} - }] - , "cases": ["*"] - , "exclude-cases": ["6.4.*", "12.*","13.*"] - , "exclude-agent-cases": {} + ], + "cases": [ + "*" + ], + "exclude-cases": [ + "6.4.*", + "12.*", + "13.*" + ], + "exclude-agent-cases": {} } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/ab/fuzzingserver.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/ab/fuzzingserver.json index 0422560..7809d9b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/ab/fuzzingserver.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/ab/fuzzingserver.json @@ -1,10 +1,16 @@ { - "url": "ws://127.0.0.1:9001" - , "options": { - "failByDrop": false - } - , "outdir": "./reports/clients" - , "cases": ["*"] - , "exclude-cases": ["6.4.*", "12.*", "13.*"] - , "exclude-agent-cases": {} + "url": "ws://127.0.0.1:9001", + "options": { + "failByDrop": false + }, + "outdir": "./reports/clients", + "cases": [ + "*" + ], + "exclude-cases": [ + "6.4.*", + "12.*", + "13.*" + ], + "exclude-agent-cases": {} } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/ab/startServer.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/ab/startServer.php index b256ec2..cc78b5d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/ab/startServer.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/ab/startServer.php @@ -1,11 +1,12 @@ on('request', function (\React\Http\Request $request, \React\Http\Respo return; } - $parser = new \Ratchet\RFC6455\Messaging\MessageBuffer($closeFrameChecker, function(MessageInterface $message) use ($response) { + $parser = new \Ratchet\RFC6455\Messaging\MessageBuffer($closeFrameChecker, function (MessageInterface $message) use ($response) { $response->write($message->getContents()); - }, function(FrameInterface $frame) use ($response, &$parser) { + }, function (FrameInterface $frame) use ($response, &$parser) { switch ($frame->getOpCode()) { case Frame::OP_CLOSE: $response->end($frame->getContents()); break; case Frame::OP_PING: - $response->write($parser->newFrame($frame->getPayload(), true, Frame::OP_PONG)->getContents()); + $response->write($parser->newFrame($frame->getPayload(), TRUE, Frame::OP_PONG)->getContents()); break; } - }, true, function() use ($uException) { + }, TRUE, function () use ($uException) { return $uException; }); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Handshake/RequestVerifierTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Handshake/RequestVerifierTest.php index 239de33..fa84c6d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Handshake/RequestVerifierTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Handshake/RequestVerifierTest.php @@ -1,11 +1,14 @@ setStrictSubProtocolCheck(true); + $negotiator->setStrictSubProtocolCheck(TRUE); $negotiator->setSupportedSubProtocols([]); $requestText = 'GET / HTTP/1.1 @@ -144,7 +144,7 @@ Accept-Language: en-US,en;q=0.8'; public function testNonStrictSubprotocolDoesNotIncludeHeaderWhenNoneAgreedOn() { $negotiator = new ServerNegotiator(new RequestVerifier()); - $negotiator->setStrictSubProtocolCheck(false); + $negotiator->setStrictSubProtocolCheck(FALSE); $negotiator->setSupportedSubProtocols(['someproto']); $requestText = 'GET / HTTP/1.1 diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Messaging/FrameTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Messaging/FrameTest.php index b73f600..39edd11 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Messaging/FrameTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Messaging/FrameTest.php @@ -1,5 +1,7 @@ = 8) { $out .= static::encode(substr($in, 0, 8)); - $in = substr($in, 8); + $in = substr($in, 8); } return $out; } @@ -73,15 +76,15 @@ class FrameTest extends \PHPUnit_Framework_TestCase { /** * @dataProvider underflowProvider * - * @covers Ratchet\RFC6455\Messaging\Frame::isFinal - * @covers Ratchet\RFC6455\Messaging\Frame::getRsv1 - * @covers Ratchet\RFC6455\Messaging\Frame::getRsv2 - * @covers Ratchet\RFC6455\Messaging\Frame::getRsv3 - * @covers Ratchet\RFC6455\Messaging\Frame::getOpcode - * @covers Ratchet\RFC6455\Messaging\Frame::isMasked - * @covers Ratchet\RFC6455\Messaging\Frame::getPayloadLength - * @covers Ratchet\RFC6455\Messaging\Frame::getMaskingKey - * @covers Ratchet\RFC6455\Messaging\Frame::getPayload + * @covers Ratchet\RFC6455\Messaging\Frame::isFinal + * @covers Ratchet\RFC6455\Messaging\Frame::getRsv1 + * @covers Ratchet\RFC6455\Messaging\Frame::getRsv2 + * @covers Ratchet\RFC6455\Messaging\Frame::getRsv3 + * @covers Ratchet\RFC6455\Messaging\Frame::getOpcode + * @covers Ratchet\RFC6455\Messaging\Frame::isMasked + * @covers Ratchet\RFC6455\Messaging\Frame::getPayloadLength + * @covers Ratchet\RFC6455\Messaging\Frame::getMaskingKey + * @covers Ratchet\RFC6455\Messaging\Frame::getPayload */ public function testUnderflowExceptionFromAllTheMethodsMimickingBuffering($method, $bin) { $this->setExpectedException('\UnderflowException'); @@ -99,12 +102,12 @@ class FrameTest extends \PHPUnit_Framework_TestCase { */ public static function firstByteProvider() { return array( - array(false, false, false, true, 8, '00011000'), - array(true, false, true, false, 10, '10101010'), - array(false, false, false, false, 15, '00001111'), - array(true, false, false, false, 1, '10000001'), - array(true, true, true, true, 15, '11111111'), - array(true, true, false, false, 7, '11000111') + array(FALSE, FALSE, FALSE, TRUE, 8, '00011000'), + array(TRUE, FALSE, TRUE, FALSE, 10, '10101010'), + array(FALSE, FALSE, FALSE, FALSE, 15, '00001111'), + array(TRUE, FALSE, FALSE, FALSE, 1, '10000001'), + array(TRUE, TRUE, TRUE, TRUE, 15, '11111111'), + array(TRUE, TRUE, FALSE, FALSE, 7, '11000111') ); } @@ -159,12 +162,12 @@ class FrameTest extends \PHPUnit_Framework_TestCase { public static function payloadLengthDescriptionProvider() { return array( - array(7, '01110101'), - array(7, '01111101'), + array(7, '01110101'), + array(7, '01111101'), array(23, '01111110'), array(71, '01111111'), - array(7, '00000000'), // Should this throw an exception? Can a payload be empty? - array(7, '00000001') + array(7, '00000000'), // Should this throw an exception? Can a payload be empty? + array(7, '00000001') ); } @@ -177,8 +180,8 @@ class FrameTest extends \PHPUnit_Framework_TestCase { $this->_frame->addBuffer(static::encode($this->_firstByteFinText)); $this->_frame->addBuffer(static::encode($bin)); $ref = new \ReflectionClass($this->_frame); - $cb = $ref->getMethod('getFirstPayloadVal'); - $cb->setAccessible(true); + $cb = $ref->getMethod('getFirstPayloadVal'); + $cb->setAccessible(TRUE); $this->assertEquals(bindec($bin), $cb->invoke($this->_frame)); } @@ -187,8 +190,8 @@ class FrameTest extends \PHPUnit_Framework_TestCase { */ public function testFirstPayloadValUnderflow() { $ref = new \ReflectionClass($this->_frame); - $cb = $ref->getMethod('getFirstPayloadVal'); - $cb->setAccessible(true); + $cb = $ref->getMethod('getFirstPayloadVal'); + $cb->setAccessible(TRUE); $this->setExpectedException('UnderflowException'); $cb->invoke($this->_frame); } @@ -201,8 +204,8 @@ class FrameTest extends \PHPUnit_Framework_TestCase { $this->_frame->addBuffer(static::encode($this->_firstByteFinText)); $this->_frame->addBuffer(static::encode($bin)); $ref = new \ReflectionClass($this->_frame); - $cb = $ref->getMethod('getNumPayloadBits'); - $cb->setAccessible(true); + $cb = $ref->getMethod('getNumPayloadBits'); + $cb->setAccessible(TRUE); $this->assertEquals($expected_bits, $cb->invoke($this->_frame)); } @@ -211,19 +214,20 @@ class FrameTest extends \PHPUnit_Framework_TestCase { */ public function testgetNumPayloadBitsUnderflow() { $ref = new \ReflectionClass($this->_frame); - $cb = $ref->getMethod('getNumPayloadBits'); - $cb->setAccessible(true); + $cb = $ref->getMethod('getNumPayloadBits'); + $cb->setAccessible(TRUE); $this->setExpectedException('UnderflowException'); $cb->invoke($this->_frame); } public function secondByteProvider() { return array( - array(true, 1, '10000001'), - array(false, 1, '00000001'), - array(true, 125, $this->_secondByteMaskedSPL) + array(TRUE, 1, '10000001'), + array(FALSE, 1, '00000001'), + array(TRUE, 125, $this->_secondByteMaskedSPL) ); } + /** * @dataProvider secondByteProvider * covers Ratchet\RFC6455\Messaging\Frame::isMasked @@ -304,7 +308,7 @@ class FrameTest extends \PHPUnit_Framework_TestCase { public static function messageFragmentProvider() { return array( - array(false, '', '', '', '', '') + array(FALSE, '', '', '', '', '') ); } @@ -314,7 +318,7 @@ class FrameTest extends \PHPUnit_Framework_TestCase { */ public function testCheckPiecingTogetherMessage($msg, $encoded) { $framed = base64_decode($encoded); - for ($i = 0, $len = strlen($framed);$i < $len; $i++) { + for ($i = 0, $len = strlen($framed); $i < $len; $i++) { $this->_frame->addBuffer(substr($framed, $i, 1)); } $this->assertEquals($msg, $this->_frame->getPayload()); @@ -327,8 +331,8 @@ class FrameTest extends \PHPUnit_Framework_TestCase { */ public function testLongCreate() { $len = 65525; - $pl = $this->generateRandomString($len); - $frame = new Frame($pl, true, Frame::OP_PING); + $pl = $this->generateRandomString($len); + $frame = new Frame($pl, TRUE, Frame::OP_PING); $this->assertTrue($frame->isFinal()); $this->assertEquals(Frame::OP_PING, $frame->getOpcode()); $this->assertFalse($frame->isMasked()); @@ -345,15 +349,16 @@ class FrameTest extends \PHPUnit_Framework_TestCase { $frame = new Frame($this->generateRandomString($len)); $this->assertEquals($len, $frame->getPayloadLength()); } + /** * covers Ratchet\RFC6455\Messaging\Frame::__construct * covers Ratchet\RFC6455\Messaging\Frame::extractOverflow */ public function testExtractOverflow() { $string1 = $this->generateRandomString(); - $frame1 = new Frame($string1); + $frame1 = new Frame($string1); $string2 = $this->generateRandomString(); - $frame2 = new Frame($string2); + $frame2 = new Frame($string2); $cat = new Frame; $cat->addBuffer($frame1->getContents() . $frame2->getContents()); $this->assertEquals($frame1->getContents(), $cat->getContents()); @@ -369,7 +374,7 @@ class FrameTest extends \PHPUnit_Framework_TestCase { */ public function testEmptyExtractOverflow() { $string = $this->generateRandomString(); - $frame = new Frame($string); + $frame = new Frame($string); $this->assertEquals($string, $frame->getPayload()); $this->assertEquals('', $frame->extractOverflow()); $this->assertEquals($string, $frame->getPayload()); @@ -391,7 +396,7 @@ class FrameTest extends \PHPUnit_Framework_TestCase { * covers Ratchet\RFC6455\Messaging\Frame::maskPayload */ public function testMasking() { - $msg = 'The quick brown fox jumps over the lazy dog.'; + $msg = 'The quick brown fox jumps over the lazy dog.'; $frame = new Frame($msg); $frame->maskPayload(); $this->assertTrue($frame->isMasked()); @@ -403,7 +408,7 @@ class FrameTest extends \PHPUnit_Framework_TestCase { */ public function testUnMaskPayload() { $string = $this->generateRandomString(); - $frame = new Frame($string); + $frame = new Frame($string); $frame->maskPayload()->unMaskPayload(); $this->assertFalse($frame->isMasked()); $this->assertEquals($string, $frame->getPayload()); @@ -413,12 +418,12 @@ class FrameTest extends \PHPUnit_Framework_TestCase { * covers Ratchet\RFC6455\Messaging\Frame::generateMaskingKey */ public function testGenerateMaskingKey() { - $dupe = false; + $dupe = FALSE; $done = array(); for ($i = 0; $i < 10; $i++) { $new = $this->_frame->generateMaskingKey(); if (in_array($new, $done)) { - $dupe = true; + $dupe = TRUE; } $done[] = $new; } @@ -446,16 +451,16 @@ class FrameTest extends \PHPUnit_Framework_TestCase { $this->_frame->maskPayload('x✖'); } - protected function generateRandomString($length = 10, $addSpaces = true, $addNumbers = true) { + protected function generateRandomString($length = 10, $addSpaces = TRUE, $addNumbers = TRUE) { $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"$%&/()=[]{}'; // ยง $useChars = array(); - for($i = 0; $i < $length; $i++) { + for ($i = 0; $i < $length; $i++) { $useChars[] = $characters[mt_rand(0, strlen($characters) - 1)]; } - if($addSpaces === true) { + if ($addSpaces === TRUE) { array_push($useChars, ' ', ' ', ' ', ' ', ' ', ' '); } - if($addNumbers === true) { + if ($addNumbers === TRUE) { array_push($useChars, rand(0, 9), rand(0, 9), rand(0, 9)); } shuffle($useChars); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Messaging/MessageBufferTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Messaging/MessageBufferTest.php index c33ff0c..cdeaf76 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Messaging/MessageBufferTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Messaging/MessageBufferTest.php @@ -14,7 +14,7 @@ class MessageBufferTest extends \PHPUnit_Framework_TestCase * buffer with many many frames without blowing the stack (pre-v0.4 issue) */ public function testProcessingLotsOfFramesInASingleChunk() { - $frame = new Frame('a', true, Frame::OP_TEXT); + $frame = new Frame('a', TRUE, Frame::OP_TEXT); $frameRaw = $frame->getContents(); @@ -28,8 +28,8 @@ class MessageBufferTest extends \PHPUnit_Framework_TestCase $messageCount++; $this->assertEquals('a', $message->getPayload()); }, - null, - false + NULL, + FALSE ); $messageBuffer->onData($data); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Messaging/MessageTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Messaging/MessageTest.php index 1f7eab5..9faccc7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Messaging/MessageTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/ratchet/rfc6455/tests/unit/Messaging/MessageTest.php @@ -1,12 +1,15 @@ message->addFrame($f1)->addFrame($f2); $this->assertEquals(strlen($a . $b), $this->message->getPayloadLength()); $this->assertEquals($a . $b, $this->message->getPayload()); } public function testUnbufferedFragment() { - $this->message->addFrame(new Frame('The quick brow', false)); + $this->message->addFrame(new Frame('The quick brow', FALSE)); $this->setExpectedException('UnderflowException'); $this->message->getPayload(); } public function testGetOpCode() { $this->message - ->addFrame(new Frame('The quick brow', false, Frame::OP_TEXT)) - ->addFrame(new Frame('n fox jumps ov', false, Frame::OP_CONTINUE)) - ->addFrame(new Frame('er the lazy dog', true, Frame::OP_CONTINUE)) - ; + ->addFrame(new Frame('The quick brow', FALSE, Frame::OP_TEXT)) + ->addFrame(new Frame('n fox jumps ov', FALSE, Frame::OP_CONTINUE)) + ->addFrame(new Frame('er the lazy dog', TRUE, Frame::OP_CONTINUE)); $this->assertEquals(Frame::OP_TEXT, $this->message->getOpCode()); } public function testGetUnBufferedPayloadLength() { $this->message - ->addFrame(new Frame('The quick brow', false, Frame::OP_TEXT)) - ->addFrame(new Frame('n fox jumps ov', false, Frame::OP_CONTINUE)) - ; + ->addFrame(new Frame('The quick brow', FALSE, Frame::OP_TEXT)) + ->addFrame(new Frame('n fox jumps ov', FALSE, Frame::OP_CONTINUE)); $this->assertEquals(28, $this->message->getPayloadLength()); } } \ No newline at end of file diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/composer.json index 51573b6..40f26fa 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/composer.json @@ -1,19 +1,28 @@ { - "name": "react/cache", - "description": "Async, Promise-based cache interface for ReactPHP", - "keywords": ["cache", "caching", "promise", "ReactPHP"], - "license": "MIT", - "require": { - "php": ">=5.3.0", - "react/promise": "~2.0|~1.1" - }, - "autoload": { - "psr-4": { "React\\Cache\\": "src/" } - }, - "autoload-dev": { - "psr-4": { "React\\Tests\\Cache\\": "tests/" } - }, - "require-dev": { - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + "name": "react/cache", + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "ReactPHP" + ], + "license": "MIT", + "require": { + "php": ">=5.3.0", + "react/promise": "~2.0|~1.1" + }, + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" } + }, + "autoload-dev": { + "psr-4": { + "React\\Tests\\Cache\\": "tests/" + } + }, + "require-dev": { + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/src/ArrayCache.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/src/ArrayCache.php index 03dcc15..716dbab 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/src/ArrayCache.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/src/ArrayCache.php @@ -8,8 +8,7 @@ class ArrayCache implements CacheInterface { private $data = array(); - public function get($key) - { + public function get($key) { if (!isset($this->data[$key])) { return Promise\reject(); } @@ -17,13 +16,11 @@ class ArrayCache implements CacheInterface return Promise\resolve($this->data[$key]); } - public function set($key, $value) - { + public function set($key, $value) { $this->data[$key] = $value; } - public function remove($key) - { + public function remove($key) { unset($this->data[$key]); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/tests/ArrayCacheTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/tests/ArrayCacheTest.php index eec3739..78c7c33 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/tests/ArrayCacheTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/tests/ArrayCacheTest.php @@ -8,14 +8,12 @@ class ArrayCacheTest extends TestCase { private $cache; - public function setUp() - { + public function setUp() { $this->cache = new ArrayCache(); } /** @test */ - public function getShouldRejectPromiseForNonExistentKey() - { + public function getShouldRejectPromiseForNonExistentKey() { $this->cache ->get('foo') ->then( @@ -25,8 +23,7 @@ class ArrayCacheTest extends TestCase } /** @test */ - public function setShouldSetKey() - { + public function setShouldSetKey() { $this->cache ->set('foo', 'bar'); @@ -42,8 +39,7 @@ class ArrayCacheTest extends TestCase } /** @test */ - public function removeShouldRemoveKey() - { + public function removeShouldRemoveKey() { $this->cache ->set('foo', 'bar'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/tests/CallableStub.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/tests/CallableStub.php index 2f547cd..4a7514b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/tests/CallableStub.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/tests/CallableStub.php @@ -4,7 +4,6 @@ namespace React\Tests\Cache; class CallableStub { - public function __invoke() - { + public function __invoke() { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/tests/TestCase.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/tests/TestCase.php index aa449f2..0f2fa31 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/tests/TestCase.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/cache/tests/TestCase.php @@ -6,8 +6,7 @@ use PHPUnit\Framework\TestCase as BaseTestCase; class TestCase extends BaseTestCase { - protected function expectCallableExactly($amount) - { + protected function expectCallableExactly($amount) { $mock = $this->createCallableMock(); $mock ->expects($this->exactly($amount)) @@ -16,8 +15,7 @@ class TestCase extends BaseTestCase return $mock; } - protected function expectCallableOnce() - { + protected function expectCallableOnce() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -26,8 +24,7 @@ class TestCase extends BaseTestCase return $mock; } - protected function expectCallableNever() - { + protected function expectCallableNever() { $mock = $this->createCallableMock(); $mock ->expects($this->never()) @@ -36,8 +33,7 @@ class TestCase extends BaseTestCase return $mock; } - protected function createCallableMock() - { + protected function createCallableMock() { return $this->getMockBuilder('React\Tests\Cache\CallableStub')->getMock(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/composer.json index 510a43c..f78116d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/composer.json @@ -1,24 +1,33 @@ { - "name": "react/dns", - "description": "Async DNS resolver for ReactPHP", - "keywords": ["dns", "dns-resolver", "ReactPHP", "async"], - "license": "MIT", - "require": { - "php": ">=5.3.0", - "react/cache": "~0.4.0|~0.3.0", - "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", - "react/promise": "^2.1 || ^1.2.1", - "react/promise-timer": "^1.2", - "react/stream": "^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4.5" - }, - "require-dev": { - "clue/block-react": "^1.2", - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" - }, - "autoload": { - "psr-4": { "React\\Dns\\": "src" } - }, - "autoload-dev": { - "psr-4": { "React\\Tests\\Dns\\": "tests" } + "name": "react/dns", + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "dns", + "dns-resolver", + "ReactPHP", + "async" + ], + "license": "MIT", + "require": { + "php": ">=5.3.0", + "react/cache": "~0.4.0|~0.3.0", + "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", + "react/promise": "^2.1 || ^1.2.1", + "react/promise-timer": "^1.2", + "react/stream": "^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4.5" + }, + "require-dev": { + "clue/block-react": "^1.2", + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + }, + "autoload": { + "psr-4": { + "React\\Dns\\": "src" } + }, + "autoload-dev": { + "psr-4": { + "React\\Tests\\Dns\\": "tests" + } + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/examples/03-cached.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/examples/03-cached.php index e76a27c..656ebc5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/examples/03-cached.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/examples/03-cached.php @@ -19,19 +19,19 @@ $resolver->resolve($name)->then(function ($ip) use ($name) { echo 'IP for ' . $name . ': ' . $ip . PHP_EOL; }, 'printf'); -$loop->addTimer(1.0, function() use ($name, $resolver) { +$loop->addTimer(1.0, function () use ($name, $resolver) { $resolver->resolve($name)->then(function ($ip) use ($name) { echo 'IP for ' . $name . ': ' . $ip . PHP_EOL; }, 'printf'); }); -$loop->addTimer(2.0, function() use ($name, $resolver) { +$loop->addTimer(2.0, function () use ($name, $resolver) { $resolver->resolve($name)->then(function ($ip) use ($name) { echo 'IP for ' . $name . ': ' . $ip . PHP_EOL; }, 'printf'); }); -$loop->addTimer(3.0, function() use ($name, $resolver) { +$loop->addTimer(3.0, function () use ($name, $resolver) { $resolver->resolve($name)->then(function ($ip) use ($name) { echo 'IP for ' . $name . ': ' . $ip . PHP_EOL; }, 'printf'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/examples/04-query-a-and-aaaa.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/examples/04-query-a-and-aaaa.php index 6c46bbf..d75422b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/examples/04-query-a-and-aaaa.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/examples/04-query-a-and-aaaa.php @@ -11,7 +11,7 @@ require __DIR__ . '/../vendor/autoload.php'; $loop = Factory::create(); -$executor = new Executor($loop, new Parser(), new BinaryDumper(), null); +$executor = new Executor($loop, new Parser(), new BinaryDumper(), NULL); $name = isset($argv[1]) ? $argv[1] : 'www.google.com'; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Config/Config.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Config/Config.php index c82635d..e91fd29 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Config/Config.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Config/Config.php @@ -26,8 +26,7 @@ class Config * @return self * @codeCoverageIgnore */ - public static function loadSystemConfigBlocking() - { + public static function loadSystemConfigBlocking() { // Use WMIC output on Windows if (DIRECTORY_SEPARATOR === '\\') { return self::loadWmicBlocking(); @@ -71,14 +70,13 @@ class Config * @return self * @throws RuntimeException if the path can not be loaded (does not exist) */ - public static function loadResolvConfBlocking($path = null) - { - if ($path === null) { + public static function loadResolvConfBlocking($path = NULL) { + if ($path === NULL) { $path = '/etc/resolv.conf'; } $contents = @file_get_contents($path); - if ($contents === false) { + if ($contents === FALSE) { throw new RuntimeException('Unable to load resolv.conf file "' . $path . '"'); } @@ -112,9 +110,8 @@ class Config * @return self * @link https://ss64.com/nt/wmic.html */ - public static function loadWmicBlocking($command = null) - { - $contents = shell_exec($command === null ? 'wmic NICCONFIG get "DNSServerSearchOrder" /format:CSV' : $command); + public static function loadWmicBlocking($command = NULL) { + $contents = shell_exec($command === NULL ? 'wmic NICCONFIG get "DNSServerSearchOrder" /format:CSV' : $command); preg_match_all('/(?<=[{;,"])([\da-f.:]{4,})(?=[};,"])/i', $contents, $matches); $config = new self(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Config/FilesystemFactory.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Config/FilesystemFactory.php index 68cec3e..75f0840 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Config/FilesystemFactory.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Config/FilesystemFactory.php @@ -16,13 +16,11 @@ class FilesystemFactory { private $loop; - public function __construct(LoopInterface $loop) - { + public function __construct(LoopInterface $loop) { $this->loop = $loop; } - public function create($filename) - { + public function create($filename) { return $this ->loadEtcResolvConf($filename) ->then(array($this, 'parseEtcResolvConf')); @@ -33,15 +31,13 @@ class FilesystemFactory * @return Promise * @deprecated see Config instead */ - public function parseEtcResolvConf($contents) - { + public function parseEtcResolvConf($contents) { return Promise\resolve(Config::loadResolvConfBlocking( 'data://text/plain;base64,' . base64_encode($contents) )); } - public function loadEtcResolvConf($filename) - { + public function loadEtcResolvConf($filename) { if (!file_exists($filename)) { return Promise\reject(new \InvalidArgumentException("The filename for /etc/resolv.conf given does not exist: $filename")); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Config/HostsFile.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Config/HostsFile.php index 5b6277e..f7bda84 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Config/HostsFile.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Config/HostsFile.php @@ -27,8 +27,7 @@ class HostsFile * @return string * @codeCoverageIgnore */ - public static function getDefaultPath() - { + public static function getDefaultPath() { // use static path for all Unix-based systems if (DIRECTORY_SEPARATOR !== '\\') { return '/etc/hosts'; @@ -39,7 +38,7 @@ class HostsFile $path = '%SystemRoot%\\system32\drivers\etc\hosts'; $base = getenv('SystemRoot'); - if ($base === false) { + if ($base === FALSE) { $base = 'C:\\Windows'; } @@ -59,14 +58,13 @@ class HostsFile * @return self * @throws RuntimeException if the path can not be loaded (does not exist) */ - public static function loadFromPathBlocking($path = null) - { - if ($path === null) { + public static function loadFromPathBlocking($path = NULL) { + if ($path === NULL) { $path = self::getDefaultPath(); } $contents = @file_get_contents($path); - if ($contents === false) { + if ($contents === FALSE) { throw new RuntimeException('Unable to load hosts file "' . $path . '"'); } @@ -78,8 +76,7 @@ class HostsFile * * @param string $contents */ - public function __construct($contents) - { + public function __construct($contents) { // remove all comments from the contents $contents = preg_replace('/[ \t]*#.*/', '', strtolower($contents)); @@ -92,21 +89,20 @@ class HostsFile * @param string $name * @return string[] */ - public function getIpsForHost($name) - { + public function getIpsForHost($name) { $name = strtolower($name); $ips = array(); foreach (preg_split('/\r?\n/', $this->contents) as $line) { $parts = preg_split('/\s+/', $line); $ip = array_shift($parts); - if ($parts && array_search($name, $parts) !== false) { + if ($parts && array_search($name, $parts) !== FALSE) { // remove IPv6 zone ID (`fe80::1%lo0` => `fe80:1`) - if (strpos($ip, ':') !== false && ($pos = strpos($ip, '%')) !== false) { + if (strpos($ip, ':') !== FALSE && ($pos = strpos($ip, '%')) !== FALSE) { $ip = substr($ip, 0, $pos); } - if (@inet_pton($ip) !== false) { + if (@inet_pton($ip) !== FALSE) { $ips[] = $ip; } } @@ -121,21 +117,20 @@ class HostsFile * @param string $ip * @return string[] */ - public function getHostsForIp($ip) - { + public function getHostsForIp($ip) { // check binary representation of IP to avoid string case and short notation $ip = @inet_pton($ip); - if ($ip === false) { + if ($ip === FALSE) { return array(); } $names = array(); foreach (preg_split('/\r?\n/', $this->contents) as $line) { - $parts = preg_split('/\s+/', $line, null, PREG_SPLIT_NO_EMPTY); + $parts = preg_split('/\s+/', $line, NULL, PREG_SPLIT_NO_EMPTY); $addr = array_shift($parts); // remove IPv6 zone ID (`fe80::1%lo0` => `fe80:1`) - if (strpos($addr, ':') !== false && ($pos = strpos($addr, '%')) !== false) { + if (strpos($addr, ':') !== FALSE && ($pos = strpos($addr, '%')) !== FALSE) { $addr = substr($addr, 0, $pos); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Model/HeaderBag.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Model/HeaderBag.php index 193e65c..7f73bca 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Model/HeaderBag.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Model/HeaderBag.php @@ -7,47 +7,41 @@ class HeaderBag public $data = ''; public $attributes = array( - 'qdCount' => 0, - 'anCount' => 0, - 'nsCount' => 0, - 'arCount' => 0, - 'qr' => 0, - 'opcode' => Message::OPCODE_QUERY, - 'aa' => 0, - 'tc' => 0, - 'rd' => 0, - 'ra' => 0, - 'z' => 0, - 'rcode' => Message::RCODE_OK, + 'qdCount' => 0, + 'anCount' => 0, + 'nsCount' => 0, + 'arCount' => 0, + 'qr' => 0, + 'opcode' => Message::OPCODE_QUERY, + 'aa' => 0, + 'tc' => 0, + 'rd' => 0, + 'ra' => 0, + 'z' => 0, + 'rcode' => Message::RCODE_OK, ); - public function get($name) - { - return isset($this->attributes[$name]) ? $this->attributes[$name] : null; + public function get($name) { + return isset($this->attributes[$name]) ? $this->attributes[$name] : NULL; } - public function set($name, $value) - { + public function set($name, $value) { $this->attributes[$name] = $value; } - public function isQuery() - { + public function isQuery() { return 0 === $this->attributes['qr']; } - public function isResponse() - { + public function isResponse() { return 1 === $this->attributes['qr']; } - public function isTruncated() - { + public function isTruncated() { return 1 === $this->attributes['tc']; } - public function populateCounts(Message $message) - { + public function populateCounts(Message $message) { $this->attributes['qdCount'] = count($message->questions); $this->attributes['anCount'] = count($message->answers); $this->attributes['nsCount'] = count($message->authority); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Model/Message.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Model/Message.php index 715cb1f..76e9dfa 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Model/Message.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Model/Message.php @@ -35,12 +35,11 @@ class Message * @param Query $query * @return self */ - public static function createRequestForQuery(Query $query) - { + public static function createRequestForQuery(Query $query) { $request = new Message(); $request->header->set('id', self::generateId()); $request->header->set('rd', 1); - $request->questions[] = (array) $query; + $request->questions[] = (array)$query; $request->prepare(); return $request; @@ -49,12 +48,11 @@ class Message /** * Creates a new response message for the given query with the given answer records * - * @param Query $query + * @param Query $query * @param Record[] $answers * @return self */ - public static function createResponseWithAnswersForQuery(Query $query, array $answers) - { + public static function createResponseWithAnswersForQuery(Query $query, array $answers) { $response = new Message(); $response->header->set('id', self::generateId()); $response->header->set('qr', 1); @@ -62,7 +60,7 @@ class Message $response->header->set('rd', 1); $response->header->set('rcode', Message::RCODE_OK); - $response->questions[] = (array) $query; + $response->questions[] = (array)$query; foreach ($answers as $record) { $response->answers[] = $record; @@ -73,8 +71,7 @@ class Message return $response; } - private static function generateId() - { + private static function generateId() { return mt_rand(0, 0xffff); } @@ -88,13 +85,11 @@ class Message public $consumed = 0; - public function __construct() - { + public function __construct() { $this->header = new HeaderBag(); } - public function prepare() - { + public function prepare() { $this->header->populateCounts($this); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Model/Record.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Model/Record.php index 029d232..4f29ee7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Model/Record.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Model/Record.php @@ -10,12 +10,11 @@ class Record public $ttl; public $data; - public function __construct($name, $type, $class, $ttl = 0, $data = null) - { - $this->name = $name; - $this->type = $type; - $this->class = $class; - $this->ttl = $ttl; - $this->data = $data; + public function __construct($name, $type, $class, $ttl = 0, $data = NULL) { + $this->name = $name; + $this->type = $type; + $this->class = $class; + $this->ttl = $ttl; + $this->data = $data; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Protocol/BinaryDumper.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Protocol/BinaryDumper.php index 35d6ae6..756b325 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Protocol/BinaryDumper.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Protocol/BinaryDumper.php @@ -7,8 +7,7 @@ use React\Dns\Model\HeaderBag; class BinaryDumper { - public function toBinary(Message $message) - { + public function toBinary(Message $message) { $data = ''; $data .= $this->headerToBinary($message->header); @@ -17,8 +16,7 @@ class BinaryDumper return $data; } - private function headerToBinary(HeaderBag $header) - { + private function headerToBinary(HeaderBag $header) { $data = ''; $data .= pack('n', $header->get('id')); @@ -43,14 +41,13 @@ class BinaryDumper return $data; } - private function questionToBinary(array $questions) - { + private function questionToBinary(array $questions) { $data = ''; foreach ($questions as $question) { $labels = explode('.', $question['name']); foreach ($labels as $label) { - $data .= chr(strlen($label)).$label; + $data .= chr(strlen($label)) . $label; } $data .= "\x00"; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Protocol/Parser.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Protocol/Parser.php index 1191cd3..933d6b1 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Protocol/Parser.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Protocol/Parser.php @@ -20,8 +20,7 @@ class Parser * @throws InvalidArgumentException * @return Message */ - public function parseMessage($data) - { + public function parseMessage($data) { $message = new Message(); if ($this->parse($data, $message) !== $message) { throw new InvalidArgumentException('Unable to parse binary message'); @@ -33,13 +32,11 @@ class Parser /** * @deprecated unused, exists for BC only */ - public function parseChunk($data, Message $message) - { + public function parseChunk($data, Message $message) { return $this->parse($data, $message); } - private function parse($data, Message $message) - { + private function parse($data, Message $message) { $message->data .= $data; if (!$message->header->get('id')) { @@ -63,8 +60,7 @@ class Parser return $message; } - public function parseHeader(Message $message) - { + public function parseHeader(Message $message) { if (strlen($message->data) < 12) { return; } @@ -84,7 +80,7 @@ class Parser $qr = ($fields >> 15) & 1; $vars = compact('id', 'qdCount', 'anCount', 'nsCount', 'arCount', - 'qr', 'opcode', 'aa', 'tc', 'rd', 'ra', 'z', 'rcode'); + 'qr', 'opcode', 'aa', 'tc', 'rd', 'ra', 'z', 'rcode'); foreach ($vars as $name => $value) { @@ -94,8 +90,7 @@ class Parser return $message; } - public function parseQuestion(Message $message) - { + public function parseQuestion(Message $message) { if (strlen($message->data) < 2) { return; } @@ -104,7 +99,7 @@ class Parser list($labels, $consumed) = $this->readLabels($message->data, $consumed); - if (null === $labels) { + if (NULL === $labels) { return; } @@ -130,8 +125,7 @@ class Parser return $message; } - public function parseAnswer(Message $message) - { + public function parseAnswer(Message $message) { if (strlen($message->data) < 2) { return; } @@ -140,7 +134,7 @@ class Parser list($labels, $consumed) = $this->readLabels($message->data, $consumed); - if (null === $labels) { + if (NULL === $labels) { return; } @@ -157,7 +151,7 @@ class Parser list($rdLength) = array_values(unpack('n', substr($message->data, $consumed, 2))); $consumed += 2; - $rdata = null; + $rdata = NULL; if (Message::TYPE_A === $type || Message::TYPE_AAAA === $type) { $ip = substr($message->data, $consumed, $rdLength); @@ -187,11 +181,10 @@ class Parser return $message; } - private function readLabels($data, $consumed) - { + private function readLabels($data, $consumed) { $labels = array(); - while (true) { + while (TRUE) { if ($this->isEndOfLabels($data, $consumed)) { $consumed += 1; break; @@ -207,7 +200,7 @@ class Parser $consumed += 1; if (strlen($data) - $consumed < $length) { - return array(null, null); + return array(NULL, NULL); } $labels[] = substr($data, $consumed, $length); @@ -217,38 +210,33 @@ class Parser return array($labels, $consumed); } - public function isEndOfLabels($data, $consumed) - { + public function isEndOfLabels($data, $consumed) { $length = ord(substr($data, $consumed, 1)); return 0 === $length; } - public function getCompressedLabel($data, $consumed) - { + public function getCompressedLabel($data, $consumed) { list($nameOffset, $consumed) = $this->getCompressedLabelOffset($data, $consumed); list($labels) = $this->readLabels($data, $nameOffset); return array($labels, $consumed); } - public function isCompressedLabel($data, $consumed) - { + public function isCompressedLabel($data, $consumed) { $mask = 0xc000; // 1100000000000000 list($peek) = array_values(unpack('n', substr($data, $consumed, 2))); - return (bool) ($peek & $mask); + return (bool)($peek & $mask); } - public function getCompressedLabelOffset($data, $consumed) - { + public function getCompressedLabelOffset($data, $consumed) { $mask = 0x3fff; // 0011111111111111 list($peek) = array_values(unpack('n', substr($data, $consumed, 2))); return array($peek & $mask, $consumed + 2); } - public function signedLongToUnsignedLong($i) - { + public function signedLongToUnsignedLong($i) { return $i & 0x80000000 ? $i - 0xffffffff : $i; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/CachedExecutor.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/CachedExecutor.php index 285936d..fe5e24a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/CachedExecutor.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/CachedExecutor.php @@ -9,14 +9,12 @@ class CachedExecutor implements ExecutorInterface private $executor; private $cache; - public function __construct(ExecutorInterface $executor, RecordCache $cache) - { + public function __construct(ExecutorInterface $executor, RecordCache $cache) { $this->executor = $executor; $this->cache = $cache; } - public function query($nameserver, Query $query) - { + public function query($nameserver, Query $query) { $executor = $this->executor; $cache = $this->cache; @@ -40,16 +38,14 @@ class CachedExecutor implements ExecutorInterface /** * @deprecated unused, exists for BC only */ - public function buildResponse(Query $query, array $cachedRecords) - { + public function buildResponse(Query $query, array $cachedRecords) { return Message::createResponseWithAnswersForQuery($query, $cachedRecords); } /** * @deprecated unused, exists for BC only */ - protected function generateId() - { + protected function generateId() { return mt_rand(0, 0xffff); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/Executor.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/Executor.php index 4c51f2b..3ee4a8b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/Executor.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/Executor.php @@ -29,16 +29,14 @@ class Executor implements ExecutorInterface * @param BinaryDumper $dumper * @param null|float $timeout DEPRECATED: timeout for DNS query or NULL=no timeout */ - public function __construct(LoopInterface $loop, Parser $parser, BinaryDumper $dumper, $timeout = 5) - { + public function __construct(LoopInterface $loop, Parser $parser, BinaryDumper $dumper, $timeout = 5) { $this->loop = $loop; $this->parser = $parser; $this->dumper = $dumper; $this->timeout = $timeout; } - public function query($nameserver, Query $query) - { + public function query($nameserver, Query $query) { $request = Message::createRequestForQuery($query); $queryData = $this->dumper->toBinary($request); @@ -50,13 +48,11 @@ class Executor implements ExecutorInterface /** * @deprecated unused, exists for BC only */ - public function prepareRequest(Query $query) - { + public function prepareRequest(Query $query) { return Message::createRequestForQuery($query); } - public function doQuery($nameserver, $transport, $queryData, $name) - { + public function doQuery($nameserver, $transport, $queryData, $name) { // we only support UDP right now if ($transport !== 'udp') { return Promise\reject(new \RuntimeException( @@ -78,14 +74,14 @@ class Executor implements ExecutorInterface $deferred = new Deferred(function ($resolve, $reject) use (&$timer, $loop, &$conn, $name) { $reject(new CancellationException(sprintf('DNS query for %s has been cancelled', $name))); - if ($timer !== null) { + if ($timer !== NULL) { $loop->cancelTimer($timer); } $conn->close(); }); - $timer = null; - if ($this->timeout !== null) { + $timer = NULL; + if ($this->timeout !== NULL) { $timer = $this->loop->addTimer($this->timeout, function () use (&$conn, $name, $deferred) { $conn->close(); $deferred->reject(new TimeoutException(sprintf("DNS query for %s timed out", $name))); @@ -94,7 +90,7 @@ class Executor implements ExecutorInterface $conn->on('data', function ($data) use ($conn, $parser, $deferred, $timer, $loop, $name) { $conn->end(); - if ($timer !== null) { + if ($timer !== NULL) { $loop->cancelTimer($timer); } @@ -120,8 +116,7 @@ class Executor implements ExecutorInterface /** * @deprecated unused, exists for BC only */ - protected function generateId() - { + protected function generateId() { return mt_rand(0, 0xffff); } @@ -130,10 +125,9 @@ class Executor implements ExecutorInterface * @param string $transport * @return \React\Stream\DuplexStreamInterface */ - protected function createConnection($nameserver, $transport) - { + protected function createConnection($nameserver, $transport) { $fd = @stream_socket_client("$transport://$nameserver", $errno, $errstr, 0, STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT); - if ($fd === false) { + if ($fd === FALSE) { throw new \RuntimeException('Unable to connect to DNS server: ' . $errstr, $errno); } @@ -147,7 +141,7 @@ class Executor implements ExecutorInterface } else { // use legacy Stream class for react/stream < v0.7.0 $conn = new Stream($fd, $this->loop); - $conn->bufferSize = null; + $conn->bufferSize = NULL; } // @coverageIgnoreEnd diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/HostsFileExecutor.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/HostsFileExecutor.php index 0ca58be..335c86a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/HostsFileExecutor.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/HostsFileExecutor.php @@ -19,21 +19,19 @@ class HostsFileExecutor implements ExecutorInterface private $hosts; private $fallback; - public function __construct(HostsFile $hosts, ExecutorInterface $fallback) - { + public function __construct(HostsFile $hosts, ExecutorInterface $fallback) { $this->hosts = $hosts; $this->fallback = $fallback; } - public function query($nameserver, Query $query) - { + public function query($nameserver, Query $query) { if ($query->class === Message::CLASS_IN && ($query->type === Message::TYPE_A || $query->type === Message::TYPE_AAAA)) { // forward lookup for type A or AAAA $records = array(); $expectsColon = $query->type === Message::TYPE_AAAA; foreach ($this->hosts->getIpsForHost($query->name) as $ip) { // ensure this is an IPv4/IPV6 address according to query type - if ((strpos($ip, ':') !== false) === $expectsColon) { + if ((strpos($ip, ':') !== FALSE) === $expectsColon) { $records[] = new Record($query->name, $query->type, $query->class, 0, $ip); } } @@ -43,11 +41,11 @@ class HostsFileExecutor implements ExecutorInterface Message::createResponseWithAnswersForQuery($query, $records) ); } - } elseif ($query->class === Message::CLASS_IN && $query->type === Message::TYPE_PTR) { + } else if ($query->class === Message::CLASS_IN && $query->type === Message::TYPE_PTR) { // reverse lookup: extract IPv4 or IPv6 from special `.arpa` domain $ip = $this->getIpFromHost($query->name); - if ($ip !== null) { + if ($ip !== NULL) { $records = array(); foreach ($this->hosts->getHostsForIp($ip) as $host) { $records[] = new Record($query->name, $query->type, $query->class, 0, $host); @@ -64,26 +62,25 @@ class HostsFileExecutor implements ExecutorInterface return $this->fallback->query($nameserver, $query); } - private function getIpFromHost($host) - { + private function getIpFromHost($host) { if (substr($host, -13) === '.in-addr.arpa') { // IPv4: read as IP and reverse bytes $ip = @inet_pton(substr($host, 0, -13)); - if ($ip === false || isset($ip[4])) { - return null; + if ($ip === FALSE || isset($ip[4])) { + return NULL; } return inet_ntop(strrev($ip)); - } elseif (substr($host, -9) === '.ip6.arpa') { + } else if (substr($host, -9) === '.ip6.arpa') { // IPv6: replace dots, reverse nibbles and interpret as hexadecimal string $ip = @inet_ntop(pack('H*', strrev(str_replace('.', '', substr($host, 0, -9))))); - if ($ip === false) { - return null; + if ($ip === FALSE) { + return NULL; } return $ip; } else { - return null; + return NULL; } } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/Query.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/Query.php index aef6e05..0485d85 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/Query.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/Query.php @@ -9,8 +9,7 @@ class Query public $class; public $currentTime; - public function __construct($name, $type, $class, $currentTime) - { + public function __construct($name, $type, $class, $currentTime) { $this->name = $name; $this->type = $type; $this->class = $class; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/RecordBag.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/RecordBag.php index 358cf5d..ac10ad0 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/RecordBag.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/RecordBag.php @@ -9,13 +9,11 @@ class RecordBag { private $records = array(); - public function set($currentTime, Record $record) - { + public function set($currentTime, Record $record) { $this->records[$record->data] = array($currentTime + $record->ttl, $record); } - public function all() - { + public function all() { return array_values(array_map( function ($value) { list($expiresAt, $record) = $value; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/RecordCache.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/RecordCache.php index b8142d3..0652458 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/RecordCache.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/RecordCache.php @@ -12,13 +12,11 @@ class RecordCache private $cache; private $expiredAt; - public function __construct(CacheInterface $cache) - { + public function __construct(CacheInterface $cache) { $this->cache = $cache; } - public function lookup(Query $query) - { + public function lookup(Query $query) { $id = $this->serializeQueryToIdentity($query); $expiredAt = $this->expiredAt; @@ -28,7 +26,7 @@ class RecordCache ->then(function ($value) use ($query, $expiredAt) { $recordBag = unserialize($value); - if (null !== $expiredAt && $expiredAt <= $query->currentTime) { + if (NULL !== $expiredAt && $expiredAt <= $query->currentTime) { return Promise\reject(); } @@ -36,15 +34,13 @@ class RecordCache }); } - public function storeResponseMessage($currentTime, Message $message) - { + public function storeResponseMessage($currentTime, Message $message) { foreach ($message->answers as $record) { $this->storeRecord($currentTime, $record); } } - public function storeRecord($currentTime, Record $record) - { + public function storeRecord($currentTime, Record $record) { $id = $this->serializeRecordToIdentity($record); $cache = $this->cache; @@ -65,18 +61,15 @@ class RecordCache }); } - public function expire($currentTime) - { + public function expire($currentTime) { $this->expiredAt = $currentTime; } - public function serializeQueryToIdentity(Query $query) - { + public function serializeQueryToIdentity(Query $query) { return sprintf('%s:%s:%s', $query->name, $query->type, $query->class); } - public function serializeRecordToIdentity(Record $record) - { + public function serializeRecordToIdentity(Record $record) { return sprintf('%s:%s:%s', $record->name, $record->type, $record->class); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/RetryExecutor.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/RetryExecutor.php index 90353e5..c7d8cbe 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/RetryExecutor.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/RetryExecutor.php @@ -9,19 +9,16 @@ class RetryExecutor implements ExecutorInterface private $executor; private $retries; - public function __construct(ExecutorInterface $executor, $retries = 2) - { + public function __construct(ExecutorInterface $executor, $retries = 2) { $this->executor = $executor; $this->retries = $retries; } - public function query($nameserver, Query $query) - { + public function query($nameserver, Query $query) { return $this->tryQuery($nameserver, $query, $this->retries); } - public function tryQuery($nameserver, Query $query, $retries) - { + public function tryQuery($nameserver, Query $query, $retries) { $that = $this; $errorback = function ($error) use ($nameserver, $query, $retries, $that) { if (!$error instanceof TimeoutException) { @@ -34,11 +31,11 @@ class RetryExecutor implements ExecutorInterface $error ); } - return $that->tryQuery($nameserver, $query, $retries-1); + return $that->tryQuery($nameserver, $query, $retries - 1); }; return $this->executor ->query($nameserver, $query) - ->then(null, $errorback); + ->then(NULL, $errorback); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/TimeoutExecutor.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/TimeoutExecutor.php index 6a44888..bcfb185 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/TimeoutExecutor.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Query/TimeoutExecutor.php @@ -13,16 +13,14 @@ class TimeoutExecutor implements ExecutorInterface private $loop; private $timeout; - public function __construct(ExecutorInterface $executor, $timeout, LoopInterface $loop) - { + public function __construct(ExecutorInterface $executor, $timeout, LoopInterface $loop) { $this->executor = $executor; $this->loop = $loop; $this->timeout = $timeout; } - public function query($nameserver, Query $query) - { - return Timer\timeout($this->executor->query($nameserver, $query), $this->timeout, $this->loop)->then(null, function ($e) use ($query) { + public function query($nameserver, Query $query) { + return Timer\timeout($this->executor->query($nameserver, $query), $this->timeout, $this->loop)->then(NULL, function ($e) use ($query) { if ($e instanceof Timer\TimeoutException) { $e = new TimeoutException(sprintf("DNS query for %s timed out", $query->name), 0, $e); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Resolver/Factory.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Resolver/Factory.php index 12a912f..6d61b03 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Resolver/Factory.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Resolver/Factory.php @@ -18,16 +18,14 @@ use React\EventLoop\LoopInterface; class Factory { - public function create($nameserver, LoopInterface $loop) - { + public function create($nameserver, LoopInterface $loop) { $nameserver = $this->addPortToServerIfMissing($nameserver); $executor = $this->decorateHostsFileExecutor($this->createRetryExecutor($loop)); return new Resolver($nameserver, $executor); } - public function createCached($nameserver, LoopInterface $loop, CacheInterface $cache = null) - { + public function createCached($nameserver, LoopInterface $loop, CacheInterface $cache = NULL) { if (!($cache instanceof CacheInterface)) { $cache = new ArrayCache(); } @@ -45,8 +43,7 @@ class Factory * @return ExecutorInterface * @codeCoverageIgnore */ - private function decorateHostsFileExecutor(ExecutorInterface $executor) - { + private function decorateHostsFileExecutor(ExecutorInterface $executor) { try { $executor = new HostsFileExecutor( HostsFile::loadFromPathBlocking(), @@ -68,33 +65,29 @@ class Factory return $executor; } - protected function createExecutor(LoopInterface $loop) - { + protected function createExecutor(LoopInterface $loop) { return new TimeoutExecutor( - new Executor($loop, new Parser(), new BinaryDumper(), null), + new Executor($loop, new Parser(), new BinaryDumper(), NULL), 5.0, $loop ); } - protected function createRetryExecutor(LoopInterface $loop) - { + protected function createRetryExecutor(LoopInterface $loop) { return new RetryExecutor($this->createExecutor($loop)); } - protected function createCachedExecutor(LoopInterface $loop, CacheInterface $cache) - { + protected function createCachedExecutor(LoopInterface $loop, CacheInterface $cache) { return new CachedExecutor($this->createRetryExecutor($loop), new RecordCache($cache)); } - protected function addPortToServerIfMissing($nameserver) - { - if (strpos($nameserver, '[') === false && substr_count($nameserver, ':') >= 2) { + protected function addPortToServerIfMissing($nameserver) { + if (strpos($nameserver, '[') === FALSE && substr_count($nameserver, ':') >= 2) { // several colons, but not enclosed in square brackets => enclose IPv6 address in square brackets $nameserver = '[' . $nameserver . ']'; } // assume a dummy scheme when checking for the port, otherwise parse_url() fails - if (parse_url('dummy://' . $nameserver, PHP_URL_PORT) === null) { + if (parse_url('dummy://' . $nameserver, PHP_URL_PORT) === NULL) { $nameserver .= ':53'; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Resolver/Resolver.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Resolver/Resolver.php index 4a4983a..8fbe4bb 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Resolver/Resolver.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/src/Resolver/Resolver.php @@ -12,14 +12,12 @@ class Resolver private $nameserver; private $executor; - public function __construct($nameserver, ExecutorInterface $executor) - { + public function __construct($nameserver, ExecutorInterface $executor) { $this->nameserver = $nameserver; $this->executor = $executor; } - public function resolve($domain) - { + public function resolve($domain) { $query = new Query($domain, Message::TYPE_A, Message::CLASS_IN, time()); $that = $this; @@ -30,8 +28,7 @@ class Resolver }); } - public function extractAddress(Query $query, Message $response) - { + public function extractAddress(Query $query, Message $response) { $answers = $response->answers; $addresses = $this->resolveAliases($answers, $query->name); @@ -45,8 +42,7 @@ class Resolver return $address; } - public function resolveAliases(array $answers, $name) - { + public function resolveAliases(array $answers, $name) { $named = $this->filterByName($answers, $name); $aRecords = $this->filterByType($named, Message::TYPE_A); $cnameRecords = $this->filterByType($named, Message::TYPE_CNAME); @@ -73,26 +69,22 @@ class Resolver return array(); } - private function filterByName(array $answers, $name) - { + private function filterByName(array $answers, $name) { return $this->filterByField($answers, 'name', $name); } - private function filterByType(array $answers, $type) - { + private function filterByType(array $answers, $type) { return $this->filterByField($answers, 'type', $type); } - private function filterByField(array $answers, $field, $value) - { + private function filterByField(array $answers, $field, $value) { $value = strtolower($value); return array_filter($answers, function ($answer) use ($field, $value) { return $value === strtolower($answer->$field); }); } - private function mapRecordData(array $records) - { + private function mapRecordData(array $records) { return array_map(function ($record) { return $record->data; }, $records); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/CallableStub.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/CallableStub.php index a34a263..651f8d7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/CallableStub.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/CallableStub.php @@ -4,7 +4,6 @@ namespace React\Tests\Dns; class CallableStub { - public function __invoke() - { + public function __invoke() { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Config/ConfigTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Config/ConfigTest.php index 8020408..14c3189 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Config/ConfigTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Config/ConfigTest.php @@ -7,15 +7,13 @@ use React\Dns\Config\Config; class ConfigTest extends TestCase { - public function testLoadsSystemDefault() - { + public function testLoadsSystemDefault() { $config = Config::loadSystemConfigBlocking(); $this->assertInstanceOf('React\Dns\Config\Config', $config); } - public function testLoadsDefaultPath() - { + public function testLoadsDefaultPath() { if (DIRECTORY_SEPARATOR === '\\') { $this->markTestSkipped('Not supported on Windows'); } @@ -25,8 +23,7 @@ class ConfigTest extends TestCase $this->assertInstanceOf('React\Dns\Config\Config', $config); } - public function testLoadsFromExplicitPath() - { + public function testLoadsFromExplicitPath() { $config = Config::loadResolvConfBlocking(__DIR__ . '/../Fixtures/etc/resolv.conf'); $this->assertEquals(array('8.8.8.8'), $config->nameservers); @@ -35,13 +32,11 @@ class ConfigTest extends TestCase /** * @expectedException RuntimeException */ - public function testLoadThrowsWhenPathIsInvalid() - { + public function testLoadThrowsWhenPathIsInvalid() { Config::loadResolvConfBlocking(__DIR__ . '/invalid.conf'); } - public function testParsesSingleEntryFile() - { + public function testParsesSingleEntryFile() { $contents = 'nameserver 8.8.8.8'; $expected = array('8.8.8.8'); @@ -49,8 +44,7 @@ class ConfigTest extends TestCase $this->assertEquals($expected, $config->nameservers); } - public function testParsesNameserverEntriesFromAverageFileCorrectly() - { + public function testParsesNameserverEntriesFromAverageFileCorrectly() { $contents = '# # Mac OS X Notice # @@ -70,8 +64,7 @@ nameserver ::1 $this->assertEquals($expected, $config->nameservers); } - public function testParsesEmptyFileWithoutNameserverEntries() - { + public function testParsesEmptyFileWithoutNameserverEntries() { $contents = ''; $expected = array(); @@ -79,8 +72,7 @@ nameserver ::1 $this->assertEquals($expected, $config->nameservers); } - public function testParsesFileAndIgnoresCommentsAndInvalidNameserverEntries() - { + public function testParsesFileAndIgnoresCommentsAndInvalidNameserverEntries() { $contents = ' # nameserver 1.2.3.4 ; nameserver 2.3.4.5 @@ -96,8 +88,7 @@ NameServer 7.8.9.10 $this->assertEquals($expected, $config->nameservers); } - public function testLoadsFromWmicOnWindows() - { + public function testLoadsFromWmicOnWindows() { if (DIRECTORY_SEPARATOR !== '\\') { $this->markTestSkipped('Only on Windows'); } @@ -107,8 +98,7 @@ NameServer 7.8.9.10 $this->assertInstanceOf('React\Dns\Config\Config', $config); } - public function testLoadsSingleEntryFromWmicOutput() - { + public function testLoadsSingleEntryFromWmicOutput() { $contents = ' Node,DNSServerSearchOrder ACE, @@ -122,8 +112,7 @@ ACE, $this->assertEquals($expected, $config->nameservers); } - public function testLoadsEmptyListFromWmicOutput() - { + public function testLoadsEmptyListFromWmicOutput() { $contents = ' Node,DNSServerSearchOrder ACE, @@ -135,8 +124,7 @@ ACE, $this->assertEquals($expected, $config->nameservers); } - public function testLoadsSingleEntryForMultipleNicsFromWmicOutput() - { + public function testLoadsSingleEntryForMultipleNicsFromWmicOutput() { $contents = ' Node,DNSServerSearchOrder ACE, @@ -152,8 +140,7 @@ ACE, $this->assertEquals($expected, $config->nameservers); } - public function testLoadsMultipleEntriesForSingleNicWithSemicolonFromWmicOutput() - { + public function testLoadsMultipleEntriesForSingleNicWithSemicolonFromWmicOutput() { $contents = ' Node,DNSServerSearchOrder ACE, @@ -167,8 +154,7 @@ ACE, $this->assertEquals($expected, $config->nameservers); } - public function testLoadsMultipleEntriesForSingleNicWithQuotesFromWmicOutput() - { + public function testLoadsMultipleEntriesForSingleNicWithQuotesFromWmicOutput() { $contents = ' Node,DNSServerSearchOrder ACE, @@ -182,8 +168,7 @@ ACE, $this->assertEquals($expected, $config->nameservers); } - private function echoCommand($output) - { + private function echoCommand($output) { return 'echo ' . escapeshellarg($output); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Config/FilesystemFactoryTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Config/FilesystemFactoryTest.php index bb9eac7..ff6ae38 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Config/FilesystemFactoryTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Config/FilesystemFactoryTest.php @@ -8,8 +8,7 @@ use React\Dns\Config\FilesystemFactory; class FilesystemFactoryTest extends TestCase { /** @test */ - public function parseEtcResolvConfShouldParseCorrectly() - { + public function parseEtcResolvConfShouldParseCorrectly() { $contents = '# # Mac OS X Notice # @@ -25,7 +24,7 @@ nameserver 8.8.8.8 '; $expected = array('127.0.0.1', '8.8.8.8'); - $capturedConfig = null; + $capturedConfig = NULL; $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $factory = new FilesystemFactory($loop); @@ -38,14 +37,13 @@ nameserver 8.8.8.8 } /** @test */ - public function createShouldLoadStuffFromFilesystem() - { + public function createShouldLoadStuffFromFilesystem() { $this->markTestIncomplete('Filesystem API is incomplete'); $expected = array('8.8.8.8'); - $triggerListener = null; - $capturedConfig = null; + $triggerListener = NULL; + $capturedConfig = NULL; $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $loop @@ -58,7 +56,7 @@ nameserver 8.8.8.8 })); $factory = new FilesystemFactory($loop); - $factory->create(__DIR__.'/../Fixtures/etc/resolv.conf')->then(function ($config) use (&$capturedConfig) { + $factory->create(__DIR__ . '/../Fixtures/etc/resolv.conf')->then(function ($config) use (&$capturedConfig) { $capturedConfig = $config; }); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Config/HostsFileTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Config/HostsFileTest.php index ff74ad2..a56a400 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Config/HostsFileTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Config/HostsFileTest.php @@ -7,15 +7,13 @@ use React\Dns\Config\HostsFile; class HostsFileTest extends TestCase { - public function testLoadsFromDefaultPath() - { + public function testLoadsFromDefaultPath() { $hosts = HostsFile::loadFromPathBlocking(); $this->assertInstanceOf('React\Dns\Config\HostsFile', $hosts); } - public function testDefaultShouldHaveLocalhostMapped() - { + public function testDefaultShouldHaveLocalhostMapped() { if (DIRECTORY_SEPARATOR === '\\') { $this->markTestSkipped('Not supported on Windows'); } @@ -28,88 +26,76 @@ class HostsFileTest extends TestCase /** * @expectedException RuntimeException */ - public function testLoadThrowsForInvalidPath() - { + public function testLoadThrowsForInvalidPath() { HostsFile::loadFromPathBlocking('does/not/exist'); } - public function testContainsSingleLocalhostEntry() - { + public function testContainsSingleLocalhostEntry() { $hosts = new HostsFile('127.0.0.1 localhost'); $this->assertEquals(array('127.0.0.1'), $hosts->getIpsForHost('localhost')); $this->assertEquals(array(), $hosts->getIpsForHost('example.com')); } - public function testNonIpReturnsNothingForInvalidHosts() - { + public function testNonIpReturnsNothingForInvalidHosts() { $hosts = new HostsFile('a b'); $this->assertEquals(array(), $hosts->getIpsForHost('a')); $this->assertEquals(array(), $hosts->getIpsForHost('b')); } - public function testIgnoresIpv6ZoneId() - { + public function testIgnoresIpv6ZoneId() { $hosts = new HostsFile('fe80::1%lo0 localhost'); $this->assertEquals(array('fe80::1'), $hosts->getIpsForHost('localhost')); } - public function testSkipsComments() - { - $hosts = new HostsFile('# start' . PHP_EOL .'#127.0.0.1 localhost' . PHP_EOL . '127.0.0.2 localhost # example.com'); + public function testSkipsComments() { + $hosts = new HostsFile('# start' . PHP_EOL . '#127.0.0.1 localhost' . PHP_EOL . '127.0.0.2 localhost # example.com'); $this->assertEquals(array('127.0.0.2'), $hosts->getIpsForHost('localhost')); $this->assertEquals(array(), $hosts->getIpsForHost('example.com')); } - public function testContainsSingleLocalhostEntryWithCaseIgnored() - { + public function testContainsSingleLocalhostEntryWithCaseIgnored() { $hosts = new HostsFile('127.0.0.1 LocalHost'); $this->assertEquals(array('127.0.0.1'), $hosts->getIpsForHost('LOCALHOST')); } - public function testEmptyFileContainsNothing() - { + public function testEmptyFileContainsNothing() { $hosts = new HostsFile(''); $this->assertEquals(array(), $hosts->getIpsForHost('example.com')); } - public function testSingleEntryWithMultipleNames() - { + public function testSingleEntryWithMultipleNames() { $hosts = new HostsFile('127.0.0.1 localhost example.com'); $this->assertEquals(array('127.0.0.1'), $hosts->getIpsForHost('example.com')); $this->assertEquals(array('127.0.0.1'), $hosts->getIpsForHost('localhost')); } - public function testMergesEntriesOverMultipleLines() - { + public function testMergesEntriesOverMultipleLines() { $hosts = new HostsFile("127.0.0.1 localhost\n127.0.0.2 localhost\n127.0.0.3 a localhost b\n127.0.0.4 a localhost"); $this->assertEquals(array('127.0.0.1', '127.0.0.2', '127.0.0.3', '127.0.0.4'), $hosts->getIpsForHost('localhost')); } - public function testMergesIpv4AndIpv6EntriesOverMultipleLines() - { + public function testMergesIpv4AndIpv6EntriesOverMultipleLines() { $hosts = new HostsFile("127.0.0.1 localhost\n::1 localhost"); $this->assertEquals(array('127.0.0.1', '::1'), $hosts->getIpsForHost('localhost')); } - public function testReverseLookup() - { + public function testReverseLookup() { $hosts = new HostsFile('127.0.0.1 localhost'); $this->assertEquals(array('localhost'), $hosts->getHostsForIp('127.0.0.1')); $this->assertEquals(array(), $hosts->getHostsForIp('192.168.1.1')); } - public function testReverseSkipsComments() - { + public function testReverseSkipsComments() { $hosts = new HostsFile("# start\n#127.0.0.1 localhosted\n127.0.0.2\tlocalhost\t# example.com\n\t127.0.0.3\t\texample.org\t\t"); $this->assertEquals(array(), $hosts->getHostsForIp('127.0.0.1')); @@ -117,52 +103,45 @@ class HostsFileTest extends TestCase $this->assertEquals(array('example.org'), $hosts->getHostsForIp('127.0.0.3')); } - public function testReverseNonIpReturnsNothing() - { + public function testReverseNonIpReturnsNothing() { $hosts = new HostsFile('127.0.0.1 localhost'); $this->assertEquals(array(), $hosts->getHostsForIp('localhost')); $this->assertEquals(array(), $hosts->getHostsForIp('127.0.0.1.1')); } - public function testReverseNonIpReturnsNothingForInvalidHosts() - { + public function testReverseNonIpReturnsNothingForInvalidHosts() { $hosts = new HostsFile('a b'); $this->assertEquals(array(), $hosts->getHostsForIp('a')); $this->assertEquals(array(), $hosts->getHostsForIp('b')); } - public function testReverseLookupReturnsLowerCaseHost() - { + public function testReverseLookupReturnsLowerCaseHost() { $hosts = new HostsFile('127.0.0.1 LocalHost'); $this->assertEquals(array('localhost'), $hosts->getHostsForIp('127.0.0.1')); } - public function testReverseLookupChecksNormalizedIpv6() - { + public function testReverseLookupChecksNormalizedIpv6() { $hosts = new HostsFile('FE80::00a1 localhost'); $this->assertEquals(array('localhost'), $hosts->getHostsForIp('fe80::A1')); } - public function testReverseLookupIgnoresIpv6ZoneId() - { + public function testReverseLookupIgnoresIpv6ZoneId() { $hosts = new HostsFile('fe80::1%lo0 localhost'); $this->assertEquals(array('localhost'), $hosts->getHostsForIp('fe80::1')); } - public function testReverseLookupReturnsMultipleHostsOverSingleLine() - { + public function testReverseLookupReturnsMultipleHostsOverSingleLine() { $hosts = new HostsFile("::1 ip6-localhost ip6-loopback"); $this->assertEquals(array('ip6-localhost', 'ip6-loopback'), $hosts->getHostsForIp('::1')); } - public function testReverseLookupReturnsMultipleHostsOverMultipleLines() - { + public function testReverseLookupReturnsMultipleHostsOverMultipleLines() { $hosts = new HostsFile("::1 ip6-localhost\n::1 ip6-loopback"); $this->assertEquals(array('ip6-localhost', 'ip6-loopback'), $hosts->getHostsForIp('::1')); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/FunctionalResolverTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/FunctionalResolverTest.php index 0807e86..8550d3e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/FunctionalResolverTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/FunctionalResolverTest.php @@ -9,16 +9,14 @@ use React\Dns\Resolver\Factory; class FunctionalTest extends TestCase { - public function setUp() - { + public function setUp() { $this->loop = LoopFactory::create(); $factory = new Factory(); $this->resolver = $factory->create('8.8.8.8', $this->loop); } - public function testResolveLocalhostResolves() - { + public function testResolveLocalhostResolves() { $promise = $this->resolver->resolve('localhost'); $promise->then($this->expectCallableOnce(), $this->expectCallableNever()); @@ -28,8 +26,7 @@ class FunctionalTest extends TestCase /** * @group internet */ - public function testResolveGoogleResolves() - { + public function testResolveGoogleResolves() { $promise = $this->resolver->resolve('google.com'); $promise->then($this->expectCallableOnce(), $this->expectCallableNever()); @@ -39,29 +36,26 @@ class FunctionalTest extends TestCase /** * @group internet */ - public function testResolveInvalidRejects() - { + public function testResolveInvalidRejects() { $promise = $this->resolver->resolve('example.invalid'); $promise->then($this->expectCallableNever(), $this->expectCallableOnce()); $this->loop->run(); } - public function testResolveCancelledRejectsImmediately() - { + public function testResolveCancelledRejectsImmediately() { $promise = $this->resolver->resolve('google.com'); $promise->then($this->expectCallableNever(), $this->expectCallableOnce()); $promise->cancel(); - $time = microtime(true); + $time = microtime(TRUE); $this->loop->run(); - $time = microtime(true) - $time; + $time = microtime(TRUE) - $time; $this->assertLessThan(0.1, $time); } - public function testInvalidResolverDoesNotResolveGoogle() - { + public function testInvalidResolverDoesNotResolveGoogle() { $factory = new Factory(); $this->resolver = $factory->create('255.255.255.255', $this->loop); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Model/MessageTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Model/MessageTest.php index 53d6b28..a2ea4d9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Model/MessageTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Model/MessageTest.php @@ -8,8 +8,7 @@ use React\Dns\Model\Message; class MessageTest extends TestCase { - public function testCreateRequestDesiresRecusion() - { + public function testCreateRequestDesiresRecusion() { $query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451); $request = Message::createRequestForQuery($query); @@ -17,8 +16,7 @@ class MessageTest extends TestCase $this->assertSame(1, $request->header->get('rd')); } - public function testCreateResponseWithNoAnswers() - { + public function testCreateResponseWithNoAnswers() { $query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451); $answers = array(); $request = Message::createResponseWithAnswersForQuery($query, $answers); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Protocol/BinaryDumperTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Protocol/BinaryDumperTest.php index bf60ca9..26fe617 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Protocol/BinaryDumperTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Protocol/BinaryDumperTest.php @@ -8,8 +8,7 @@ use React\Dns\Model\Message; class BinaryDumperTest extends TestCase { - public function testRequestToBinary() - { + public function testRequestToBinary() { $data = ""; $data .= "72 62 01 00 00 01 00 00 00 00 00 00"; // header $data .= "04 69 67 6f 72 02 69 6f 00"; // question: igor.io @@ -22,8 +21,8 @@ class BinaryDumperTest extends TestCase $request->header->set('rd', 1); $request->questions[] = array( - 'name' => 'igor.io', - 'type' => Message::TYPE_A, + 'name' => 'igor.io', + 'type' => Message::TYPE_A, 'class' => Message::CLASS_IN, ); @@ -36,13 +35,11 @@ class BinaryDumperTest extends TestCase $this->assertSame($expected, $data); } - private function convertBinaryToHexDump($input) - { + private function convertBinaryToHexDump($input) { return $this->formatHexDump(implode('', unpack('H*', $input))); } - private function formatHexDump($input) - { + private function formatHexDump($input) { return implode(' ', str_split($input, 2)); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Protocol/ParserTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Protocol/ParserTest.php index 195fad2..01e15f2 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Protocol/ParserTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Protocol/ParserTest.php @@ -8,31 +8,27 @@ use React\Dns\Model\Message; class ParserTest extends TestCase { - public function setUp() - { + public function setUp() { $this->parser = new Parser(); } /** * @dataProvider provideConvertTcpDumpToBinary */ - public function testConvertTcpDumpToBinary($expected, $data) - { + public function testConvertTcpDumpToBinary($expected, $data) { $this->assertSame($expected, $this->convertTcpDumpToBinary($data)); } - public function provideConvertTcpDumpToBinary() - { + public function provideConvertTcpDumpToBinary() { return array( - array(chr(0x72).chr(0x62), "72 62"), - array(chr(0x72).chr(0x62).chr(0x01).chr(0x00), "72 62 01 00"), - array(chr(0x72).chr(0x62).chr(0x01).chr(0x00).chr(0x00).chr(0x01), "72 62 01 00 00 01"), - array(chr(0x01).chr(0x00).chr(0x01), "01 00 01"), + array(chr(0x72) . chr(0x62), "72 62"), + array(chr(0x72) . chr(0x62) . chr(0x01) . chr(0x00), "72 62 01 00"), + array(chr(0x72) . chr(0x62) . chr(0x01) . chr(0x00) . chr(0x00) . chr(0x01), "72 62 01 00 00 01"), + array(chr(0x01) . chr(0x00) . chr(0x01), "01 00 01"), ); } - public function testParseRequest() - { + public function testParseRequest() { $data = ""; $data .= "72 62 01 00 00 01 00 00 00 00 00 00"; // header $data .= "04 69 67 6f 72 02 69 6f 00"; // question: igor.io @@ -63,8 +59,7 @@ class ParserTest extends TestCase $this->assertSame(Message::CLASS_IN, $request->questions[0]['class']); } - public function testParseResponse() - { + public function testParseResponse() { $data = ""; $data .= "72 62 81 80 00 01 00 01 00 00 00 00"; // header $data .= "04 69 67 6f 72 02 69 6f 00"; // question: igor.io @@ -107,8 +102,7 @@ class ParserTest extends TestCase $this->assertSame('178.79.169.131', $response->answers[0]->data); } - public function testParseQuestionWithTwoQuestions() - { + public function testParseQuestionWithTwoQuestions() { $data = ""; $data .= "04 69 67 6f 72 02 69 6f 00"; // question: igor.io $data .= "00 01 00 01"; // question: type A, class IN @@ -132,8 +126,7 @@ class ParserTest extends TestCase $this->assertSame(Message::CLASS_IN, $request->questions[1]['class']); } - public function testParseAnswerWithInlineData() - { + public function testParseAnswerWithInlineData() { $data = ""; $data .= "04 69 67 6f 72 02 69 6f 00"; // answer: igor.io $data .= "00 01 00 01"; // answer: type A, class IN @@ -157,8 +150,7 @@ class ParserTest extends TestCase $this->assertSame('178.79.169.131', $response->answers[0]->data); } - public function testParseResponseWithCnameAndOffsetPointers() - { + public function testParseResponseWithCnameAndOffsetPointers() { $data = ""; $data .= "9e 8d 81 80 00 01 00 01 00 00 00 00"; // header $data .= "04 6d 61 69 6c 06 67 6f 6f 67 6c 65 03 63 6f 6d 00"; // question: mail.google.com @@ -187,8 +179,7 @@ class ParserTest extends TestCase $this->assertSame('googlemail.l.google.com', $response->answers[0]->data); } - public function testParseAAAAResponse() - { + public function testParseAAAAResponse() { $data = ""; $data .= "cd 72 81 80 00 01 00 01 00 00 00 00 06"; // header $data .= "67 6f 6f 67 6c 65 03 63 6f 6d 00"; // question: google.com @@ -231,12 +222,11 @@ class ParserTest extends TestCase $this->assertSame('2a00:1450:4009:809::200e', $response->answers[0]->data); } - public function testParseResponseWithTwoAnswers() - { + public function testParseResponseWithTwoAnswers() { $data = ""; $data .= "bc 73 81 80 00 01 00 02 00 00 00 00"; // header $data .= "02 69 6f 0d 77 68 6f 69 73 2d 73 65 72 76 65 72 73 03 6e 65 74 00"; - // question: io.whois-servers.net + // question: io.whois-servers.net $data .= "00 01 00 01"; // question: type A, class IN $data .= "c0 0c"; // answer: offset pointer to io.whois-servers.net $data .= "00 05 00 01"; // answer: type CNAME, class IN @@ -273,8 +263,7 @@ class ParserTest extends TestCase $this->assertSame('193.223.78.152', $response->answers[1]->data); } - public function testParsePTRResponse() - { + public function testParsePTRResponse() { $data = ""; $data .= "5d d8 81 80 00 01 00 01 00 00 00 00"; // header $data .= "01 34 01 34 01 38 01 38 07 69 6e"; // question: 4.4.8.8.in-addr.arpa @@ -322,8 +311,7 @@ class ParserTest extends TestCase /** * @expectedException InvalidArgumentException */ - public function testParseIncomplete() - { + public function testParseIncomplete() { $data = ""; $data .= "72 62 01 00 00 01 00 00 00 00 00 00"; // header $data .= "04 69 67 6f 72 02 69 6f 00"; // question: igor.io @@ -334,8 +322,7 @@ class ParserTest extends TestCase $this->parser->parseMessage($data); } - private function convertTcpDumpToBinary($input) - { + private function convertTcpDumpToBinary($input) { // sudo ngrep -d en1 -x port 53 return pack('H*', str_replace(' ', '', $input)); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/CachedExecutorTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/CachedExecutorTest.php index d08ed05..545947c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/CachedExecutorTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/CachedExecutorTest.php @@ -15,8 +15,7 @@ class CachedExecutorTest extends TestCase * @covers React\Dns\Query\CachedExecutor * @test */ - public function queryShouldDelegateToDecoratedExecutor() - { + public function queryShouldDelegateToDecoratedExecutor() { $executor = $this->createExecutorMock(); $executor ->expects($this->once()) @@ -41,8 +40,7 @@ class CachedExecutorTest extends TestCase * @covers React\Dns\Query\CachedExecutor * @test */ - public function callingQueryTwiceShouldUseCachedResult() - { + public function callingQueryTwiceShouldUseCachedResult() { $cachedRecords = array(new Record('igor.io', Message::TYPE_A, Message::CLASS_IN)); $executor = $this->createExecutorMock(); @@ -72,12 +70,15 @@ class CachedExecutorTest extends TestCase $cachedExecutor = new CachedExecutor($executor, $cache); $query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451); - $cachedExecutor->query('8.8.8.8', $query, function () {}, function () {}); - $cachedExecutor->query('8.8.8.8', $query, function () {}, function () {}); + $cachedExecutor->query('8.8.8.8', $query, function () { + }, function () { + }); + $cachedExecutor->query('8.8.8.8', $query, function () { + }, function () { + }); } - private function callQueryCallbackWithAddress($address) - { + private function callQueryCallbackWithAddress($address) { return $this->returnCallback(function ($nameserver, $query) use ($address) { $response = new Message(); $response->header->set('qr', 1); @@ -88,13 +89,11 @@ class CachedExecutorTest extends TestCase }); } - private function createExecutorMock() - { + private function createExecutorMock() { return $this->getMockBuilder('React\Dns\Query\ExecutorInterface')->getMock(); } - private function createPromiseMock() - { + private function createPromiseMock() { return $this->getMockBuilder('React\Promise\PromiseInterface')->getMock(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/ExecutorTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/ExecutorTest.php index 0d7ac1d..a5932cb 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/ExecutorTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/ExecutorTest.php @@ -17,8 +17,7 @@ class ExecutorTest extends TestCase private $dumper; private $executor; - public function setUp() - { + public function setUp() { $this->loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $this->parser = $this->getMockBuilder('React\Dns\Protocol\Parser')->getMock(); $this->dumper = new BinaryDumper(); @@ -27,8 +26,7 @@ class ExecutorTest extends TestCase } /** @test */ - public function queryShouldCreateUdpRequest() - { + public function queryShouldCreateUdpRequest() { $timer = $this->createTimerMock(); $this->loop ->expects($this->any()) @@ -40,16 +38,15 @@ class ExecutorTest extends TestCase ->expects($this->once()) ->method('createConnection') ->with('8.8.8.8:53', 'udp') - ->will($this->returnNewConnectionMock(false)); + ->will($this->returnNewConnectionMock(FALSE)); $query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451); $this->executor->query('8.8.8.8:53', $query); } /** @test */ - public function resolveShouldRejectIfRequestIsLargerThan512Bytes() - { - $query = new Query(str_repeat('a', 512).'.igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451); + public function resolveShouldRejectIfRequestIsLargerThan512Bytes() { + $query = new Query(str_repeat('a', 512) . '.igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451); $promise = $this->executor->query('8.8.8.8:53', $query); $this->setExpectedException('RuntimeException', 'DNS query for ' . $query->name . ' failed: Requested transport "tcp" not available, only UDP is supported in this version'); @@ -57,9 +54,8 @@ class ExecutorTest extends TestCase } /** @test */ - public function resolveShouldCloseConnectionWhenCancelled() - { - $conn = $this->createConnectionMock(false); + public function resolveShouldCloseConnectionWhenCancelled() { + $conn = $this->createConnectionMock(FALSE); $conn->expects($this->once())->method('close'); $timer = $this->createTimerMock(); @@ -85,13 +81,12 @@ class ExecutorTest extends TestCase } /** @test */ - public function resolveShouldNotStartOrCancelTimerWhenCancelledWithTimeoutIsNull() - { + public function resolveShouldNotStartOrCancelTimerWhenCancelledWithTimeoutIsNull() { $this->loop ->expects($this->never()) ->method('addTimer'); - $this->executor = new Executor($this->loop, $this->parser, $this->dumper, null); + $this->executor = new Executor($this->loop, $this->parser, $this->dumper, NULL); $query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451); $promise = $this->executor->query('127.0.0.1:53', $query); @@ -103,8 +98,7 @@ class ExecutorTest extends TestCase } /** @test */ - public function resolveShouldRejectIfResponseIsTruncated() - { + public function resolveShouldRejectIfResponseIsTruncated() { $timer = $this->createTimerMock(); $this->loop @@ -129,8 +123,7 @@ class ExecutorTest extends TestCase } /** @test */ - public function resolveShouldFailIfUdpThrow() - { + public function resolveShouldFailIfUdpThrow() { $this->loop ->expects($this->never()) ->method('addTimer'); @@ -154,8 +147,7 @@ class ExecutorTest extends TestCase } /** @test */ - public function resolveShouldCancelTimerWhenFullResponseIsReceived() - { + public function resolveShouldCancelTimerWhenFullResponseIsReceived() { $conn = $this->createConnectionMock(); $this->parser @@ -189,14 +181,13 @@ class ExecutorTest extends TestCase } /** @test */ - public function resolveShouldCloseConnectionOnTimeout() - { + public function resolveShouldCloseConnectionOnTimeout() { $this->executor = $this->createExecutorMock(); $this->executor ->expects($this->at(0)) ->method('createConnection') ->with('8.8.8.8:53', 'udp') - ->will($this->returnNewConnectionMock(false)); + ->will($this->returnNewConnectionMock(FALSE)); $timer = $this->createTimerMock(); @@ -223,8 +214,7 @@ class ExecutorTest extends TestCase Block\await($promise, $this->loop); } - private function returnStandardResponse() - { + private function returnStandardResponse() { $that = $this; $callback = function ($data) use ($that) { $response = new Message(); @@ -235,8 +225,7 @@ class ExecutorTest extends TestCase return $this->returnCallback($callback); } - private function returnTruncatedResponse() - { + private function returnTruncatedResponse() { $that = $this; $callback = function ($data) use ($that) { $response = new Message(); @@ -247,8 +236,7 @@ class ExecutorTest extends TestCase return $this->returnCallback($callback); } - public function convertMessageToStandardResponse(Message $response) - { + public function convertMessageToStandardResponse(Message $response) { $response->header->set('qr', 1); $response->questions[] = new Record('igor.io', Message::TYPE_A, Message::CLASS_IN); $response->answers[] = new Record('igor.io', Message::TYPE_A, Message::CLASS_IN, 3600, '178.79.169.131'); @@ -257,8 +245,7 @@ class ExecutorTest extends TestCase return $response; } - public function convertMessageToTruncatedResponse(Message $response) - { + public function convertMessageToTruncatedResponse(Message $response) { $this->convertMessageToStandardResponse($response); $response->header->set('tc', 1); $response->prepare(); @@ -266,8 +253,7 @@ class ExecutorTest extends TestCase return $response; } - private function returnNewConnectionMock($emitData = true) - { + private function returnNewConnectionMock($emitData = TRUE) { $conn = $this->createConnectionMock($emitData); $callback = function () use ($conn) { @@ -277,29 +263,26 @@ class ExecutorTest extends TestCase return $this->returnCallback($callback); } - private function createConnectionMock($emitData = true) - { + private function createConnectionMock($emitData = TRUE) { $conn = $this->getMockBuilder('React\Stream\DuplexStreamInterface')->getMock(); $conn ->expects($this->any()) ->method('on') ->with('data', $this->isInstanceOf('Closure')) ->will($this->returnCallback(function ($name, $callback) use ($emitData) { - $emitData && $callback(null); + $emitData && $callback(NULL); })); return $conn; } - private function createTimerMock() - { + private function createTimerMock() { return $this->getMockBuilder( interface_exists('React\EventLoop\TimerInterface') ? 'React\EventLoop\TimerInterface' : 'React\EventLoop\Timer\TimerInterface' )->getMock(); } - private function createExecutorMock() - { + private function createExecutorMock() { return $this->getMockBuilder('React\Dns\Query\Executor') ->setConstructorArgs(array($this->loop, $this->parser, $this->dumper)) ->setMethods(array('createConnection')) diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/HostsFileExecutorTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/HostsFileExecutorTest.php index 70d877e..61982be 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/HostsFileExecutorTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/HostsFileExecutorTest.php @@ -13,111 +13,97 @@ class HostsFileExecutorTest extends TestCase private $fallback; private $executor; - public function setUp() - { + public function setUp() { $this->hosts = $this->getMockBuilder('React\Dns\Config\HostsFile')->disableOriginalConstructor()->getMock(); $this->fallback = $this->getMockBuilder('React\Dns\Query\ExecutorInterface')->getMock(); $this->executor = new HostsFileExecutor($this->hosts, $this->fallback); } - public function testDoesNotTryToGetIpsForMxQuery() - { + public function testDoesNotTryToGetIpsForMxQuery() { $this->hosts->expects($this->never())->method('getIpsForHost'); $this->fallback->expects($this->once())->method('query'); $this->executor->query('8.8.8.8', new Query('google.com', Message::TYPE_MX, Message::CLASS_IN, 0)); } - public function testFallsBackIfNoIpsWereFound() - { + public function testFallsBackIfNoIpsWereFound() { $this->hosts->expects($this->once())->method('getIpsForHost')->willReturn(array()); $this->fallback->expects($this->once())->method('query'); $this->executor->query('8.8.8.8', new Query('google.com', Message::TYPE_A, Message::CLASS_IN, 0)); } - public function testReturnsResponseMessageIfIpsWereFound() - { + public function testReturnsResponseMessageIfIpsWereFound() { $this->hosts->expects($this->once())->method('getIpsForHost')->willReturn(array('127.0.0.1')); $this->fallback->expects($this->never())->method('query'); $ret = $this->executor->query('8.8.8.8', new Query('google.com', Message::TYPE_A, Message::CLASS_IN, 0)); } - public function testFallsBackIfNoIpv4Matches() - { + public function testFallsBackIfNoIpv4Matches() { $this->hosts->expects($this->once())->method('getIpsForHost')->willReturn(array('::1')); $this->fallback->expects($this->once())->method('query'); $ret = $this->executor->query('8.8.8.8', new Query('google.com', Message::TYPE_A, Message::CLASS_IN, 0)); } - public function testReturnsResponseMessageIfIpv6AddressesWereFound() - { + public function testReturnsResponseMessageIfIpv6AddressesWereFound() { $this->hosts->expects($this->once())->method('getIpsForHost')->willReturn(array('::1')); $this->fallback->expects($this->never())->method('query'); $ret = $this->executor->query('8.8.8.8', new Query('google.com', Message::TYPE_AAAA, Message::CLASS_IN, 0)); } - public function testFallsBackIfNoIpv6Matches() - { + public function testFallsBackIfNoIpv6Matches() { $this->hosts->expects($this->once())->method('getIpsForHost')->willReturn(array('127.0.0.1')); $this->fallback->expects($this->once())->method('query'); $ret = $this->executor->query('8.8.8.8', new Query('google.com', Message::TYPE_AAAA, Message::CLASS_IN, 0)); } - public function testDoesReturnReverseIpv4Lookup() - { + public function testDoesReturnReverseIpv4Lookup() { $this->hosts->expects($this->once())->method('getHostsForIp')->with('127.0.0.1')->willReturn(array('localhost')); $this->fallback->expects($this->never())->method('query'); $this->executor->query('8.8.8.8', new Query('1.0.0.127.in-addr.arpa', Message::TYPE_PTR, Message::CLASS_IN, 0)); } - public function testFallsBackIfNoReverseIpv4Matches() - { + public function testFallsBackIfNoReverseIpv4Matches() { $this->hosts->expects($this->once())->method('getHostsForIp')->with('127.0.0.1')->willReturn(array()); $this->fallback->expects($this->once())->method('query'); $this->executor->query('8.8.8.8', new Query('1.0.0.127.in-addr.arpa', Message::TYPE_PTR, Message::CLASS_IN, 0)); } - public function testDoesReturnReverseIpv6Lookup() - { + public function testDoesReturnReverseIpv6Lookup() { $this->hosts->expects($this->once())->method('getHostsForIp')->with('2a02:2e0:3fe:100::6')->willReturn(array('ip6-localhost')); $this->fallback->expects($this->never())->method('query'); $this->executor->query('8.8.8.8', new Query('6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1.0.e.f.3.0.0.e.2.0.2.0.a.2.ip6.arpa', Message::TYPE_PTR, Message::CLASS_IN, 0)); } - public function testFallsBackForInvalidAddress() - { + public function testFallsBackForInvalidAddress() { $this->hosts->expects($this->never())->method('getHostsForIp'); $this->fallback->expects($this->once())->method('query'); $this->executor->query('8.8.8.8', new Query('example.com', Message::TYPE_PTR, Message::CLASS_IN, 0)); } - public function testReverseFallsBackForInvalidIpv4Address() - { + public function testReverseFallsBackForInvalidIpv4Address() { $this->hosts->expects($this->never())->method('getHostsForIp'); $this->fallback->expects($this->once())->method('query'); $this->executor->query('8.8.8.8', new Query('::1.in-addr.arpa', Message::TYPE_PTR, Message::CLASS_IN, 0)); } - public function testReverseFallsBackForInvalidLengthIpv6Address() - { + public function testReverseFallsBackForInvalidLengthIpv6Address() { $this->hosts->expects($this->never())->method('getHostsForIp'); $this->fallback->expects($this->once())->method('query'); $this->executor->query('8.8.8.8', new Query('abcd.ip6.arpa', Message::TYPE_PTR, Message::CLASS_IN, 0)); } - public function testReverseFallsBackForInvalidHexIpv6Address() - { + public function testReverseFallsBackForInvalidHexIpv6Address() { $this->hosts->expects($this->never())->method('getHostsForIp'); $this->fallback->expects($this->once())->method('query'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/RecordBagTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/RecordBagTest.php index 83b8934..7e2ce31 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/RecordBagTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/RecordBagTest.php @@ -10,22 +10,20 @@ use React\Dns\Model\Record; class RecordBagTest extends TestCase { /** - * @covers React\Dns\Query\RecordBag - * @test - */ - public function emptyBagShouldBeEmpty() - { + * @covers React\Dns\Query\RecordBag + * @test + */ + public function emptyBagShouldBeEmpty() { $recordBag = new RecordBag(); $this->assertSame(array(), $recordBag->all()); } /** - * @covers React\Dns\Query\RecordBag - * @test - */ - public function setShouldSetTheValue() - { + * @covers React\Dns\Query\RecordBag + * @test + */ + public function setShouldSetTheValue() { $currentTime = 1345656451; $recordBag = new RecordBag(); @@ -39,11 +37,10 @@ class RecordBagTest extends TestCase } /** - * @covers React\Dns\Query\RecordBag - * @test - */ - public function setShouldSetManyValues() - { + * @covers React\Dns\Query\RecordBag + * @test + */ + public function setShouldSetManyValues() { $currentTime = 1345656451; $recordBag = new RecordBag(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/RecordCacheTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/RecordCacheTest.php index 399fbe8..c7c2a31 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/RecordCacheTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/RecordCacheTest.php @@ -13,11 +13,10 @@ use React\Promise\PromiseInterface; class RecordCacheTest extends TestCase { /** - * @covers React\Dns\Query\RecordCache - * @test - */ - public function lookupOnEmptyCacheShouldReturnNull() - { + * @covers React\Dns\Query\RecordCache + * @test + */ + public function lookupOnEmptyCacheShouldReturnNull() { $query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451); $cache = new RecordCache(new ArrayCache()); @@ -27,11 +26,10 @@ class RecordCacheTest extends TestCase } /** - * @covers React\Dns\Query\RecordCache - * @test - */ - public function storeRecordShouldMakeLookupSucceed() - { + * @covers React\Dns\Query\RecordCache + * @test + */ + public function storeRecordShouldMakeLookupSucceed() { $query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451); $cache = new RecordCache(new ArrayCache()); @@ -46,11 +44,10 @@ class RecordCacheTest extends TestCase } /** - * @covers React\Dns\Query\RecordCache - * @test - */ - public function storeTwoRecordsShouldReturnBoth() - { + * @covers React\Dns\Query\RecordCache + * @test + */ + public function storeTwoRecordsShouldReturnBoth() { $query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451); $cache = new RecordCache(new ArrayCache()); @@ -67,11 +64,10 @@ class RecordCacheTest extends TestCase } /** - * @covers React\Dns\Query\RecordCache - * @test - */ - public function storeResponseMessageShouldStoreAllAnswerValues() - { + * @covers React\Dns\Query\RecordCache + * @test + */ + public function storeResponseMessageShouldStoreAllAnswerValues() { $query = new Query('igor.io', Message::TYPE_A, Message::CLASS_IN, 1345656451); $response = new Message(); @@ -92,11 +88,10 @@ class RecordCacheTest extends TestCase } /** - * @covers React\Dns\Query\RecordCache - * @test - */ - public function expireShouldExpireDeadRecords() - { + * @covers React\Dns\Query\RecordCache + * @test + */ + public function expireShouldExpireDeadRecords() { $cachedTime = 1345656451; $currentTime = $cachedTime + 3605; @@ -110,9 +105,8 @@ class RecordCacheTest extends TestCase $this->assertInstanceOf('React\Promise\RejectedPromise', $promise); } - private function getPromiseValue(PromiseInterface $promise) - { - $capturedValue = null; + private function getPromiseValue(PromiseInterface $promise) { + $capturedValue = NULL; $promise->then(function ($value) use (&$capturedValue) { $capturedValue = $value; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/RetryExecutorTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/RetryExecutorTest.php index 8950f84..633c4af 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/RetryExecutorTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/RetryExecutorTest.php @@ -15,11 +15,10 @@ use React\Dns\Query\CancellationException; class RetryExecutorTest extends TestCase { /** - * @covers React\Dns\Query\RetryExecutor - * @test - */ - public function queryShouldDelegateToDecoratedExecutor() - { + * @covers React\Dns\Query\RetryExecutor + * @test + */ + public function queryShouldDelegateToDecoratedExecutor() { $executor = $this->createExecutorMock(); $executor ->expects($this->once()) @@ -34,11 +33,10 @@ class RetryExecutorTest extends TestCase } /** - * @covers React\Dns\Query\RetryExecutor - * @test - */ - public function queryShouldRetryQueryOnTimeout() - { + * @covers React\Dns\Query\RetryExecutor + * @test + */ + public function queryShouldRetryQueryOnTimeout() { $response = $this->createStandardResponse(); $executor = $this->createExecutorMock(); @@ -70,11 +68,10 @@ class RetryExecutorTest extends TestCase } /** - * @covers React\Dns\Query\RetryExecutor - * @test - */ - public function queryShouldStopRetryingAfterSomeAttempts() - { + * @covers React\Dns\Query\RetryExecutor + * @test + */ + public function queryShouldStopRetryingAfterSomeAttempts() { $executor = $this->createExecutorMock(); $executor ->expects($this->exactly(3)) @@ -99,11 +96,10 @@ class RetryExecutorTest extends TestCase } /** - * @covers React\Dns\Query\RetryExecutor - * @test - */ - public function queryShouldForwardNonTimeoutErrors() - { + * @covers React\Dns\Query\RetryExecutor + * @test + */ + public function queryShouldForwardNonTimeoutErrors() { $executor = $this->createExecutorMock(); $executor ->expects($this->once()) @@ -131,8 +127,7 @@ class RetryExecutorTest extends TestCase * @covers React\Dns\Query\RetryExecutor * @test */ - public function queryShouldCancelQueryOnCancel() - { + public function queryShouldCancelQueryOnCancel() { $cancelled = 0; $executor = $this->createExecutorMock(); @@ -148,7 +143,7 @@ class RetryExecutorTest extends TestCase return $deferred->promise(); }) - ); + ); $retryExecutor = new RetryExecutor($executor, 2); @@ -162,8 +157,7 @@ class RetryExecutorTest extends TestCase $this->assertEquals(1, $cancelled); } - protected function expectPromiseOnce($return = null) - { + protected function expectPromiseOnce($return = NULL) { $mock = $this->createPromiseMock(); $mock ->expects($this->once()) @@ -173,18 +167,15 @@ class RetryExecutorTest extends TestCase return $mock; } - protected function createExecutorMock() - { + protected function createExecutorMock() { return $this->getMockBuilder('React\Dns\Query\ExecutorInterface')->getMock(); } - protected function createPromiseMock() - { + protected function createPromiseMock() { return $this->getMockBuilder('React\Promise\PromiseInterface')->getMock(); } - protected function createStandardResponse() - { + protected function createStandardResponse() { $response = new Message(); $response->header->set('qr', 1); $response->questions[] = new Record('igor.io', Message::TYPE_A, Message::CLASS_IN); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/TimeoutExecutorTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/TimeoutExecutorTest.php index 0d37fb4..f55ca50 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/TimeoutExecutorTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Query/TimeoutExecutorTest.php @@ -13,8 +13,7 @@ use React\Promise; class TimeoutExecutorTest extends TestCase { - public function setUp() - { + public function setUp() { $this->loop = Factory::create(); $this->wrapped = $this->getMockBuilder('React\Dns\Query\ExecutorInterface')->getMock(); @@ -22,8 +21,7 @@ class TimeoutExecutorTest extends TestCase $this->executor = new TimeoutExecutor($this->wrapped, 5.0, $this->loop); } - public function testCancellingPromiseWillCancelWrapped() - { + public function testCancellingPromiseWillCancelWrapped() { $cancelled = 0; $this->wrapped @@ -48,8 +46,7 @@ class TimeoutExecutorTest extends TestCase $promise->then($this->expectCallableNever(), $this->expectCallableOnce()); } - public function testResolvesPromiseWhenWrappedResolves() - { + public function testResolvesPromiseWhenWrappedResolves() { $this->wrapped ->expects($this->once()) ->method('query') @@ -61,8 +58,7 @@ class TimeoutExecutorTest extends TestCase $promise->then($this->expectCallableOnce(), $this->expectCallableNever()); } - public function testRejectsPromiseWhenWrappedRejects() - { + public function testRejectsPromiseWhenWrappedRejects() { $this->wrapped ->expects($this->once()) ->method('query') @@ -74,8 +70,7 @@ class TimeoutExecutorTest extends TestCase $promise->then($this->expectCallableNever(), $this->expectCallableOnceWith(new \RuntimeException())); } - public function testWrappedWillBeCancelledOnTimeout() - { + public function testWrappedWillBeCancelledOnTimeout() { $this->executor = new TimeoutExecutor($this->wrapped, 0, $this->loop); $cancelled = 0; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Resolver/FactoryTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Resolver/FactoryTest.php index acaeac0..2756ef5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Resolver/FactoryTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Resolver/FactoryTest.php @@ -9,8 +9,7 @@ use React\Dns\Query\HostsFileExecutor; class FactoryTest extends TestCase { /** @test */ - public function createShouldCreateResolver() - { + public function createShouldCreateResolver() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $factory = new Factory(); @@ -20,8 +19,7 @@ class FactoryTest extends TestCase } /** @test */ - public function createWithoutPortShouldCreateResolverWithDefaultPort() - { + public function createWithoutPortShouldCreateResolverWithDefaultPort() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $factory = new Factory(); @@ -32,8 +30,7 @@ class FactoryTest extends TestCase } /** @test */ - public function createCachedShouldCreateResolverWithCachedExecutor() - { + public function createCachedShouldCreateResolverWithCachedExecutor() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $factory = new Factory(); @@ -49,8 +46,7 @@ class FactoryTest extends TestCase } /** @test */ - public function createCachedShouldCreateResolverWithCachedExecutorWithCustomCache() - { + public function createCachedShouldCreateResolverWithCachedExecutorWithCustomCache() { $cache = $this->getMockBuilder('React\Cache\CacheInterface')->getMock(); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -70,8 +66,7 @@ class FactoryTest extends TestCase * @test * @dataProvider factoryShouldAddDefaultPortProvider */ - public function factoryShouldAddDefaultPort($input, $expected) - { + public function factoryShouldAddDefaultPort($input, $expected) { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $factory = new Factory(); @@ -81,26 +76,24 @@ class FactoryTest extends TestCase $this->assertSame($expected, $this->getResolverPrivateMemberValue($resolver, 'nameserver')); } - public static function factoryShouldAddDefaultPortProvider() - { + public static function factoryShouldAddDefaultPortProvider() { return array( - array('8.8.8.8', '8.8.8.8:53'), - array('1.2.3.4:5', '1.2.3.4:5'), - array('localhost', 'localhost:53'), + array('8.8.8.8', '8.8.8.8:53'), + array('1.2.3.4:5', '1.2.3.4:5'), + array('localhost', 'localhost:53'), array('localhost:1234', 'localhost:1234'), - array('::1', '[::1]:53'), - array('[::1]:53', '[::1]:53') + array('::1', '[::1]:53'), + array('[::1]:53', '[::1]:53') ); } - private function getResolverPrivateExecutor($resolver) - { + private function getResolverPrivateExecutor($resolver) { $executor = $this->getResolverPrivateMemberValue($resolver, 'executor'); // extract underlying executor that may be wrapped in multiple layers of hosts file executors while ($executor instanceof HostsFileExecutor) { $reflector = new \ReflectionProperty('React\Dns\Query\HostsFileExecutor', 'fallback'); - $reflector->setAccessible(true); + $reflector->setAccessible(TRUE); $executor = $reflector->getValue($executor); } @@ -108,24 +101,21 @@ class FactoryTest extends TestCase return $executor; } - private function getResolverPrivateMemberValue($resolver, $field) - { + private function getResolverPrivateMemberValue($resolver, $field) { $reflector = new \ReflectionProperty('React\Dns\Resolver\Resolver', $field); - $reflector->setAccessible(true); + $reflector->setAccessible(TRUE); return $reflector->getValue($resolver); } - private function getCachedExecutorPrivateMemberValue($resolver, $field) - { + private function getCachedExecutorPrivateMemberValue($resolver, $field) { $reflector = new \ReflectionProperty('React\Dns\Query\CachedExecutor', $field); - $reflector->setAccessible(true); + $reflector->setAccessible(TRUE); return $reflector->getValue($resolver); } - private function getRecordCachePrivateMemberValue($resolver, $field) - { + private function getRecordCachePrivateMemberValue($resolver, $field) { $reflector = new \ReflectionProperty('React\Dns\Query\RecordCache', $field); - $reflector->setAccessible(true); + $reflector->setAccessible(TRUE); return $reflector->getValue($resolver); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Resolver/ResolveAliasesTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Resolver/ResolveAliasesTest.php index b5175e3..321f9f4 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Resolver/ResolveAliasesTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Resolver/ResolveAliasesTest.php @@ -11,11 +11,10 @@ use React\Dns\Model\Record; class ResolveAliasesTest extends TestCase { /** - * @covers React\Dns\Resolver\Resolver::resolveAliases + * @covers React\Dns\Resolver\Resolver::resolveAliases * @dataProvider provideAliasedAnswers */ - public function testResolveAliases(array $expectedAnswers, array $answers, $name) - { + public function testResolveAliases(array $expectedAnswers, array $answers, $name) { $executor = $this->createExecutorMock(); $resolver = new Resolver('8.8.8.8:53', $executor); @@ -24,8 +23,7 @@ class ResolveAliasesTest extends TestCase $this->assertEquals($expectedAnswers, $answers); } - public function provideAliasedAnswers() - { + public function provideAliasedAnswers() { return array( array( array('178.79.169.131'), @@ -93,8 +91,7 @@ class ResolveAliasesTest extends TestCase ); } - private function createExecutorMock() - { + private function createExecutorMock() { return $this->getMockBuilder('React\Dns\Query\ExecutorInterface')->getMock(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Resolver/ResolverTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Resolver/ResolverTest.php index e11509b..b68c055 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Resolver/ResolverTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/Resolver/ResolverTest.php @@ -12,8 +12,7 @@ use React\Tests\Dns\TestCase; class ResolverTest extends TestCase { /** @test */ - public function resolveShouldQueryARecords() - { + public function resolveShouldQueryARecords() { $executor = $this->createExecutorMock(); $executor ->expects($this->once()) @@ -33,8 +32,7 @@ class ResolverTest extends TestCase } /** @test */ - public function resolveShouldQueryARecordsAndIgnoreCase() - { + public function resolveShouldQueryARecordsAndIgnoreCase() { $executor = $this->createExecutorMock(); $executor ->expects($this->once()) @@ -54,8 +52,7 @@ class ResolverTest extends TestCase } /** @test */ - public function resolveShouldFilterByName() - { + public function resolveShouldFilterByName() { $executor = $this->createExecutorMock(); $executor ->expects($this->once()) @@ -77,8 +74,7 @@ class ResolverTest extends TestCase } /** @test */ - public function resolveWithNoAnswersShouldThrowException() - { + public function resolveWithNoAnswersShouldThrowException() { $executor = $this->createExecutorMock(); $executor ->expects($this->once()) @@ -101,8 +97,7 @@ class ResolverTest extends TestCase /** * @test */ - public function resolveWithNoAnswersShouldCallErrbackIfGiven() - { + public function resolveWithNoAnswersShouldCallErrbackIfGiven() { $executor = $this->createExecutorMock(); $executor ->expects($this->once()) @@ -122,8 +117,7 @@ class ResolverTest extends TestCase $resolver->resolve('igor.io')->then($this->expectCallableNever(), $errback); } - private function createExecutorMock() - { + private function createExecutorMock() { return $this->getMockBuilder('React\Dns\Query\ExecutorInterface')->getMock(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/TestCase.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/TestCase.php index a5a22bf..3d2889e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/TestCase.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/dns/tests/TestCase.php @@ -6,8 +6,7 @@ use PHPUnit\Framework\TestCase as BaseTestCase; abstract class TestCase extends BaseTestCase { - protected function expectCallableOnce() - { + protected function expectCallableOnce() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -16,8 +15,7 @@ abstract class TestCase extends BaseTestCase return $mock; } - protected function expectCallableOnceWith($value) - { + protected function expectCallableOnceWith($value) { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -27,8 +25,7 @@ abstract class TestCase extends BaseTestCase return $mock; } - protected function expectCallableNever() - { + protected function expectCallableNever() { $mock = $this->createCallableMock(); $mock ->expects($this->never()) @@ -37,25 +34,23 @@ abstract class TestCase extends BaseTestCase return $mock; } - protected function createCallableMock() - { + protected function createCallableMock() { return $this->getMockBuilder('React\Tests\Dns\CallableStub')->getMock(); } - public function setExpectedException($exception, $exceptionMessage = '', $exceptionCode = null) - { - if (method_exists($this, 'expectException')) { - // PHPUnit 5 - $this->expectException($exception); - if ($exceptionMessage !== '') { - $this->expectExceptionMessage($exceptionMessage); - } - if ($exceptionCode !== null) { - $this->expectExceptionCode($exceptionCode); - } - } else { - // legacy PHPUnit 4 - parent::setExpectedException($exception, $exceptionMessage, $exceptionCode); - } - } + public function setExpectedException($exception, $exceptionMessage = '', $exceptionCode = NULL) { + if (method_exists($this, 'expectException')) { + // PHPUnit 5 + $this->expectException($exception); + if ($exceptionMessage !== '') { + $this->expectExceptionMessage($exceptionMessage); + } + if ($exceptionCode !== NULL) { + $this->expectExceptionCode($exceptionCode); + } + } else { + // legacy PHPUnit 4 + parent::setExpectedException($exception, $exceptionMessage, $exceptionCode); + } + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/composer.json index 24974ec..4412c3a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/composer.json @@ -1,21 +1,24 @@ { - "name": "react/event-loop", - "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", - "keywords": ["event-loop", "asynchronous"], - "license": "MIT", - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.8.35 || ^5.7 || ^6.4" - }, - "suggest": { - "ext-event": "~1.0 for ExtEventLoop", - "ext-pcntl": "For signal handling support when using the StreamSelectLoop" - }, - "autoload": { - "psr-4": { - "React\\EventLoop\\": "src" - } + "name": "react/event-loop", + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "event-loop", + "asynchronous" + ], + "license": "MIT", + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.35 || ^5.7 || ^6.4" + }, + "suggest": { + "ext-event": "~1.0 for ExtEventLoop", + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src" } + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/11-consume-stdin.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/11-consume-stdin.php index 2a77245..fc90a65 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/11-consume-stdin.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/11-consume-stdin.php @@ -4,7 +4,7 @@ use React\EventLoop\Factory; require __DIR__ . '/../vendor/autoload.php'; -if (!defined('STDIN') || stream_set_blocking(STDIN, false) !== true) { +if (!defined('STDIN') || stream_set_blocking(STDIN, FALSE) !== TRUE) { fwrite(STDERR, 'ERROR: Unable to set STDIN non-blocking (not CLI or Windows?)' . PHP_EOL); exit(1); } @@ -19,7 +19,7 @@ $loop->addReadStream(STDIN, function ($stream) use ($loop) { // reading nothing means we reached EOF if ($chunk === '') { $loop->removeReadStream($stream); - stream_set_blocking($stream, true); + stream_set_blocking($stream, TRUE); fclose($stream); return; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/12-generate-yes.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/12-generate-yes.php index ebc2beb..c62da32 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/12-generate-yes.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/12-generate-yes.php @@ -10,7 +10,7 @@ $data = str_repeat($data, round(200000 / strlen($data))); $loop = React\EventLoop\Factory::create(); -if (!defined('STDOUT') || stream_set_blocking(STDOUT, false) !== true) { +if (!defined('STDOUT') || stream_set_blocking(STDOUT, FALSE) !== TRUE) { fwrite(STDERR, 'ERROR: Unable to set STDOUT non-blocking (not CLI or Windows?)' . PHP_EOL); exit(1); } @@ -25,7 +25,7 @@ $loop->addWriteStream(STDOUT, function ($stdout) use ($loop, &$data) { if ($r === 0) { $loop->removeWriteStream($stdout); fclose($stdout); - stream_set_blocking($stdout, true); + stream_set_blocking($stdout, TRUE); fwrite(STDERR, 'Stopped because STDOUT closed' . PHP_EOL); return; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/13-http-client-blocking.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/13-http-client-blocking.php index a2dde55..c312082 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/13-http-client-blocking.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/13-http-client-blocking.php @@ -12,7 +12,7 @@ $stream = stream_socket_client('tcp://www.google.com:80'); if (!$stream) { exit(1); } -stream_set_blocking($stream, false); +stream_set_blocking($stream, FALSE); // send HTTP request fwrite($stream, "GET / HTTP/1.1\r\nHost: www.google.com\r\nConnection: close\r\n\r\n"); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/14-http-client-async.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/14-http-client-async.php index c82c988..4713e78 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/14-http-client-async.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/14-http-client-async.php @@ -9,18 +9,18 @@ $loop = Factory::create(); // resolve hostname before establishing TCP/IP connection (resolving DNS is still blocking here) // for illustration purposes only, should use react/socket or react/dns instead! $ip = gethostbyname('www.google.com'); -if (ip2long($ip) === false) { +if (ip2long($ip) === FALSE) { echo 'Unable to resolve hostname' . PHP_EOL; exit(1); } // establish TCP/IP connection (non-blocking) // for illustraction purposes only, should use react/socket instead! -$stream = stream_socket_client('tcp://' . $ip . ':80', $errno, $errstr, null, STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT); +$stream = stream_socket_client('tcp://' . $ip . ':80', $errno, $errstr, NULL, STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT); if (!$stream) { exit(1); } -stream_set_blocking($stream, false); +stream_set_blocking($stream, FALSE); // print progress every 10ms echo 'Connecting'; @@ -34,7 +34,7 @@ $loop->addWriteStream($stream, function ($stream) use ($loop, $timer) { $loop->cancelTimer($timer); // check for socket error (connection rejected) - if (stream_socket_get_name($stream, true) === false) { + if (stream_socket_get_name($stream, TRUE) === FALSE) { echo '[unable to connect]' . PHP_EOL; exit(1); } else { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/21-http-server.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/21-http-server.php index 89520ce..55391f3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/21-http-server.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/21-http-server.php @@ -10,7 +10,7 @@ $server = stream_socket_server('tcp://127.0.0.1:8080'); if (!$server) { exit(1); } -stream_set_blocking($server, false); +stream_set_blocking($server, FALSE); // wait for incoming connections on server socket $loop->addReadStream($server, function ($server) use ($loop) { @@ -29,7 +29,7 @@ $loop->addReadStream($server, function ($server) use ($loop) { $loop->addPeriodicTimer(5, function () { $memory = memory_get_usage() / 1024; - $formatted = number_format($memory, 3).'K'; + $formatted = number_format($memory, 3) . 'K'; echo "Current memory usage: {$formatted}\n"; }); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/91-benchmark-ticks.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/91-benchmark-ticks.php index 3f4690b..38b96a6 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/91-benchmark-ticks.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/91-benchmark-ticks.php @@ -9,7 +9,8 @@ $loop = Factory::create(); $n = isset($argv[1]) ? (int)$argv[1] : 1000 * 100; for ($i = 0; $i < $n; ++$i) { - $loop->futureTick(function () { }); + $loop->futureTick(function () { + }); } $loop->run(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/92-benchmark-timers.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/92-benchmark-timers.php index e2e02e4..014566d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/92-benchmark-timers.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/92-benchmark-timers.php @@ -9,7 +9,8 @@ $loop = Factory::create(); $n = isset($argv[1]) ? (int)$argv[1] : 1000 * 100; for ($i = 0; $i < $n; ++$i) { - $loop->addTimer(0, function () { }); + $loop->addTimer(0, function () { + }); } $loop->run(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/95-benchmark-memory.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/95-benchmark-memory.php index 084c404..d22593e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/95-benchmark-memory.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/examples/95-benchmark-memory.php @@ -14,7 +14,7 @@ use React\EventLoop\TimerInterface; require __DIR__ . '/../vendor/autoload.php'; $args = getopt('t:l:r:'); -$t = isset($args['t']) ? (int)$args['t'] : 0; +$t = isset($args['t']) ? (int)$args['t'] : 0; $loop = isset($args['l']) && class_exists('React\EventLoop\\' . $args['l'] . 'Loop') ? 'React\EventLoop\\' . $args['l'] . 'Loop' : Factory::create(); if (!($loop instanceof LoopInterface)) { @@ -42,7 +42,7 @@ $loop->addPeriodicTimer(0.001, function () use (&$runs, $loop) { $loop->addPeriodicTimer($r, function () use (&$runs) { $kmem = round(memory_get_usage() / 1024); - $kmemReal = round(memory_get_usage(true) / 1024); + $kmemReal = round(memory_get_usage(TRUE) / 1024); echo "Runs:\t\t\t$runs\n"; echo "Memory (internal):\t$kmem KiB\n"; echo "Memory (real):\t\t$kmemReal KiB\n"; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/ExtEvLoop.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/ExtEvLoop.php index 74db6d0..9e836be 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/ExtEvLoop.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/ExtEvLoop.php @@ -62,16 +62,14 @@ class ExtEvLoop implements LoopInterface */ private $signalEvents = []; - public function __construct() - { + public function __construct() { $this->loop = new EvLoop(); $this->futureTickQueue = new FutureTickQueue(); $this->timers = new SplObjectStorage(); $this->signals = new SignalsHandler(); } - public function addReadStream($stream, $listener) - { + public function addReadStream($stream, $listener) { $key = (int)$stream; if (isset($this->readStreams[$key])) { @@ -89,15 +87,13 @@ class ExtEvLoop implements LoopInterface * * @return \Closure */ - private function getStreamListenerClosure($stream, $listener) - { + private function getStreamListenerClosure($stream, $listener) { return function () use ($stream, $listener) { call_user_func($listener, $stream); }; } - public function addWriteStream($stream, $listener) - { + public function addWriteStream($stream, $listener) { $key = (int)$stream; if (isset($this->writeStreams[$key])) { @@ -109,8 +105,7 @@ class ExtEvLoop implements LoopInterface $this->writeStreams[$key] = $event; } - public function removeReadStream($stream) - { + public function removeReadStream($stream) { $key = (int)$stream; if (!isset($this->readStreams[$key])) { @@ -121,8 +116,7 @@ class ExtEvLoop implements LoopInterface unset($this->readStreams[$key]); } - public function removeWriteStream($stream) - { + public function removeWriteStream($stream) { $key = (int)$stream; if (!isset($this->writeStreams[$key])) { @@ -133,9 +127,8 @@ class ExtEvLoop implements LoopInterface unset($this->writeStreams[$key]); } - public function addTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, false); + public function addTimer($interval, $callback) { + $timer = new Timer($interval, $callback, FALSE); $that = $this; $timers = $this->timers; @@ -153,9 +146,8 @@ class ExtEvLoop implements LoopInterface return $timer; } - public function addPeriodicTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, true); + public function addPeriodicTimer($interval, $callback) { + $timer = new Timer($interval, $callback, TRUE); $callback = function () use ($timer) { call_user_func($timer->getCallback(), $timer); @@ -167,8 +159,7 @@ class ExtEvLoop implements LoopInterface return $timer; } - public function cancelTimer(TimerInterface $timer) - { + public function cancelTimer(TimerInterface $timer) { if (!isset($this->timers[$timer])) { return; } @@ -178,14 +169,12 @@ class ExtEvLoop implements LoopInterface $this->timers->detach($timer); } - public function futureTick($listener) - { + public function futureTick($listener) { $this->futureTickQueue->add($listener); } - public function run() - { - $this->running = true; + public function run() { + $this->running = TRUE; while ($this->running) { $this->futureTickQueue->tick(); @@ -200,7 +189,7 @@ class ExtEvLoop implements LoopInterface $flags = Ev::RUN_ONCE; if ($wasJustStopped || $hasPendingCallbacks) { $flags |= Ev::RUN_NOWAIT; - } elseif ($nothingLeftToDo) { + } else if ($nothingLeftToDo) { break; } @@ -208,13 +197,11 @@ class ExtEvLoop implements LoopInterface } } - public function stop() - { - $this->running = false; + public function stop() { + $this->running = FALSE; } - public function __destruct() - { + public function __destruct() { /** @var TimerInterface $timer */ foreach ($this->timers as $timer) { $this->cancelTimer($timer); @@ -229,19 +216,17 @@ class ExtEvLoop implements LoopInterface } } - public function addSignal($signal, $listener) - { + public function addSignal($signal, $listener) { $this->signals->add($signal, $listener); if (!isset($this->signalEvents[$signal])) { - $this->signalEvents[$signal] = $this->loop->signal($signal, function() use ($signal) { + $this->signalEvents[$signal] = $this->loop->signal($signal, function () use ($signal) { $this->signals->call($signal); }); } } - public function removeSignal($signal, $listener) - { + public function removeSignal($signal, $listener) { $this->signals->remove($signal, $listener); if (isset($this->signalEvents[$signal])) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/ExtEventLoop.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/ExtEventLoop.php index 622dd47..bf28aec 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/ExtEventLoop.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/ExtEventLoop.php @@ -37,9 +37,8 @@ final class ExtEventLoop implements LoopInterface private $signals; private $signalEvents = array(); - public function __construct() - { - if (!class_exists('EventBase', false)) { + public function __construct() { + if (!class_exists('EventBase', FALSE)) { throw new BadMethodCallException('Cannot create ExtEventLoop, ext-event extension missing'); } @@ -55,9 +54,8 @@ final class ExtEventLoop implements LoopInterface $this->createStreamCallback(); } - public function addReadStream($stream, $listener) - { - $key = (int) $stream; + public function addReadStream($stream, $listener) { + $key = (int)$stream; if (isset($this->readListeners[$key])) { return; } @@ -74,9 +72,8 @@ final class ExtEventLoop implements LoopInterface } } - public function addWriteStream($stream, $listener) - { - $key = (int) $stream; + public function addWriteStream($stream, $listener) { + $key = (int)$stream; if (isset($this->writeListeners[$key])) { return; } @@ -93,9 +90,8 @@ final class ExtEventLoop implements LoopInterface } } - public function removeReadStream($stream) - { - $key = (int) $stream; + public function removeReadStream($stream) { + $key = (int)$stream; if (isset($this->readEvents[$key])) { $this->readEvents[$key]->free(); @@ -107,9 +103,8 @@ final class ExtEventLoop implements LoopInterface } } - public function removeWriteStream($stream) - { - $key = (int) $stream; + public function removeWriteStream($stream) { + $key = (int)$stream; if (isset($this->writeEvents[$key])) { $this->writeEvents[$key]->free(); @@ -121,39 +116,34 @@ final class ExtEventLoop implements LoopInterface } } - public function addTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, false); + public function addTimer($interval, $callback) { + $timer = new Timer($interval, $callback, FALSE); $this->scheduleTimer($timer); return $timer; } - public function addPeriodicTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, true); + public function addPeriodicTimer($interval, $callback) { + $timer = new Timer($interval, $callback, TRUE); $this->scheduleTimer($timer); return $timer; } - public function cancelTimer(TimerInterface $timer) - { + public function cancelTimer(TimerInterface $timer) { if ($this->timerEvents->contains($timer)) { $this->timerEvents[$timer]->free(); $this->timerEvents->detach($timer); } } - public function futureTick($listener) - { + public function futureTick($listener) { $this->futureTickQueue->add($listener); } - public function addSignal($signal, $listener) - { + public function addSignal($signal, $listener) { $this->signals->add($signal, $listener); if (!isset($this->signalEvents[$signal])) { @@ -162,8 +152,7 @@ final class ExtEventLoop implements LoopInterface } } - public function removeSignal($signal, $listener) - { + public function removeSignal($signal, $listener) { $this->signals->remove($signal, $listener); if (isset($this->signalEvents[$signal]) && $this->signals->count($signal) === 0) { @@ -172,9 +161,8 @@ final class ExtEventLoop implements LoopInterface } } - public function run() - { - $this->running = true; + public function run() { + $this->running = TRUE; while ($this->running) { $this->futureTickQueue->tick(); @@ -182,7 +170,7 @@ final class ExtEventLoop implements LoopInterface $flags = EventBase::LOOP_ONCE; if (!$this->running || !$this->futureTickQueue->isEmpty()) { $flags |= EventBase::LOOP_NONBLOCK; - } elseif (!$this->readEvents && !$this->writeEvents && !$this->timerEvents->count() && $this->signals->isEmpty()) { + } else if (!$this->readEvents && !$this->writeEvents && !$this->timerEvents->count() && $this->signals->isEmpty()) { break; } @@ -190,9 +178,8 @@ final class ExtEventLoop implements LoopInterface } } - public function stop() - { - $this->running = false; + public function stop() { + $this->running = FALSE; } /** @@ -200,8 +187,7 @@ final class ExtEventLoop implements LoopInterface * * @param TimerInterface $timer */ - private function scheduleTimer(TimerInterface $timer) - { + private function scheduleTimer(TimerInterface $timer) { $flags = Event::TIMEOUT; if ($timer->isPeriodic()) { @@ -221,8 +207,7 @@ final class ExtEventLoop implements LoopInterface * to prevent "Cannot destroy active lambda function" fatal error from * the event extension. */ - private function createTimerCallback() - { + private function createTimerCallback() { $timers = $this->timerEvents; $this->timerCallback = function ($_, $__, $timer) use ($timers) { call_user_func($timer->getCallback(), $timer); @@ -240,12 +225,11 @@ final class ExtEventLoop implements LoopInterface * to prevent "Cannot destroy active lambda function" fatal error from * the event extension. */ - private function createStreamCallback() - { + private function createStreamCallback() { $read =& $this->readListeners; $write =& $this->writeListeners; $this->streamCallback = function ($stream, $flags) use (&$read, &$write) { - $key = (int) $stream; + $key = (int)$stream; if (Event::READ === (Event::READ & $flags) && isset($read[$key])) { call_user_func($read[$key], $stream); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/ExtLibevLoop.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/ExtLibevLoop.php index d3b0df8..7c2589f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/ExtLibevLoop.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/ExtLibevLoop.php @@ -35,9 +35,8 @@ final class ExtLibevLoop implements LoopInterface private $signals; private $signalEvents = array(); - public function __construct() - { - if (!class_exists('libev\EventLoop', false)) { + public function __construct() { + if (!class_exists('libev\EventLoop', FALSE)) { throw new BadMethodCallException('Cannot create ExtLibevLoop, ext-libev extension missing'); } @@ -47,9 +46,8 @@ final class ExtLibevLoop implements LoopInterface $this->signals = new SignalsHandler(); } - public function addReadStream($stream, $listener) - { - if (isset($this->readEvents[(int) $stream])) { + public function addReadStream($stream, $listener) { + if (isset($this->readEvents[(int)$stream])) { return; } @@ -60,12 +58,11 @@ final class ExtLibevLoop implements LoopInterface $event = new IOEvent($callback, $stream, IOEvent::READ); $this->loop->add($event); - $this->readEvents[(int) $stream] = $event; + $this->readEvents[(int)$stream] = $event; } - public function addWriteStream($stream, $listener) - { - if (isset($this->writeEvents[(int) $stream])) { + public function addWriteStream($stream, $listener) { + if (isset($this->writeEvents[(int)$stream])) { return; } @@ -76,12 +73,11 @@ final class ExtLibevLoop implements LoopInterface $event = new IOEvent($callback, $stream, IOEvent::WRITE); $this->loop->add($event); - $this->writeEvents[(int) $stream] = $event; + $this->writeEvents[(int)$stream] = $event; } - public function removeReadStream($stream) - { - $key = (int) $stream; + public function removeReadStream($stream) { + $key = (int)$stream; if (isset($this->readEvents[$key])) { $this->readEvents[$key]->stop(); @@ -90,9 +86,8 @@ final class ExtLibevLoop implements LoopInterface } } - public function removeWriteStream($stream) - { - $key = (int) $stream; + public function removeWriteStream($stream) { + $key = (int)$stream; if (isset($this->writeEvents[$key])) { $this->writeEvents[$key]->stop(); @@ -101,9 +96,8 @@ final class ExtLibevLoop implements LoopInterface } } - public function addTimer($interval, $callback) - { - $timer = new Timer( $interval, $callback, false); + public function addTimer($interval, $callback) { + $timer = new Timer($interval, $callback, FALSE); $that = $this; $timers = $this->timerEvents; @@ -122,9 +116,8 @@ final class ExtLibevLoop implements LoopInterface return $timer; } - public function addPeriodicTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, true); + public function addPeriodicTimer($interval, $callback) { + $timer = new Timer($interval, $callback, TRUE); $callback = function () use ($timer) { call_user_func($timer->getCallback(), $timer); @@ -137,21 +130,18 @@ final class ExtLibevLoop implements LoopInterface return $timer; } - public function cancelTimer(TimerInterface $timer) - { + public function cancelTimer(TimerInterface $timer) { if (isset($this->timerEvents[$timer])) { $this->loop->remove($this->timerEvents[$timer]); $this->timerEvents->detach($timer); } } - public function futureTick($listener) - { + public function futureTick($listener) { $this->futureTickQueue->add($listener); } - public function addSignal($signal, $listener) - { + public function addSignal($signal, $listener) { $this->signals->add($signal, $listener); if (!isset($this->signalEvents[$signal])) { @@ -163,8 +153,7 @@ final class ExtLibevLoop implements LoopInterface } } - public function removeSignal($signal, $listener) - { + public function removeSignal($signal, $listener) { $this->signals->remove($signal, $listener); if (isset($this->signalEvents[$signal]) && $this->signals->count($signal) === 0) { @@ -174,9 +163,8 @@ final class ExtLibevLoop implements LoopInterface } } - public function run() - { - $this->running = true; + public function run() { + $this->running = TRUE; while ($this->running) { $this->futureTickQueue->tick(); @@ -184,7 +172,7 @@ final class ExtLibevLoop implements LoopInterface $flags = EventLoop::RUN_ONCE; if (!$this->running || !$this->futureTickQueue->isEmpty()) { $flags |= EventLoop::RUN_NOWAIT; - } elseif (!$this->readEvents && !$this->writeEvents && !$this->timerEvents->count() && $this->signals->isEmpty()) { + } else if (!$this->readEvents && !$this->writeEvents && !$this->timerEvents->count() && $this->signals->isEmpty()) { break; } @@ -192,8 +180,7 @@ final class ExtLibevLoop implements LoopInterface } } - public function stop() - { - $this->running = false; + public function stop() { + $this->running = FALSE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/ExtLibeventLoop.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/ExtLibeventLoop.php index 427f8db..21c49de 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/ExtLibeventLoop.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/ExtLibeventLoop.php @@ -51,8 +51,7 @@ final class ExtLibeventLoop implements LoopInterface private $signals; private $signalEvents = array(); - public function __construct() - { + public function __construct() { if (!function_exists('event_base_new')) { throw new BadMethodCallException('Cannot create ExtLibeventLoop, ext-libevent extension missing'); } @@ -66,9 +65,8 @@ final class ExtLibeventLoop implements LoopInterface $this->createStreamCallback(); } - public function addReadStream($stream, $listener) - { - $key = (int) $stream; + public function addReadStream($stream, $listener) { + $key = (int)$stream; if (isset($this->readListeners[$key])) { return; } @@ -82,9 +80,8 @@ final class ExtLibeventLoop implements LoopInterface $this->readListeners[$key] = $listener; } - public function addWriteStream($stream, $listener) - { - $key = (int) $stream; + public function addWriteStream($stream, $listener) { + $key = (int)$stream; if (isset($this->writeListeners[$key])) { return; } @@ -98,9 +95,8 @@ final class ExtLibeventLoop implements LoopInterface $this->writeListeners[$key] = $listener; } - public function removeReadStream($stream) - { - $key = (int) $stream; + public function removeReadStream($stream) { + $key = (int)$stream; if (isset($this->readListeners[$key])) { $event = $this->readEvents[$key]; @@ -114,9 +110,8 @@ final class ExtLibeventLoop implements LoopInterface } } - public function removeWriteStream($stream) - { - $key = (int) $stream; + public function removeWriteStream($stream) { + $key = (int)$stream; if (isset($this->writeListeners[$key])) { $event = $this->writeEvents[$key]; @@ -130,26 +125,23 @@ final class ExtLibeventLoop implements LoopInterface } } - public function addTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, false); + public function addTimer($interval, $callback) { + $timer = new Timer($interval, $callback, FALSE); $this->scheduleTimer($timer); return $timer; } - public function addPeriodicTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, true); + public function addPeriodicTimer($interval, $callback) { + $timer = new Timer($interval, $callback, TRUE); $this->scheduleTimer($timer); return $timer; } - public function cancelTimer(TimerInterface $timer) - { + public function cancelTimer(TimerInterface $timer) { if ($this->timerEvents->contains($timer)) { $event = $this->timerEvents[$timer]; event_del($event); @@ -159,13 +151,11 @@ final class ExtLibeventLoop implements LoopInterface } } - public function futureTick($listener) - { + public function futureTick($listener) { $this->futureTickQueue->add($listener); } - public function addSignal($signal, $listener) - { + public function addSignal($signal, $listener) { $this->signals->add($signal, $listener); if (!isset($this->signalEvents[$signal])) { @@ -176,8 +166,7 @@ final class ExtLibeventLoop implements LoopInterface } } - public function removeSignal($signal, $listener) - { + public function removeSignal($signal, $listener) { $this->signals->remove($signal, $listener); if (isset($this->signalEvents[$signal]) && $this->signals->count($signal) === 0) { @@ -187,9 +176,8 @@ final class ExtLibeventLoop implements LoopInterface } } - public function run() - { - $this->running = true; + public function run() { + $this->running = TRUE; while ($this->running) { $this->futureTickQueue->tick(); @@ -197,7 +185,7 @@ final class ExtLibeventLoop implements LoopInterface $flags = EVLOOP_ONCE; if (!$this->running || !$this->futureTickQueue->isEmpty()) { $flags |= EVLOOP_NONBLOCK; - } elseif (!$this->readEvents && !$this->writeEvents && !$this->timerEvents->count() && $this->signals->isEmpty()) { + } else if (!$this->readEvents && !$this->writeEvents && !$this->timerEvents->count() && $this->signals->isEmpty()) { break; } @@ -205,9 +193,8 @@ final class ExtLibeventLoop implements LoopInterface } } - public function stop() - { - $this->running = false; + public function stop() { + $this->running = FALSE; } /** @@ -215,8 +202,7 @@ final class ExtLibeventLoop implements LoopInterface * * @param TimerInterface $timer */ - private function scheduleTimer(TimerInterface $timer) - { + private function scheduleTimer(TimerInterface $timer) { $this->timerEvents[$timer] = $event = event_timer_new(); event_timer_set($event, $this->timerCallback, $timer); @@ -231,8 +217,7 @@ final class ExtLibeventLoop implements LoopInterface * to prevent "Cannot destroy active lambda function" fatal error from * the event extension. */ - private function createTimerCallback() - { + private function createTimerCallback() { $that = $this; $timers = $this->timerEvents; $this->timerCallback = function ($_, $__, $timer) use ($timers, $that) { @@ -250,7 +235,7 @@ final class ExtLibeventLoop implements LoopInterface $timer->getInterval() * ExtLibeventLoop::MICROSECONDS_PER_SECOND ); - // Clean-up one shot timers ... + // Clean-up one shot timers ... } else { $that->cancelTimer($timer); } @@ -264,12 +249,11 @@ final class ExtLibeventLoop implements LoopInterface * to prevent "Cannot destroy active lambda function" fatal error from * the event extension. */ - private function createStreamCallback() - { + private function createStreamCallback() { $read =& $this->readListeners; $write =& $this->writeListeners; $this->streamCallback = function ($stream, $flags) use (&$read, &$write) { - $key = (int) $stream; + $key = (int)$stream; if (EV_READ === (EV_READ & $flags) && isset($read[$key])) { call_user_func($read[$key], $stream); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/Factory.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/Factory.php index b46fc07..b602248 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/Factory.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/Factory.php @@ -21,16 +21,15 @@ final class Factory * * @return LoopInterface */ - public static function create() - { + public static function create() { // @codeCoverageIgnoreStart - if (class_exists('libev\EventLoop', false)) { + if (class_exists('libev\EventLoop', FALSE)) { return new ExtLibevLoop(); - } elseif (class_exists('EvLoop', false)) { + } else if (class_exists('EvLoop', FALSE)) { return new ExtEvLoop(); - } elseif (class_exists('EventBase', false)) { + } else if (class_exists('EventBase', FALSE)) { return new ExtEventLoop(); - } elseif (function_exists('event_base_new') && PHP_VERSION_ID < 70000) { + } else if (function_exists('event_base_new') && PHP_VERSION_ID < 70000) { // only use ext-libevent on PHP < 7 for now return new ExtLibeventLoop(); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/LoopInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/LoopInterface.php index 1cc8640..108301a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/LoopInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/LoopInterface.php @@ -46,7 +46,7 @@ interface LoopInterface * The execution order of listeners when multiple streams become ready at * the same time is not guaranteed. * - * @param resource $stream The PHP stream resource to check. + * @param resource $stream The PHP stream resource to check. * @param callable $listener Invoked when the stream is ready. * @throws \Exception if the given resource type is not supported by this loop implementation * @see self::removeReadStream() @@ -103,7 +103,7 @@ interface LoopInterface * As such, it's recommended to use `stream_set_read_buffer($stream, 0);` * to disable PHP's internal read buffer in this case. * - * @param resource $stream The PHP stream resource to check. + * @param resource $stream The PHP stream resource to check. * @param callable $listener Invoked when the stream is ready. * @throws \Exception if the given resource type is not supported by this loop implementation * @see self::removeWriteStream() @@ -195,7 +195,7 @@ interface LoopInterface * See also [event loop implementations](#loop-implementations) for more details. * * @param int|float $interval The number of seconds to wait before execution. - * @param callable $callback The callback to invoke. + * @param callable $callback The callback to invoke. * * @return TimerInterface */ @@ -278,7 +278,7 @@ interface LoopInterface * accuracy or below. * * @param int|float $interval The number of seconds to wait before execution. - * @param callable $callback The callback to invoke. + * @param callable $callback The callback to invoke. * * @return TimerInterface */ diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/SignalsHandler.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/SignalsHandler.php index 523e1ca..b153c17 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/SignalsHandler.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/SignalsHandler.php @@ -9,8 +9,7 @@ final class SignalsHandler { private $signals = array(); - public function add($signal, $listener) - { + public function add($signal, $listener) { if (!isset($this->signals[$signal])) { $this->signals[$signal] = array(); } @@ -22,13 +21,12 @@ final class SignalsHandler $this->signals[$signal][] = $listener; } - public function remove($signal, $listener) - { + public function remove($signal, $listener) { if (!isset($this->signals[$signal])) { return; } - $index = \array_search($listener, $this->signals[$signal], true); + $index = \array_search($listener, $this->signals[$signal], TRUE); unset($this->signals[$signal][$index]); if (isset($this->signals[$signal]) && \count($this->signals[$signal]) === 0) { @@ -36,8 +34,7 @@ final class SignalsHandler } } - public function call($signal) - { + public function call($signal) { if (!isset($this->signals[$signal])) { return; } @@ -47,8 +44,7 @@ final class SignalsHandler } } - public function count($signal) - { + public function count($signal) { if (!isset($this->signals[$signal])) { return 0; } @@ -56,8 +52,7 @@ final class SignalsHandler return \count($this->signals[$signal]); } - public function isEmpty() - { + public function isEmpty() { return !$this->signals; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/StreamSelectLoop.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/StreamSelectLoop.php index e82e9e4..17d1304 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/StreamSelectLoop.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/StreamSelectLoop.php @@ -61,20 +61,18 @@ final class StreamSelectLoop implements LoopInterface private $writeStreams = array(); private $writeListeners = array(); private $running; - private $pcntl = false; + private $pcntl = FALSE; private $signals; - public function __construct() - { + public function __construct() { $this->futureTickQueue = new FutureTickQueue(); $this->timers = new Timers(); $this->pcntl = extension_loaded('pcntl'); $this->signals = new SignalsHandler(); } - public function addReadStream($stream, $listener) - { - $key = (int) $stream; + public function addReadStream($stream, $listener) { + $key = (int)$stream; if (!isset($this->readStreams[$key])) { $this->readStreams[$key] = $stream; @@ -82,9 +80,8 @@ final class StreamSelectLoop implements LoopInterface } } - public function addWriteStream($stream, $listener) - { - $key = (int) $stream; + public function addWriteStream($stream, $listener) { + $key = (int)$stream; if (!isset($this->writeStreams[$key])) { $this->writeStreams[$key] = $stream; @@ -92,9 +89,8 @@ final class StreamSelectLoop implements LoopInterface } } - public function removeReadStream($stream) - { - $key = (int) $stream; + public function removeReadStream($stream) { + $key = (int)$stream; unset( $this->readStreams[$key], @@ -102,9 +98,8 @@ final class StreamSelectLoop implements LoopInterface ); } - public function removeWriteStream($stream) - { - $key = (int) $stream; + public function removeWriteStream($stream) { + $key = (int)$stream; unset( $this->writeStreams[$key], @@ -112,37 +107,32 @@ final class StreamSelectLoop implements LoopInterface ); } - public function addTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, false); + public function addTimer($interval, $callback) { + $timer = new Timer($interval, $callback, FALSE); $this->timers->add($timer); return $timer; } - public function addPeriodicTimer($interval, $callback) - { - $timer = new Timer($interval, $callback, true); + public function addPeriodicTimer($interval, $callback) { + $timer = new Timer($interval, $callback, TRUE); $this->timers->add($timer); return $timer; } - public function cancelTimer(TimerInterface $timer) - { + public function cancelTimer(TimerInterface $timer) { $this->timers->cancel($timer); } - public function futureTick($listener) - { + public function futureTick($listener) { $this->futureTickQueue->add($listener); } - public function addSignal($signal, $listener) - { - if ($this->pcntl === false) { + public function addSignal($signal, $listener) { + if ($this->pcntl === FALSE) { throw new \BadMethodCallException('Event loop feature "signals" isn\'t supported by the "StreamSelectLoop"'); } @@ -154,8 +144,7 @@ final class StreamSelectLoop implements LoopInterface } } - public function removeSignal($signal, $listener) - { + public function removeSignal($signal, $listener) { if (!$this->signals->count($signal)) { return; } @@ -167,9 +156,8 @@ final class StreamSelectLoop implements LoopInterface } } - public function run() - { - $this->running = true; + public function run() { + $this->running = TRUE; while ($this->running) { $this->futureTickQueue->tick(); @@ -180,8 +168,8 @@ final class StreamSelectLoop implements LoopInterface if (!$this->running || !$this->futureTickQueue->isEmpty()) { $timeout = 0; - // There is a pending timer, only block until it is due ... - } elseif ($scheduledAt = $this->timers->getFirst()) { + // There is a pending timer, only block until it is due ... + } else if ($scheduledAt = $this->timers->getFirst()) { $timeout = $scheduledAt - $this->timers->getTime(); if ($timeout < 0) { $timeout = 0; @@ -193,11 +181,11 @@ final class StreamSelectLoop implements LoopInterface $timeout = $timeout > PHP_INT_MAX ? PHP_INT_MAX : (int)$timeout; } - // The only possible event is stream or signal activity, so wait forever ... - } elseif ($this->readStreams || $this->writeStreams || !$this->signals->isEmpty()) { - $timeout = null; + // The only possible event is stream or signal activity, so wait forever ... + } else if ($this->readStreams || $this->writeStreams || !$this->signals->isEmpty()) { + $timeout = NULL; - // There's nothing left to do ... + // There's nothing left to do ... } else { break; } @@ -206,9 +194,8 @@ final class StreamSelectLoop implements LoopInterface } } - public function stop() - { - $this->running = false; + public function stop() { + $this->running = FALSE; } /** @@ -216,23 +203,22 @@ final class StreamSelectLoop implements LoopInterface * * @param integer|null $timeout Activity timeout in microseconds, or null to wait forever. */ - private function waitForStreamActivity($timeout) - { - $read = $this->readStreams; + private function waitForStreamActivity($timeout) { + $read = $this->readStreams; $write = $this->writeStreams; $available = $this->streamSelect($read, $write, $timeout); if ($this->pcntl) { \pcntl_signal_dispatch(); } - if (false === $available) { + if (FALSE === $available) { // if a system call has been interrupted, // we cannot rely on it's outcome return; } foreach ($read as $stream) { - $key = (int) $stream; + $key = (int)$stream; if (isset($this->readListeners[$key])) { call_user_func($this->readListeners[$key], $stream); @@ -240,7 +226,7 @@ final class StreamSelectLoop implements LoopInterface } foreach ($write as $stream) { - $key = (int) $stream; + $key = (int)$stream; if (isset($this->writeListeners[$key])) { call_user_func($this->writeListeners[$key], $stream); @@ -252,20 +238,19 @@ final class StreamSelectLoop implements LoopInterface * Emulate a stream_select() implementation that does not break when passed * empty stream arrays. * - * @param array &$read An array of read streams to select upon. - * @param array &$write An array of write streams to select upon. + * @param array &$read An array of read streams to select upon. + * @param array &$write An array of write streams to select upon. * @param integer|null $timeout Activity timeout in microseconds, or null to wait forever. * * @return integer|false The total number of streams that are ready for read/write. * Can return false if stream_select() is interrupted by a signal. */ - private function streamSelect(array &$read, array &$write, $timeout) - { + private function streamSelect(array &$read, array &$write, $timeout) { if ($read || $write) { - $except = null; + $except = NULL; // suppress warnings that occur, when stream_select is interrupted by a signal - return @stream_select($read, $write, $except, $timeout === null ? null : 0, $timeout); + return @stream_select($read, $write, $except, $timeout === NULL ? NULL : 0, $timeout); } $timeout && usleep($timeout); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/Tick/FutureTickQueue.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/Tick/FutureTickQueue.php index c79afc5..2644609 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/Tick/FutureTickQueue.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/Tick/FutureTickQueue.php @@ -16,8 +16,7 @@ final class FutureTickQueue { private $queue; - public function __construct() - { + public function __construct() { $this->queue = new SplQueue(); } @@ -28,16 +27,14 @@ final class FutureTickQueue * * @param callable $listener The callback to invoke. */ - public function add($listener) - { + public function add($listener) { $this->queue->enqueue($listener); } /** * Flush the callback queue. */ - public function tick() - { + public function tick() { // Only invoke as many callbacks as were on the queue when tick() was called. $count = $this->queue->count(); @@ -53,8 +50,7 @@ final class FutureTickQueue * * @return boolean */ - public function isEmpty() - { + public function isEmpty() { return $this->queue->isEmpty(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/Timer/Timer.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/Timer/Timer.php index da3602a..19294c6 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/Timer/Timer.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/Timer/Timer.php @@ -23,33 +23,29 @@ final class Timer implements TimerInterface /** * Constructor initializes the fields of the Timer * - * @param float $interval The interval after which this timer will execute, in seconds - * @param callable $callback The callback that will be executed when this timer elapses - * @param bool $periodic Whether the time is periodic + * @param float $interval The interval after which this timer will execute, in seconds + * @param callable $callback The callback that will be executed when this timer elapses + * @param bool $periodic Whether the time is periodic */ - public function __construct($interval, $callback, $periodic = false) - { + public function __construct($interval, $callback, $periodic = FALSE) { if ($interval < self::MIN_INTERVAL) { $interval = self::MIN_INTERVAL; } - $this->interval = (float) $interval; + $this->interval = (float)$interval; $this->callback = $callback; - $this->periodic = (bool) $periodic; + $this->periodic = (bool)$periodic; } - public function getInterval() - { + public function getInterval() { return $this->interval; } - public function getCallback() - { + public function getCallback() { return $this->callback; } - public function isPeriodic() - { + public function isPeriodic() { return $this->periodic; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/Timer/Timers.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/Timer/Timers.php index 17bbdac..95af896 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/Timer/Timers.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/src/Timer/Timers.php @@ -20,43 +20,36 @@ final class Timers private $timers; private $scheduler; - public function __construct() - { + public function __construct() { $this->timers = new SplObjectStorage(); $this->scheduler = new SplPriorityQueue(); } - public function updateTime() - { - return $this->time = microtime(true); + public function updateTime() { + return $this->time = microtime(TRUE); } - public function getTime() - { + public function getTime() { return $this->time ?: $this->updateTime(); } - public function add(TimerInterface $timer) - { + public function add(TimerInterface $timer) { $interval = $timer->getInterval(); - $scheduledAt = $interval + microtime(true); + $scheduledAt = $interval + microtime(TRUE); $this->timers->attach($timer, $scheduledAt); $this->scheduler->insert($timer, -$scheduledAt); } - public function contains(TimerInterface $timer) - { + public function contains(TimerInterface $timer) { return $this->timers->contains($timer); } - public function cancel(TimerInterface $timer) - { + public function cancel(TimerInterface $timer) { $this->timers->detach($timer); } - public function getFirst() - { + public function getFirst() { while ($this->scheduler->count()) { $timer = $this->scheduler->top(); @@ -67,16 +60,14 @@ final class Timers $this->scheduler->extract(); } - return null; + return NULL; } - public function isEmpty() - { + public function isEmpty() { return count($this->timers) === 0; } - public function tick() - { + public function tick() { $time = $this->updateTime(); $timers = $this->timers; $scheduler = $this->scheduler; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/AbstractLoopTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/AbstractLoopTest.php index dbfc91e..9b67b82 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/AbstractLoopTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/AbstractLoopTest.php @@ -13,8 +13,7 @@ abstract class AbstractLoopTest extends TestCase const PHP_DEFAULT_CHUNK_SIZE = 8192; - public function setUp() - { + public function setUp() { // It's a timeout, don't set it too low. Travis and other CI systems are slow. $this->tickTimeout = 0.02; $this->loop = $this->createLoop(); @@ -22,8 +21,7 @@ abstract class AbstractLoopTest extends TestCase abstract public function createLoop(); - public function createSocketPair() - { + public function createSocketPair() { $domain = (DIRECTORY_SEPARATOR === '\\') ? STREAM_PF_INET : STREAM_PF_UNIX; $sockets = stream_socket_pair($domain, STREAM_SOCK_STREAM, STREAM_IPPROTO_IP); @@ -36,8 +34,7 @@ abstract class AbstractLoopTest extends TestCase return $sockets; } - public function testAddReadStream() - { + public function testAddReadStream() { list ($input, $output) = $this->createSocketPair(); $this->loop->addReadStream($input, $this->expectCallableExactly(2)); @@ -49,8 +46,7 @@ abstract class AbstractLoopTest extends TestCase $this->tickLoop($this->loop); } - public function testAddReadStreamIgnoresSecondCallable() - { + public function testAddReadStreamIgnoresSecondCallable() { list ($input, $output) = $this->createSocketPair(); $this->loop->addReadStream($input, $this->expectCallableExactly(2)); @@ -63,8 +59,7 @@ abstract class AbstractLoopTest extends TestCase $this->tickLoop($this->loop); } - public function testAddReadStreamReceivesDataFromStreamReference() - { + public function testAddReadStreamReceivesDataFromStreamReference() { $this->received = ''; $this->subAddReadStreamReceivesDataFromStreamReference(); $this->assertEquals('', $this->received); @@ -77,8 +72,7 @@ abstract class AbstractLoopTest extends TestCase * Helper for above test. This happens in another helper method to verify * the loop keeps track of assigned stream resources (refcount). */ - private function subAddReadStreamReceivesDataFromStreamReference() - { + private function subAddReadStreamReceivesDataFromStreamReference() { list ($input, $output) = $this->createSocketPair(); fwrite($input, 'hello'); @@ -98,8 +92,7 @@ abstract class AbstractLoopTest extends TestCase }); } - public function testAddWriteStream() - { + public function testAddWriteStream() { list ($input) = $this->createSocketPair(); $this->loop->addWriteStream($input, $this->expectCallableExactly(2)); @@ -107,8 +100,7 @@ abstract class AbstractLoopTest extends TestCase $this->tickLoop($this->loop); } - public function testAddWriteStreamIgnoresSecondCallable() - { + public function testAddWriteStreamIgnoresSecondCallable() { list ($input) = $this->createSocketPair(); $this->loop->addWriteStream($input, $this->expectCallableExactly(2)); @@ -117,8 +109,7 @@ abstract class AbstractLoopTest extends TestCase $this->tickLoop($this->loop); } - public function testRemoveReadStreamInstantly() - { + public function testRemoveReadStreamInstantly() { list ($input, $output) = $this->createSocketPair(); $this->loop->addReadStream($input, $this->expectCallableNever()); @@ -128,8 +119,7 @@ abstract class AbstractLoopTest extends TestCase $this->tickLoop($this->loop); } - public function testRemoveReadStreamAfterReading() - { + public function testRemoveReadStreamAfterReading() { list ($input, $output) = $this->createSocketPair(); $this->loop->addReadStream($input, $this->expectCallableOnce()); @@ -143,8 +133,7 @@ abstract class AbstractLoopTest extends TestCase $this->tickLoop($this->loop); } - public function testRemoveWriteStreamInstantly() - { + public function testRemoveWriteStreamInstantly() { list ($input) = $this->createSocketPair(); $this->loop->addWriteStream($input, $this->expectCallableNever()); @@ -152,8 +141,7 @@ abstract class AbstractLoopTest extends TestCase $this->tickLoop($this->loop); } - public function testRemoveWriteStreamAfterWriting() - { + public function testRemoveWriteStreamAfterWriting() { list ($input) = $this->createSocketPair(); $this->loop->addWriteStream($input, $this->expectCallableOnce()); @@ -163,8 +151,7 @@ abstract class AbstractLoopTest extends TestCase $this->tickLoop($this->loop); } - public function testRemoveStreamForReadOnly() - { + public function testRemoveStreamForReadOnly() { list ($input, $output) = $this->createSocketPair(); $this->loop->addReadStream($input, $this->expectCallableNever()); @@ -175,8 +162,7 @@ abstract class AbstractLoopTest extends TestCase $this->tickLoop($this->loop); } - public function testRemoveStreamForWriteOnly() - { + public function testRemoveStreamForWriteOnly() { list ($input, $output) = $this->createSocketPair(); fwrite($output, "foo\n"); @@ -188,14 +174,14 @@ abstract class AbstractLoopTest extends TestCase $this->tickLoop($this->loop); } - public function testRemoveReadAndWriteStreamFromLoopOnceResourceClosesEndsLoop() - { + public function testRemoveReadAndWriteStreamFromLoopOnceResourceClosesEndsLoop() { list($stream, $other) = $this->createSocketPair(); - stream_set_blocking($stream, false); - stream_set_blocking($other, false); + stream_set_blocking($stream, FALSE); + stream_set_blocking($other, FALSE); // dummy writable handler - $this->loop->addWriteStream($stream, function () { }); + $this->loop->addWriteStream($stream, function () { + }); // remove stream when the stream is readable (closes) $loop = $this->loop; @@ -211,14 +197,14 @@ abstract class AbstractLoopTest extends TestCase $this->assertRunFasterThan($this->tickTimeout); } - public function testRemoveReadAndWriteStreamFromLoopOnceResourceClosesOnEndOfFileEndsLoop() - { + public function testRemoveReadAndWriteStreamFromLoopOnceResourceClosesOnEndOfFileEndsLoop() { list($stream, $other) = $this->createSocketPair(); - stream_set_blocking($stream, false); - stream_set_blocking($other, false); + stream_set_blocking($stream, FALSE); + stream_set_blocking($other, FALSE); // dummy writable handler - $this->loop->addWriteStream($stream, function () { }); + $this->loop->addWriteStream($stream, function () { + }); // remove stream when the stream is readable (closes) $loop = $this->loop; @@ -242,14 +228,14 @@ abstract class AbstractLoopTest extends TestCase $this->assertRunFasterThan(0.1); } - public function testRemoveReadAndWriteStreamFromLoopWithClosingResourceEndsLoop() - { + public function testRemoveReadAndWriteStreamFromLoopWithClosingResourceEndsLoop() { // get only one part of the pair to ensure the other side will close immediately list($stream) = $this->createSocketPair(); - stream_set_blocking($stream, false); + stream_set_blocking($stream, FALSE); // dummy writable handler - $this->loop->addWriteStream($stream, function () { }); + $this->loop->addWriteStream($stream, function () { + }); // remove stream when the stream is readable (closes) $loop = $this->loop; @@ -262,26 +248,23 @@ abstract class AbstractLoopTest extends TestCase $this->assertRunFasterThan($this->tickTimeout); } - public function testRemoveInvalid() - { + public function testRemoveInvalid() { list ($stream) = $this->createSocketPair(); // remove a valid stream from the event loop that was never added in the first place $this->loop->removeReadStream($stream); $this->loop->removeWriteStream($stream); - $this->assertTrue(true); + $this->assertTrue(TRUE); } /** @test */ - public function emptyRunShouldSimplyReturn() - { + public function emptyRunShouldSimplyReturn() { $this->assertRunFasterThan($this->tickTimeout); } /** @test */ - public function runShouldReturnWhenNoMoreFds() - { + public function runShouldReturnWhenNoMoreFds() { list ($input, $output) = $this->createSocketPair(); $loop = $this->loop; @@ -295,8 +278,7 @@ abstract class AbstractLoopTest extends TestCase } /** @test */ - public function stopShouldStopRunningLoop() - { + public function stopShouldStopRunningLoop() { list ($input, $output) = $this->createSocketPair(); $loop = $this->loop; @@ -309,8 +291,7 @@ abstract class AbstractLoopTest extends TestCase $this->assertRunFasterThan($this->tickTimeout * 2); } - public function testStopShouldPreventRunFromBlocking() - { + public function testStopShouldPreventRunFromBlocking() { $that = $this; $this->loop->addTimer( 1, @@ -329,13 +310,12 @@ abstract class AbstractLoopTest extends TestCase $this->assertRunFasterThan($this->tickTimeout * 2); } - public function testIgnoreRemovedCallback() - { + public function testIgnoreRemovedCallback() { // two independent streams, both should be readable right away list ($input1, $output1) = $this->createSocketPair(); list ($input2, $output2) = $this->createSocketPair(); - $called = false; + $called = FALSE; $loop = $this->loop; $loop->addReadStream($input1, function ($stream) use (& $called, $loop, $input2) { @@ -343,7 +323,7 @@ abstract class AbstractLoopTest extends TestCase $loop->removeReadStream($stream); $loop->removeReadStream($input2); - $called = true; + $called = TRUE; }); // this callback would have to be called as well, but the first stream already removed us @@ -362,8 +342,7 @@ abstract class AbstractLoopTest extends TestCase $this->assertTrue($called); } - public function testFutureTickEventGeneratedByFutureTick() - { + public function testFutureTickEventGeneratedByFutureTick() { $loop = $this->loop; $this->loop->futureTick( function () use ($loop) { @@ -380,12 +359,11 @@ abstract class AbstractLoopTest extends TestCase $this->loop->run(); } - public function testFutureTick() - { - $called = false; + public function testFutureTick() { + $called = FALSE; $callback = function () use (&$called) { - $called = true; + $called = TRUE; }; $this->loop->futureTick($callback); @@ -397,8 +375,7 @@ abstract class AbstractLoopTest extends TestCase $this->assertTrue($called); } - public function testFutureTickFiresBeforeIO() - { + public function testFutureTickFiresBeforeIO() { list ($stream) = $this->createSocketPair(); $this->loop->addWriteStream( @@ -419,8 +396,7 @@ abstract class AbstractLoopTest extends TestCase $this->tickLoop($this->loop); } - public function testRecursiveFutureTick() - { + public function testRecursiveFutureTick() { list ($stream) = $this->createSocketPair(); $loop = $this->loop; @@ -448,8 +424,7 @@ abstract class AbstractLoopTest extends TestCase $this->loop->run(); } - public function testRunWaitsForFutureTickEvents() - { + public function testRunWaitsForFutureTickEvents() { list ($stream) = $this->createSocketPair(); $loop = $this->loop; @@ -470,8 +445,7 @@ abstract class AbstractLoopTest extends TestCase $this->loop->run(); } - public function testFutureTickEventGeneratedByTimer() - { + public function testFutureTickEventGeneratedByTimer() { $loop = $this->loop; $this->loop->addTimer( 0.001, @@ -489,30 +463,30 @@ abstract class AbstractLoopTest extends TestCase $this->loop->run(); } - public function testRemoveSignalNotRegisteredIsNoOp() - { - $this->loop->removeSignal(SIGINT, function () { }); - $this->assertTrue(true); + public function testRemoveSignalNotRegisteredIsNoOp() { + $this->loop->removeSignal(SIGINT, function () { + }); + $this->assertTrue(TRUE); } - public function testSignal() - { + public function testSignal() { if (!function_exists('posix_kill') || !function_exists('posix_getpid')) { $this->markTestSkipped('Signal test skipped because functions "posix_kill" and "posix_getpid" are missing.'); } - $called = false; - $calledShouldNot = true; + $called = FALSE; + $calledShouldNot = TRUE; - $timer = $this->loop->addPeriodicTimer(1, function () {}); + $timer = $this->loop->addPeriodicTimer(1, function () { + }); $this->loop->addSignal(SIGUSR2, $func2 = function () use (&$calledShouldNot) { - $calledShouldNot = false; + $calledShouldNot = FALSE; }); $loop = $this->loop; $this->loop->addSignal(SIGUSR1, $func1 = function () use (&$func1, &$func2, &$called, $timer, $loop) { - $called = true; + $called = TRUE; $loop->removeSignal(SIGUSR1, $func1); $loop->removeSignal(SIGUSR2, $func2); $loop->cancelTimer($timer); @@ -528,13 +502,13 @@ abstract class AbstractLoopTest extends TestCase $this->assertTrue($calledShouldNot); } - public function testSignalMultipleUsagesForTheSameListener() - { + public function testSignalMultipleUsagesForTheSameListener() { $funcCallCount = 0; $func = function () use (&$funcCallCount) { $funcCallCount++; }; - $this->loop->addTimer(1, function () {}); + $this->loop->addTimer(1, function () { + }); $this->loop->addSignal(SIGUSR1, $func); $this->loop->addSignal(SIGUSR1, $func); @@ -552,10 +526,10 @@ abstract class AbstractLoopTest extends TestCase $this->assertSame(1, $funcCallCount); } - public function testSignalsKeepTheLoopRunning() - { + public function testSignalsKeepTheLoopRunning() { $loop = $this->loop; - $function = function () {}; + $function = function () { + }; $this->loop->addSignal(SIGUSR1, $function); $this->loop->addTimer(1.5, function () use ($function, $loop) { $loop->removeSignal(SIGUSR1, $function); @@ -565,10 +539,10 @@ abstract class AbstractLoopTest extends TestCase $this->assertRunSlowerThan(1.5); } - public function testSignalsKeepTheLoopRunningAndRemovingItStopsTheLoop() - { + public function testSignalsKeepTheLoopRunningAndRemovingItStopsTheLoop() { $loop = $this->loop; - $function = function () {}; + $function = function () { + }; $this->loop->addSignal(SIGUSR1, $function); $this->loop->addTimer(1.5, function () use ($function, $loop) { $loop->removeSignal(SIGUSR1, $function); @@ -577,13 +551,13 @@ abstract class AbstractLoopTest extends TestCase $this->assertRunFasterThan(1.6); } - public function testTimerIntervalCanBeFarInFuture() - { + public function testTimerIntervalCanBeFarInFuture() { // get only one part of the pair to ensure the other side will close immediately list($stream) = $this->createSocketPair(); // start a timer very far in the future - $timer = $this->loop->addTimer(PHP_INT_MAX, function () { }); + $timer = $this->loop->addTimer(PHP_INT_MAX, function () { + }); // remove stream and timer when the stream is readable (closes) $loop = $this->loop; @@ -595,25 +569,23 @@ abstract class AbstractLoopTest extends TestCase $this->assertRunFasterThan($this->tickTimeout); } - private function assertRunSlowerThan($minInterval) - { - $start = microtime(true); + private function assertRunSlowerThan($minInterval) { + $start = microtime(TRUE); $this->loop->run(); - $end = microtime(true); + $end = microtime(TRUE); $interval = $end - $start; $this->assertLessThan($interval, $minInterval); } - private function assertRunFasterThan($maxInterval) - { - $start = microtime(true); + private function assertRunFasterThan($maxInterval) { + $start = microtime(TRUE); $this->loop->run(); - $end = microtime(true); + $end = microtime(TRUE); $interval = $end - $start; $this->assertLessThan($maxInterval, $interval); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/CallableStub.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/CallableStub.php index 913d403..2d22b09 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/CallableStub.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/CallableStub.php @@ -4,7 +4,6 @@ namespace React\Tests\EventLoop; class CallableStub { - public function __invoke() - { + public function __invoke() { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/ExtEvLoopTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/ExtEvLoopTest.php index ab41c9f..d85afe3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/ExtEvLoopTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/ExtEvLoopTest.php @@ -6,8 +6,7 @@ use React\EventLoop\ExtEvLoop; class ExtEvLoopTest extends AbstractLoopTest { - public function createLoop() - { + public function createLoop() { if (!class_exists('EvLoop')) { $this->markTestSkipped('ExtEvLoop tests skipped because ext-ev extension is not installed.'); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/ExtEventLoopTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/ExtEventLoopTest.php index 2f88d18..86320b9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/ExtEventLoopTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/ExtEventLoopTest.php @@ -6,8 +6,7 @@ use React\EventLoop\ExtEventLoop; class ExtEventLoopTest extends AbstractLoopTest { - public function createLoop($readStreamCompatible = false) - { + public function createLoop($readStreamCompatible = FALSE) { if ('Linux' === PHP_OS && !extension_loaded('posix')) { $this->markTestSkipped('libevent tests skipped on linux due to linux epoll issues.'); } @@ -19,8 +18,7 @@ class ExtEventLoopTest extends AbstractLoopTest return new ExtEventLoop(); } - public function createStream() - { + public function createStream() { // Use a FIFO on linux to get around lack of support for disk-based file // descriptors when using the EPOLL back-end. if ('Linux' === PHP_OS) { @@ -32,12 +30,12 @@ class ExtEventLoopTest extends AbstractLoopTest $stream = fopen($this->fifoPath, 'r+'); - // ext-event (as of 1.8.1) does not yet support in-memory temporary - // streams. Setting maxmemory:0 and performing a write forces PHP to - // back this temporary stream with a real file. - // - // This problem is mentioned at https://bugs.php.net/bug.php?id=64652&edit=3 - // but remains unresolved (despite that issue being closed). + // ext-event (as of 1.8.1) does not yet support in-memory temporary + // streams. Setting maxmemory:0 and performing a write forces PHP to + // back this temporary stream with a real file. + // + // This problem is mentioned at https://bugs.php.net/bug.php?id=64652&edit=3 + // but remains unresolved (despite that issue being closed). } else { $stream = fopen('php://temp/maxmemory:0', 'r+'); @@ -48,8 +46,7 @@ class ExtEventLoopTest extends AbstractLoopTest return $stream; } - public function writeToStream($stream, $content) - { + public function writeToStream($stream, $content) { if ('Linux' !== PHP_OS) { return parent::writeToStream($stream, $content); } @@ -60,13 +57,12 @@ class ExtEventLoopTest extends AbstractLoopTest /** * @group epoll-readable-error */ - public function testCanUseReadableStreamWithFeatureFds() - { + public function testCanUseReadableStreamWithFeatureFds() { if (PHP_VERSION_ID > 70000) { $this->markTestSkipped('Memory stream not supported'); } - $this->loop = $this->createLoop(true); + $this->loop = $this->createLoop(TRUE); $input = fopen('php://temp/maxmemory:0', 'r+'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/ExtLibevLoopTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/ExtLibevLoopTest.php index 19a5e87..249535f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/ExtLibevLoopTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/ExtLibevLoopTest.php @@ -6,8 +6,7 @@ use React\EventLoop\ExtLibevLoop; class ExtLibevLoopTest extends AbstractLoopTest { - public function createLoop() - { + public function createLoop() { if (!class_exists('libev\EventLoop')) { $this->markTestSkipped('libev tests skipped because ext-libev is not installed.'); } @@ -15,8 +14,7 @@ class ExtLibevLoopTest extends AbstractLoopTest return new ExtLibevLoop(); } - public function testLibEvConstructor() - { + public function testLibEvConstructor() { $loop = new ExtLibevLoop(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/ExtLibeventLoopTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/ExtLibeventLoopTest.php index 8497065..82015f4 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/ExtLibeventLoopTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/ExtLibeventLoopTest.php @@ -8,8 +8,7 @@ class ExtLibeventLoopTest extends AbstractLoopTest { private $fifoPath; - public function createLoop() - { + public function createLoop() { if ('Linux' === PHP_OS && !extension_loaded('posix')) { $this->markTestSkipped('libevent tests skipped on linux due to linux epoll issues.'); } @@ -21,15 +20,13 @@ class ExtLibeventLoopTest extends AbstractLoopTest return new ExtLibeventLoop(); } - public function tearDown() - { + public function tearDown() { if (file_exists($this->fifoPath)) { unlink($this->fifoPath); } } - public function createStream() - { + public function createStream() { if ('Linux' !== PHP_OS) { return parent::createStream(); } @@ -47,8 +44,7 @@ class ExtLibeventLoopTest extends AbstractLoopTest return $stream; } - public function writeToStream($stream, $content) - { + public function writeToStream($stream, $content) { if ('Linux' !== PHP_OS) { return parent::writeToStream($stream, $content); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/SignalsHandlerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/SignalsHandlerTest.php index f8b7df3..22f1288 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/SignalsHandlerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/SignalsHandlerTest.php @@ -6,8 +6,7 @@ use React\EventLoop\SignalsHandler; final class SignalsHandlerTest extends TestCase { - public function testEmittedEventsAndCallHandling() - { + public function testEmittedEventsAndCallHandling() { $callCount = 0; $func = function () use (&$callCount) { $callCount++; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/StreamSelectLoopTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/StreamSelectLoopTest.php index bd19e1c..36ce93e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/StreamSelectLoopTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/StreamSelectLoopTest.php @@ -7,38 +7,34 @@ use React\EventLoop\StreamSelectLoop; class StreamSelectLoopTest extends AbstractLoopTest { - protected function tearDown() - { + protected function tearDown() { parent::tearDown(); - if (strncmp($this->getName(false), 'testSignal', 10) === 0 && extension_loaded('pcntl')) { + if (strncmp($this->getName(FALSE), 'testSignal', 10) === 0 && extension_loaded('pcntl')) { $this->resetSignalHandlers(); } } - public function createLoop() - { + public function createLoop() { return new StreamSelectLoop(); } - public function testStreamSelectTimeoutEmulation() - { + public function testStreamSelectTimeoutEmulation() { $this->loop->addTimer( 0.05, $this->expectCallableOnce() ); - $start = microtime(true); + $start = microtime(TRUE); $this->loop->run(); - $end = microtime(true); + $end = microtime(TRUE); $interval = $end - $start; $this->assertGreaterThan(0.04, $interval); } - public function signalProvider() - { + public function signalProvider() { return array( array('SIGUSR1'), array('SIGHUP'), @@ -50,14 +46,13 @@ class StreamSelectLoopTest extends AbstractLoopTest * Test signal interrupt when no stream is attached to the loop * @dataProvider signalProvider */ - public function testSignalInterruptNoStream($signal) - { + public function testSignalInterruptNoStream($signal) { if (!extension_loaded('pcntl')) { $this->markTestSkipped('"pcntl" extension is required to run this test.'); } // dispatch signal handler every 10ms for 0.1s - $check = $this->loop->addPeriodicTimer(0.01, function() { + $check = $this->loop->addPeriodicTimer(0.01, function () { pcntl_signal_dispatch(); }); $loop = $this->loop; @@ -65,9 +60,9 @@ class StreamSelectLoopTest extends AbstractLoopTest $loop->cancelTimer($check); }); - $handled = false; + $handled = FALSE; $this->assertTrue(pcntl_signal(constant($signal), function () use (&$handled) { - $handled = true; + $handled = TRUE; })); // spawn external process to send signal to current process id @@ -81,14 +76,13 @@ class StreamSelectLoopTest extends AbstractLoopTest * Test signal interrupt when a stream is attached to the loop * @dataProvider signalProvider */ - public function testSignalInterruptWithStream($signal) - { + public function testSignalInterruptWithStream($signal) { if (!extension_loaded('pcntl')) { $this->markTestSkipped('"pcntl" extension is required to run this test.'); } // dispatch signal handler every 10ms - $this->loop->addPeriodicTimer(0.01, function() { + $this->loop->addPeriodicTimer(0.01, function () { pcntl_signal_dispatch(); }); @@ -102,13 +96,13 @@ class StreamSelectLoopTest extends AbstractLoopTest $loop->stop(); } }); - $this->loop->addTimer(0.1, function() use ($writeStream) { + $this->loop->addTimer(0.1, function () use ($writeStream) { fwrite($writeStream, "end loop\n"); }); - $handled = false; + $handled = FALSE; $this->assertTrue(pcntl_signal(constant($signal), function () use (&$handled) { - $handled = true; + $handled = TRUE; })); // spawn external process to send signal to current process id @@ -122,9 +116,8 @@ class StreamSelectLoopTest extends AbstractLoopTest /** * reset all signal handlers to default */ - protected function resetSignalHandlers() - { - foreach($this->signalProvider() as $signal) { + protected function resetSignalHandlers() { + foreach ($this->signalProvider() as $signal) { pcntl_signal(constant($signal[0]), SIG_DFL); } } @@ -132,8 +125,7 @@ class StreamSelectLoopTest extends AbstractLoopTest /** * fork child process to send signal to current process id */ - protected function forkSendSignal($signal) - { + protected function forkSendSignal($signal) { $currentPid = posix_getpid(); $childPid = pcntl_fork(); if ($childPid == -1) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/TestCase.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/TestCase.php index dbdd54c..f784106 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/TestCase.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/TestCase.php @@ -7,8 +7,7 @@ use React\EventLoop\LoopInterface; class TestCase extends BaseTestCase { - protected function expectCallableExactly($amount) - { + protected function expectCallableExactly($amount) { $mock = $this->createCallableMock(); $mock ->expects($this->exactly($amount)) @@ -17,8 +16,7 @@ class TestCase extends BaseTestCase return $mock; } - protected function expectCallableOnce() - { + protected function expectCallableOnce() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -27,8 +25,7 @@ class TestCase extends BaseTestCase return $mock; } - protected function expectCallableNever() - { + protected function expectCallableNever() { $mock = $this->createCallableMock(); $mock ->expects($this->never()) @@ -37,13 +34,11 @@ class TestCase extends BaseTestCase return $mock; } - protected function createCallableMock() - { + protected function createCallableMock() { return $this->getMockBuilder('React\Tests\EventLoop\CallableStub')->getMock(); } - protected function tickLoop(LoopInterface $loop) - { + protected function tickLoop(LoopInterface $loop) { $loop->futureTick(function () use ($loop) { $loop->stop(); }); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/AbstractTimerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/AbstractTimerTest.php index 294e683..61f2c2a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/AbstractTimerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/AbstractTimerTest.php @@ -12,8 +12,7 @@ abstract class AbstractTimerTest extends TestCase */ abstract public function createLoop(); - public function testAddTimerReturnsNonPeriodicTimerInstance() - { + public function testAddTimerReturnsNonPeriodicTimerInstance() { $loop = $this->createLoop(); $timer = $loop->addTimer(0.001, $this->expectCallableNever()); @@ -22,15 +21,14 @@ abstract class AbstractTimerTest extends TestCase $this->assertFalse($timer->isPeriodic()); } - public function testAddTimerWillBeInvokedOnceAndBlocksLoopWhenRunning() - { + public function testAddTimerWillBeInvokedOnceAndBlocksLoopWhenRunning() { $loop = $this->createLoop(); $loop->addTimer(0.001, $this->expectCallableOnce()); - $start = microtime(true); + $start = microtime(TRUE); $loop->run(); - $end = microtime(true); + $end = microtime(TRUE); // make no strict assumptions about actual time interval. // must be at least 0.001s (1ms) and should not take longer than 0.1s @@ -38,8 +36,7 @@ abstract class AbstractTimerTest extends TestCase $this->assertLessThan(0.1, $end - $start); } - public function testAddPeriodicTimerReturnsPeriodicTimerInstance() - { + public function testAddPeriodicTimerReturnsPeriodicTimerInstance() { $loop = $this->createLoop(); $periodic = $loop->addPeriodicTimer(0.1, $this->expectCallableNever()); @@ -48,8 +45,7 @@ abstract class AbstractTimerTest extends TestCase $this->assertTrue($periodic->isPeriodic()); } - public function testAddPeriodicTimerWillBeInvokedUntilItIsCancelled() - { + public function testAddPeriodicTimerWillBeInvokedUntilItIsCancelled() { $loop = $this->createLoop(); $periodic = $loop->addPeriodicTimer(0.1, $this->expectCallableExactly(3)); @@ -63,8 +59,7 @@ abstract class AbstractTimerTest extends TestCase $loop->run(); } - public function testAddPeriodicTimerWillBeInvokedWithMaximumAccuracyUntilItIsCancelled() - { + public function testAddPeriodicTimerWillBeInvokedWithMaximumAccuracyUntilItIsCancelled() { $loop = $this->createLoop(); $i = 0; @@ -85,8 +80,7 @@ abstract class AbstractTimerTest extends TestCase $this->assertGreaterThan(2, $i); } - public function testAddPeriodicTimerCancelsItself() - { + public function testAddPeriodicTimerCancelsItself() { $loop = $this->createLoop(); $i = 0; @@ -98,9 +92,9 @@ abstract class AbstractTimerTest extends TestCase } }); - $start = microtime(true); + $start = microtime(TRUE); $loop->run(); - $end = microtime(true); + $end = microtime(TRUE); $this->assertEquals(5, $i); @@ -111,11 +105,11 @@ abstract class AbstractTimerTest extends TestCase $this->assertLessThan(0.1, $end - $start); } - public function testMinimumIntervalOneMicrosecond() - { + public function testMinimumIntervalOneMicrosecond() { $loop = $this->createLoop(); - $timer = $loop->addTimer(0, function () {}); + $timer = $loop->addTimer(0, function () { + }); $this->assertEquals(0.000001, $timer->getInterval()); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/ExtEvTimerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/ExtEvTimerTest.php index bfa9186..2699330 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/ExtEvTimerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/ExtEvTimerTest.php @@ -6,8 +6,7 @@ use React\EventLoop\ExtEvLoop; class ExtEvTimerTest extends AbstractTimerTest { - public function createLoop() - { + public function createLoop() { if (!class_exists('EvLoop')) { $this->markTestSkipped('ExtEvLoop tests skipped because ext-ev extension is not installed.'); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/ExtEventTimerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/ExtEventTimerTest.php index a7a6d00..e393536 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/ExtEventTimerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/ExtEventTimerTest.php @@ -6,8 +6,7 @@ use React\EventLoop\ExtEventLoop; class ExtEventTimerTest extends AbstractTimerTest { - public function createLoop() - { + public function createLoop() { if (!extension_loaded('event')) { $this->markTestSkipped('ext-event tests skipped because ext-event is not installed.'); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/ExtLibevTimerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/ExtLibevTimerTest.php index 65e82be..a7f60bf 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/ExtLibevTimerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/ExtLibevTimerTest.php @@ -6,8 +6,7 @@ use React\EventLoop\ExtLibevLoop; class ExtLibevTimerTest extends AbstractTimerTest { - public function createLoop() - { + public function createLoop() { if (!class_exists('libev\EventLoop')) { $this->markTestSkipped('libev tests skipped because ext-libev is not installed.'); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/ExtLibeventTimerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/ExtLibeventTimerTest.php index 9089b9a..51ef319 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/ExtLibeventTimerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/ExtLibeventTimerTest.php @@ -6,8 +6,7 @@ use React\EventLoop\ExtLibeventLoop; class ExtLibeventTimerTest extends AbstractTimerTest { - public function createLoop() - { + public function createLoop() { if (!function_exists('event_base_new')) { $this->markTestSkipped('libevent tests skipped because ext-libevent is not installed.'); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/StreamSelectTimerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/StreamSelectTimerTest.php index cfe1d7d..3136373 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/StreamSelectTimerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/StreamSelectTimerTest.php @@ -6,8 +6,7 @@ use React\EventLoop\StreamSelectLoop; class StreamSelectTimerTest extends AbstractTimerTest { - public function createLoop() - { + public function createLoop() { return new StreamSelectLoop(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/TimersTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/TimersTest.php index b279478..e0ed0bf 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/TimersTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/event-loop/tests/Timer/TimersTest.php @@ -8,8 +8,7 @@ use React\EventLoop\Timer\Timers; class TimersTest extends TestCase { - public function testBlockedTimer() - { + public function testBlockedTimer() { $timers = new Timers(); $timers->tick(); @@ -22,6 +21,6 @@ class TimersTest extends TestCase $timers->tick(); - $this->assertTrue(true); + $this->assertTrue(TRUE); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/composer.json index e425dc6..c2de584 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/composer.json @@ -1,28 +1,41 @@ { - "name": "react/promise-timer", - "description": "A trivial implementation of timeouts for Promises, built on top of ReactPHP.", - "keywords": ["Promise", "timeout", "timer", "event-loop", "ReactPHP", "async"], - "homepage": "https://github.com/react/promise-timer", - "license": "MIT", - "authors": [ - { - "name": "Christian Lück", - "email": "christian@lueck.tv" - } - ], - "autoload": { - "psr-4": { "React\\Promise\\Timer\\": "src/" }, - "files": [ "src/functions.php" ] - }, - "autoload-dev": { - "psr-4": { "React\\Tests\\Promise\\Timer\\": "tests/" } - }, - "require": { - "php": ">=5.3", - "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", - "react/promise": "~2.1|~1.2" + "name": "react/promise-timer", + "description": "A trivial implementation of timeouts for Promises, built on top of ReactPHP.", + "keywords": [ + "Promise", + "timeout", + "timer", + "event-loop", + "ReactPHP", + "async" + ], + "homepage": "https://github.com/react/promise-timer", + "license": "MIT", + "authors": [ + { + "name": "Christian Lück", + "email": "christian@lueck.tv" + } + ], + "autoload": { + "psr-4": { + "React\\Promise\\Timer\\": "src/" }, - "require-dev": { - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + "files": [ + "src/functions.php" + ] + }, + "autoload-dev": { + "psr-4": { + "React\\Tests\\Promise\\Timer\\": "tests/" } + }, + "require": { + "php": ">=5.3", + "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", + "react/promise": "~2.1|~1.2" + }, + "require-dev": { + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/src/TimeoutException.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/src/TimeoutException.php index 18ea72f..9f8cfb4 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/src/TimeoutException.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/src/TimeoutException.php @@ -8,15 +8,13 @@ class TimeoutException extends RuntimeException { private $timeout; - public function __construct($timeout, $message = null, $code = null, $previous = null) - { + public function __construct($timeout, $message = NULL, $code = NULL, $previous = NULL) { parent::__construct($message, $code, $previous); $this->timeout = $timeout; } - public function getTimeout() - { + public function getTimeout() { return $this->timeout; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/src/functions.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/src/functions.php index 6ad9867..7c6502f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/src/functions.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/src/functions.php @@ -7,33 +7,32 @@ use React\EventLoop\LoopInterface; use React\Promise\PromiseInterface; use React\Promise\Promise; -function timeout(PromiseInterface $promise, $time, LoopInterface $loop) -{ +function timeout(PromiseInterface $promise, $time, LoopInterface $loop) { // cancelling this promise will only try to cancel the input promise, // thus leaving responsibility to the input promise. - $canceller = null; + $canceller = NULL; if ($promise instanceof CancellablePromiseInterface) { $canceller = array($promise, 'cancel'); } return new Promise(function ($resolve, $reject) use ($loop, $time, $promise) { - $timer = null; + $timer = NULL; $promise->then(function ($v) use (&$timer, $loop, $resolve) { if ($timer) { $loop->cancelTimer($timer); } - $timer = false; + $timer = FALSE; $resolve($v); }, function ($v) use (&$timer, $loop, $reject) { if ($timer) { $loop->cancelTimer($timer); } - $timer = false; + $timer = FALSE; $reject($v); }); // promise already resolved => no need to start timer - if ($timer === false) { + if ($timer === FALSE) { return; } @@ -48,8 +47,7 @@ function timeout(PromiseInterface $promise, $time, LoopInterface $loop) }, $canceller); } -function resolve($time, LoopInterface $loop) -{ +function resolve($time, LoopInterface $loop) { return new Promise(function ($resolve) use ($loop, $time, &$timer) { // resolve the promise when the timer fires in $time seconds $timer = $loop->addTimer($time, function () use ($time, $resolve) { @@ -62,8 +60,7 @@ function resolve($time, LoopInterface $loop) }); } -function reject($time, LoopInterface $loop) -{ +function reject($time, LoopInterface $loop) { return resolve($time, $loop)->then(function ($time) { throw new TimeoutException($time, 'Timer expired after ' . $time . ' seconds'); }); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/CallableStub.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/CallableStub.php index a391aa5..25ec4a3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/CallableStub.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/CallableStub.php @@ -4,7 +4,6 @@ namespace React\Tests\Promise\Timer; class CallableStub { - public function __invoke() - { + public function __invoke() { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/FunctionRejectTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/FunctionRejectTest.php index 6153fcc..c8b2a0f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/FunctionRejectTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/FunctionRejectTest.php @@ -6,22 +6,19 @@ use React\Promise\Timer; class FunctionRejectTest extends TestCase { - public function testPromiseIsPendingWithoutRunningLoop() - { + public function testPromiseIsPendingWithoutRunningLoop() { $promise = Timer\reject(0.01, $this->loop); $this->expectPromisePending($promise); } - public function testPromiseExpiredIsPendingWithoutRunningLoop() - { + public function testPromiseExpiredIsPendingWithoutRunningLoop() { $promise = Timer\reject(-1, $this->loop); $this->expectPromisePending($promise); } - public function testPromiseWillBeRejectedOnTimeout() - { + public function testPromiseWillBeRejectedOnTimeout() { $promise = Timer\reject(0.01, $this->loop); $this->loop->run(); @@ -29,8 +26,7 @@ class FunctionRejectTest extends TestCase $this->expectPromiseRejected($promise); } - public function testPromiseExpiredWillBeRejectedOnTimeout() - { + public function testPromiseExpiredWillBeRejectedOnTimeout() { $promise = Timer\reject(-1, $this->loop); $this->loop->run(); @@ -38,8 +34,7 @@ class FunctionRejectTest extends TestCase $this->expectPromiseRejected($promise); } - public function testCancelingPromiseWillRejectTimer() - { + public function testCancelingPromiseWillRejectTimer() { $promise = Timer\reject(0.01, $this->loop); $promise->cancel(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/FunctionResolveTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/FunctionResolveTest.php index 0bfdc21..9015bff 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/FunctionResolveTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/FunctionResolveTest.php @@ -6,22 +6,19 @@ use React\Promise\Timer; class FunctionResolveTest extends TestCase { - public function testPromiseIsPendingWithoutRunningLoop() - { + public function testPromiseIsPendingWithoutRunningLoop() { $promise = Timer\resolve(0.01, $this->loop); $this->expectPromisePending($promise); } - public function testPromiseExpiredIsPendingWithoutRunningLoop() - { + public function testPromiseExpiredIsPendingWithoutRunningLoop() { $promise = Timer\resolve(-1, $this->loop); $this->expectPromisePending($promise); } - public function testPromiseWillBeResolvedOnTimeout() - { + public function testPromiseWillBeResolvedOnTimeout() { $promise = Timer\resolve(0.01, $this->loop); $this->loop->run(); @@ -29,8 +26,7 @@ class FunctionResolveTest extends TestCase $this->expectPromiseResolved($promise); } - public function testPromiseExpiredWillBeResolvedOnTimeout() - { + public function testPromiseExpiredWillBeResolvedOnTimeout() { $promise = Timer\resolve(-1, $this->loop); $this->loop->run(); @@ -38,16 +34,14 @@ class FunctionResolveTest extends TestCase $this->expectPromiseResolved($promise); } - public function testWillStartLoopTimer() - { + public function testWillStartLoopTimer() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $loop->expects($this->once())->method('addTimer')->with($this->equalTo(0.01)); Timer\resolve(0.01, $loop); } - public function testCancellingPromiseWillCancelLoopTimer() - { + public function testCancellingPromiseWillCancelLoopTimer() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $timer = $this->getMockBuilder(interface_exists('React\EventLoop\TimerInterface') ? 'React\EventLoop\TimerInterface' : 'React\EventLoop\Timer\TimerInterface')->getMock(); @@ -60,8 +54,7 @@ class FunctionResolveTest extends TestCase $promise->cancel(); } - public function testCancelingPromiseWillRejectTimer() - { + public function testCancelingPromiseWillRejectTimer() { $promise = Timer\resolve(0.01, $this->loop); $promise->cancel(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/FunctionTimeoutTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/FunctionTimeoutTest.php index aaca2da..30094f8 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/FunctionTimeoutTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/FunctionTimeoutTest.php @@ -7,8 +7,7 @@ use React\Promise; class FunctionTimerTest extends TestCase { - public function testResolvedWillResolveRightAway() - { + public function testResolvedWillResolveRightAway() { $promise = Promise\resolve(); $promise = Timer\timeout($promise, 3, $this->loop); @@ -16,8 +15,7 @@ class FunctionTimerTest extends TestCase $this->expectPromiseResolved($promise); } - public function testResolvedExpiredWillResolveRightAway() - { + public function testResolvedExpiredWillResolveRightAway() { $promise = Promise\resolve(); $promise = Timer\timeout($promise, -1, $this->loop); @@ -25,21 +23,19 @@ class FunctionTimerTest extends TestCase $this->expectPromiseResolved($promise); } - public function testResolvedWillNotStartTimer() - { + public function testResolvedWillNotStartTimer() { $promise = Promise\resolve(); Timer\timeout($promise, 3, $this->loop); - $time = microtime(true); + $time = microtime(TRUE); $this->loop->run(); - $time = microtime(true) - $time; + $time = microtime(TRUE) - $time; $this->assertLessThan(0.5, $time); } - public function testRejectedWillRejectRightAway() - { + public function testRejectedWillRejectRightAway() { $promise = Promise\reject(); $promise = Timer\timeout($promise, 3, $this->loop); @@ -47,21 +43,19 @@ class FunctionTimerTest extends TestCase $this->expectPromiseRejected($promise); } - public function testRejectedWillNotStartTimer() - { + public function testRejectedWillNotStartTimer() { $promise = Promise\reject(); Timer\timeout($promise, 3, $this->loop); - $time = microtime(true); + $time = microtime(TRUE); $this->loop->run(); - $time = microtime(true) - $time; + $time = microtime(TRUE) - $time; $this->assertLessThan(0.5, $time); } - public function testPendingWillRejectOnTimeout() - { + public function testPendingWillRejectOnTimeout() { $promise = $this->getMockBuilder('React\Promise\PromiseInterface')->getMock(); $promise = Timer\timeout($promise, 0.01, $this->loop); @@ -71,8 +65,7 @@ class FunctionTimerTest extends TestCase $this->expectPromiseRejected($promise); } - public function testPendingCancellableWillBeCancelledOnTimeout() - { + public function testPendingCancellableWillBeCancelledOnTimeout() { $promise = $this->getMockBuilder('React\Promise\CancellablePromiseInterface')->getMock(); $promise->expects($this->once())->method('cancel'); @@ -81,9 +74,9 @@ class FunctionTimerTest extends TestCase $this->loop->run(); } - public function testCancelTimeoutWithoutCancellationhandlerWillNotCancelTimerAndWillNotReject() - { - $promise = new \React\Promise\Promise(function () { }); + public function testCancelTimeoutWithoutCancellationhandlerWillNotCancelTimerAndWillNotReject() { + $promise = new \React\Promise\Promise(function () { + }); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -98,9 +91,10 @@ class FunctionTimerTest extends TestCase $this->expectPromisePending($timeout); } - public function testResolvedPromiseWillNotStartTimer() - { - $promise = new \React\Promise\Promise(function ($resolve) { $resolve(true); }); + public function testResolvedPromiseWillNotStartTimer() { + $promise = new \React\Promise\Promise(function ($resolve) { + $resolve(TRUE); + }); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $loop->expects($this->never())->method('addTimer'); @@ -110,8 +104,7 @@ class FunctionTimerTest extends TestCase $this->expectPromiseResolved($timeout); } - public function testRejectedPromiseWillNotStartTimer() - { + public function testRejectedPromiseWillNotStartTimer() { $promise = Promise\reject(new \RuntimeException()); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -122,18 +115,20 @@ class FunctionTimerTest extends TestCase $this->expectPromiseRejected($timeout); } - public function testCancelTimeoutWillCancelGivenPromise() - { - $promise = new \React\Promise\Promise(function () { }, $this->expectCallableOnce()); + public function testCancelTimeoutWillCancelGivenPromise() { + $promise = new \React\Promise\Promise(function () { + }, $this->expectCallableOnce()); $timeout = Timer\timeout($promise, 0.01, $this->loop); $timeout->cancel(); } - public function testCancelGivenPromiseWillReject() - { - $promise = new \React\Promise\Promise(function () { }, function ($resolve, $reject) { $reject(); }); + public function testCancelGivenPromiseWillReject() { + $promise = new \React\Promise\Promise(function () { + }, function ($resolve, $reject) { + $reject(); + }); $timeout = Timer\timeout($promise, 0.01, $this->loop); @@ -143,9 +138,11 @@ class FunctionTimerTest extends TestCase $this->expectPromiseRejected($timeout); } - public function testCancelTimeoutWillRejectIfGivenPromiseWillReject() - { - $promise = new \React\Promise\Promise(function () { }, function ($resolve, $reject) { $reject(); }); + public function testCancelTimeoutWillRejectIfGivenPromiseWillReject() { + $promise = new \React\Promise\Promise(function () { + }, function ($resolve, $reject) { + $reject(); + }); $timeout = Timer\timeout($promise, 0.01, $this->loop); @@ -155,9 +152,11 @@ class FunctionTimerTest extends TestCase $this->expectPromiseRejected($timeout); } - public function testCancelTimeoutWillResolveIfGivenPromiseWillResolve() - { - $promise = new \React\Promise\Promise(function () { }, function ($resolve, $reject) { $resolve(); }); + public function testCancelTimeoutWillResolveIfGivenPromiseWillResolve() { + $promise = new \React\Promise\Promise(function () { + }, function ($resolve, $reject) { + $resolve(); + }); $timeout = Timer\timeout($promise, 0.01, $this->loop); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/TestCase.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/TestCase.php index 9d8d49a..35c0ed9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/TestCase.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/TestCase.php @@ -9,13 +9,11 @@ class TestCase extends BaseTestCase { protected $loop; - public function setUp() - { + public function setUp() { $this->loop = Factory::create(); } - protected function expectCallableOnce() - { + protected function expectCallableOnce() { $mock = $this->createCallableMock(); $mock @@ -25,8 +23,7 @@ class TestCase extends BaseTestCase return $mock; } - protected function expectCallableNever() - { + protected function expectCallableNever() { $mock = $this->createCallableMock(); $mock @@ -39,23 +36,19 @@ class TestCase extends BaseTestCase /** * @link https://github.com/reactphp/react/blob/master/tests/React/Tests/Socket/TestCase.php (taken from reactphp/react) */ - protected function createCallableMock() - { + protected function createCallableMock() { return $this->getMockBuilder('React\Tests\Promise\Timer\CallableStub')->getMock(); } - protected function expectPromiseRejected($promise) - { + protected function expectPromiseRejected($promise) { return $promise->then($this->expectCallableNever(), $this->expectCallableOnce()); } - protected function expectPromiseResolved($promise) - { + protected function expectPromiseResolved($promise) { return $promise->then($this->expectCallableOnce(), $this->expectCallableNever()); } - protected function expectPromisePending($promise) - { + protected function expectPromisePending($promise) { return $promise->then($this->expectCallableNever(), $this->expectCallableNever()); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/TimeoutExceptionTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/TimeoutExceptionTest.php index e9bedd9..0456f4b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/TimeoutExceptionTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise-timer/tests/TimeoutExceptionTest.php @@ -6,8 +6,7 @@ use React\Promise\Timer\TimeoutException; class TimeoutExceptionTest extends TestCase { - public function testAccessTimeout() - { + public function testAccessTimeout() { $e = new TimeoutException(10); $this->assertEquals(10, $e->getTimeout()); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/composer.json index 2fc4809..03726fb 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/composer.json @@ -1,29 +1,34 @@ { - "name": "react/promise", - "description": "A lightweight implementation of CommonJS Promises/A for PHP", - "license": "MIT", - "authors": [ - {"name": "Jan Sorgalla", "email": "jsorgalla@gmail.com"} - ], - "require": { - "php": ">=5.4.0" + "name": "react/promise", + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "license": "MIT", + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com" + } + ], + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "autoload": { + "psr-4": { + "React\\Promise\\": "src/" }, - "require-dev": { - "phpunit/phpunit": "~4.8" - }, - "autoload": { - "psr-4": { - "React\\Promise\\": "src/" - }, - "files": ["src/functions_include.php"] - }, - "autoload-dev": { - "psr-4": { - "React\\Promise\\": "tests/fixtures" - } - }, - "keywords": [ - "promise", - "promises" + "files": [ + "src/functions_include.php" ] + }, + "autoload-dev": { + "psr-4": { + "React\\Promise\\": "tests/fixtures" + } + }, + "keywords": [ + "promise", + "promises" + ] } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/CancellationQueue.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/CancellationQueue.php index a366994..6a06e23 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/CancellationQueue.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/CancellationQueue.php @@ -4,21 +4,19 @@ namespace React\Promise; class CancellationQueue { - private $started = false; + private $started = FALSE; private $queue = []; - public function __invoke() - { + public function __invoke() { if ($this->started) { return; } - $this->started = true; + $this->started = TRUE; $this->drain(); } - public function enqueue($cancellable) - { + public function enqueue($cancellable) { if (!method_exists($cancellable, 'then') || !method_exists($cancellable, 'cancel')) { return; } @@ -30,12 +28,11 @@ class CancellationQueue } } - private function drain() - { + private function drain() { for ($i = key($this->queue); isset($this->queue[$i]); $i++) { $cancellable = $this->queue[$i]; - $exception = null; + $exception = NULL; try { $cancellable->cancel(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/Deferred.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/Deferred.php index f23980c..c58749b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/Deferred.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/Deferred.php @@ -10,40 +10,35 @@ class Deferred implements PromisorInterface private $notifyCallback; private $canceller; - public function __construct(callable $canceller = null) - { + public function __construct(callable $canceller = NULL) { $this->canceller = $canceller; } - public function promise() - { - if (null === $this->promise) { + public function promise() { + if (NULL === $this->promise) { $this->promise = new Promise(function ($resolve, $reject, $notify) { $this->resolveCallback = $resolve; - $this->rejectCallback = $reject; - $this->notifyCallback = $notify; + $this->rejectCallback = $reject; + $this->notifyCallback = $notify; }, $this->canceller); } return $this->promise; } - public function resolve($value = null) - { + public function resolve($value = NULL) { $this->promise(); call_user_func($this->resolveCallback, $value); } - public function reject($reason = null) - { + public function reject($reason = NULL) { $this->promise(); call_user_func($this->rejectCallback, $reason); } - public function notify($update = null) - { + public function notify($update = NULL) { $this->promise(); call_user_func($this->notifyCallback, $update); @@ -53,8 +48,7 @@ class Deferred implements PromisorInterface * @deprecated 2.2.0 * @see Deferred::notify() */ - public function progress($update = null) - { + public function progress($update = NULL) { $this->notify($update); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/ExtendedPromiseInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/ExtendedPromiseInterface.php index 9cb6435..a09c13b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/ExtendedPromiseInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/ExtendedPromiseInterface.php @@ -7,7 +7,7 @@ interface ExtendedPromiseInterface extends PromiseInterface /** * @return void */ - public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null); + public function done(callable $onFulfilled = NULL, callable $onRejected = NULL, callable $onProgress = NULL); /** * @return ExtendedPromiseInterface diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/FulfilledPromise.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/FulfilledPromise.php index 914bb5c..34e2407 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/FulfilledPromise.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/FulfilledPromise.php @@ -6,8 +6,7 @@ class FulfilledPromise implements ExtendedPromiseInterface, CancellablePromiseIn { private $value; - public function __construct($value = null) - { + public function __construct($value = NULL) { if ($value instanceof PromiseInterface) { throw new \InvalidArgumentException('You cannot create React\Promise\FulfilledPromise with a promise. Use React\Promise\resolve($promiseOrValue) instead.'); } @@ -15,9 +14,8 @@ class FulfilledPromise implements ExtendedPromiseInterface, CancellablePromiseIn $this->value = $value; } - public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) - { - if (null === $onFulfilled) { + public function then(callable $onFulfilled = NULL, callable $onRejected = NULL, callable $onProgress = NULL) { + if (NULL === $onFulfilled) { return $this; } @@ -30,9 +28,8 @@ class FulfilledPromise implements ExtendedPromiseInterface, CancellablePromiseIn } } - public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) - { - if (null === $onFulfilled) { + public function done(callable $onFulfilled = NULL, callable $onRejected = NULL, callable $onProgress = NULL) { + if (NULL === $onFulfilled) { return; } @@ -43,13 +40,11 @@ class FulfilledPromise implements ExtendedPromiseInterface, CancellablePromiseIn } } - public function otherwise(callable $onRejected) - { + public function otherwise(callable $onRejected) { return $this; } - public function always(callable $onFulfilledOrRejected) - { + public function always(callable $onFulfilledOrRejected) { return $this->then(function ($value) use ($onFulfilledOrRejected) { return resolve($onFulfilledOrRejected())->then(function () use ($value) { return $value; @@ -57,12 +52,10 @@ class FulfilledPromise implements ExtendedPromiseInterface, CancellablePromiseIn }); } - public function progress(callable $onProgress) - { + public function progress(callable $onProgress) { return $this; } - public function cancel() - { + public function cancel() { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/LazyPromise.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/LazyPromise.php index 7e3a3d3..16233e5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/LazyPromise.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/LazyPromise.php @@ -7,38 +7,31 @@ class LazyPromise implements ExtendedPromiseInterface, CancellablePromiseInterfa private $factory; private $promise; - public function __construct(callable $factory) - { + public function __construct(callable $factory) { $this->factory = $factory; } - public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) - { + public function then(callable $onFulfilled = NULL, callable $onRejected = NULL, callable $onProgress = NULL) { return $this->promise()->then($onFulfilled, $onRejected, $onProgress); } - public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) - { + public function done(callable $onFulfilled = NULL, callable $onRejected = NULL, callable $onProgress = NULL) { return $this->promise()->done($onFulfilled, $onRejected, $onProgress); } - public function otherwise(callable $onRejected) - { + public function otherwise(callable $onRejected) { return $this->promise()->otherwise($onRejected); } - public function always(callable $onFulfilledOrRejected) - { + public function always(callable $onFulfilledOrRejected) { return $this->promise()->always($onFulfilledOrRejected); } - public function progress(callable $onProgress) - { + public function progress(callable $onProgress) { return $this->promise()->progress($onProgress); } - public function cancel() - { + public function cancel() { return $this->promise()->cancel(); } @@ -46,9 +39,8 @@ class LazyPromise implements ExtendedPromiseInterface, CancellablePromiseInterfa * @internal * @see Promise::settle() */ - public function promise() - { - if (null === $this->promise) { + public function promise() { + if (NULL === $this->promise) { try { $this->promise = resolve(call_user_func($this->factory)); } catch (\Throwable $exception) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/Promise.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/Promise.php index 0261eb3..c430b4d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/Promise.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/Promise.php @@ -13,19 +13,17 @@ class Promise implements ExtendedPromiseInterface, CancellablePromiseInterface private $requiredCancelRequests = 0; private $cancelRequests = 0; - public function __construct(callable $resolver, callable $canceller = null) - { + public function __construct(callable $resolver, callable $canceller = NULL) { $this->canceller = $canceller; $this->call($resolver); } - public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) - { - if (null !== $this->result) { + public function then(callable $onFulfilled = NULL, callable $onRejected = NULL, callable $onProgress = NULL) { + if (NULL !== $this->result) { return $this->result->then($onFulfilled, $onRejected, $onProgress); } - if (null === $this->canceller) { + if (NULL === $this->canceller) { return new static($this->resolver($onFulfilled, $onRejected, $onProgress)); } @@ -40,9 +38,8 @@ class Promise implements ExtendedPromiseInterface, CancellablePromiseInterface }); } - public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) - { - if (null !== $this->result) { + public function done(callable $onFulfilled = NULL, callable $onRejected = NULL, callable $onProgress = NULL) { + if (NULL !== $this->result) { return $this->result->done($onFulfilled, $onRejected, $onProgress); } @@ -56,9 +53,8 @@ class Promise implements ExtendedPromiseInterface, CancellablePromiseInterface } } - public function otherwise(callable $onRejected) - { - return $this->then(null, function ($reason) use ($onRejected) { + public function otherwise(callable $onRejected) { + return $this->then(NULL, function ($reason) use ($onRejected) { if (!_checkTypehint($onRejected, $reason)) { return new RejectedPromise($reason); } @@ -67,8 +63,7 @@ class Promise implements ExtendedPromiseInterface, CancellablePromiseInterface }); } - public function always(callable $onFulfilledOrRejected) - { + public function always(callable $onFulfilledOrRejected) { return $this->then(function ($value) use ($onFulfilledOrRejected) { return resolve($onFulfilledOrRejected())->then(function () use ($value) { return $value; @@ -80,25 +75,22 @@ class Promise implements ExtendedPromiseInterface, CancellablePromiseInterface }); } - public function progress(callable $onProgress) - { - return $this->then(null, null, $onProgress); + public function progress(callable $onProgress) { + return $this->then(NULL, NULL, $onProgress); } - public function cancel() - { - if (null === $this->canceller || null !== $this->result) { + public function cancel() { + if (NULL === $this->canceller || NULL !== $this->result) { return; } $canceller = $this->canceller; - $this->canceller = null; + $this->canceller = NULL; $this->call($canceller); } - private function resolver(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) - { + private function resolver(callable $onFulfilled = NULL, callable $onRejected = NULL, callable $onProgress = NULL) { return function ($resolve, $reject, $notify) use ($onFulfilled, $onRejected, $onProgress) { if ($onProgress) { $progressHandler = function ($update) use ($notify, $onProgress) { @@ -124,27 +116,24 @@ class Promise implements ExtendedPromiseInterface, CancellablePromiseInterface }; } - private function resolve($value = null) - { - if (null !== $this->result) { + private function resolve($value = NULL) { + if (NULL !== $this->result) { return; } $this->settle(resolve($value)); } - private function reject($reason = null) - { - if (null !== $this->result) { + private function reject($reason = NULL) { + if (NULL !== $this->result) { return; } $this->settle(reject($reason)); } - private function notify($update = null) - { - if (null !== $this->result) { + private function notify($update = NULL) { + if (NULL !== $this->result) { return; } @@ -153,8 +142,7 @@ class Promise implements ExtendedPromiseInterface, CancellablePromiseInterface } } - private function settle(ExtendedPromiseInterface $promise) - { + private function settle(ExtendedPromiseInterface $promise) { $promise = $this->unwrap($promise); $handlers = $this->handlers; @@ -167,19 +155,17 @@ class Promise implements ExtendedPromiseInterface, CancellablePromiseInterface } } - private function unwrap($promise) - { + private function unwrap($promise) { $promise = $this->extract($promise); - while ($promise instanceof self && null !== $promise->result) { + while ($promise instanceof self && NULL !== $promise->result) { $promise = $this->extract($promise->result); } return $promise; } - private function extract($promise) - { + private function extract($promise) { if ($promise instanceof LazyPromise) { $promise = $promise->promise(); } @@ -193,17 +179,16 @@ class Promise implements ExtendedPromiseInterface, CancellablePromiseInterface return $promise; } - private function call(callable $callback) - { + private function call(callable $callback) { try { $callback( - function ($value = null) { + function ($value = NULL) { $this->resolve($value); }, - function ($reason = null) { + function ($reason = NULL) { $this->reject($reason); }, - function ($update = null) { + function ($update = NULL) { $this->notify($update); } ); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/PromiseInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/PromiseInterface.php index d80d114..e638cb8 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/PromiseInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/PromiseInterface.php @@ -7,5 +7,5 @@ interface PromiseInterface /** * @return PromiseInterface */ - public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null); + public function then(callable $onFulfilled = NULL, callable $onRejected = NULL, callable $onProgress = NULL); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/RejectedPromise.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/RejectedPromise.php index 479a746..562a1c9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/RejectedPromise.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/RejectedPromise.php @@ -6,8 +6,7 @@ class RejectedPromise implements ExtendedPromiseInterface, CancellablePromiseInt { private $reason; - public function __construct($reason = null) - { + public function __construct($reason = NULL) { if ($reason instanceof PromiseInterface) { throw new \InvalidArgumentException('You cannot create React\Promise\RejectedPromise with a promise. Use React\Promise\reject($promiseOrValue) instead.'); } @@ -15,9 +14,8 @@ class RejectedPromise implements ExtendedPromiseInterface, CancellablePromiseInt $this->reason = $reason; } - public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) - { - if (null === $onRejected) { + public function then(callable $onFulfilled = NULL, callable $onRejected = NULL, callable $onProgress = NULL) { + if (NULL === $onRejected) { return $this; } @@ -30,9 +28,8 @@ class RejectedPromise implements ExtendedPromiseInterface, CancellablePromiseInt } } - public function done(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) - { - if (null === $onRejected) { + public function done(callable $onFulfilled = NULL, callable $onRejected = NULL, callable $onProgress = NULL) { + if (NULL === $onRejected) { throw UnhandledRejectionException::resolve($this->reason); } @@ -47,30 +44,26 @@ class RejectedPromise implements ExtendedPromiseInterface, CancellablePromiseInt } } - public function otherwise(callable $onRejected) - { + public function otherwise(callable $onRejected) { if (!_checkTypehint($onRejected, $this->reason)) { return $this; } - return $this->then(null, $onRejected); + return $this->then(NULL, $onRejected); } - public function always(callable $onFulfilledOrRejected) - { - return $this->then(null, function ($reason) use ($onFulfilledOrRejected) { + public function always(callable $onFulfilledOrRejected) { + return $this->then(NULL, function ($reason) use ($onFulfilledOrRejected) { return resolve($onFulfilledOrRejected())->then(function () use ($reason) { return new RejectedPromise($reason); }); }); } - public function progress(callable $onProgress) - { + public function progress(callable $onProgress) { return $this; } - public function cancel() - { + public function cancel() { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/UnhandledRejectionException.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/UnhandledRejectionException.php index a44b7a1..d865c4b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/UnhandledRejectionException.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/UnhandledRejectionException.php @@ -6,8 +6,7 @@ class UnhandledRejectionException extends \RuntimeException { private $reason; - public static function resolve($reason) - { + public static function resolve($reason) { if ($reason instanceof \Exception || $reason instanceof \Throwable) { return $reason; } @@ -15,8 +14,7 @@ class UnhandledRejectionException extends \RuntimeException return new static($reason); } - public function __construct($reason) - { + public function __construct($reason) { $this->reason = $reason; $message = sprintf('Unhandled Rejection: %s', json_encode($reason)); @@ -24,8 +22,7 @@ class UnhandledRejectionException extends \RuntimeException parent::__construct($message, 0); } - public function getReason() - { + public function getReason() { return $this->reason; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/functions.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/functions.php index 70c0eb7..f9db669 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/functions.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/functions.php @@ -2,14 +2,13 @@ namespace React\Promise; -function resolve($promiseOrValue = null) -{ +function resolve($promiseOrValue = NULL) { if ($promiseOrValue instanceof ExtendedPromiseInterface) { return $promiseOrValue; } if (method_exists($promiseOrValue, 'then')) { - $canceller = null; + $canceller = NULL; if (method_exists($promiseOrValue, 'cancel')) { $canceller = [$promiseOrValue, 'cancel']; @@ -23,8 +22,7 @@ function resolve($promiseOrValue = null) return new FulfilledPromise($promiseOrValue); } -function reject($promiseOrValue = null) -{ +function reject($promiseOrValue = NULL) { if ($promiseOrValue instanceof PromiseInterface) { return resolve($promiseOrValue)->then(function ($value) { return new RejectedPromise($value); @@ -34,15 +32,13 @@ function reject($promiseOrValue = null) return new RejectedPromise($promiseOrValue); } -function all($promisesOrValues) -{ +function all($promisesOrValues) { return map($promisesOrValues, function ($val) { return $val; }); } -function race($promisesOrValues) -{ +function race($promisesOrValues) { $cancellationQueue = new CancellationQueue(); $cancellationQueue->enqueue($promisesOrValues); @@ -64,16 +60,14 @@ function race($promisesOrValues) }, $cancellationQueue); } -function any($promisesOrValues) -{ +function any($promisesOrValues) { return some($promisesOrValues, 1) ->then(function ($val) { return array_shift($val); }); } -function some($promisesOrValues, $howMany) -{ +function some($promisesOrValues, $howMany) { $cancellationQueue = new CancellationQueue(); $cancellationQueue->enqueue($promisesOrValues); @@ -100,9 +94,9 @@ function some($promisesOrValues, $howMany) } $toResolve = $howMany; - $toReject = ($len - $toResolve) + 1; - $values = []; - $reasons = []; + $toReject = ($len - $toResolve) + 1; + $values = []; + $reasons = []; foreach ($array as $i => $promiseOrValue) { $fulfiller = function ($val) use ($i, &$values, &$toResolve, $toReject, $resolve) { @@ -138,8 +132,7 @@ function some($promisesOrValues, $howMany) }, $cancellationQueue); } -function map($promisesOrValues, callable $mapFunc) -{ +function map($promisesOrValues, callable $mapFunc) { $cancellationQueue = new CancellationQueue(); $cancellationQueue->enqueue($promisesOrValues); @@ -152,11 +145,11 @@ function map($promisesOrValues, callable $mapFunc) } $toResolve = count($array); - $values = []; + $values = []; foreach ($array as $i => $promiseOrValue) { $cancellationQueue->enqueue($promiseOrValue); - $values[$i] = null; + $values[$i] = NULL; resolve($promiseOrValue) ->then($mapFunc) @@ -176,8 +169,7 @@ function map($promisesOrValues, callable $mapFunc) }, $cancellationQueue); } -function reduce($promisesOrValues, callable $reduceFunc, $initialValue = null) -{ +function reduce($promisesOrValues, callable $reduceFunc, $initialValue = NULL) { $cancellationQueue = new CancellationQueue(); $cancellationQueue->enqueue($promisesOrValues); @@ -214,15 +206,14 @@ function reduce($promisesOrValues, callable $reduceFunc, $initialValue = null) } // Internal functions -function _checkTypehint(callable $callback, $object) -{ +function _checkTypehint(callable $callback, $object) { if (!is_object($object)) { - return true; + return TRUE; } if (is_array($callback)) { $callbackReflection = new \ReflectionMethod($callback[0], $callback[1]); - } elseif (is_object($callback) && !$callback instanceof \Closure) { + } else if (is_object($callback) && !$callback instanceof \Closure) { $callbackReflection = new \ReflectionMethod($callback, '__invoke'); } else { $callbackReflection = new \ReflectionFunction($callback); @@ -231,13 +222,13 @@ function _checkTypehint(callable $callback, $object) $parameters = $callbackReflection->getParameters(); if (!isset($parameters[0])) { - return true; + return TRUE; } $expectedException = $parameters[0]; if (!$expectedException->getClass()) { - return true; + return TRUE; } return $expectedException->getClass()->isInstance($object); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/functions_include.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/functions_include.php index c71decb..f75f638 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/functions_include.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/src/functions_include.php @@ -1,5 +1,5 @@ getCancellableDeferred(); $d2 = $this->getCancellableDeferred(); @@ -44,8 +41,7 @@ class CancellationQueueTest extends TestCase } /** @test */ - public function callsCancelOnPromisesEnqueuedAfterStart() - { + public function callsCancelOnPromisesEnqueuedAfterStart() { $d1 = $this->getCancellableDeferred(); $d2 = $this->getCancellableDeferred(); @@ -58,8 +54,7 @@ class CancellationQueueTest extends TestCase } /** @test */ - public function doesNotCallCancelTwiceWhenStartedTwice() - { + public function doesNotCallCancelTwiceWhenStartedTwice() { $d = $this->getCancellableDeferred(); $cancellationQueue = new CancellationQueue(); @@ -70,8 +65,7 @@ class CancellationQueueTest extends TestCase } /** @test */ - public function rethrowsExceptionsThrownFromCancel() - { + public function rethrowsExceptionsThrownFromCancel() { $this->setExpectedException('\Exception', 'test'); $mock = $this @@ -88,8 +82,7 @@ class CancellationQueueTest extends TestCase $cancellationQueue(); } - private function getCancellableDeferred() - { + private function getCancellableDeferred() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/DeferredTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/DeferredTest.php index 16212e9..00e2564 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/DeferredTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/DeferredTest.php @@ -8,22 +8,20 @@ class DeferredTest extends TestCase { use PromiseTest\FullTestTrait; - public function getPromiseTestAdapter(callable $canceller = null) - { + public function getPromiseTestAdapter(callable $canceller = NULL) { $d = new Deferred($canceller); return new CallbackPromiseAdapter([ 'promise' => [$d, 'promise'], 'resolve' => [$d, 'resolve'], - 'reject' => [$d, 'reject'], - 'notify' => [$d, 'progress'], - 'settle' => [$d, 'resolve'], + 'reject' => [$d, 'reject'], + 'notify' => [$d, 'progress'], + 'settle' => [$d, 'resolve'], ]); } /** @test */ - public function progressIsAnAliasForNotify() - { + public function progressIsAnAliasForNotify() { $deferred = new Deferred(); $sentinel = new \stdClass(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FulfilledPromiseTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FulfilledPromiseTest.php index 97fc8f6..2cbde01 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FulfilledPromiseTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FulfilledPromiseTest.php @@ -9,9 +9,8 @@ class FulfilledPromiseTest extends TestCase use PromiseTest\PromiseSettledTestTrait, PromiseTest\PromiseFulfilledTestTrait; - public function getPromiseTestAdapter(callable $canceller = null) - { - $promise = null; + public function getPromiseTestAdapter(callable $canceller = NULL) { + $promise = NULL; return new CallbackPromiseAdapter([ 'promise' => function () use (&$promise) { @@ -21,7 +20,7 @@ class FulfilledPromiseTest extends TestCase return $promise; }, - 'resolve' => function ($value = null) use (&$promise) { + 'resolve' => function ($value = NULL) use (&$promise) { if (!$promise) { $promise = new FulfilledPromise($value); } @@ -32,7 +31,7 @@ class FulfilledPromiseTest extends TestCase 'notify' => function () { // no-op }, - 'settle' => function ($value = null) use (&$promise) { + 'settle' => function ($value = NULL) use (&$promise) { if (!$promise) { $promise = new FulfilledPromise($value); } @@ -41,8 +40,7 @@ class FulfilledPromiseTest extends TestCase } /** @test */ - public function shouldThrowExceptionIfConstructedWithAPromise() - { + public function shouldThrowExceptionIfConstructedWithAPromise() { $this->setExpectedException('\InvalidArgumentException'); return new FulfilledPromise(new FulfilledPromise()); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionAllTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionAllTest.php index 74c1d7c..c71818c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionAllTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionAllTest.php @@ -5,8 +5,7 @@ namespace React\Promise; class FunctionAllTest extends TestCase { /** @test */ - public function shouldResolveEmptyInput() - { + public function shouldResolveEmptyInput() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -18,8 +17,7 @@ class FunctionAllTest extends TestCase } /** @test */ - public function shouldResolveValuesArray() - { + public function shouldResolveValuesArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -31,8 +29,7 @@ class FunctionAllTest extends TestCase } /** @test */ - public function shouldResolvePromisesArray() - { + public function shouldResolvePromisesArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -44,21 +41,19 @@ class FunctionAllTest extends TestCase } /** @test */ - public function shouldResolveSparseArrayInput() - { + public function shouldResolveSparseArrayInput() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') - ->with($this->identicalTo([null, 1, null, 1, 1])); + ->with($this->identicalTo([NULL, 1, NULL, 1, 1])); - all([null, 1, null, 1, 1]) + all([NULL, 1, NULL, 1, 1]) ->then($mock); } /** @test */ - public function shouldRejectIfAnyInputPromiseRejects() - { + public function shouldRejectIfAnyInputPromiseRejects() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -70,8 +65,7 @@ class FunctionAllTest extends TestCase } /** @test */ - public function shouldAcceptAPromiseForAnArray() - { + public function shouldAcceptAPromiseForAnArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -83,8 +77,7 @@ class FunctionAllTest extends TestCase } /** @test */ - public function shouldResolveToEmptyArrayWhenInputPromiseDoesNotResolveToArray() - { + public function shouldResolveToEmptyArrayWhenInputPromiseDoesNotResolveToArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -96,8 +89,7 @@ class FunctionAllTest extends TestCase } /** @test */ - public function shouldPreserveTheOrderOfArrayWhenResolvingAsyncPromises() - { + public function shouldPreserveTheOrderOfArrayWhenResolvingAsyncPromises() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionAnyTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionAnyTest.php index 140b551..4c1358e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionAnyTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionAnyTest.php @@ -7,16 +7,15 @@ use React\Promise\Exception\LengthException; class FunctionAnyTest extends TestCase { /** @test */ - public function shouldRejectWithLengthExceptionWithEmptyInputArray() - { + public function shouldRejectWithLengthExceptionWithEmptyInputArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') ->with( - $this->callback(function($exception){ + $this->callback(function ($exception) { return $exception instanceof LengthException && - 'Input array must contain at least 1 item but contains only 0 items.' === $exception->getMessage(); + 'Input array must contain at least 1 item but contains only 0 items.' === $exception->getMessage(); }) ); @@ -25,21 +24,19 @@ class FunctionAnyTest extends TestCase } /** @test */ - public function shouldResolveToNullWithNonArrayInput() - { + public function shouldResolveToNullWithNonArrayInput() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') - ->with($this->identicalTo(null)); + ->with($this->identicalTo(NULL)); - any(null) + any(NULL) ->then($mock); } /** @test */ - public function shouldResolveWithAnInputValue() - { + public function shouldResolveWithAnInputValue() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -51,8 +48,7 @@ class FunctionAnyTest extends TestCase } /** @test */ - public function shouldResolveWithAPromisedInputValue() - { + public function shouldResolveWithAPromisedInputValue() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -64,8 +60,7 @@ class FunctionAnyTest extends TestCase } /** @test */ - public function shouldRejectWithAllRejectedInputValuesIfAllInputsAreRejected() - { + public function shouldRejectWithAllRejectedInputValuesIfAllInputsAreRejected() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -77,8 +72,7 @@ class FunctionAnyTest extends TestCase } /** @test */ - public function shouldResolveWhenFirstInputPromiseResolves() - { + public function shouldResolveWhenFirstInputPromiseResolves() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -90,8 +84,7 @@ class FunctionAnyTest extends TestCase } /** @test */ - public function shouldAcceptAPromiseForAnArray() - { + public function shouldAcceptAPromiseForAnArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -103,21 +96,19 @@ class FunctionAnyTest extends TestCase } /** @test */ - public function shouldResolveToNullArrayWhenInputPromiseDoesNotResolveToArray() - { + public function shouldResolveToNullArrayWhenInputPromiseDoesNotResolveToArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') - ->with($this->identicalTo(null)); + ->with($this->identicalTo(NULL)); any(resolve(1)) ->then($mock); } /** @test */ - public function shouldNotRelyOnArryIndexesWhenUnwrappingToASingleResolutionValue() - { + public function shouldNotRelyOnArryIndexesWhenUnwrappingToASingleResolutionValue() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -135,21 +126,19 @@ class FunctionAnyTest extends TestCase } /** @test */ - public function shouldRejectWhenInputPromiseRejects() - { + public function shouldRejectWhenInputPromiseRejects() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') - ->with($this->identicalTo(null)); + ->with($this->identicalTo(NULL)); any(reject()) ->then($this->expectCallableNever(), $mock); } /** @test */ - public function shouldCancelInputPromise() - { + public function shouldCancelInputPromise() { $mock = $this ->getMockBuilder('React\Promise\CancellablePromiseInterface') ->getMock(); @@ -161,8 +150,7 @@ class FunctionAnyTest extends TestCase } /** @test */ - public function shouldCancelInputArrayPromises() - { + public function shouldCancelInputArrayPromises() { $mock1 = $this ->getMockBuilder('React\Promise\CancellablePromiseInterface') ->getMock(); @@ -181,8 +169,7 @@ class FunctionAnyTest extends TestCase } /** @test */ - public function shouldNotCancelOtherPendingInputArrayPromisesIfOnePromiseFulfills() - { + public function shouldNotCancelOtherPendingInputArrayPromisesIfOnePromiseFulfills() { $mock = $this->createCallableMock(); $mock ->expects($this->never()) diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionCheckTypehintTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionCheckTypehintTest.php index 8449bc1..3a6e6f3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionCheckTypehintTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionCheckTypehintTest.php @@ -5,114 +5,96 @@ namespace React\Promise; class FunctionCheckTypehintTest extends TestCase { /** @test */ - public function shouldAcceptClosureCallbackWithTypehint() - { + public function shouldAcceptClosureCallbackWithTypehint() { $this->assertTrue(_checkTypehint(function (\InvalidArgumentException $e) { - }, new \InvalidArgumentException())); + }, new \InvalidArgumentException())); $this->assertfalse(_checkTypehint(function (\InvalidArgumentException $e) { - }, new \Exception())); + }, new \Exception())); } /** @test */ - public function shouldAcceptFunctionStringCallbackWithTypehint() - { + public function shouldAcceptFunctionStringCallbackWithTypehint() { $this->assertTrue(_checkTypehint('React\Promise\testCallbackWithTypehint', new \InvalidArgumentException())); $this->assertfalse(_checkTypehint('React\Promise\testCallbackWithTypehint', new \Exception())); } /** @test */ - public function shouldAcceptInvokableObjectCallbackWithTypehint() - { + public function shouldAcceptInvokableObjectCallbackWithTypehint() { $this->assertTrue(_checkTypehint(new TestCallbackWithTypehintClass(), new \InvalidArgumentException())); $this->assertfalse(_checkTypehint(new TestCallbackWithTypehintClass(), new \Exception())); } /** @test */ - public function shouldAcceptObjectMethodCallbackWithTypehint() - { + public function shouldAcceptObjectMethodCallbackWithTypehint() { $this->assertTrue(_checkTypehint([new TestCallbackWithTypehintClass(), 'testCallback'], new \InvalidArgumentException())); $this->assertfalse(_checkTypehint([new TestCallbackWithTypehintClass(), 'testCallback'], new \Exception())); } /** @test */ - public function shouldAcceptStaticClassCallbackWithTypehint() - { + public function shouldAcceptStaticClassCallbackWithTypehint() { $this->assertTrue(_checkTypehint(['React\Promise\TestCallbackWithTypehintClass', 'testCallbackStatic'], new \InvalidArgumentException())); $this->assertfalse(_checkTypehint(['React\Promise\TestCallbackWithTypehintClass', 'testCallbackStatic'], new \Exception())); } /** @test */ - public function shouldAcceptClosureCallbackWithoutTypehint() - { + public function shouldAcceptClosureCallbackWithoutTypehint() { $this->assertTrue(_checkTypehint(function (\InvalidArgumentException $e) { }, new \InvalidArgumentException())); } /** @test */ - public function shouldAcceptFunctionStringCallbackWithoutTypehint() - { + public function shouldAcceptFunctionStringCallbackWithoutTypehint() { $this->assertTrue(_checkTypehint('React\Promise\testCallbackWithoutTypehint', new \InvalidArgumentException())); } /** @test */ - public function shouldAcceptInvokableObjectCallbackWithoutTypehint() - { + public function shouldAcceptInvokableObjectCallbackWithoutTypehint() { $this->assertTrue(_checkTypehint(new TestCallbackWithoutTypehintClass(), new \InvalidArgumentException())); } /** @test */ - public function shouldAcceptObjectMethodCallbackWithoutTypehint() - { + public function shouldAcceptObjectMethodCallbackWithoutTypehint() { $this->assertTrue(_checkTypehint([new TestCallbackWithoutTypehintClass(), 'testCallback'], new \InvalidArgumentException())); } /** @test */ - public function shouldAcceptStaticClassCallbackWithoutTypehint() - { + public function shouldAcceptStaticClassCallbackWithoutTypehint() { $this->assertTrue(_checkTypehint(['React\Promise\TestCallbackWithoutTypehintClass', 'testCallbackStatic'], new \InvalidArgumentException())); } } -function testCallbackWithTypehint(\InvalidArgumentException $e) -{ +function testCallbackWithTypehint(\InvalidArgumentException $e) { } -function testCallbackWithoutTypehint() -{ +function testCallbackWithoutTypehint() { } class TestCallbackWithTypehintClass { - public function __invoke(\InvalidArgumentException $e) - { + public function __invoke(\InvalidArgumentException $e) { } - public function testCallback(\InvalidArgumentException $e) - { + public function testCallback(\InvalidArgumentException $e) { } - public static function testCallbackStatic(\InvalidArgumentException $e) - { + public static function testCallbackStatic(\InvalidArgumentException $e) { } } class TestCallbackWithoutTypehintClass { - public function __invoke() - { + public function __invoke() { } - public function testCallback() - { + public function testCallback() { } - public static function testCallbackStatic() - { + public static function testCallbackStatic() { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionMapTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionMapTest.php index 1ea560a..b43557f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionMapTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionMapTest.php @@ -4,23 +4,20 @@ namespace React\Promise; class FunctionMapTest extends TestCase { - protected function mapper() - { + protected function mapper() { return function ($val) { return $val * 2; }; } - protected function promiseMapper() - { + protected function promiseMapper() { return function ($val) { return resolve($val * 2); }; } /** @test */ - public function shouldMapInputValuesArray() - { + public function shouldMapInputValuesArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -34,8 +31,7 @@ class FunctionMapTest extends TestCase } /** @test */ - public function shouldMapInputPromisesArray() - { + public function shouldMapInputPromisesArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -49,8 +45,7 @@ class FunctionMapTest extends TestCase } /** @test */ - public function shouldMapMixedInputArray() - { + public function shouldMapMixedInputArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -64,8 +59,7 @@ class FunctionMapTest extends TestCase } /** @test */ - public function shouldMapInputWhenMapperReturnsAPromise() - { + public function shouldMapInputWhenMapperReturnsAPromise() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -79,8 +73,7 @@ class FunctionMapTest extends TestCase } /** @test */ - public function shouldAcceptAPromiseForAnArray() - { + public function shouldAcceptAPromiseForAnArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -94,8 +87,7 @@ class FunctionMapTest extends TestCase } /** @test */ - public function shouldResolveToEmptyArrayWhenInputPromiseDoesNotResolveToArray() - { + public function shouldResolveToEmptyArrayWhenInputPromiseDoesNotResolveToArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -109,8 +101,7 @@ class FunctionMapTest extends TestCase } /** @test */ - public function shouldPreserveTheOrderOfArrayWhenResolvingAsyncPromises() - { + public function shouldPreserveTheOrderOfArrayWhenResolvingAsyncPromises() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -128,8 +119,7 @@ class FunctionMapTest extends TestCase } /** @test */ - public function shouldRejectWhenInputContainsRejection() - { + public function shouldRejectWhenInputContainsRejection() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -143,13 +133,12 @@ class FunctionMapTest extends TestCase } /** @test */ - public function shouldRejectWhenInputPromiseRejects() - { + public function shouldRejectWhenInputPromiseRejects() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') - ->with($this->identicalTo(null)); + ->with($this->identicalTo(NULL)); map( reject(), @@ -158,8 +147,7 @@ class FunctionMapTest extends TestCase } /** @test */ - public function shouldCancelInputPromise() - { + public function shouldCancelInputPromise() { $mock = $this ->getMockBuilder('React\Promise\CancellablePromiseInterface') ->getMock(); @@ -174,8 +162,7 @@ class FunctionMapTest extends TestCase } /** @test */ - public function shouldCancelInputArrayPromises() - { + public function shouldCancelInputArrayPromises() { $mock1 = $this ->getMockBuilder('React\Promise\CancellablePromiseInterface') ->getMock(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionRaceTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionRaceTest.php index 83770ec..0e01eb1 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionRaceTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionRaceTest.php @@ -5,13 +5,12 @@ namespace React\Promise; class FunctionRaceTest extends TestCase { /** @test */ - public function shouldResolveEmptyInput() - { + public function shouldResolveEmptyInput() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') - ->with($this->identicalTo(null)); + ->with($this->identicalTo(NULL)); race( [] @@ -19,8 +18,7 @@ class FunctionRaceTest extends TestCase } /** @test */ - public function shouldResolveValuesArray() - { + public function shouldResolveValuesArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -33,8 +31,7 @@ class FunctionRaceTest extends TestCase } /** @test */ - public function shouldResolvePromisesArray() - { + public function shouldResolvePromisesArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -56,22 +53,20 @@ class FunctionRaceTest extends TestCase } /** @test */ - public function shouldResolveSparseArrayInput() - { + public function shouldResolveSparseArrayInput() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') - ->with($this->identicalTo(null)); + ->with($this->identicalTo(NULL)); race( - [null, 1, null, 2, 3] + [NULL, 1, NULL, 2, 3] )->then($mock); } /** @test */ - public function shouldRejectIfFirstSettledPromiseRejects() - { + public function shouldRejectIfFirstSettledPromiseRejects() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -93,8 +88,7 @@ class FunctionRaceTest extends TestCase } /** @test */ - public function shouldAcceptAPromiseForAnArray() - { + public function shouldAcceptAPromiseForAnArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -107,13 +101,12 @@ class FunctionRaceTest extends TestCase } /** @test */ - public function shouldResolveToNullWhenInputPromiseDoesNotResolveToArray() - { + public function shouldResolveToNullWhenInputPromiseDoesNotResolveToArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') - ->with($this->identicalTo(null)); + ->with($this->identicalTo(NULL)); race( resolve(1) @@ -121,13 +114,12 @@ class FunctionRaceTest extends TestCase } /** @test */ - public function shouldRejectWhenInputPromiseRejects() - { + public function shouldRejectWhenInputPromiseRejects() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') - ->with($this->identicalTo(null)); + ->with($this->identicalTo(NULL)); race( reject() @@ -135,8 +127,7 @@ class FunctionRaceTest extends TestCase } /** @test */ - public function shouldCancelInputPromise() - { + public function shouldCancelInputPromise() { $mock = $this ->getMockBuilder('React\Promise\CancellablePromiseInterface') ->getMock(); @@ -148,8 +139,7 @@ class FunctionRaceTest extends TestCase } /** @test */ - public function shouldCancelInputArrayPromises() - { + public function shouldCancelInputArrayPromises() { $mock1 = $this ->getMockBuilder('React\Promise\CancellablePromiseInterface') ->getMock(); @@ -168,8 +158,7 @@ class FunctionRaceTest extends TestCase } /** @test */ - public function shouldNotCancelOtherPendingInputArrayPromisesIfOnePromiseFulfills() - { + public function shouldNotCancelOtherPendingInputArrayPromisesIfOnePromiseFulfills() { $mock = $this->createCallableMock(); $mock ->expects($this->never()) @@ -189,8 +178,7 @@ class FunctionRaceTest extends TestCase } /** @test */ - public function shouldNotCancelOtherPendingInputArrayPromisesIfOnePromiseRejects() - { + public function shouldNotCancelOtherPendingInputArrayPromisesIfOnePromiseRejects() { $mock = $this->createCallableMock(); $mock ->expects($this->never()) diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionReduceTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionReduceTest.php index 8b43a87..1f09a48 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionReduceTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionReduceTest.php @@ -4,23 +4,20 @@ namespace React\Promise; class FunctionReduceTest extends TestCase { - protected function plus() - { + protected function plus() { return function ($sum, $val) { return $sum + $val; }; } - protected function append() - { + protected function append() { return function ($sum, $val) { return $sum . $val; }; } /** @test */ - public function shouldReduceValuesWithoutInitialValue() - { + public function shouldReduceValuesWithoutInitialValue() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -34,8 +31,7 @@ class FunctionReduceTest extends TestCase } /** @test */ - public function shouldReduceValuesWithInitialValue() - { + public function shouldReduceValuesWithInitialValue() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -50,8 +46,7 @@ class FunctionReduceTest extends TestCase } /** @test */ - public function shouldReduceValuesWithInitialPromise() - { + public function shouldReduceValuesWithInitialPromise() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -66,8 +61,7 @@ class FunctionReduceTest extends TestCase } /** @test */ - public function shouldReducePromisedValuesWithoutInitialValue() - { + public function shouldReducePromisedValuesWithoutInitialValue() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -81,8 +75,7 @@ class FunctionReduceTest extends TestCase } /** @test */ - public function shouldReducePromisedValuesWithInitialValue() - { + public function shouldReducePromisedValuesWithInitialValue() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -97,8 +90,7 @@ class FunctionReduceTest extends TestCase } /** @test */ - public function shouldReducePromisedValuesWithInitialPromise() - { + public function shouldReducePromisedValuesWithInitialPromise() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -113,8 +105,7 @@ class FunctionReduceTest extends TestCase } /** @test */ - public function shouldReduceEmptyInputWithInitialValue() - { + public function shouldReduceEmptyInputWithInitialValue() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -129,8 +120,7 @@ class FunctionReduceTest extends TestCase } /** @test */ - public function shouldReduceEmptyInputWithInitialPromise() - { + public function shouldReduceEmptyInputWithInitialPromise() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -145,8 +135,7 @@ class FunctionReduceTest extends TestCase } /** @test */ - public function shouldRejectWhenInputContainsRejection() - { + public function shouldRejectWhenInputContainsRejection() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -161,8 +150,7 @@ class FunctionReduceTest extends TestCase } /** @test */ - public function shouldResolveWithNullWhenInputIsEmptyAndNoInitialValueOrPromiseProvided() - { + public function shouldResolveWithNullWhenInputIsEmptyAndNoInitialValueOrPromiseProvided() { // Note: this is different from when.js's behavior! // In when.reduce(), this rejects with a TypeError exception (following // JavaScript's [].reduce behavior. @@ -171,7 +159,7 @@ class FunctionReduceTest extends TestCase $mock ->expects($this->once()) ->method('__invoke') - ->with($this->identicalTo(null)); + ->with($this->identicalTo(NULL)); reduce( [], @@ -180,8 +168,7 @@ class FunctionReduceTest extends TestCase } /** @test */ - public function shouldAllowSparseArrayInputWithoutInitialValue() - { + public function shouldAllowSparseArrayInputWithoutInitialValue() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -189,14 +176,13 @@ class FunctionReduceTest extends TestCase ->with($this->identicalTo(3)); reduce( - [null, null, 1, null, 1, 1], + [NULL, NULL, 1, NULL, 1, 1], $this->plus() )->then($mock); } /** @test */ - public function shouldAllowSparseArrayInputWithInitialValue() - { + public function shouldAllowSparseArrayInputWithInitialValue() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -204,15 +190,14 @@ class FunctionReduceTest extends TestCase ->with($this->identicalTo(4)); reduce( - [null, null, 1, null, 1, 1], + [NULL, NULL, 1, NULL, 1, 1], $this->plus(), 1 )->then($mock); } /** @test */ - public function shouldReduceInInputOrder() - { + public function shouldReduceInInputOrder() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -227,8 +212,7 @@ class FunctionReduceTest extends TestCase } /** @test */ - public function shouldAcceptAPromiseForAnArray() - { + public function shouldAcceptAPromiseForAnArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -243,8 +227,7 @@ class FunctionReduceTest extends TestCase } /** @test */ - public function shouldResolveToInitialValueWhenInputPromiseDoesNotResolveToAnArray() - { + public function shouldResolveToInitialValueWhenInputPromiseDoesNotResolveToAnArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -259,8 +242,7 @@ class FunctionReduceTest extends TestCase } /** @test */ - public function shouldProvideCorrectBasisValue() - { + public function shouldProvideCorrectBasisValue() { $insertIntoArray = function ($arr, $val, $i) { $arr[$i] = $val; @@ -289,13 +271,12 @@ class FunctionReduceTest extends TestCase } /** @test */ - public function shouldRejectWhenInputPromiseRejects() - { + public function shouldRejectWhenInputPromiseRejects() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') - ->with($this->identicalTo(null)); + ->with($this->identicalTo(NULL)); reduce( reject(), @@ -305,8 +286,7 @@ class FunctionReduceTest extends TestCase } /** @test */ - public function shouldCancelInputPromise() - { + public function shouldCancelInputPromise() { $mock = $this ->getMockBuilder('React\Promise\CancellablePromiseInterface') ->getMock(); @@ -322,8 +302,7 @@ class FunctionReduceTest extends TestCase } /** @test */ - public function shouldCancelInputArrayPromises() - { + public function shouldCancelInputArrayPromises() { $mock1 = $this ->getMockBuilder('React\Promise\CancellablePromiseInterface') ->getMock(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionRejectTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionRejectTest.php index 84b8ec6..5c6b5fd 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionRejectTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionRejectTest.php @@ -5,8 +5,7 @@ namespace React\Promise; class FunctionRejectTest extends TestCase { /** @test */ - public function shouldRejectAnImmediateValue() - { + public function shouldRejectAnImmediateValue() { $expected = 123; $mock = $this->createCallableMock(); @@ -23,8 +22,7 @@ class FunctionRejectTest extends TestCase } /** @test */ - public function shouldRejectAFulfilledPromise() - { + public function shouldRejectAFulfilledPromise() { $expected = 123; $resolved = new FulfilledPromise($expected); @@ -43,8 +41,7 @@ class FunctionRejectTest extends TestCase } /** @test */ - public function shouldRejectARejectedPromise() - { + public function shouldRejectARejectedPromise() { $expected = 123; $resolved = new RejectedPromise($expected); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionResolveTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionResolveTest.php index 53126bc..c82a370 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionResolveTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionResolveTest.php @@ -5,8 +5,7 @@ namespace React\Promise; class FunctionResolveTest extends TestCase { /** @test */ - public function shouldResolveAnImmediateValue() - { + public function shouldResolveAnImmediateValue() { $expected = 123; $mock = $this->createCallableMock(); @@ -23,8 +22,7 @@ class FunctionResolveTest extends TestCase } /** @test */ - public function shouldResolveAFulfilledPromise() - { + public function shouldResolveAFulfilledPromise() { $expected = 123; $resolved = new FulfilledPromise($expected); @@ -43,8 +41,7 @@ class FunctionResolveTest extends TestCase } /** @test */ - public function shouldResolveAThenable() - { + public function shouldResolveAThenable() { $thenable = new SimpleFulfilledTestThenable(); $mock = $this->createCallableMock(); @@ -61,8 +58,7 @@ class FunctionResolveTest extends TestCase } /** @test */ - public function shouldResolveACancellableThenable() - { + public function shouldResolveACancellableThenable() { $thenable = new SimpleTestCancellableThenable(); $promise = resolve($thenable); @@ -72,8 +68,7 @@ class FunctionResolveTest extends TestCase } /** @test */ - public function shouldRejectARejectedPromise() - { + public function shouldRejectARejectedPromise() { $expected = 123; $resolved = new RejectedPromise($expected); @@ -92,10 +87,9 @@ class FunctionResolveTest extends TestCase } /** @test */ - public function shouldSupportDeepNestingInPromiseChains() - { + public function shouldSupportDeepNestingInPromiseChains() { $d = new Deferred(); - $d->resolve(false); + $d->resolve(FALSE); $result = resolve(resolve($d->promise()->then(function ($val) { $d = new Deferred(); @@ -116,14 +110,13 @@ class FunctionResolveTest extends TestCase $mock ->expects($this->once()) ->method('__invoke') - ->with($this->identicalTo(true)); + ->with($this->identicalTo(TRUE)); $result->then($mock); } /** @test */ - public function shouldSupportVeryDeepNestedPromises() - { + public function shouldSupportVeryDeepNestedPromises() { $deferreds = []; // @TODO Increase count once global-queue is merged @@ -133,13 +126,13 @@ class FunctionResolveTest extends TestCase $last = $p; for ($j = 0; $j < 10; $j++) { - $last = $last->then(function($result) { + $last = $last->then(function ($result) { return $result; }); } } - $p = null; + $p = NULL; foreach ($deferreds as $d) { if ($p) { $d->resolve($p); @@ -148,20 +141,19 @@ class FunctionResolveTest extends TestCase $p = $d->promise(); } - $deferreds[0]->resolve(true); + $deferreds[0]->resolve(TRUE); $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') - ->with($this->identicalTo(true)); + ->with($this->identicalTo(TRUE)); $deferreds[0]->promise()->then($mock); } /** @test */ - public function returnsExtendePromiseForSimplePromise() - { + public function returnsExtendePromiseForSimplePromise() { $promise = $this ->getMockBuilder('React\Promise\PromiseInterface') ->getMock(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionSomeTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionSomeTest.php index 276b54b..a9fc8a1 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionSomeTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/FunctionSomeTest.php @@ -7,16 +7,15 @@ use React\Promise\Exception\LengthException; class FunctionSomeTest extends TestCase { /** @test */ - public function shouldRejectWithLengthExceptionWithEmptyInputArray() - { + public function shouldRejectWithLengthExceptionWithEmptyInputArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') ->with( - $this->callback(function($exception){ + $this->callback(function ($exception) { return $exception instanceof LengthException && - 'Input array must contain at least 1 item but contains only 0 items.' === $exception->getMessage(); + 'Input array must contain at least 1 item but contains only 0 items.' === $exception->getMessage(); }) ); @@ -27,16 +26,15 @@ class FunctionSomeTest extends TestCase } /** @test */ - public function shouldRejectWithLengthExceptionWithInputArrayContainingNotEnoughItems() - { + public function shouldRejectWithLengthExceptionWithInputArrayContainingNotEnoughItems() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') ->with( - $this->callback(function($exception){ + $this->callback(function ($exception) { return $exception instanceof LengthException && - 'Input array must contain at least 4 items but contains only 3 items.' === $exception->getMessage(); + 'Input array must contain at least 4 items but contains only 3 items.' === $exception->getMessage(); }) ); @@ -47,8 +45,7 @@ class FunctionSomeTest extends TestCase } /** @test */ - public function shouldResolveToEmptyArrayWithNonArrayInput() - { + public function shouldResolveToEmptyArrayWithNonArrayInput() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -56,14 +53,13 @@ class FunctionSomeTest extends TestCase ->with($this->identicalTo([])); some( - null, + NULL, 1 )->then($mock); } /** @test */ - public function shouldResolveValuesArray() - { + public function shouldResolveValuesArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -77,8 +73,7 @@ class FunctionSomeTest extends TestCase } /** @test */ - public function shouldResolvePromisesArray() - { + public function shouldResolvePromisesArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -92,23 +87,21 @@ class FunctionSomeTest extends TestCase } /** @test */ - public function shouldResolveSparseArrayInput() - { + public function shouldResolveSparseArrayInput() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') - ->with($this->identicalTo([null, 1])); + ->with($this->identicalTo([NULL, 1])); some( - [null, 1, null, 2, 3], + [NULL, 1, NULL, 2, 3], 2 )->then($mock); } /** @test */ - public function shouldRejectIfAnyInputPromiseRejectsBeforeDesiredNumberOfInputsAreResolved() - { + public function shouldRejectIfAnyInputPromiseRejectsBeforeDesiredNumberOfInputsAreResolved() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -122,8 +115,7 @@ class FunctionSomeTest extends TestCase } /** @test */ - public function shouldAcceptAPromiseForAnArray() - { + public function shouldAcceptAPromiseForAnArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -137,8 +129,7 @@ class FunctionSomeTest extends TestCase } /** @test */ - public function shouldResolveWithEmptyArrayIfHowManyIsLessThanOne() - { + public function shouldResolveWithEmptyArrayIfHowManyIsLessThanOne() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -152,8 +143,7 @@ class FunctionSomeTest extends TestCase } /** @test */ - public function shouldResolveToEmptyArrayWhenInputPromiseDoesNotResolveToArray() - { + public function shouldResolveToEmptyArrayWhenInputPromiseDoesNotResolveToArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -167,13 +157,12 @@ class FunctionSomeTest extends TestCase } /** @test */ - public function shouldRejectWhenInputPromiseRejects() - { + public function shouldRejectWhenInputPromiseRejects() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') - ->with($this->identicalTo(null)); + ->with($this->identicalTo(NULL)); some( reject(), @@ -182,8 +171,7 @@ class FunctionSomeTest extends TestCase } /** @test */ - public function shouldCancelInputPromise() - { + public function shouldCancelInputPromise() { $mock = $this ->getMockBuilder('React\Promise\CancellablePromiseInterface') ->getMock(); @@ -195,8 +183,7 @@ class FunctionSomeTest extends TestCase } /** @test */ - public function shouldCancelInputArrayPromises() - { + public function shouldCancelInputArrayPromises() { $mock1 = $this ->getMockBuilder('React\Promise\CancellablePromiseInterface') ->getMock(); @@ -215,8 +202,7 @@ class FunctionSomeTest extends TestCase } /** @test */ - public function shouldNotCancelOtherPendingInputArrayPromisesIfEnoughPromisesFulfill() - { + public function shouldNotCancelOtherPendingInputArrayPromisesIfEnoughPromisesFulfill() { $mock = $this->createCallableMock(); $mock ->expects($this->never()) @@ -236,8 +222,7 @@ class FunctionSomeTest extends TestCase } /** @test */ - public function shouldNotCancelOtherPendingInputArrayPromisesIfEnoughPromisesReject() - { + public function shouldNotCancelOtherPendingInputArrayPromisesIfEnoughPromisesReject() { $mock = $this->createCallableMock(); $mock ->expects($this->never()) diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/LazyPromiseTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/LazyPromiseTest.php index b630881..28f9eeb 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/LazyPromiseTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/LazyPromiseTest.php @@ -8,8 +8,7 @@ class LazyPromiseTest extends TestCase { use PromiseTest\FullTestTrait; - public function getPromiseTestAdapter(callable $canceller = null) - { + public function getPromiseTestAdapter(callable $canceller = NULL) { $d = new Deferred($canceller); $factory = function () use ($d) { @@ -17,19 +16,18 @@ class LazyPromiseTest extends TestCase }; return new CallbackPromiseAdapter([ - 'promise' => function () use ($factory) { + 'promise' => function () use ($factory) { return new LazyPromise($factory); }, 'resolve' => [$d, 'resolve'], - 'reject' => [$d, 'reject'], - 'notify' => [$d, 'progress'], - 'settle' => [$d, 'resolve'], + 'reject' => [$d, 'reject'], + 'notify' => [$d, 'progress'], + 'settle' => [$d, 'resolve'], ]); } /** @test */ - public function shouldNotCallFactoryIfThenIsNotInvoked() - { + public function shouldNotCallFactoryIfThenIsNotInvoked() { $factory = $this->createCallableMock(); $factory ->expects($this->never()) @@ -39,8 +37,7 @@ class LazyPromiseTest extends TestCase } /** @test */ - public function shouldCallFactoryIfThenIsInvoked() - { + public function shouldCallFactoryIfThenIsInvoked() { $factory = $this->createCallableMock(); $factory ->expects($this->once()) @@ -51,8 +48,7 @@ class LazyPromiseTest extends TestCase } /** @test */ - public function shouldReturnPromiseFromFactory() - { + public function shouldReturnPromiseFromFactory() { $factory = $this->createCallableMock(); $factory ->expects($this->once()) @@ -71,21 +67,19 @@ class LazyPromiseTest extends TestCase } /** @test */ - public function shouldReturnPromiseIfFactoryReturnsNull() - { + public function shouldReturnPromiseIfFactoryReturnsNull() { $factory = $this->createCallableMock(); $factory ->expects($this->once()) ->method('__invoke') - ->will($this->returnValue(null)); + ->will($this->returnValue(NULL)); $p = new LazyPromise($factory); $this->assertInstanceOf('React\\Promise\\PromiseInterface', $p->then()); } /** @test */ - public function shouldReturnRejectedPromiseIfFactoryThrowsException() - { + public function shouldReturnRejectedPromiseIfFactoryThrowsException() { $exception = new \Exception(); $factory = $this->createCallableMock(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseAdapter/CallbackPromiseAdapter.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseAdapter/CallbackPromiseAdapter.php index bdedf46..24cc566 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseAdapter/CallbackPromiseAdapter.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseAdapter/CallbackPromiseAdapter.php @@ -8,33 +8,27 @@ class CallbackPromiseAdapter implements PromiseAdapterInterface { private $callbacks; - public function __construct(array $callbacks) - { + public function __construct(array $callbacks) { $this->callbacks = $callbacks; } - public function promise() - { + public function promise() { return call_user_func_array($this->callbacks['promise'], func_get_args()); } - public function resolve() - { + public function resolve() { return call_user_func_array($this->callbacks['resolve'], func_get_args()); } - public function reject() - { + public function reject() { return call_user_func_array($this->callbacks['reject'], func_get_args()); } - public function notify() - { + public function notify() { return call_user_func_array($this->callbacks['notify'], func_get_args()); } - public function settle() - { + public function settle() { return call_user_func_array($this->callbacks['settle'], func_get_args()); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseAdapter/PromiseAdapterInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseAdapter/PromiseAdapterInterface.php index 9157cd4..e8b8aad 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseAdapter/PromiseAdapterInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseAdapter/PromiseAdapterInterface.php @@ -7,8 +7,12 @@ use React\Promise; interface PromiseAdapterInterface { public function promise(); + public function resolve(); + public function reject(); + public function notify(); + public function settle(); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest.php index dc7b733..2fd96e2 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest.php @@ -8,13 +8,12 @@ class PromiseTest extends TestCase { use PromiseTest\FullTestTrait; - public function getPromiseTestAdapter(callable $canceller = null) - { - $resolveCallback = $rejectCallback = $progressCallback = null; + public function getPromiseTestAdapter(callable $canceller = NULL) { + $resolveCallback = $rejectCallback = $progressCallback = NULL; $promise = new Promise(function ($resolve, $reject, $progress) use (&$resolveCallback, &$rejectCallback, &$progressCallback) { - $resolveCallback = $resolve; - $rejectCallback = $reject; + $resolveCallback = $resolve; + $rejectCallback = $reject; $progressCallback = $progress; }, $canceller); @@ -23,15 +22,14 @@ class PromiseTest extends TestCase return $promise; }, 'resolve' => $resolveCallback, - 'reject' => $rejectCallback, - 'notify' => $progressCallback, - 'settle' => $resolveCallback, + 'reject' => $rejectCallback, + 'notify' => $progressCallback, + 'settle' => $resolveCallback, ]); } /** @test */ - public function shouldRejectIfResolverThrowsException() - { + public function shouldRejectIfResolverThrowsException() { $exception = new \Exception('foo'); $promise = new Promise(function () use ($exception) { @@ -49,8 +47,7 @@ class PromiseTest extends TestCase } /** @test */ - public function shouldFulfillIfFullfilledWithSimplePromise() - { + public function shouldFulfillIfFullfilledWithSimplePromise() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -66,8 +63,7 @@ class PromiseTest extends TestCase } /** @test */ - public function shouldRejectIfRejectedWithSimplePromise() - { + public function shouldRejectIfRejectedWithSimplePromise() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/CancelTestTrait.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/CancelTestTrait.php index d722d75..8b83709 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/CancelTestTrait.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/CancelTestTrait.php @@ -9,11 +9,10 @@ trait CancelTestTrait /** * @return \React\Promise\PromiseAdapter\PromiseAdapterInterface */ - abstract public function getPromiseTestAdapter(callable $canceller = null); + abstract public function getPromiseTestAdapter(callable $canceller = NULL); /** @test */ - public function cancelShouldCallCancellerWithResolverArguments() - { + public function cancelShouldCallCancellerWithResolverArguments() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -26,8 +25,7 @@ trait CancelTestTrait } /** @test */ - public function cancelShouldFulfillPromiseIfCancellerFulfills() - { + public function cancelShouldFulfillPromiseIfCancellerFulfills() { $adapter = $this->getPromiseTestAdapter(function ($resolve) { $resolve(1); }); @@ -45,8 +43,7 @@ trait CancelTestTrait } /** @test */ - public function cancelShouldRejectPromiseIfCancellerRejects() - { + public function cancelShouldRejectPromiseIfCancellerRejects() { $adapter = $this->getPromiseTestAdapter(function ($resolve, $reject) { $reject(1); }); @@ -64,8 +61,7 @@ trait CancelTestTrait } /** @test */ - public function cancelShouldRejectPromiseWithExceptionIfCancellerThrows() - { + public function cancelShouldRejectPromiseWithExceptionIfCancellerThrows() { $e = new \Exception(); $adapter = $this->getPromiseTestAdapter(function () use ($e) { @@ -85,8 +81,7 @@ trait CancelTestTrait } /** @test */ - public function cancelShouldProgressPromiseIfCancellerNotifies() - { + public function cancelShouldProgressPromiseIfCancellerNotifies() { $adapter = $this->getPromiseTestAdapter(function ($resolve, $reject, $progress) { $progress(1); }); @@ -104,8 +99,7 @@ trait CancelTestTrait } /** @test */ - public function cancelShouldCallCancellerOnlyOnceIfCancellerResolves() - { + public function cancelShouldCallCancellerOnlyOnceIfCancellerResolves() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -121,9 +115,9 @@ trait CancelTestTrait } /** @test */ - public function cancelShouldHaveNoEffectIfCancellerDoesNothing() - { - $adapter = $this->getPromiseTestAdapter(function () {}); + public function cancelShouldHaveNoEffectIfCancellerDoesNothing() { + $adapter = $this->getPromiseTestAdapter(function () { + }); $adapter->promise() ->then($this->expectCallableNever(), $this->expectCallableNever()); @@ -133,8 +127,7 @@ trait CancelTestTrait } /** @test */ - public function cancelShouldCallCancellerFromDeepNestedPromiseChain() - { + public function cancelShouldCallCancellerFromDeepNestedPromiseChain() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -144,7 +137,8 @@ trait CancelTestTrait $promise = $adapter->promise() ->then(function () { - return new Promise\Promise(function () {}); + return new Promise\Promise(function () { + }); }) ->then(function () { $d = new Promise\Deferred(); @@ -152,15 +146,15 @@ trait CancelTestTrait return $d->promise(); }) ->then(function () { - return new Promise\Promise(function () {}); + return new Promise\Promise(function () { + }); }); $promise->cancel(); } /** @test */ - public function cancelCalledOnChildrenSouldOnlyCancelWhenAllChildrenCancelled() - { + public function cancelCalledOnChildrenSouldOnlyCancelWhenAllChildrenCancelled() { $adapter = $this->getPromiseTestAdapter($this->expectCallableNever()); $child1 = $adapter->promise() @@ -174,8 +168,7 @@ trait CancelTestTrait } /** @test */ - public function cancelShouldTriggerCancellerWhenAllChildrenCancel() - { + public function cancelShouldTriggerCancellerWhenAllChildrenCancel() { $adapter = $this->getPromiseTestAdapter($this->expectCallableOnce()); $child1 = $adapter->promise() @@ -190,8 +183,7 @@ trait CancelTestTrait } /** @test */ - public function cancelShouldNotTriggerCancellerWhenCancellingOneChildrenMultipleTimes() - { + public function cancelShouldNotTriggerCancellerWhenCancellingOneChildrenMultipleTimes() { $adapter = $this->getPromiseTestAdapter($this->expectCallableNever()); $child1 = $adapter->promise() @@ -206,8 +198,7 @@ trait CancelTestTrait } /** @test */ - public function cancelShouldTriggerCancellerOnlyOnceWhenCancellingMultipleTimes() - { + public function cancelShouldTriggerCancellerOnlyOnceWhenCancellingMultipleTimes() { $adapter = $this->getPromiseTestAdapter($this->expectCallableOnce()); $adapter->promise()->cancel(); @@ -215,8 +206,7 @@ trait CancelTestTrait } /** @test */ - public function cancelShouldAlwaysTriggerCancellerWhenCalledOnRootPromise() - { + public function cancelShouldAlwaysTriggerCancellerWhenCalledOnRootPromise() { $adapter = $this->getPromiseTestAdapter($this->expectCallableOnce()); $adapter->promise() diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/NotifyTestTrait.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/NotifyTestTrait.php index 4501df6..2179275 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/NotifyTestTrait.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/NotifyTestTrait.php @@ -7,11 +7,10 @@ trait NotifyTestTrait /** * @return \React\Promise\PromiseAdapter\PromiseAdapterInterface */ - abstract public function getPromiseTestAdapter(callable $canceller = null); + abstract public function getPromiseTestAdapter(callable $canceller = NULL); /** @test */ - public function notifyShouldProgress() - { + public function notifyShouldProgress() { $adapter = $this->getPromiseTestAdapter(); $sentinel = new \stdClass(); @@ -29,8 +28,7 @@ trait NotifyTestTrait } /** @test */ - public function notifyShouldPropagateProgressToDownstreamPromises() - { + public function notifyShouldPropagateProgressToDownstreamPromises() { $adapter = $this->getPromiseTestAdapter(); $sentinel = new \stdClass(); @@ -63,8 +61,7 @@ trait NotifyTestTrait } /** @test */ - public function notifyShouldPropagateTransformedProgressToDownstreamPromises() - { + public function notifyShouldPropagateTransformedProgressToDownstreamPromises() { $adapter = $this->getPromiseTestAdapter(); $sentinel = new \stdClass(); @@ -97,8 +94,7 @@ trait NotifyTestTrait } /** @test */ - public function notifyShouldPropagateCaughtExceptionValueAsProgress() - { + public function notifyShouldPropagateCaughtExceptionValueAsProgress() { $adapter = $this->getPromiseTestAdapter(); $exception = new \Exception(); @@ -131,8 +127,7 @@ trait NotifyTestTrait } /** @test */ - public function notifyShouldForwardProgressEventsWhenIntermediaryCallbackTiedToAResolvedPromiseReturnsAPromise() - { + public function notifyShouldForwardProgressEventsWhenIntermediaryCallbackTiedToAResolvedPromiseReturnsAPromise() { $adapter = $this->getPromiseTestAdapter(); $adapter2 = $this->getPromiseTestAdapter(); @@ -163,8 +158,7 @@ trait NotifyTestTrait } /** @test */ - public function notifyShouldForwardProgressEventsWhenIntermediaryCallbackTiedToAnUnresolvedPromiseReturnsAPromise() - { + public function notifyShouldForwardProgressEventsWhenIntermediaryCallbackTiedToAnUnresolvedPromiseReturnsAPromise() { $adapter = $this->getPromiseTestAdapter(); $adapter2 = $this->getPromiseTestAdapter(); @@ -194,8 +188,7 @@ trait NotifyTestTrait } /** @test */ - public function notifyShouldForwardProgressWhenResolvedWithAnotherPromise() - { + public function notifyShouldForwardProgressWhenResolvedWithAnotherPromise() { $adapter = $this->getPromiseTestAdapter(); $adapter2 = $this->getPromiseTestAdapter(); @@ -230,8 +223,7 @@ trait NotifyTestTrait } /** @test */ - public function notifyShouldAllowResolveAfterProgress() - { + public function notifyShouldAllowResolveAfterProgress() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -256,8 +248,7 @@ trait NotifyTestTrait } /** @test */ - public function notifyShouldAllowRejectAfterProgress() - { + public function notifyShouldAllowRejectAfterProgress() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -282,8 +273,7 @@ trait NotifyTestTrait } /** @test */ - public function notifyShouldReturnSilentlyOnProgressWhenAlreadyRejected() - { + public function notifyShouldReturnSilentlyOnProgressWhenAlreadyRejected() { $adapter = $this->getPromiseTestAdapter(); $adapter->reject(1); @@ -292,8 +282,7 @@ trait NotifyTestTrait } /** @test */ - public function notifyShouldInvokeProgressHandler() - { + public function notifyShouldInvokeProgressHandler() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -307,8 +296,7 @@ trait NotifyTestTrait } /** @test */ - public function notifyShouldInvokeProgressHandlerFromDone() - { + public function notifyShouldInvokeProgressHandlerFromDone() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -317,18 +305,17 @@ trait NotifyTestTrait ->method('__invoke') ->with($this->identicalTo(1)); - $this->assertNull($adapter->promise()->done(null, null, $mock)); + $this->assertNull($adapter->promise()->done(NULL, NULL, $mock)); $adapter->notify(1); } /** @test */ - public function notifyShouldThrowExceptionThrownProgressHandlerFromDone() - { + public function notifyShouldThrowExceptionThrownProgressHandlerFromDone() { $adapter = $this->getPromiseTestAdapter(); $this->setExpectedException('\Exception', 'UnhandledRejectionException'); - $this->assertNull($adapter->promise()->done(null, null, function () { + $this->assertNull($adapter->promise()->done(NULL, NULL, function () { throw new \Exception('UnhandledRejectionException'); })); $adapter->notify(1); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/PromiseFulfilledTestTrait.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/PromiseFulfilledTestTrait.php index 428230b..9b9bb2a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/PromiseFulfilledTestTrait.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/PromiseFulfilledTestTrait.php @@ -7,11 +7,10 @@ trait PromiseFulfilledTestTrait /** * @return \React\Promise\PromiseAdapter\PromiseAdapterInterface */ - abstract public function getPromiseTestAdapter(callable $canceller = null); + abstract public function getPromiseTestAdapter(callable $canceller = NULL); /** @test */ - public function fulfilledPromiseShouldBeImmutable() - { + public function fulfilledPromiseShouldBeImmutable() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -31,8 +30,7 @@ trait PromiseFulfilledTestTrait } /** @test */ - public function fulfilledPromiseShouldInvokeNewlyAddedCallback() - { + public function fulfilledPromiseShouldInvokeNewlyAddedCallback() { $adapter = $this->getPromiseTestAdapter(); $adapter->resolve(1); @@ -48,8 +46,7 @@ trait PromiseFulfilledTestTrait } /** @test */ - public function thenShouldForwardResultWhenCallbackIsNull() - { + public function thenShouldForwardResultWhenCallbackIsNull() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -61,7 +58,7 @@ trait PromiseFulfilledTestTrait $adapter->resolve(1); $adapter->promise() ->then( - null, + NULL, $this->expectCallableNever() ) ->then( @@ -71,8 +68,7 @@ trait PromiseFulfilledTestTrait } /** @test */ - public function thenShouldForwardCallbackResultToNextCallback() - { + public function thenShouldForwardCallbackResultToNextCallback() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -96,8 +92,7 @@ trait PromiseFulfilledTestTrait } /** @test */ - public function thenShouldForwardPromisedCallbackResultValueToNextCallback() - { + public function thenShouldForwardPromisedCallbackResultValueToNextCallback() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -121,8 +116,7 @@ trait PromiseFulfilledTestTrait } /** @test */ - public function thenShouldSwitchFromCallbacksToErrbacksWhenCallbackReturnsARejection() - { + public function thenShouldSwitchFromCallbacksToErrbacksWhenCallbackReturnsARejection() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -146,8 +140,7 @@ trait PromiseFulfilledTestTrait } /** @test */ - public function thenShouldSwitchFromCallbacksToErrbacksWhenCallbackThrows() - { + public function thenShouldSwitchFromCallbacksToErrbacksWhenCallbackThrows() { $adapter = $this->getPromiseTestAdapter(); $exception = new \Exception(); @@ -177,8 +170,7 @@ trait PromiseFulfilledTestTrait } /** @test */ - public function cancelShouldReturnNullForFulfilledPromise() - { + public function cancelShouldReturnNullForFulfilledPromise() { $adapter = $this->getPromiseTestAdapter(); $adapter->resolve(); @@ -187,8 +179,7 @@ trait PromiseFulfilledTestTrait } /** @test */ - public function cancelShouldHaveNoEffectForFulfilledPromise() - { + public function cancelShouldHaveNoEffectForFulfilledPromise() { $adapter = $this->getPromiseTestAdapter($this->expectCallableNever()); $adapter->resolve(); @@ -197,8 +188,7 @@ trait PromiseFulfilledTestTrait } /** @test */ - public function doneShouldInvokeFulfillmentHandlerForFulfilledPromise() - { + public function doneShouldInvokeFulfillmentHandlerForFulfilledPromise() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -212,8 +202,7 @@ trait PromiseFulfilledTestTrait } /** @test */ - public function doneShouldThrowExceptionThrownFulfillmentHandlerForFulfilledPromise() - { + public function doneShouldThrowExceptionThrownFulfillmentHandlerForFulfilledPromise() { $adapter = $this->getPromiseTestAdapter(); $this->setExpectedException('\Exception', 'UnhandledRejectionException'); @@ -225,8 +214,7 @@ trait PromiseFulfilledTestTrait } /** @test */ - public function doneShouldThrowUnhandledRejectionExceptionWhenFulfillmentHandlerRejectsForFulfilledPromise() - { + public function doneShouldThrowUnhandledRejectionExceptionWhenFulfillmentHandlerRejectsForFulfilledPromise() { $adapter = $this->getPromiseTestAdapter(); $this->setExpectedException('React\\Promise\\UnhandledRejectionException'); @@ -238,8 +226,7 @@ trait PromiseFulfilledTestTrait } /** @test */ - public function otherwiseShouldNotInvokeRejectionHandlerForFulfilledPromise() - { + public function otherwiseShouldNotInvokeRejectionHandlerForFulfilledPromise() { $adapter = $this->getPromiseTestAdapter(); $adapter->resolve(1); @@ -247,8 +234,7 @@ trait PromiseFulfilledTestTrait } /** @test */ - public function alwaysShouldNotSuppressValueForFulfilledPromise() - { + public function alwaysShouldNotSuppressValueForFulfilledPromise() { $adapter = $this->getPromiseTestAdapter(); $value = new \stdClass(); @@ -261,13 +247,13 @@ trait PromiseFulfilledTestTrait $adapter->resolve($value); $adapter->promise() - ->always(function () {}) + ->always(function () { + }) ->then($mock); } /** @test */ - public function alwaysShouldNotSuppressValueWhenHandlerReturnsANonPromiseForFulfilledPromise() - { + public function alwaysShouldNotSuppressValueWhenHandlerReturnsANonPromiseForFulfilledPromise() { $adapter = $this->getPromiseTestAdapter(); $value = new \stdClass(); @@ -287,8 +273,7 @@ trait PromiseFulfilledTestTrait } /** @test */ - public function alwaysShouldNotSuppressValueWhenHandlerReturnsAPromiseForFulfilledPromise() - { + public function alwaysShouldNotSuppressValueWhenHandlerReturnsAPromiseForFulfilledPromise() { $adapter = $this->getPromiseTestAdapter(); $value = new \stdClass(); @@ -308,8 +293,7 @@ trait PromiseFulfilledTestTrait } /** @test */ - public function alwaysShouldRejectWhenHandlerThrowsForFulfilledPromise() - { + public function alwaysShouldRejectWhenHandlerThrowsForFulfilledPromise() { $adapter = $this->getPromiseTestAdapter(); $exception = new \Exception(); @@ -325,12 +309,11 @@ trait PromiseFulfilledTestTrait ->always(function () use ($exception) { throw $exception; }) - ->then(null, $mock); + ->then(NULL, $mock); } /** @test */ - public function alwaysShouldRejectWhenHandlerRejectsForFulfilledPromise() - { + public function alwaysShouldRejectWhenHandlerRejectsForFulfilledPromise() { $adapter = $this->getPromiseTestAdapter(); $exception = new \Exception(); @@ -346,6 +329,6 @@ trait PromiseFulfilledTestTrait ->always(function () use ($exception) { return \React\Promise\reject($exception); }) - ->then(null, $mock); + ->then(NULL, $mock); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/PromisePendingTestTrait.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/PromisePendingTestTrait.php index a4f48ee..d0ba8da 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/PromisePendingTestTrait.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/PromisePendingTestTrait.php @@ -7,51 +7,45 @@ trait PromisePendingTestTrait /** * @return \React\Promise\PromiseAdapter\PromiseAdapterInterface */ - abstract public function getPromiseTestAdapter(callable $canceller = null); + abstract public function getPromiseTestAdapter(callable $canceller = NULL); /** @test */ - public function thenShouldReturnAPromiseForPendingPromise() - { + public function thenShouldReturnAPromiseForPendingPromise() { $adapter = $this->getPromiseTestAdapter(); $this->assertInstanceOf('React\\Promise\\PromiseInterface', $adapter->promise()->then()); } /** @test */ - public function thenShouldReturnAllowNullForPendingPromise() - { + public function thenShouldReturnAllowNullForPendingPromise() { $adapter = $this->getPromiseTestAdapter(); - $this->assertInstanceOf('React\\Promise\\PromiseInterface', $adapter->promise()->then(null, null, null)); + $this->assertInstanceOf('React\\Promise\\PromiseInterface', $adapter->promise()->then(NULL, NULL, NULL)); } /** @test */ - public function cancelShouldReturnNullForPendingPromise() - { + public function cancelShouldReturnNullForPendingPromise() { $adapter = $this->getPromiseTestAdapter(); $this->assertNull($adapter->promise()->cancel()); } /** @test */ - public function doneShouldReturnNullForPendingPromise() - { + public function doneShouldReturnNullForPendingPromise() { $adapter = $this->getPromiseTestAdapter(); $this->assertNull($adapter->promise()->done()); } /** @test */ - public function doneShouldReturnAllowNullForPendingPromise() - { + public function doneShouldReturnAllowNullForPendingPromise() { $adapter = $this->getPromiseTestAdapter(); - $this->assertNull($adapter->promise()->done(null, null, null)); + $this->assertNull($adapter->promise()->done(NULL, NULL, NULL)); } /** @test */ - public function otherwiseShouldNotInvokeRejectionHandlerForPendingPromise() - { + public function otherwiseShouldNotInvokeRejectionHandlerForPendingPromise() { $adapter = $this->getPromiseTestAdapter(); $adapter->settle(); @@ -59,10 +53,10 @@ trait PromisePendingTestTrait } /** @test */ - public function alwaysShouldReturnAPromiseForPendingPromise() - { + public function alwaysShouldReturnAPromiseForPendingPromise() { $adapter = $this->getPromiseTestAdapter(); - $this->assertInstanceOf('React\\Promise\\PromiseInterface', $adapter->promise()->always(function () {})); + $this->assertInstanceOf('React\\Promise\\PromiseInterface', $adapter->promise()->always(function () { + })); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/PromiseRejectedTestTrait.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/PromiseRejectedTestTrait.php index 98d1dcf..49ebe62 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/PromiseRejectedTestTrait.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/PromiseRejectedTestTrait.php @@ -10,11 +10,10 @@ trait PromiseRejectedTestTrait /** * @return \React\Promise\PromiseAdapter\PromiseAdapterInterface */ - abstract public function getPromiseTestAdapter(callable $canceller = null); + abstract public function getPromiseTestAdapter(callable $canceller = NULL); /** @test */ - public function rejectedPromiseShouldBeImmutable() - { + public function rejectedPromiseShouldBeImmutable() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -34,8 +33,7 @@ trait PromiseRejectedTestTrait } /** @test */ - public function rejectedPromiseShouldInvokeNewlyAddedCallback() - { + public function rejectedPromiseShouldInvokeNewlyAddedCallback() { $adapter = $this->getPromiseTestAdapter(); $adapter->reject(1); @@ -51,15 +49,14 @@ trait PromiseRejectedTestTrait } /** @test */ - public function shouldForwardUndefinedRejectionValue() - { + public function shouldForwardUndefinedRejectionValue() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') - ->with(null); + ->with(NULL); $adapter->reject(1); $adapter->promise() @@ -79,8 +76,7 @@ trait PromiseRejectedTestTrait } /** @test */ - public function shouldSwitchFromErrbacksToCallbacksWhenErrbackDoesNotExplicitlyPropagate() - { + public function shouldSwitchFromErrbacksToCallbacksWhenErrbackDoesNotExplicitlyPropagate() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -104,8 +100,7 @@ trait PromiseRejectedTestTrait } /** @test */ - public function shouldSwitchFromErrbacksToCallbacksWhenErrbackReturnsAResolution() - { + public function shouldSwitchFromErrbacksToCallbacksWhenErrbackReturnsAResolution() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -129,8 +124,7 @@ trait PromiseRejectedTestTrait } /** @test */ - public function shouldPropagateRejectionsWhenErrbackThrows() - { + public function shouldPropagateRejectionsWhenErrbackThrows() { $adapter = $this->getPromiseTestAdapter(); $exception = new \Exception(); @@ -160,8 +154,7 @@ trait PromiseRejectedTestTrait } /** @test */ - public function shouldPropagateRejectionsWhenErrbackReturnsARejection() - { + public function shouldPropagateRejectionsWhenErrbackReturnsARejection() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -185,8 +178,7 @@ trait PromiseRejectedTestTrait } /** @test */ - public function doneShouldInvokeRejectionHandlerForRejectedPromise() - { + public function doneShouldInvokeRejectionHandlerForRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -196,25 +188,23 @@ trait PromiseRejectedTestTrait ->with($this->identicalTo(1)); $adapter->reject(1); - $this->assertNull($adapter->promise()->done(null, $mock)); + $this->assertNull($adapter->promise()->done(NULL, $mock)); } /** @test */ - public function doneShouldThrowExceptionThrownByRejectionHandlerForRejectedPromise() - { + public function doneShouldThrowExceptionThrownByRejectionHandlerForRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $this->setExpectedException('\Exception', 'UnhandledRejectionException'); $adapter->reject(1); - $this->assertNull($adapter->promise()->done(null, function () { + $this->assertNull($adapter->promise()->done(NULL, function () { throw new \Exception('UnhandledRejectionException'); })); } /** @test */ - public function doneShouldThrowUnhandledRejectionExceptionWhenRejectedWithNonExceptionForRejectedPromise() - { + public function doneShouldThrowUnhandledRejectionExceptionWhenRejectedWithNonExceptionForRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $this->setExpectedException('React\\Promise\\UnhandledRejectionException'); @@ -224,8 +214,7 @@ trait PromiseRejectedTestTrait } /** @test */ - public function unhandledRejectionExceptionThrownByDoneHoldsRejectionValue() - { + public function unhandledRejectionExceptionThrownByDoneHoldsRejectionValue() { $adapter = $this->getPromiseTestAdapter(); $expected = new \stdClass(); @@ -243,34 +232,31 @@ trait PromiseRejectedTestTrait } /** @test */ - public function doneShouldThrowUnhandledRejectionExceptionWhenRejectionHandlerRejectsForRejectedPromise() - { + public function doneShouldThrowUnhandledRejectionExceptionWhenRejectionHandlerRejectsForRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $this->setExpectedException('React\\Promise\\UnhandledRejectionException'); $adapter->reject(1); - $this->assertNull($adapter->promise()->done(null, function () { + $this->assertNull($adapter->promise()->done(NULL, function () { return \React\Promise\reject(); })); } /** @test */ - public function doneShouldThrowRejectionExceptionWhenRejectionHandlerRejectsWithExceptionForRejectedPromise() - { + public function doneShouldThrowRejectionExceptionWhenRejectionHandlerRejectsWithExceptionForRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $this->setExpectedException('\Exception', 'UnhandledRejectionException'); $adapter->reject(1); - $this->assertNull($adapter->promise()->done(null, function () { + $this->assertNull($adapter->promise()->done(NULL, function () { return \React\Promise\reject(new \Exception('UnhandledRejectionException')); })); } /** @test */ - public function doneShouldThrowExceptionProvidedAsRejectionValueForRejectedPromise() - { + public function doneShouldThrowExceptionProvidedAsRejectionValueForRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $this->setExpectedException('\Exception', 'UnhandledRejectionException'); @@ -280,8 +266,7 @@ trait PromiseRejectedTestTrait } /** @test */ - public function doneShouldThrowWithDeepNestingPromiseChainsForRejectedPromise() - { + public function doneShouldThrowWithDeepNestingPromiseChainsForRejectedPromise() { $this->setExpectedException('\Exception', 'UnhandledRejectionException'); $exception = new \Exception('UnhandledRejectionException'); @@ -293,7 +278,8 @@ trait PromiseRejectedTestTrait $d = new Deferred(); $d->resolve(); - return \React\Promise\resolve($d->promise()->then(function () {}))->then( + return \React\Promise\resolve($d->promise()->then(function () { + }))->then( function () use ($exception) { throw $exception; } @@ -304,19 +290,17 @@ trait PromiseRejectedTestTrait } /** @test */ - public function doneShouldRecoverWhenRejectionHandlerCatchesExceptionForRejectedPromise() - { + public function doneShouldRecoverWhenRejectionHandlerCatchesExceptionForRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $adapter->reject(new \Exception('UnhandledRejectionException')); - $this->assertNull($adapter->promise()->done(null, function (\Exception $e) { + $this->assertNull($adapter->promise()->done(NULL, function (\Exception $e) { })); } /** @test */ - public function otherwiseShouldInvokeRejectionHandlerForRejectedPromise() - { + public function otherwiseShouldInvokeRejectionHandlerForRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -330,8 +314,7 @@ trait PromiseRejectedTestTrait } /** @test */ - public function otherwiseShouldInvokeNonTypeHintedRejectionHandlerIfReasonIsAnExceptionForRejectedPromise() - { + public function otherwiseShouldInvokeNonTypeHintedRejectionHandlerIfReasonIsAnExceptionForRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $exception = new \Exception(); @@ -350,8 +333,7 @@ trait PromiseRejectedTestTrait } /** @test */ - public function otherwiseShouldInvokeRejectionHandlerIfReasonMatchesTypehintForRejectedPromise() - { + public function otherwiseShouldInvokeRejectionHandlerIfReasonMatchesTypehintForRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $exception = new \InvalidArgumentException(); @@ -370,8 +352,7 @@ trait PromiseRejectedTestTrait } /** @test */ - public function otherwiseShouldNotInvokeRejectionHandlerIfReaonsDoesNotMatchTypehintForRejectedPromise() - { + public function otherwiseShouldNotInvokeRejectionHandlerIfReaonsDoesNotMatchTypehintForRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $exception = new \Exception(); @@ -386,8 +367,7 @@ trait PromiseRejectedTestTrait } /** @test */ - public function alwaysShouldNotSuppressRejectionForRejectedPromise() - { + public function alwaysShouldNotSuppressRejectionForRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $exception = new \Exception(); @@ -400,13 +380,13 @@ trait PromiseRejectedTestTrait $adapter->reject($exception); $adapter->promise() - ->always(function () {}) - ->then(null, $mock); + ->always(function () { + }) + ->then(NULL, $mock); } /** @test */ - public function alwaysShouldNotSuppressRejectionWhenHandlerReturnsANonPromiseForRejectedPromise() - { + public function alwaysShouldNotSuppressRejectionWhenHandlerReturnsANonPromiseForRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $exception = new \Exception(); @@ -422,12 +402,11 @@ trait PromiseRejectedTestTrait ->always(function () { return 1; }) - ->then(null, $mock); + ->then(NULL, $mock); } /** @test */ - public function alwaysShouldNotSuppressRejectionWhenHandlerReturnsAPromiseForRejectedPromise() - { + public function alwaysShouldNotSuppressRejectionWhenHandlerReturnsAPromiseForRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $exception = new \Exception(); @@ -443,12 +422,11 @@ trait PromiseRejectedTestTrait ->always(function () { return \React\Promise\resolve(1); }) - ->then(null, $mock); + ->then(NULL, $mock); } /** @test */ - public function alwaysShouldRejectWhenHandlerThrowsForRejectedPromise() - { + public function alwaysShouldRejectWhenHandlerThrowsForRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $exception1 = new \Exception(); @@ -465,12 +443,11 @@ trait PromiseRejectedTestTrait ->always(function () use ($exception2) { throw $exception2; }) - ->then(null, $mock); + ->then(NULL, $mock); } /** @test */ - public function alwaysShouldRejectWhenHandlerRejectsForRejectedPromise() - { + public function alwaysShouldRejectWhenHandlerRejectsForRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $exception1 = new \Exception(); @@ -487,12 +464,11 @@ trait PromiseRejectedTestTrait ->always(function () use ($exception2) { return \React\Promise\reject($exception2); }) - ->then(null, $mock); + ->then(NULL, $mock); } /** @test */ - public function cancelShouldReturnNullForRejectedPromise() - { + public function cancelShouldReturnNullForRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $adapter->reject(); @@ -501,8 +477,7 @@ trait PromiseRejectedTestTrait } /** @test */ - public function cancelShouldHaveNoEffectForRejectedPromise() - { + public function cancelShouldHaveNoEffectForRejectedPromise() { $adapter = $this->getPromiseTestAdapter($this->expectCallableNever()); $adapter->reject(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/PromiseSettledTestTrait.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/PromiseSettledTestTrait.php index e363b6d..a86b661 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/PromiseSettledTestTrait.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/PromiseSettledTestTrait.php @@ -7,11 +7,10 @@ trait PromiseSettledTestTrait /** * @return \React\Promise\PromiseAdapter\PromiseAdapterInterface */ - abstract public function getPromiseTestAdapter(callable $canceller = null); + abstract public function getPromiseTestAdapter(callable $canceller = NULL); /** @test */ - public function thenShouldReturnAPromiseForSettledPromise() - { + public function thenShouldReturnAPromiseForSettledPromise() { $adapter = $this->getPromiseTestAdapter(); $adapter->settle(); @@ -19,17 +18,15 @@ trait PromiseSettledTestTrait } /** @test */ - public function thenShouldReturnAllowNullForSettledPromise() - { + public function thenShouldReturnAllowNullForSettledPromise() { $adapter = $this->getPromiseTestAdapter(); $adapter->settle(); - $this->assertInstanceOf('React\\Promise\\PromiseInterface', $adapter->promise()->then(null, null, null)); + $this->assertInstanceOf('React\\Promise\\PromiseInterface', $adapter->promise()->then(NULL, NULL, NULL)); } /** @test */ - public function cancelShouldReturnNullForSettledPromise() - { + public function cancelShouldReturnNullForSettledPromise() { $adapter = $this->getPromiseTestAdapter(); $adapter->settle(); @@ -38,8 +35,7 @@ trait PromiseSettledTestTrait } /** @test */ - public function cancelShouldHaveNoEffectForSettledPromise() - { + public function cancelShouldHaveNoEffectForSettledPromise() { $adapter = $this->getPromiseTestAdapter($this->expectCallableNever()); $adapter->settle(); @@ -48,26 +44,25 @@ trait PromiseSettledTestTrait } /** @test */ - public function doneShouldReturnNullForSettledPromise() - { + public function doneShouldReturnNullForSettledPromise() { $adapter = $this->getPromiseTestAdapter(); $adapter->settle(); - $this->assertNull($adapter->promise()->done(null, function () {})); + $this->assertNull($adapter->promise()->done(NULL, function () { + })); } /** @test */ - public function doneShouldReturnAllowNullForSettledPromise() - { + public function doneShouldReturnAllowNullForSettledPromise() { $adapter = $this->getPromiseTestAdapter(); $adapter->settle(); - $this->assertNull($adapter->promise()->done(null, function () {}, null)); + $this->assertNull($adapter->promise()->done(NULL, function () { + }, NULL)); } /** @test */ - public function progressShouldNotInvokeProgressHandlerForSettledPromise() - { + public function progressShouldNotInvokeProgressHandlerForSettledPromise() { $adapter = $this->getPromiseTestAdapter(); $adapter->settle(); @@ -76,11 +71,11 @@ trait PromiseSettledTestTrait } /** @test */ - public function alwaysShouldReturnAPromiseForSettledPromise() - { + public function alwaysShouldReturnAPromiseForSettledPromise() { $adapter = $this->getPromiseTestAdapter(); $adapter->settle(); - $this->assertInstanceOf('React\\Promise\\PromiseInterface', $adapter->promise()->always(function () {})); + $this->assertInstanceOf('React\\Promise\\PromiseInterface', $adapter->promise()->always(function () { + })); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/RejectTestTrait.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/RejectTestTrait.php index 063f178..83ec55b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/RejectTestTrait.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/RejectTestTrait.php @@ -10,11 +10,10 @@ trait RejectTestTrait /** * @return \React\Promise\PromiseAdapter\PromiseAdapterInterface */ - abstract public function getPromiseTestAdapter(callable $canceller = null); + abstract public function getPromiseTestAdapter(callable $canceller = NULL); /** @test */ - public function rejectShouldRejectWithAnImmediateValue() - { + public function rejectShouldRejectWithAnImmediateValue() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -30,8 +29,7 @@ trait RejectTestTrait } /** @test */ - public function rejectShouldRejectWithFulfilledPromise() - { + public function rejectShouldRejectWithFulfilledPromise() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -47,8 +45,7 @@ trait RejectTestTrait } /** @test */ - public function rejectShouldRejectWithRejectedPromise() - { + public function rejectShouldRejectWithRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -64,8 +61,7 @@ trait RejectTestTrait } /** @test */ - public function rejectShouldForwardReasonWhenCallbackIsNull() - { + public function rejectShouldForwardReasonWhenCallbackIsNull() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -87,8 +83,7 @@ trait RejectTestTrait } /** @test */ - public function rejectShouldMakePromiseImmutable() - { + public function rejectShouldMakePromiseImmutable() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -98,7 +93,7 @@ trait RejectTestTrait ->with($this->identicalTo(1)); $adapter->promise() - ->then(null, function ($value) use ($adapter) { + ->then(NULL, function ($value) use ($adapter) { $adapter->reject(3); return Promise\reject($value); @@ -113,8 +108,7 @@ trait RejectTestTrait } /** @test */ - public function notifyShouldInvokeOtherwiseHandler() - { + public function notifyShouldInvokeOtherwiseHandler() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -130,8 +124,7 @@ trait RejectTestTrait } /** @test */ - public function doneShouldInvokeRejectionHandler() - { + public function doneShouldInvokeRejectionHandler() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -140,26 +133,24 @@ trait RejectTestTrait ->method('__invoke') ->with($this->identicalTo(1)); - $this->assertNull($adapter->promise()->done(null, $mock)); + $this->assertNull($adapter->promise()->done(NULL, $mock)); $adapter->reject(1); } /** @test */ - public function doneShouldThrowExceptionThrownByRejectionHandler() - { + public function doneShouldThrowExceptionThrownByRejectionHandler() { $adapter = $this->getPromiseTestAdapter(); $this->setExpectedException('\Exception', 'UnhandledRejectionException'); - $this->assertNull($adapter->promise()->done(null, function () { + $this->assertNull($adapter->promise()->done(NULL, function () { throw new \Exception('UnhandledRejectionException'); })); $adapter->reject(1); } /** @test */ - public function doneShouldThrowUnhandledRejectionExceptionWhenRejectedWithNonException() - { + public function doneShouldThrowUnhandledRejectionExceptionWhenRejectedWithNonException() { $adapter = $this->getPromiseTestAdapter(); $this->setExpectedException('React\\Promise\\UnhandledRejectionException'); @@ -169,34 +160,31 @@ trait RejectTestTrait } /** @test */ - public function doneShouldThrowUnhandledRejectionExceptionWhenRejectionHandlerRejects() - { + public function doneShouldThrowUnhandledRejectionExceptionWhenRejectionHandlerRejects() { $adapter = $this->getPromiseTestAdapter(); $this->setExpectedException('React\\Promise\\UnhandledRejectionException'); - $this->assertNull($adapter->promise()->done(null, function () { + $this->assertNull($adapter->promise()->done(NULL, function () { return \React\Promise\reject(); })); $adapter->reject(1); } /** @test */ - public function doneShouldThrowRejectionExceptionWhenRejectionHandlerRejectsWithException() - { + public function doneShouldThrowRejectionExceptionWhenRejectionHandlerRejectsWithException() { $adapter = $this->getPromiseTestAdapter(); $this->setExpectedException('\Exception', 'UnhandledRejectionException'); - $this->assertNull($adapter->promise()->done(null, function () { + $this->assertNull($adapter->promise()->done(NULL, function () { return \React\Promise\reject(new \Exception('UnhandledRejectionException')); })); $adapter->reject(1); } /** @test */ - public function doneShouldThrowUnhandledRejectionExceptionWhenRejectionHandlerRetunsPendingPromiseWhichRejectsLater() - { + public function doneShouldThrowUnhandledRejectionExceptionWhenRejectionHandlerRetunsPendingPromiseWhichRejectsLater() { $adapter = $this->getPromiseTestAdapter(); $this->setExpectedException('React\\Promise\\UnhandledRejectionException'); @@ -204,7 +192,7 @@ trait RejectTestTrait $d = new Deferred(); $promise = $d->promise(); - $this->assertNull($adapter->promise()->done(null, function () use ($promise) { + $this->assertNull($adapter->promise()->done(NULL, function () use ($promise) { return $promise; })); $adapter->reject(1); @@ -212,8 +200,7 @@ trait RejectTestTrait } /** @test */ - public function doneShouldThrowExceptionProvidedAsRejectionValue() - { + public function doneShouldThrowExceptionProvidedAsRejectionValue() { $adapter = $this->getPromiseTestAdapter(); $this->setExpectedException('\Exception', 'UnhandledRejectionException'); @@ -223,8 +210,7 @@ trait RejectTestTrait } /** @test */ - public function doneShouldThrowWithDeepNestingPromiseChains() - { + public function doneShouldThrowWithDeepNestingPromiseChains() { $this->setExpectedException('\Exception', 'UnhandledRejectionException'); $exception = new \Exception('UnhandledRejectionException'); @@ -235,7 +221,8 @@ trait RejectTestTrait $d = new Deferred(); $d->resolve(); - return \React\Promise\resolve($d->promise()->then(function () {}))->then( + return \React\Promise\resolve($d->promise()->then(function () { + }))->then( function () use ($exception) { throw $exception; } @@ -248,19 +235,17 @@ trait RejectTestTrait } /** @test */ - public function doneShouldRecoverWhenRejectionHandlerCatchesException() - { + public function doneShouldRecoverWhenRejectionHandlerCatchesException() { $adapter = $this->getPromiseTestAdapter(); - $this->assertNull($adapter->promise()->done(null, function (\Exception $e) { + $this->assertNull($adapter->promise()->done(NULL, function (\Exception $e) { })); $adapter->reject(new \Exception('UnhandledRejectionException')); } /** @test */ - public function alwaysShouldNotSuppressRejection() - { + public function alwaysShouldNotSuppressRejection() { $adapter = $this->getPromiseTestAdapter(); $exception = new \Exception(); @@ -272,15 +257,15 @@ trait RejectTestTrait ->with($this->identicalTo($exception)); $adapter->promise() - ->always(function () {}) - ->then(null, $mock); + ->always(function () { + }) + ->then(NULL, $mock); $adapter->reject($exception); } /** @test */ - public function alwaysShouldNotSuppressRejectionWhenHandlerReturnsANonPromise() - { + public function alwaysShouldNotSuppressRejectionWhenHandlerReturnsANonPromise() { $adapter = $this->getPromiseTestAdapter(); $exception = new \Exception(); @@ -295,14 +280,13 @@ trait RejectTestTrait ->always(function () { return 1; }) - ->then(null, $mock); + ->then(NULL, $mock); $adapter->reject($exception); } /** @test */ - public function alwaysShouldNotSuppressRejectionWhenHandlerReturnsAPromise() - { + public function alwaysShouldNotSuppressRejectionWhenHandlerReturnsAPromise() { $adapter = $this->getPromiseTestAdapter(); $exception = new \Exception(); @@ -317,14 +301,13 @@ trait RejectTestTrait ->always(function () { return \React\Promise\resolve(1); }) - ->then(null, $mock); + ->then(NULL, $mock); $adapter->reject($exception); } /** @test */ - public function alwaysShouldRejectWhenHandlerThrowsForRejection() - { + public function alwaysShouldRejectWhenHandlerThrowsForRejection() { $adapter = $this->getPromiseTestAdapter(); $exception = new \Exception(); @@ -339,14 +322,13 @@ trait RejectTestTrait ->always(function () use ($exception) { throw $exception; }) - ->then(null, $mock); + ->then(NULL, $mock); $adapter->reject($exception); } /** @test */ - public function alwaysShouldRejectWhenHandlerRejectsForRejection() - { + public function alwaysShouldRejectWhenHandlerRejectsForRejection() { $adapter = $this->getPromiseTestAdapter(); $exception = new \Exception(); @@ -361,7 +343,7 @@ trait RejectTestTrait ->always(function () use ($exception) { return \React\Promise\reject($exception); }) - ->then(null, $mock); + ->then(NULL, $mock); $adapter->reject($exception); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/ResolveTestTrait.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/ResolveTestTrait.php index 0736d35..43a915e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/ResolveTestTrait.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/PromiseTest/ResolveTestTrait.php @@ -9,11 +9,10 @@ trait ResolveTestTrait /** * @return \React\Promise\PromiseAdapter\PromiseAdapterInterface */ - abstract public function getPromiseTestAdapter(callable $canceller = null); + abstract public function getPromiseTestAdapter(callable $canceller = NULL); /** @test */ - public function resolveShouldResolve() - { + public function resolveShouldResolve() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -29,8 +28,7 @@ trait ResolveTestTrait } /** @test */ - public function resolveShouldResolveWithPromisedValue() - { + public function resolveShouldResolveWithPromisedValue() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -46,8 +44,7 @@ trait ResolveTestTrait } /** @test */ - public function resolveShouldRejectWhenResolvedWithRejectedPromise() - { + public function resolveShouldRejectWhenResolvedWithRejectedPromise() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -63,8 +60,7 @@ trait ResolveTestTrait } /** @test */ - public function resolveShouldForwardValueWhenCallbackIsNull() - { + public function resolveShouldForwardValueWhenCallbackIsNull() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -75,7 +71,7 @@ trait ResolveTestTrait $adapter->promise() ->then( - null, + NULL, $this->expectCallableNever() ) ->then( @@ -87,8 +83,7 @@ trait ResolveTestTrait } /** @test */ - public function resolveShouldMakePromiseImmutable() - { + public function resolveShouldMakePromiseImmutable() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -115,8 +110,7 @@ trait ResolveTestTrait /** * @test */ - public function resolveShouldRejectWhenResolvedWithItself() - { + public function resolveShouldRejectWhenResolvedWithItself() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -137,8 +131,7 @@ trait ResolveTestTrait /** * @test */ - public function resolveShouldRejectWhenResolvedWithAPromiseWhichFollowsItself() - { + public function resolveShouldRejectWhenResolvedWithAPromiseWhichFollowsItself() { $adapter1 = $this->getPromiseTestAdapter(); $adapter2 = $this->getPromiseTestAdapter(); @@ -162,8 +155,7 @@ trait ResolveTestTrait } /** @test */ - public function doneShouldInvokeFulfillmentHandler() - { + public function doneShouldInvokeFulfillmentHandler() { $adapter = $this->getPromiseTestAdapter(); $mock = $this->createCallableMock(); @@ -177,8 +169,7 @@ trait ResolveTestTrait } /** @test */ - public function doneShouldThrowExceptionThrownFulfillmentHandler() - { + public function doneShouldThrowExceptionThrownFulfillmentHandler() { $adapter = $this->getPromiseTestAdapter(); $this->setExpectedException('\Exception', 'UnhandledRejectionException'); @@ -190,8 +181,7 @@ trait ResolveTestTrait } /** @test */ - public function doneShouldThrowUnhandledRejectionExceptionWhenFulfillmentHandlerRejects() - { + public function doneShouldThrowUnhandledRejectionExceptionWhenFulfillmentHandlerRejects() { $adapter = $this->getPromiseTestAdapter(); $this->setExpectedException('React\\Promise\\UnhandledRejectionException'); @@ -203,8 +193,7 @@ trait ResolveTestTrait } /** @test */ - public function alwaysShouldNotSuppressValue() - { + public function alwaysShouldNotSuppressValue() { $adapter = $this->getPromiseTestAdapter(); $value = new \stdClass(); @@ -216,15 +205,15 @@ trait ResolveTestTrait ->with($this->identicalTo($value)); $adapter->promise() - ->always(function () {}) + ->always(function () { + }) ->then($mock); $adapter->resolve($value); } /** @test */ - public function alwaysShouldNotSuppressValueWhenHandlerReturnsANonPromise() - { + public function alwaysShouldNotSuppressValueWhenHandlerReturnsANonPromise() { $adapter = $this->getPromiseTestAdapter(); $value = new \stdClass(); @@ -245,8 +234,7 @@ trait ResolveTestTrait } /** @test */ - public function alwaysShouldNotSuppressValueWhenHandlerReturnsAPromise() - { + public function alwaysShouldNotSuppressValueWhenHandlerReturnsAPromise() { $adapter = $this->getPromiseTestAdapter(); $value = new \stdClass(); @@ -267,8 +255,7 @@ trait ResolveTestTrait } /** @test */ - public function alwaysShouldRejectWhenHandlerThrowsForFulfillment() - { + public function alwaysShouldRejectWhenHandlerThrowsForFulfillment() { $adapter = $this->getPromiseTestAdapter(); $exception = new \Exception(); @@ -283,14 +270,13 @@ trait ResolveTestTrait ->always(function () use ($exception) { throw $exception; }) - ->then(null, $mock); + ->then(NULL, $mock); $adapter->resolve(1); } /** @test */ - public function alwaysShouldRejectWhenHandlerRejectsForFulfillment() - { + public function alwaysShouldRejectWhenHandlerRejectsForFulfillment() { $adapter = $this->getPromiseTestAdapter(); $exception = new \Exception(); @@ -305,7 +291,7 @@ trait ResolveTestTrait ->always(function () use ($exception) { return \React\Promise\reject($exception); }) - ->then(null, $mock); + ->then(NULL, $mock); $adapter->resolve(1); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/RejectedPromiseTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/RejectedPromiseTest.php index c886b00..72c1b5b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/RejectedPromiseTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/RejectedPromiseTest.php @@ -9,9 +9,8 @@ class RejectedPromiseTest extends TestCase use PromiseTest\PromiseSettledTestTrait, PromiseTest\PromiseRejectedTestTrait; - public function getPromiseTestAdapter(callable $canceller = null) - { - $promise = null; + public function getPromiseTestAdapter(callable $canceller = NULL) { + $promise = NULL; return new CallbackPromiseAdapter([ 'promise' => function () use (&$promise) { @@ -24,7 +23,7 @@ class RejectedPromiseTest extends TestCase 'resolve' => function () { throw new \LogicException('You cannot call resolve() for React\Promise\RejectedPromise'); }, - 'reject' => function ($reason = null) use (&$promise) { + 'reject' => function ($reason = NULL) use (&$promise) { if (!$promise) { $promise = new RejectedPromise($reason); } @@ -32,7 +31,7 @@ class RejectedPromiseTest extends TestCase 'notify' => function () { // no-op }, - 'settle' => function ($reason = null) use (&$promise) { + 'settle' => function ($reason = NULL) use (&$promise) { if (!$promise) { $promise = new RejectedPromise($reason); } @@ -41,8 +40,7 @@ class RejectedPromiseTest extends TestCase } /** @test */ - public function shouldThrowExceptionIfConstructedWithAPromise() - { + public function shouldThrowExceptionIfConstructedWithAPromise() { $this->setExpectedException('\InvalidArgumentException'); return new RejectedPromise(new RejectedPromise()); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/Stub/CallableStub.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/Stub/CallableStub.php index 0120893..f7f1daf 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/Stub/CallableStub.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/Stub/CallableStub.php @@ -4,7 +4,6 @@ namespace React\Promise\Stub; class CallableStub { - public function __invoke() - { + public function __invoke() { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/TestCase.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/TestCase.php index c9274f4..ba7e593 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/TestCase.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/TestCase.php @@ -4,8 +4,7 @@ namespace React\Promise; class TestCase extends \PHPUnit_Framework_TestCase { - public function expectCallableExactly($amount) - { + public function expectCallableExactly($amount) { $mock = $this->createCallableMock(); $mock ->expects($this->exactly($amount)) @@ -14,8 +13,7 @@ class TestCase extends \PHPUnit_Framework_TestCase return $mock; } - public function expectCallableOnce() - { + public function expectCallableOnce() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -24,8 +22,7 @@ class TestCase extends \PHPUnit_Framework_TestCase return $mock; } - public function expectCallableNever() - { + public function expectCallableNever() { $mock = $this->createCallableMock(); $mock ->expects($this->never()) @@ -34,8 +31,7 @@ class TestCase extends \PHPUnit_Framework_TestCase return $mock; } - public function createCallableMock() - { + public function createCallableMock() { return $this ->getMockBuilder('React\\Promise\Stub\CallableStub') ->getMock(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/bootstrap.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/bootstrap.php index 9b7f872..adce908 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/bootstrap.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/bootstrap.php @@ -1,7 +1,7 @@ addPsr4('React\\Promise\\', __DIR__); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleFulfilledTestPromise.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleFulfilledTestPromise.php index ef4d530..d8745c1 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleFulfilledTestPromise.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleFulfilledTestPromise.php @@ -4,8 +4,7 @@ namespace React\Promise; class SimpleFulfilledTestPromise implements PromiseInterface { - public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) - { + public function then(callable $onFulfilled = NULL, callable $onRejected = NULL, callable $onProgress = NULL) { try { if ($onFulfilled) { $onFulfilled('foo'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleFulfilledTestThenable.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleFulfilledTestThenable.php index 3f66f63..1928f99 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleFulfilledTestThenable.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleFulfilledTestThenable.php @@ -4,8 +4,7 @@ namespace React\Promise; class SimpleFulfilledTestThenable { - public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) - { + public function then(callable $onFulfilled = NULL, callable $onRejected = NULL, callable $onProgress = NULL) { try { if ($onFulfilled) { $onFulfilled('foo'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleRejectedTestPromise.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleRejectedTestPromise.php index b30a226..90e8566 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleRejectedTestPromise.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleRejectedTestPromise.php @@ -4,8 +4,7 @@ namespace React\Promise; class SimpleRejectedTestPromise implements PromiseInterface { - public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) - { + public function then(callable $onFulfilled = NULL, callable $onRejected = NULL, callable $onProgress = NULL) { try { if ($onRejected) { $onRejected('foo'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleTestCancellable.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleTestCancellable.php index f232a68..d36c881 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleTestCancellable.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleTestCancellable.php @@ -4,10 +4,9 @@ namespace React\Promise; class SimpleTestCancellable { - public $cancelCalled = false; + public $cancelCalled = FALSE; - public function cancel() - { - $this->cancelCalled = true; + public function cancel() { + $this->cancelCalled = TRUE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleTestCancellableThenable.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleTestCancellableThenable.php index c0f1593..3cbbcd3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleTestCancellableThenable.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/promise/tests/fixtures/SimpleTestCancellableThenable.php @@ -4,15 +4,13 @@ namespace React\Promise; class SimpleTestCancellableThenable { - public $cancelCalled = false; + public $cancelCalled = FALSE; - public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) - { + public function then(callable $onFulfilled = NULL, callable $onRejected = NULL, callable $onProgress = NULL) { return new self(); } - public function cancel() - { - $this->cancelCalled = true; + public function cancel() { + $this->cancelCalled = TRUE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/composer.json index bc85aab..6ba672e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/composer.json @@ -1,29 +1,35 @@ { - "name": "react/socket", - "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", - "keywords": ["async", "socket", "stream", "connection", "ReactPHP"], - "license": "MIT", - "require": { - "php": ">=5.3.0", - "evenement/evenement": "^3.0 || ^2.0 || ^1.0", - "react/dns": "^0.4.13", - "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", - "react/stream": "^1.0 || ^0.7.1", - "react/promise": "^2.1 || ^1.2", - "react/promise-timer": "~1.0" - }, - "require-dev": { - "clue/block-react": "^1.2", - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" - }, - "autoload": { - "psr-4": { - "React\\Socket\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "React\\Tests\\Socket\\": "tests" - } + "name": "react/socket", + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": [ + "async", + "socket", + "stream", + "connection", + "ReactPHP" + ], + "license": "MIT", + "require": { + "php": ">=5.3.0", + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "react/dns": "^0.4.13", + "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", + "react/stream": "^1.0 || ^0.7.1", + "react/promise": "^2.1 || ^1.2", + "react/promise-timer": "~1.0" + }, + "require-dev": { + "clue/block-react": "^1.2", + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35" + }, + "autoload": { + "psr-4": { + "React\\Socket\\": "src" } + }, + "autoload-dev": { + "psr-4": { + "React\\Tests\\Socket\\": "tests" + } + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/02-chat-server.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/02-chat-server.php index 46439e0..a21069f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/02-chat-server.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/02-chat-server.php @@ -31,7 +31,7 @@ $server = new Server(isset($argv[1]) ? $argv[1] : 0, $loop, array( ) )); -$server = new LimitingServer($server, null); +$server = new LimitingServer($server, NULL); $server->on('connection', function (ConnectionInterface $client) use ($server) { // whenever a new message comes in diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/11-http-client.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/11-http-client.php index 2b64a43..b64178a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/11-http-client.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/11-http-client.php @@ -22,7 +22,7 @@ require __DIR__ . '/../vendor/autoload.php'; $loop = Factory::create(); $connector = new Connector($loop); -$connector->connect($host. ':80')->then(function (ConnectionInterface $connection) use ($host) { +$connector->connect($host . ':80')->then(function (ConnectionInterface $connection) use ($host) { $connection->on('data', function ($data) { echo $data; }); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/22-http-client.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/22-http-client.php index fcb8107..67ab299 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/22-http-client.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/22-http-client.php @@ -22,7 +22,7 @@ require __DIR__ . '/../vendor/autoload.php'; $uri = isset($argv[1]) ? $argv[1] : 'www.google.com'; -if (strpos($uri, '://') === false) { +if (strpos($uri, '://') === FALSE) { $uri = 'http://' . $uri; } $parts = parse_url($uri); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/91-benchmark-server.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/91-benchmark-server.php index 420d474..4428977 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/91-benchmark-server.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/91-benchmark-server.php @@ -46,9 +46,9 @@ $server->on('connection', function (ConnectionInterface $conn) use ($loop) { }); // report average throughput once client disconnects - $t = microtime(true); + $t = microtime(TRUE); $conn->on('close', function () use ($conn, $t, &$bytes) { - $t = microtime(true) - $t; + $t = microtime(TRUE) - $t; echo '[disconnected after receiving ' . $bytes . ' bytes in ' . round($t, 3) . 's => ' . round($bytes / $t / 1024 / 1024, 1) . ' MiB/s]' . PHP_EOL; }); }); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/99-generate-self-signed.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/99-generate-self-signed.php index 00f9314..af010ff 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/99-generate-self-signed.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/examples/99-generate-self-signed.php @@ -20,12 +20,12 @@ $dn = array( // create certificate which is valid for ~10 years $privkey = openssl_pkey_new(); $cert = openssl_csr_new($dn, $privkey); -$cert = openssl_csr_sign($cert, null, $privkey, 3650); +$cert = openssl_csr_sign($cert, NULL, $privkey, 3650); // export public and (optionally encrypted) private key in PEM format openssl_x509_export($cert, $out); echo $out; -$passphrase = isset($argv[2]) ? $argv[2] : null; +$passphrase = isset($argv[2]) ? $argv[2] : NULL; openssl_pkey_export($privkey, $out, $passphrase); echo $out; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/Connection.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/Connection.php index c6267cc..86888d7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/Connection.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/Connection.php @@ -24,7 +24,7 @@ class Connection extends EventEmitter implements ConnectionInterface * * @internal */ - public $unix = false; + public $unix = FALSE; /** * Internal flag whether encryption has been enabled on this connection @@ -34,15 +34,14 @@ class Connection extends EventEmitter implements ConnectionInterface * * @internal */ - public $encryptionEnabled = false; + public $encryptionEnabled = FALSE; /** @internal */ public $stream; private $input; - public function __construct($resource, LoopInterface $loop) - { + public function __construct($resource, LoopInterface $loop) { // PHP < 5.6.8 suffers from a buffer indicator bug on secure TLS connections // as a work-around we always read the complete buffer until its end. // The buffer size is limited due to TCP/IP buffers anyway, so this @@ -65,8 +64,8 @@ class Connection extends EventEmitter implements ConnectionInterface $this->input = new DuplexResourceStream( $resource, $loop, - $clearCompleteBuffer ? -1 : null, - new WritableResourceStream($resource, $loop, null, $limitWriteChunks ? 8192 : null) + $clearCompleteBuffer ? -1 : NULL, + new WritableResourceStream($resource, $loop, NULL, $limitWriteChunks ? 8192 : NULL) ); $this->stream = $resource; @@ -76,50 +75,41 @@ class Connection extends EventEmitter implements ConnectionInterface $this->input->on('close', array($this, 'close')); } - public function isReadable() - { + public function isReadable() { return $this->input->isReadable(); } - public function isWritable() - { + public function isWritable() { return $this->input->isWritable(); } - public function pause() - { + public function pause() { $this->input->pause(); } - public function resume() - { + public function resume() { $this->input->resume(); } - public function pipe(WritableStreamInterface $dest, array $options = array()) - { + public function pipe(WritableStreamInterface $dest, array $options = array()) { return $this->input->pipe($dest, $options); } - public function write($data) - { + public function write($data) { return $this->input->write($data); } - public function end($data = null) - { + public function end($data = NULL) { $this->input->end($data); } - public function close() - { + public function close() { $this->input->close(); $this->handleClose(); $this->removeAllListeners(); } - public function handleClose() - { + public function handleClose() { if (!is_resource($this->stream)) { return; } @@ -131,23 +121,20 @@ class Connection extends EventEmitter implements ConnectionInterface // Underlying Stream implementation will take care of closing file // handle, so we otherwise keep this open here. @stream_socket_shutdown($this->stream, STREAM_SHUT_RDWR); - stream_set_blocking($this->stream, false); + stream_set_blocking($this->stream, FALSE); } - public function getRemoteAddress() - { - return $this->parseAddress(@stream_socket_get_name($this->stream, true)); + public function getRemoteAddress() { + return $this->parseAddress(@stream_socket_get_name($this->stream, TRUE)); } - public function getLocalAddress() - { - return $this->parseAddress(@stream_socket_get_name($this->stream, false)); + public function getLocalAddress() { + return $this->parseAddress(@stream_socket_get_name($this->stream, FALSE)); } - private function parseAddress($address) - { - if ($address === false) { - return null; + private function parseAddress($address) { + if ($address === FALSE) { + return NULL; } if ($this->unix) { @@ -159,8 +146,8 @@ class Connection extends EventEmitter implements ConnectionInterface // work around unknown addresses should return null value: https://3v4l.org/5C1lo and https://bugs.php.net/bug.php?id=74556 // PHP uses "\0" string and HHVM uses empty string (colon removed above) - if ($address === '' || $address[0] === "\x00" ) { - return null; + if ($address === '' || $address[0] === "\x00") { + return NULL; } return 'unix://' . $address; @@ -168,7 +155,7 @@ class Connection extends EventEmitter implements ConnectionInterface // check if this is an IPv6 address which includes multiple colons but no square brackets $pos = strrpos($address, ':'); - if ($pos !== false && strpos($address, ':') < $pos && substr($address, 0, 1) !== '[') { + if ($pos !== FALSE && strpos($address, ':') < $pos && substr($address, 0, 1) !== '[') { $port = substr($address, $pos + 1); $address = '[' . substr($address, 0, $pos) . ']:' . $port; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/Connector.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/Connector.php index 75276bc..8dcca50 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/Connector.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/Connector.php @@ -28,19 +28,18 @@ final class Connector implements ConnectorInterface { private $connectors = array(); - public function __construct(LoopInterface $loop, array $options = array()) - { + public function __construct(LoopInterface $loop, array $options = array()) { // apply default options if not explicitly given $options += array( - 'tcp' => true, - 'tls' => true, - 'unix' => true, + 'tcp' => TRUE, + 'tls' => TRUE, + 'unix' => TRUE, - 'dns' => true, - 'timeout' => true, + 'dns' => TRUE, + 'timeout' => TRUE, ); - if ($options['timeout'] === true) { + if ($options['timeout'] === TRUE) { $options['timeout'] = (float)ini_get("default_socket_timeout"); } @@ -53,11 +52,11 @@ final class Connector implements ConnectorInterface ); } - if ($options['dns'] !== false) { + if ($options['dns'] !== FALSE) { if ($options['dns'] instanceof Resolver) { $resolver = $options['dns']; } else { - if ($options['dns'] !== true) { + if ($options['dns'] !== TRUE) { $server = $options['dns']; } else { // try to load nameservers from system config or default to Google's public DNS @@ -75,10 +74,10 @@ final class Connector implements ConnectorInterface $tcp = new DnsConnector($tcp, $resolver); } - if ($options['tcp'] !== false) { + if ($options['tcp'] !== FALSE) { $options['tcp'] = $tcp; - if ($options['timeout'] !== false) { + if ($options['timeout'] !== FALSE) { $options['tcp'] = new TimeoutConnector( $options['tcp'], $options['timeout'], @@ -89,7 +88,7 @@ final class Connector implements ConnectorInterface $this->connectors['tcp'] = $options['tcp']; } - if ($options['tls'] !== false) { + if ($options['tls'] !== FALSE) { if (!$options['tls'] instanceof ConnectorInterface) { $options['tls'] = new SecureConnector( $tcp, @@ -98,7 +97,7 @@ final class Connector implements ConnectorInterface ); } - if ($options['timeout'] !== false) { + if ($options['timeout'] !== FALSE) { $options['tls'] = new TimeoutConnector( $options['tls'], $options['timeout'], @@ -109,7 +108,7 @@ final class Connector implements ConnectorInterface $this->connectors['tls'] = $options['tls']; } - if ($options['unix'] !== false) { + if ($options['unix'] !== FALSE) { if (!$options['unix'] instanceof ConnectorInterface) { $options['unix'] = new UnixConnector($loop); } @@ -117,10 +116,9 @@ final class Connector implements ConnectorInterface } } - public function connect($uri) - { + public function connect($uri) { $scheme = 'tcp'; - if (strpos($uri, '://') !== false) { + if (strpos($uri, '://') !== FALSE) { $scheme = (string)substr($uri, 0, strpos($uri, '://')); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/DnsConnector.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/DnsConnector.php index 90170e5..d2e3687 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/DnsConnector.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/DnsConnector.php @@ -13,15 +13,13 @@ final class DnsConnector implements ConnectorInterface private $connector; private $resolver; - public function __construct(ConnectorInterface $connector, Resolver $resolver) - { + public function __construct(ConnectorInterface $connector, Resolver $resolver) { $this->connector = $connector; $this->resolver = $resolver; } - public function connect($uri) - { - if (strpos($uri, '://') === false) { + public function connect($uri) { + if (strpos($uri, '://') === FALSE) { $parts = parse_url('tcp://' . $uri); unset($parts['scheme']); } else { @@ -45,7 +43,7 @@ final class DnsConnector implements ConnectorInterface $uri .= $parts['scheme'] . '://'; } - if (strpos($ip, ':') !== false) { + if (strpos($ip, ':') !== FALSE) { // enclose IPv6 addresses in square brackets before appending port $uri .= '[' . $ip . ']'; } else { @@ -84,9 +82,8 @@ final class DnsConnector implements ConnectorInterface }); } - private function resolveHostname($host) - { - if (false !== filter_var($host, FILTER_VALIDATE_IP)) { + private function resolveHostname($host) { + if (FALSE !== filter_var($host, FILTER_VALIDATE_IP)) { return Promise\resolve($host); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/FixedUriConnector.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/FixedUriConnector.php index 057bcdf..c28180b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/FixedUriConnector.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/FixedUriConnector.php @@ -28,14 +28,12 @@ class FixedUriConnector implements ConnectorInterface * @param string $uri * @param ConnectorInterface $connector */ - public function __construct($uri, ConnectorInterface $connector) - { + public function __construct($uri, ConnectorInterface $connector) { $this->uri = $uri; $this->connector = $connector; } - public function connect($_) - { + public function connect($_) { return $this->connector->connect($this->uri); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/LimitingServer.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/LimitingServer.php index c7874ee..ed07c19 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/LimitingServer.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/LimitingServer.php @@ -39,9 +39,9 @@ class LimitingServer extends EventEmitter implements ServerInterface private $server; private $limit; - private $pauseOnLimit = false; - private $autoPaused = false; - private $manuPaused = false; + private $pauseOnLimit = FALSE; + private $autoPaused = FALSE; + private $manuPaused = FALSE; /** * Instantiates a new LimitingServer. @@ -89,14 +89,13 @@ class LimitingServer extends EventEmitter implements ServerInterface * ``` * * @param ServerInterface $server - * @param int|null $connectionLimit - * @param bool $pauseOnLimit + * @param int|null $connectionLimit + * @param bool $pauseOnLimit */ - public function __construct(ServerInterface $server, $connectionLimit, $pauseOnLimit = false) - { + public function __construct(ServerInterface $server, $connectionLimit, $pauseOnLimit = FALSE) { $this->server = $server; $this->limit = $connectionLimit; - if ($connectionLimit !== null) { + if ($connectionLimit !== NULL) { $this->pauseOnLimit = $pauseOnLimit; } @@ -115,20 +114,17 @@ class LimitingServer extends EventEmitter implements ServerInterface * * @return ConnectionInterface[] */ - public function getConnections() - { + public function getConnections() { return $this->connections; } - public function getAddress() - { + public function getAddress() { return $this->server->getAddress(); } - public function pause() - { + public function pause() { if (!$this->manuPaused) { - $this->manuPaused = true; + $this->manuPaused = TRUE; if (!$this->autoPaused) { $this->server->pause(); @@ -136,10 +132,9 @@ class LimitingServer extends EventEmitter implements ServerInterface } } - public function resume() - { + public function resume() { if ($this->manuPaused) { - $this->manuPaused = false; + $this->manuPaused = FALSE; if (!$this->autoPaused) { $this->server->resume(); @@ -147,16 +142,14 @@ class LimitingServer extends EventEmitter implements ServerInterface } } - public function close() - { + public function close() { $this->server->close(); } /** @internal */ - public function handleConnection(ConnectionInterface $connection) - { + public function handleConnection(ConnectionInterface $connection) { // close connection if limit exceeded - if ($this->limit !== null && count($this->connections) >= $this->limit) { + if ($this->limit !== NULL && count($this->connections) >= $this->limit) { $this->handleError(new OverflowException('Connection closed because server reached connection limit')); $connection->close(); return; @@ -170,7 +163,7 @@ class LimitingServer extends EventEmitter implements ServerInterface // pause accepting new connections if limit exceeded if ($this->pauseOnLimit && !$this->autoPaused && count($this->connections) >= $this->limit) { - $this->autoPaused = true; + $this->autoPaused = TRUE; if (!$this->manuPaused) { $this->server->pause(); @@ -181,13 +174,12 @@ class LimitingServer extends EventEmitter implements ServerInterface } /** @internal */ - public function handleDisconnection(ConnectionInterface $connection) - { + public function handleDisconnection(ConnectionInterface $connection) { unset($this->connections[array_search($connection, $this->connections)]); // continue accepting new connection if below limit if ($this->autoPaused && count($this->connections) < $this->limit) { - $this->autoPaused = false; + $this->autoPaused = FALSE; if (!$this->manuPaused) { $this->server->resume(); @@ -196,8 +188,7 @@ class LimitingServer extends EventEmitter implements ServerInterface } /** @internal */ - public function handleError(Exception $error) - { + public function handleError(Exception $error) { $this->emit('error', array($error)); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/SecureConnector.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/SecureConnector.php index f04183d..5192eca 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/SecureConnector.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/SecureConnector.php @@ -14,20 +14,18 @@ final class SecureConnector implements ConnectorInterface private $streamEncryption; private $context; - public function __construct(ConnectorInterface $connector, LoopInterface $loop, array $context = array()) - { + public function __construct(ConnectorInterface $connector, LoopInterface $loop, array $context = array()) { $this->connector = $connector; - $this->streamEncryption = new StreamEncryption($loop, false); + $this->streamEncryption = new StreamEncryption($loop, FALSE); $this->context = $context; } - public function connect($uri) - { + public function connect($uri) { if (!function_exists('stream_socket_enable_crypto')) { return Promise\reject(new BadMethodCallException('Encryption not supported on your platform (HHVM < 3.8?)')); // @codeCoverageIgnore } - if (strpos($uri, '://') === false) { + if (strpos($uri, '://') === FALSE) { $uri = 'tls://' . $uri; } @@ -54,7 +52,7 @@ final class SecureConnector implements ConnectorInterface } // try to enable encryption - return $encryption->enable($connection)->then(null, function ($error) use ($connection) { + return $encryption->enable($connection)->then(NULL, function ($error) use ($connection) { // establishing encryption failed => close invalid connection and return error $connection->close(); throw $error; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/SecureServer.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/SecureServer.php index 302ae93..8b9e988 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/SecureServer.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/SecureServer.php @@ -115,8 +115,7 @@ final class SecureServer extends EventEmitter implements ServerInterface * @see TcpServer * @link http://php.net/manual/en/context.ssl.php for TLS context options */ - public function __construct(ServerInterface $tcp, LoopInterface $loop, array $context) - { + public function __construct(ServerInterface $tcp, LoopInterface $loop, array $context) { if (!function_exists('stream_socket_enable_crypto')) { throw new BadMethodCallException('Encryption not supported on your platform (HHVM < 3.8?)'); // @codeCoverageIgnore } @@ -139,34 +138,29 @@ final class SecureServer extends EventEmitter implements ServerInterface }); } - public function getAddress() - { + public function getAddress() { $address = $this->tcp->getAddress(); - if ($address === null) { - return null; + if ($address === NULL) { + return NULL; } - return str_replace('tcp://' , 'tls://', $address); + return str_replace('tcp://', 'tls://', $address); } - public function pause() - { + public function pause() { $this->tcp->pause(); } - public function resume() - { + public function resume() { $this->tcp->resume(); } - public function close() - { + public function close() { return $this->tcp->close(); } /** @internal */ - public function handleConnection(ConnectionInterface $connection) - { + public function handleConnection(ConnectionInterface $connection) { if (!$connection instanceof Connection) { $this->emit('error', array(new UnexpectedValueException('Base server does not use internal Connection class exposing stream resource'))); $connection->end(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/Server.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/Server.php index 72712e4..3e00381 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/Server.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/Server.php @@ -10,8 +10,7 @@ final class Server extends EventEmitter implements ServerInterface { private $server; - public function __construct($uri, LoopInterface $loop, array $context = array()) - { + public function __construct($uri, LoopInterface $loop, array $context = array()) { // sanitize TCP context options if not properly wrapped if ($context && (!isset($context['tcp']) && !isset($context['tls']) && !isset($context['unix']))) { $context = array('tcp' => $context); @@ -26,7 +25,7 @@ final class Server extends EventEmitter implements ServerInterface $scheme = 'tcp'; $pos = strpos($uri, '://'); - if ($pos !== false) { + if ($pos !== FALSE) { $scheme = substr($uri, 0, $pos); } @@ -51,23 +50,19 @@ final class Server extends EventEmitter implements ServerInterface }); } - public function getAddress() - { + public function getAddress() { return $this->server->getAddress(); } - public function pause() - { + public function pause() { $this->server->pause(); } - public function resume() - { + public function resume() { $this->server->resume(); } - public function close() - { + public function close() { $this->server->close(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/StreamEncryption.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/StreamEncryption.php index ba5d472..8e2a250 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/StreamEncryption.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/StreamEncryption.php @@ -22,8 +22,7 @@ class StreamEncryption private $errstr; private $errno; - public function __construct(LoopInterface $loop, $server = true) - { + public function __construct(LoopInterface $loop, $server = TRUE) { $this->loop = $loop; $this->server = $server; @@ -61,18 +60,15 @@ class StreamEncryption } } - public function enable(Connection $stream) - { - return $this->toggle($stream, true); + public function enable(Connection $stream) { + return $this->toggle($stream, TRUE); } - public function disable(Connection $stream) - { - return $this->toggle($stream, false); + public function disable(Connection $stream) { + return $this->toggle($stream, FALSE); } - public function toggle(Connection $stream, $toggle) - { + public function toggle(Connection $stream, $toggle) { // pause actual stream instance to continue operation on raw stream socket $stream->pause(); @@ -113,22 +109,21 @@ class StreamEncryption $stream->resume(); return $stream; - }, function($error) use ($stream, $socket, $loop) { + }, function ($error) use ($stream, $socket, $loop) { $loop->removeReadStream($socket); $stream->resume(); throw $error; }); } - public function toggleCrypto($socket, Deferred $deferred, $toggle, $method) - { + public function toggleCrypto($socket, Deferred $deferred, $toggle, $method) { set_error_handler(array($this, 'handleError')); $result = stream_socket_enable_crypto($socket, $toggle, $method); restore_error_handler(); - if (true === $result) { + if (TRUE === $result) { $deferred->resolve(); - } else if (false === $result) { + } else if (FALSE === $result) { $deferred->reject(new UnexpectedValueException( sprintf("Unable to complete SSL/TLS handshake: %s", $this->errstr), $this->errno @@ -138,9 +133,8 @@ class StreamEncryption } } - public function handleError($errno, $errstr) - { + public function handleError($errno, $errstr) { $this->errstr = str_replace(array("\r", "\n"), ' ', $errstr); - $this->errno = $errno; + $this->errno = $errno; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/TcpConnector.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/TcpConnector.php index 90d7df1..2fe0276 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/TcpConnector.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/TcpConnector.php @@ -12,15 +12,13 @@ final class TcpConnector implements ConnectorInterface private $loop; private $context; - public function __construct(LoopInterface $loop, array $context = array()) - { + public function __construct(LoopInterface $loop, array $context = array()) { $this->loop = $loop; $this->context = $context; } - public function connect($uri) - { - if (strpos($uri, '://') === false) { + public function connect($uri) { + if (strpos($uri, '://') === FALSE) { $uri = 'tcp://' . $uri; } @@ -30,7 +28,7 @@ final class TcpConnector implements ConnectorInterface } $ip = trim($parts['host'], '[]'); - if (false === filter_var($ip, FILTER_VALIDATE_IP)) { + if (FALSE === filter_var($ip, FILTER_VALIDATE_IP)) { return Promise\reject(new InvalidArgumentException('Given URI "' . $ip . '" does not contain a valid host IP')); } @@ -52,7 +50,7 @@ final class TcpConnector implements ConnectorInterface // If TLS is not enabled later, this doesn't hurt either. if (isset($args['hostname'])) { $context['ssl'] = array( - 'SNI_enabled' => true, + 'SNI_enabled' => TRUE, 'peer_name' => $args['hostname'] ); @@ -80,7 +78,7 @@ final class TcpConnector implements ConnectorInterface stream_context_create($context) ); - if (false === $socket) { + if (FALSE === $socket) { return Promise\reject(new RuntimeException( sprintf("Connection to %s failed: %s", $uri, $errstr), $errno @@ -94,8 +92,7 @@ final class TcpConnector implements ConnectorInterface return $this->waitForStreamOnce($socket); } - private function waitForStreamOnce($stream) - { + private function waitForStreamOnce($stream) { $loop = $this->loop; return new Promise\Promise(function ($resolve, $reject) use ($loop, $stream) { @@ -104,7 +101,7 @@ final class TcpConnector implements ConnectorInterface // The following hack looks like the only way to // detect connection refused errors with PHP's stream sockets. - if (false === stream_socket_get_name($stream, true)) { + if (FALSE === stream_socket_get_name($stream, TRUE)) { fclose($stream); $reject(new RuntimeException('Connection refused')); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/TcpServer.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/TcpServer.php index 119e177..9fd014f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/TcpServer.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/TcpServer.php @@ -35,7 +35,7 @@ final class TcpServer extends EventEmitter implements ServerInterface { private $master; private $loop; - private $listening = false; + private $listening = FALSE; /** * Creates a plaintext TCP/IP socket server and starts listening on the given address @@ -114,14 +114,13 @@ final class TcpServer extends EventEmitter implements ServerInterface * and/or PHP version. * Passing unknown context options has no effect. * - * @param string|int $uri + * @param string|int $uri * @param LoopInterface $loop - * @param array $context + * @param array $context * @throws InvalidArgumentException if the listening address is invalid * @throws RuntimeException if listening on this address fails (already in use etc.) */ - public function __construct($uri, LoopInterface $loop, array $context = array()) - { + public function __construct($uri, LoopInterface $loop, array $context = array()) { $this->loop = $loop; // a single port has been given => assume localhost @@ -130,7 +129,7 @@ final class TcpServer extends EventEmitter implements ServerInterface } // assume default scheme if none has been given - if (strpos($uri, '://') === false) { + if (strpos($uri, '://') === FALSE) { $uri = 'tcp://' . $uri; } @@ -149,7 +148,7 @@ final class TcpServer extends EventEmitter implements ServerInterface throw new InvalidArgumentException('Invalid URI "' . $uri . '" given'); } - if (false === filter_var(trim($parts['host'], '[]'), FILTER_VALIDATE_IP)) { + if (FALSE === filter_var(trim($parts['host'], '[]'), FILTER_VALIDATE_IP)) { throw new InvalidArgumentException('Given URI "' . $uri . '" does not contain a valid host IP'); } @@ -160,7 +159,7 @@ final class TcpServer extends EventEmitter implements ServerInterface STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, stream_context_create(array('socket' => $context)) ); - if (false === $this->master) { + if (FALSE === $this->master) { throw new RuntimeException('Failed to listen on "' . $uri . '": ' . $errstr, $errno); } stream_set_blocking($this->master, 0); @@ -168,17 +167,16 @@ final class TcpServer extends EventEmitter implements ServerInterface $this->resume(); } - public function getAddress() - { + public function getAddress() { if (!is_resource($this->master)) { - return null; + return NULL; } - $address = stream_socket_get_name($this->master, false); + $address = stream_socket_get_name($this->master, FALSE); // check if this is an IPv6 address which includes multiple colons but no square brackets $pos = strrpos($address, ':'); - if ($pos !== false && strpos($address, ':') < $pos && substr($address, 0, 1) !== '[') { + if ($pos !== FALSE && strpos($address, ':') < $pos && substr($address, 0, 1) !== '[') { $port = substr($address, $pos + 1); $address = '[' . substr($address, 0, $pos) . ']:' . $port; } @@ -186,18 +184,16 @@ final class TcpServer extends EventEmitter implements ServerInterface return 'tcp://' . $address; } - public function pause() - { + public function pause() { if (!$this->listening) { return; } $this->loop->removeReadStream($this->master); - $this->listening = false; + $this->listening = FALSE; } - public function resume() - { + public function resume() { if ($this->listening || !is_resource($this->master)) { return; } @@ -205,18 +201,17 @@ final class TcpServer extends EventEmitter implements ServerInterface $that = $this; $this->loop->addReadStream($this->master, function ($master) use ($that) { $newSocket = @stream_socket_accept($master); - if (false === $newSocket) { + if (FALSE === $newSocket) { $that->emit('error', array(new RuntimeException('Error accepting new connection'))); return; } $that->handleConnection($newSocket); }); - $this->listening = true; + $this->listening = TRUE; } - public function close() - { + public function close() { if (!is_resource($this->master)) { return; } @@ -227,8 +222,7 @@ final class TcpServer extends EventEmitter implements ServerInterface } /** @internal */ - public function handleConnection($socket) - { + public function handleConnection($socket) { $this->emit('connection', array( new Connection($socket, $this->loop) )); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/TimeoutConnector.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/TimeoutConnector.php index d4eba2e..7787f2f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/TimeoutConnector.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/TimeoutConnector.php @@ -11,15 +11,13 @@ final class TimeoutConnector implements ConnectorInterface private $timeout; private $loop; - public function __construct(ConnectorInterface $connector, $timeout, LoopInterface $loop) - { + public function __construct(ConnectorInterface $connector, $timeout, LoopInterface $loop) { $this->connector = $connector; $this->timeout = $timeout; $this->loop = $loop; } - public function connect($uri) - { + public function connect($uri) { return Timer\timeout($this->connector->connect($uri), $this->timeout, $this->loop); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/UnixConnector.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/UnixConnector.php index 9b84ab0..5789605 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/UnixConnector.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/UnixConnector.php @@ -17,16 +17,14 @@ final class UnixConnector implements ConnectorInterface { private $loop; - public function __construct(LoopInterface $loop) - { + public function __construct(LoopInterface $loop) { $this->loop = $loop; } - public function connect($path) - { - if (strpos($path, '://') === false) { + public function connect($path) { + if (strpos($path, '://') === FALSE) { $path = 'unix://' . $path; - } elseif (substr($path, 0, 7) !== 'unix://') { + } else if (substr($path, 0, 7) !== 'unix://') { return Promise\reject(new InvalidArgumentException('Given URI "' . $path . '" is invalid')); } @@ -37,7 +35,7 @@ final class UnixConnector implements ConnectorInterface } $connection = new Connection($resource, $this->loop); - $connection->unix = true; + $connection->unix = TRUE; return Promise\resolve($connection); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/UnixServer.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/UnixServer.php index 8f1ed98..12ac1ea 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/UnixServer.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/src/UnixServer.php @@ -24,7 +24,7 @@ final class UnixServer extends EventEmitter implements ServerInterface { private $master; private $loop; - private $listening = false; + private $listening = FALSE; /** * Creates a plaintext socket server and starts listening on the given unix socket @@ -37,19 +37,18 @@ final class UnixServer extends EventEmitter implements ServerInterface * $server = new UnixServer('unix:///tmp/app.sock', $loop); * ``` * - * @param string $path + * @param string $path * @param LoopInterface $loop - * @param array $context + * @param array $context * @throws InvalidArgumentException if the listening address is invalid * @throws RuntimeException if listening on this address fails (already in use etc.) */ - public function __construct($path, LoopInterface $loop, array $context = array()) - { + public function __construct($path, LoopInterface $loop, array $context = array()) { $this->loop = $loop; - if (strpos($path, '://') === false) { + if (strpos($path, '://') === FALSE) { $path = 'unix://' . $path; - } elseif (substr($path, 0, 7) !== 'unix://') { + } else if (substr($path, 0, 7) !== 'unix://') { throw new InvalidArgumentException('Given URI "' . $path . '" is invalid'); } @@ -60,7 +59,7 @@ final class UnixServer extends EventEmitter implements ServerInterface STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, stream_context_create(array('socket' => $context)) ); - if (false === $this->master) { + if (FALSE === $this->master) { throw new RuntimeException('Failed to listen on unix domain socket "' . $path . '": ' . $errstr, $errno); } stream_set_blocking($this->master, 0); @@ -68,27 +67,24 @@ final class UnixServer extends EventEmitter implements ServerInterface $this->resume(); } - public function getAddress() - { + public function getAddress() { if (!is_resource($this->master)) { - return null; + return NULL; } - return 'unix://' . stream_socket_get_name($this->master, false); + return 'unix://' . stream_socket_get_name($this->master, FALSE); } - public function pause() - { + public function pause() { if (!$this->listening) { return; } $this->loop->removeReadStream($this->master); - $this->listening = false; + $this->listening = FALSE; } - public function resume() - { + public function resume() { if ($this->listening || !is_resource($this->master)) { return; } @@ -96,18 +92,17 @@ final class UnixServer extends EventEmitter implements ServerInterface $that = $this; $this->loop->addReadStream($this->master, function ($master) use ($that) { $newSocket = @stream_socket_accept($master); - if (false === $newSocket) { + if (FALSE === $newSocket) { $that->emit('error', array(new RuntimeException('Error accepting new connection'))); return; } $that->handleConnection($newSocket); }); - $this->listening = true; + $this->listening = TRUE; } - public function close() - { + public function close() { if (!is_resource($this->master)) { return; } @@ -118,10 +113,9 @@ final class UnixServer extends EventEmitter implements ServerInterface } /** @internal */ - public function handleConnection($socket) - { + public function handleConnection($socket) { $connection = new Connection($socket, $this->loop); - $connection->unix = true; + $connection->unix = TRUE; $this->emit('connection', array( $connection diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/ConnectionTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/ConnectionTest.php index d3563df..19535d3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/ConnectionTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/ConnectionTest.php @@ -6,8 +6,7 @@ use React\Socket\Connection; class ConnectionTest extends TestCase { - public function testCloseConnectionWillCloseSocketResource() - { + public function testCloseConnectionWillCloseSocketResource() { if (defined('HHVM_VERSION')) { $this->markTestSkipped('HHVM does not support socket operation on test memory stream'); } @@ -21,8 +20,7 @@ class ConnectionTest extends TestCase $this->assertFalse(is_resource($resource)); } - public function testCloseConnectionWillRemoveResourceFromLoopBeforeClosingResource() - { + public function testCloseConnectionWillRemoveResourceFromLoopBeforeClosingResource() { if (defined('HHVM_VERSION')) { $this->markTestSkipped('HHVM does not support socket operation on test memory stream'); } @@ -31,10 +29,10 @@ class ConnectionTest extends TestCase $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $loop->expects($this->once())->method('addWriteStream')->with($resource); - $onRemove = null; + $onRemove = NULL; $loop->expects($this->once())->method('removeWriteStream')->with($this->callback(function ($param) use (&$onRemove) { $onRemove = is_resource($param); - return true; + return TRUE; })); $connection = new Connection($resource, $loop); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/ConnectorTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/ConnectorTest.php index c8eb19b..d0a7084 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/ConnectorTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/ConnectorTest.php @@ -7,11 +7,11 @@ use React\Promise\Promise; class ConnectorTest extends TestCase { - public function testConnectorUsesTcpAsDefaultScheme() - { + public function testConnectorUsesTcpAsDefaultScheme() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); - $promise = new Promise(function () { }); + $promise = new Promise(function () { + }); $tcp = $this->getMockBuilder('React\Socket\ConnectorInterface')->getMock(); $tcp->expects($this->once())->method('connect')->with('127.0.0.1:80')->willReturn($promise); @@ -22,80 +22,75 @@ class ConnectorTest extends TestCase $connector->connect('127.0.0.1:80'); } - public function testConnectorPassedThroughHostnameIfDnsIsDisabled() - { + public function testConnectorPassedThroughHostnameIfDnsIsDisabled() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); - $promise = new Promise(function () { }); + $promise = new Promise(function () { + }); $tcp = $this->getMockBuilder('React\Socket\ConnectorInterface')->getMock(); $tcp->expects($this->once())->method('connect')->with('tcp://google.com:80')->willReturn($promise); $connector = new Connector($loop, array( 'tcp' => $tcp, - 'dns' => false + 'dns' => FALSE )); $connector->connect('tcp://google.com:80'); } - public function testConnectorWithUnknownSchemeAlwaysFails() - { + public function testConnectorWithUnknownSchemeAlwaysFails() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $connector = new Connector($loop); $promise = $connector->connect('unknown://google.com:80'); - $promise->then(null, $this->expectCallableOnce()); + $promise->then(NULL, $this->expectCallableOnce()); } - public function testConnectorWithDisabledTcpDefaultSchemeAlwaysFails() - { + public function testConnectorWithDisabledTcpDefaultSchemeAlwaysFails() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $connector = new Connector($loop, array( - 'tcp' => false + 'tcp' => FALSE )); $promise = $connector->connect('google.com:80'); - $promise->then(null, $this->expectCallableOnce()); + $promise->then(NULL, $this->expectCallableOnce()); } - public function testConnectorWithDisabledTcpSchemeAlwaysFails() - { + public function testConnectorWithDisabledTcpSchemeAlwaysFails() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $connector = new Connector($loop, array( - 'tcp' => false + 'tcp' => FALSE )); $promise = $connector->connect('tcp://google.com:80'); - $promise->then(null, $this->expectCallableOnce()); + $promise->then(NULL, $this->expectCallableOnce()); } - public function testConnectorWithDisabledTlsSchemeAlwaysFails() - { + public function testConnectorWithDisabledTlsSchemeAlwaysFails() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $connector = new Connector($loop, array( - 'tls' => false + 'tls' => FALSE )); $promise = $connector->connect('tls://google.com:443'); - $promise->then(null, $this->expectCallableOnce()); + $promise->then(NULL, $this->expectCallableOnce()); } - public function testConnectorWithDisabledUnixSchemeAlwaysFails() - { + public function testConnectorWithDisabledUnixSchemeAlwaysFails() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $connector = new Connector($loop, array( - 'unix' => false + 'unix' => FALSE )); $promise = $connector->connect('unix://demo.sock'); - $promise->then(null, $this->expectCallableOnce()); + $promise->then(NULL, $this->expectCallableOnce()); } - public function testConnectorUsesGivenResolverInstance() - { + public function testConnectorUsesGivenResolverInstance() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); - $promise = new Promise(function () { }); + $promise = new Promise(function () { + }); $resolver = $this->getMockBuilder('React\Dns\Resolver\Resolver')->disableOriginalConstructor()->getMock(); $resolver->expects($this->once())->method('resolve')->with('google.com')->willReturn($promise); @@ -106,15 +101,17 @@ class ConnectorTest extends TestCase $connector->connect('google.com:80'); } - public function testConnectorUsesResolvedHostnameIfDnsIsUsed() - { + public function testConnectorUsesResolvedHostnameIfDnsIsUsed() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); - $promise = new Promise(function ($resolve) { $resolve('127.0.0.1'); }); + $promise = new Promise(function ($resolve) { + $resolve('127.0.0.1'); + }); $resolver = $this->getMockBuilder('React\Dns\Resolver\Resolver')->disableOriginalConstructor()->getMock(); $resolver->expects($this->once())->method('resolve')->with('google.com')->willReturn($promise); - $promise = new Promise(function () { }); + $promise = new Promise(function () { + }); $tcp = $this->getMockBuilder('React\Socket\ConnectorInterface')->getMock(); $tcp->expects($this->once())->method('connect')->with('tcp://127.0.0.1:80?hostname=google.com')->willReturn($promise); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/DnsConnectorTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/DnsConnectorTest.php index 3c94c39..b60878e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/DnsConnectorTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/DnsConnectorTest.php @@ -11,64 +11,56 @@ class DnsConnectorTest extends TestCase private $resolver; private $connector; - public function setUp() - { + public function setUp() { $this->tcp = $this->getMockBuilder('React\Socket\ConnectorInterface')->getMock(); $this->resolver = $this->getMockBuilder('React\Dns\Resolver\Resolver')->disableOriginalConstructor()->getMock(); $this->connector = new DnsConnector($this->tcp, $this->resolver); } - public function testPassByResolverIfGivenIp() - { + public function testPassByResolverIfGivenIp() { $this->resolver->expects($this->never())->method('resolve'); $this->tcp->expects($this->once())->method('connect')->with($this->equalTo('127.0.0.1:80'))->will($this->returnValue(Promise\reject())); $this->connector->connect('127.0.0.1:80'); } - public function testPassThroughResolverIfGivenHost() - { + public function testPassThroughResolverIfGivenHost() { $this->resolver->expects($this->once())->method('resolve')->with($this->equalTo('google.com'))->will($this->returnValue(Promise\resolve('1.2.3.4'))); $this->tcp->expects($this->once())->method('connect')->with($this->equalTo('1.2.3.4:80?hostname=google.com'))->will($this->returnValue(Promise\reject())); $this->connector->connect('google.com:80'); } - public function testPassThroughResolverIfGivenHostWhichResolvesToIpv6() - { + public function testPassThroughResolverIfGivenHostWhichResolvesToIpv6() { $this->resolver->expects($this->once())->method('resolve')->with($this->equalTo('google.com'))->will($this->returnValue(Promise\resolve('::1'))); $this->tcp->expects($this->once())->method('connect')->with($this->equalTo('[::1]:80?hostname=google.com'))->will($this->returnValue(Promise\reject())); $this->connector->connect('google.com:80'); } - public function testPassByResolverIfGivenCompleteUri() - { + public function testPassByResolverIfGivenCompleteUri() { $this->resolver->expects($this->never())->method('resolve'); $this->tcp->expects($this->once())->method('connect')->with($this->equalTo('scheme://127.0.0.1:80/path?query#fragment'))->will($this->returnValue(Promise\reject())); $this->connector->connect('scheme://127.0.0.1:80/path?query#fragment'); } - public function testPassThroughResolverIfGivenCompleteUri() - { + public function testPassThroughResolverIfGivenCompleteUri() { $this->resolver->expects($this->once())->method('resolve')->with($this->equalTo('google.com'))->will($this->returnValue(Promise\resolve('1.2.3.4'))); $this->tcp->expects($this->once())->method('connect')->with($this->equalTo('scheme://1.2.3.4:80/path?query&hostname=google.com#fragment'))->will($this->returnValue(Promise\reject())); $this->connector->connect('scheme://google.com:80/path?query#fragment'); } - public function testPassThroughResolverIfGivenExplicitHost() - { + public function testPassThroughResolverIfGivenExplicitHost() { $this->resolver->expects($this->once())->method('resolve')->with($this->equalTo('google.com'))->will($this->returnValue(Promise\resolve('1.2.3.4'))); $this->tcp->expects($this->once())->method('connect')->with($this->equalTo('scheme://1.2.3.4:80/?hostname=google.de'))->will($this->returnValue(Promise\reject())); $this->connector->connect('scheme://google.com:80/?hostname=google.de'); } - public function testRejectsImmediatelyIfUriIsInvalid() - { + public function testRejectsImmediatelyIfUriIsInvalid() { $this->resolver->expects($this->never())->method('resolve'); $this->tcp->expects($this->never())->method('connect'); @@ -77,17 +69,16 @@ class DnsConnectorTest extends TestCase $promise->then($this->expectCallableNever(), $this->expectCallableOnce()); } - public function testSkipConnectionIfDnsFails() - { + public function testSkipConnectionIfDnsFails() { $this->resolver->expects($this->once())->method('resolve')->with($this->equalTo('example.invalid'))->will($this->returnValue(Promise\reject())); $this->tcp->expects($this->never())->method('connect'); $this->connector->connect('example.invalid:80'); } - public function testCancelDuringDnsCancelsDnsAndDoesNotStartTcpConnection() - { - $pending = new Promise\Promise(function () { }, $this->expectCallableOnce()); + public function testCancelDuringDnsCancelsDnsAndDoesNotStartTcpConnection() { + $pending = new Promise\Promise(function () { + }, $this->expectCallableOnce()); $this->resolver->expects($this->once())->method('resolve')->with($this->equalTo('example.com'))->will($this->returnValue($pending)); $this->tcp->expects($this->never())->method('connect'); @@ -97,9 +88,11 @@ class DnsConnectorTest extends TestCase $promise->then($this->expectCallableNever(), $this->expectCallableOnce()); } - public function testCancelDuringTcpConnectionCancelsTcpConnection() - { - $pending = new Promise\Promise(function () { }, function () { throw new \Exception(); }); + public function testCancelDuringTcpConnectionCancelsTcpConnection() { + $pending = new Promise\Promise(function () { + }, function () { + throw new \Exception(); + }); $this->resolver->expects($this->once())->method('resolve')->with($this->equalTo('example.com'))->will($this->returnValue(Promise\resolve('1.2.3.4'))); $this->tcp->expects($this->once())->method('connect')->with($this->equalTo('1.2.3.4:80?hostname=example.com'))->will($this->returnValue($pending)); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/FixedUriConnectorTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/FixedUriConnectorTest.php index f42d74f..1d2629a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/FixedUriConnectorTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/FixedUriConnectorTest.php @@ -7,8 +7,7 @@ use React\Tests\Socket\TestCase; class FixedUriConnectorTest extends TestCase { - public function testWillInvokeGivenConnector() - { + public function testWillInvokeGivenConnector() { $base = $this->getMockBuilder('React\Socket\ConnectorInterface')->getMock(); $base->expects($this->once())->method('connect')->with('test')->willReturn('ret'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/FunctionalConnectorTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/FunctionalConnectorTest.php index 6611352..8de3216 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/FunctionalConnectorTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/FunctionalConnectorTest.php @@ -12,8 +12,7 @@ class FunctionalConnectorTest extends TestCase const TIMEOUT = 1.0; /** @test */ - public function connectionToTcpServerShouldSucceedWithLocalhost() - { + public function connectionToTcpServerShouldSucceedWithLocalhost() { $loop = Factory::create(); $server = new TcpServer(9998, $loop); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/FunctionalSecureServerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/FunctionalSecureServerTest.php index 78a59d0..3b4684d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/FunctionalSecureServerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/FunctionalSecureServerTest.php @@ -14,15 +14,13 @@ class FunctionalSecureServerTest extends TestCase { const TIMEOUT = 0.5; - public function setUp() - { + public function setUp() { if (!function_exists('stream_socket_enable_crypto')) { $this->markTestSkipped('Not supported on your platform (outdated HHVM?)'); } } - public function testEmitsConnectionForNewConnection() - { + public function testEmitsConnectionForNewConnection() { $loop = Factory::create(); $server = new TcpServer(0, $loop); @@ -32,15 +30,14 @@ class FunctionalSecureServerTest extends TestCase $server->on('connection', $this->expectCallableOnce()); $connector = new SecureConnector(new TcpConnector($loop), $loop, array( - 'verify_peer' => false + 'verify_peer' => FALSE )); $promise = $connector->connect($server->getAddress()); Block\await($promise, $loop, self::TIMEOUT); } - public function testWritesDataToConnection() - { + public function testWritesDataToConnection() { $loop = Factory::create(); $server = new TcpServer(0, $loop); @@ -54,7 +51,7 @@ class FunctionalSecureServerTest extends TestCase }); $connector = new SecureConnector(new TcpConnector($loop), $loop, array( - 'verify_peer' => false + 'verify_peer' => FALSE )); $promise = $connector->connect($server->getAddress()); @@ -66,8 +63,7 @@ class FunctionalSecureServerTest extends TestCase Block\sleep(self::TIMEOUT, $loop); } - public function testWritesDataInMultipleChunksToConnection() - { + public function testWritesDataInMultipleChunksToConnection() { $loop = Factory::create(); $server = new TcpServer(0, $loop); @@ -81,7 +77,7 @@ class FunctionalSecureServerTest extends TestCase }); $connector = new SecureConnector(new TcpConnector($loop), $loop, array( - 'verify_peer' => false + 'verify_peer' => FALSE )); $promise = $connector->connect($server->getAddress()); @@ -98,8 +94,7 @@ class FunctionalSecureServerTest extends TestCase $this->assertEquals(400000, $received); } - public function testWritesMoreDataInMultipleChunksToConnection() - { + public function testWritesMoreDataInMultipleChunksToConnection() { $loop = Factory::create(); $server = new TcpServer(0, $loop); @@ -113,7 +108,7 @@ class FunctionalSecureServerTest extends TestCase }); $connector = new SecureConnector(new TcpConnector($loop), $loop, array( - 'verify_peer' => false + 'verify_peer' => FALSE )); $promise = $connector->connect($server->getAddress()); @@ -130,8 +125,7 @@ class FunctionalSecureServerTest extends TestCase $this->assertEquals(2000000, $received); } - public function testEmitsDataFromConnection() - { + public function testEmitsDataFromConnection() { $loop = Factory::create(); $server = new TcpServer(0, $loop); @@ -146,7 +140,7 @@ class FunctionalSecureServerTest extends TestCase }); $connector = new SecureConnector(new TcpConnector($loop), $loop, array( - 'verify_peer' => false + 'verify_peer' => FALSE )); $promise = $connector->connect($server->getAddress()); @@ -158,8 +152,7 @@ class FunctionalSecureServerTest extends TestCase Block\sleep(self::TIMEOUT, $loop); } - public function testEmitsDataInMultipleChunksFromConnection() - { + public function testEmitsDataInMultipleChunksFromConnection() { $loop = Factory::create(); $server = new TcpServer(0, $loop); @@ -176,7 +169,7 @@ class FunctionalSecureServerTest extends TestCase }); $connector = new SecureConnector(new TcpConnector($loop), $loop, array( - 'verify_peer' => false + 'verify_peer' => FALSE )); $promise = $connector->connect($server->getAddress()); @@ -190,8 +183,7 @@ class FunctionalSecureServerTest extends TestCase $this->assertEquals(400000, $received); } - public function testPipesDataBackInMultipleChunksFromConnection() - { + public function testPipesDataBackInMultipleChunksFromConnection() { $loop = Factory::create(); $server = new TcpServer(0, $loop); @@ -205,7 +197,7 @@ class FunctionalSecureServerTest extends TestCase }); $connector = new SecureConnector(new TcpConnector($loop), $loop, array( - 'verify_peer' => false + 'verify_peer' => FALSE )); $promise = $connector->connect($server->getAddress()); @@ -227,8 +219,7 @@ class FunctionalSecureServerTest extends TestCase /** * @requires PHP 5.6 */ - public function testEmitsConnectionForNewTlsv11Connection() - { + public function testEmitsConnectionForNewTlsv11Connection() { $loop = Factory::create(); $server = new TcpServer(0, $loop); @@ -239,7 +230,7 @@ class FunctionalSecureServerTest extends TestCase $server->on('connection', $this->expectCallableOnce()); $connector = new SecureConnector(new TcpConnector($loop), $loop, array( - 'verify_peer' => false, + 'verify_peer' => FALSE, 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT )); $promise = $connector->connect($server->getAddress()); @@ -250,20 +241,19 @@ class FunctionalSecureServerTest extends TestCase /** * @requires PHP 5.6 */ - public function testEmitsErrorForClientWithTlsVersionMismatch() - { + public function testEmitsErrorForClientWithTlsVersionMismatch() { $loop = Factory::create(); $server = new TcpServer(0, $loop); $server = new SecureServer($server, $loop, array( 'local_cert' => __DIR__ . '/../examples/localhost.pem', - 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_1_SERVER|STREAM_CRYPTO_METHOD_TLSv1_2_SERVER + 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_1_SERVER | STREAM_CRYPTO_METHOD_TLSv1_2_SERVER )); $server->on('connection', $this->expectCallableNever()); $server->on('error', $this->expectCallableOnce()); $connector = new SecureConnector(new TcpConnector($loop), $loop, array( - 'verify_peer' => false, + 'verify_peer' => FALSE, 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT )); $promise = $connector->connect($server->getAddress()); @@ -272,8 +262,7 @@ class FunctionalSecureServerTest extends TestCase Block\await($promise, $loop, self::TIMEOUT); } - public function testEmitsConnectionForNewConnectionWithEncryptedCertificate() - { + public function testEmitsConnectionForNewConnectionWithEncryptedCertificate() { $loop = Factory::create(); $server = new TcpServer(0, $loop); @@ -284,15 +273,14 @@ class FunctionalSecureServerTest extends TestCase $server->on('connection', $this->expectCallableOnce()); $connector = new SecureConnector(new TcpConnector($loop), $loop, array( - 'verify_peer' => false + 'verify_peer' => FALSE )); $promise = $connector->connect($server->getAddress()); Block\await($promise, $loop, self::TIMEOUT); } - public function testEmitsErrorForServerWithInvalidCertificate() - { + public function testEmitsErrorForServerWithInvalidCertificate() { $loop = Factory::create(); $server = new TcpServer(0, $loop); @@ -303,7 +291,7 @@ class FunctionalSecureServerTest extends TestCase $server->on('error', $this->expectCallableOnce()); $connector = new SecureConnector(new TcpConnector($loop), $loop, array( - 'verify_peer' => false + 'verify_peer' => FALSE )); $promise = $connector->connect($server->getAddress()); @@ -311,8 +299,7 @@ class FunctionalSecureServerTest extends TestCase Block\await($promise, $loop, self::TIMEOUT); } - public function testEmitsErrorForServerWithEncryptedCertificateMissingPassphrase() - { + public function testEmitsErrorForServerWithEncryptedCertificateMissingPassphrase() { $loop = Factory::create(); $server = new TcpServer(0, $loop); @@ -323,7 +310,7 @@ class FunctionalSecureServerTest extends TestCase $server->on('error', $this->expectCallableOnce()); $connector = new SecureConnector(new TcpConnector($loop), $loop, array( - 'verify_peer' => false + 'verify_peer' => FALSE )); $promise = $connector->connect($server->getAddress()); @@ -331,8 +318,7 @@ class FunctionalSecureServerTest extends TestCase Block\await($promise, $loop, self::TIMEOUT); } - public function testEmitsErrorForServerWithEncryptedCertificateWithInvalidPassphrase() - { + public function testEmitsErrorForServerWithEncryptedCertificateWithInvalidPassphrase() { $loop = Factory::create(); $server = new TcpServer(0, $loop); @@ -344,7 +330,7 @@ class FunctionalSecureServerTest extends TestCase $server->on('error', $this->expectCallableOnce()); $connector = new SecureConnector(new TcpConnector($loop), $loop, array( - 'verify_peer' => false + 'verify_peer' => FALSE )); $promise = $connector->connect($server->getAddress()); @@ -352,8 +338,7 @@ class FunctionalSecureServerTest extends TestCase Block\await($promise, $loop, self::TIMEOUT); } - public function testEmitsErrorForConnectionWithPeerVerification() - { + public function testEmitsErrorForConnectionWithPeerVerification() { $loop = Factory::create(); $server = new TcpServer(0, $loop); @@ -364,16 +349,15 @@ class FunctionalSecureServerTest extends TestCase $server->on('error', $this->expectCallableOnce()); $connector = new SecureConnector(new TcpConnector($loop), $loop, array( - 'verify_peer' => true + 'verify_peer' => TRUE )); $promise = $connector->connect($server->getAddress()); - $promise->then(null, $this->expectCallableOnce()); + $promise->then(NULL, $this->expectCallableOnce()); Block\sleep(self::TIMEOUT, $loop); } - public function testEmitsErrorIfConnectionIsCancelled() - { + public function testEmitsErrorIfConnectionIsCancelled() { if (PHP_OS !== 'Linux') { $this->markTestSkipped('Linux only (OS is ' . PHP_OS . ')'); } @@ -388,17 +372,16 @@ class FunctionalSecureServerTest extends TestCase $server->on('error', $this->expectCallableOnce()); $connector = new SecureConnector(new TcpConnector($loop), $loop, array( - 'verify_peer' => false + 'verify_peer' => FALSE )); $promise = $connector->connect($server->getAddress()); $promise->cancel(); - $promise->then(null, $this->expectCallableOnce()); + $promise->then(NULL, $this->expectCallableOnce()); Block\sleep(self::TIMEOUT, $loop); } - public function testEmitsNothingIfConnectionIsIdle() - { + public function testEmitsNothingIfConnectionIsIdle() { $loop = Factory::create(); $server = new TcpServer(0, $loop); @@ -415,8 +398,7 @@ class FunctionalSecureServerTest extends TestCase Block\sleep(self::TIMEOUT, $loop); } - public function testEmitsErrorIfConnectionIsNotSecureHandshake() - { + public function testEmitsErrorIfConnectionIsNotSecureHandshake() { $loop = Factory::create(); $server = new TcpServer(0, $loop); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/FunctionalTcpServerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/FunctionalTcpServerTest.php index ec7855e..f436c92 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/FunctionalTcpServerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/FunctionalTcpServerTest.php @@ -10,8 +10,7 @@ use Clue\React\Block; class FunctionalTcpServerTest extends TestCase { - public function testEmitsConnectionForNewConnection() - { + public function testEmitsConnectionForNewConnection() { $loop = Factory::create(); $server = new TcpServer(0, $loop); @@ -25,8 +24,7 @@ class FunctionalTcpServerTest extends TestCase Block\sleep(0.1, $loop); } - public function testEmitsNoConnectionForNewConnectionWhenPaused() - { + public function testEmitsNoConnectionForNewConnectionWhenPaused() { $loop = Factory::create(); $server = new TcpServer(0, $loop); @@ -41,8 +39,7 @@ class FunctionalTcpServerTest extends TestCase Block\sleep(0.1, $loop); } - public function testEmitsConnectionForNewConnectionWhenResumedAfterPause() - { + public function testEmitsConnectionForNewConnectionWhenResumedAfterPause() { $loop = Factory::create(); $server = new TcpServer(0, $loop); @@ -58,12 +55,11 @@ class FunctionalTcpServerTest extends TestCase Block\sleep(0.1, $loop); } - public function testEmitsConnectionWithRemoteIp() - { + public function testEmitsConnectionWithRemoteIp() { $loop = Factory::create(); $server = new TcpServer(0, $loop); - $peer = null; + $peer = NULL; $server->on('connection', function (ConnectionInterface $conn) use (&$peer) { $peer = $conn->getRemoteAddress(); }); @@ -78,12 +74,11 @@ class FunctionalTcpServerTest extends TestCase $this->assertContains('127.0.0.1:', $peer); } - public function testEmitsConnectionWithLocalIp() - { + public function testEmitsConnectionWithLocalIp() { $loop = Factory::create(); $server = new TcpServer(0, $loop); - $local = null; + $local = NULL; $server->on('connection', function (ConnectionInterface $conn) use (&$local) { $local = $conn->getLocalAddress(); }); @@ -99,12 +94,11 @@ class FunctionalTcpServerTest extends TestCase $this->assertEquals($server->getAddress(), $local); } - public function testEmitsConnectionWithLocalIpDespiteListeningOnAll() - { + public function testEmitsConnectionWithLocalIpDespiteListeningOnAll() { $loop = Factory::create(); $server = new TcpServer('0.0.0.0:0', $loop); - $local = null; + $local = NULL; $server->on('connection', function (ConnectionInterface $conn) use (&$local) { $local = $conn->getLocalAddress(); }); @@ -119,12 +113,11 @@ class FunctionalTcpServerTest extends TestCase $this->assertContains('127.0.0.1:', $local); } - public function testEmitsConnectionWithRemoteIpAfterConnectionIsClosedByPeer() - { + public function testEmitsConnectionWithRemoteIpAfterConnectionIsClosedByPeer() { $loop = Factory::create(); $server = new TcpServer(0, $loop); - $peer = null; + $peer = NULL; $server->on('connection', function (ConnectionInterface $conn) use (&$peer) { $conn->on('close', function () use ($conn, &$peer) { $peer = $conn->getRemoteAddress(); @@ -142,12 +135,11 @@ class FunctionalTcpServerTest extends TestCase $this->assertContains('127.0.0.1:', $peer); } - public function testEmitsConnectionWithRemoteNullAddressAfterConnectionIsClosedLocally() - { + public function testEmitsConnectionWithRemoteNullAddressAfterConnectionIsClosedLocally() { $loop = Factory::create(); $server = new TcpServer(0, $loop); - $peer = null; + $peer = NULL; $server->on('connection', function (ConnectionInterface $conn) use (&$peer) { $conn->close(); $peer = $conn->getRemoteAddress(); @@ -163,8 +155,7 @@ class FunctionalTcpServerTest extends TestCase $this->assertNull($peer); } - public function testEmitsConnectionEvenIfConnectionIsCancelled() - { + public function testEmitsConnectionEvenIfConnectionIsCancelled() { if (PHP_OS !== 'Linux') { $this->markTestSkipped('Linux only (OS is ' . PHP_OS . ')'); } @@ -178,13 +169,12 @@ class FunctionalTcpServerTest extends TestCase $promise = $connector->connect($server->getAddress()); $promise->cancel(); - $promise->then(null, $this->expectCallableOnce()); + $promise->then(NULL, $this->expectCallableOnce()); Block\sleep(0.1, $loop); } - public function testEmitsConnectionForNewIpv6Connection() - { + public function testEmitsConnectionForNewIpv6Connection() { $loop = Factory::create(); try { @@ -203,8 +193,7 @@ class FunctionalTcpServerTest extends TestCase Block\sleep(0.1, $loop); } - public function testEmitsConnectionWithRemoteIpv6() - { + public function testEmitsConnectionWithRemoteIpv6() { $loop = Factory::create(); try { @@ -213,7 +202,7 @@ class FunctionalTcpServerTest extends TestCase $this->markTestSkipped('Unable to start IPv6 server socket (not available on your platform?)'); } - $peer = null; + $peer = NULL; $server->on('connection', function (ConnectionInterface $conn) use (&$peer) { $peer = $conn->getRemoteAddress(); }); @@ -228,8 +217,7 @@ class FunctionalTcpServerTest extends TestCase $this->assertContains('[::1]:', $peer); } - public function testEmitsConnectionWithLocalIpv6() - { + public function testEmitsConnectionWithLocalIpv6() { $loop = Factory::create(); try { @@ -238,7 +226,7 @@ class FunctionalTcpServerTest extends TestCase $this->markTestSkipped('Unable to start IPv6 server socket (not available on your platform?)'); } - $local = null; + $local = NULL; $server->on('connection', function (ConnectionInterface $conn) use (&$local) { $local = $conn->getLocalAddress(); }); @@ -254,8 +242,7 @@ class FunctionalTcpServerTest extends TestCase $this->assertEquals($server->getAddress(), $local); } - public function testEmitsConnectionWithInheritedContextOptions() - { + public function testEmitsConnectionWithInheritedContextOptions() { if (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.13', '<')) { // https://3v4l.org/hB4Tc $this->markTestSkipped('Not supported on legacy HHVM < 3.13'); @@ -267,7 +254,7 @@ class FunctionalTcpServerTest extends TestCase 'backlog' => 4 )); - $all = null; + $all = NULL; $server->on('connection', function (ConnectionInterface $conn) use (&$all) { $all = stream_context_get_options($conn->stream); }); @@ -285,8 +272,7 @@ class FunctionalTcpServerTest extends TestCase /** * @expectedException InvalidArgumentException */ - public function testFailsToListenOnInvalidUri() - { + public function testFailsToListenOnInvalidUri() { $loop = Factory::create(); new TcpServer('///', $loop); @@ -295,8 +281,7 @@ class FunctionalTcpServerTest extends TestCase /** * @expectedException InvalidArgumentException */ - public function testFailsToListenOnUriWithoutPort() - { + public function testFailsToListenOnUriWithoutPort() { $loop = Factory::create(); new TcpServer('127.0.0.1', $loop); @@ -305,8 +290,7 @@ class FunctionalTcpServerTest extends TestCase /** * @expectedException InvalidArgumentException */ - public function testFailsToListenOnUriWithWrongScheme() - { + public function testFailsToListenOnUriWithWrongScheme() { $loop = Factory::create(); new TcpServer('udp://127.0.0.1:0', $loop); @@ -315,8 +299,7 @@ class FunctionalTcpServerTest extends TestCase /** * @expectedException InvalidArgumentException */ - public function testFailsToListenOnUriWIthHostname() - { + public function testFailsToListenOnUriWIthHostname() { $loop = Factory::create(); new TcpServer('localhost:8080', $loop); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/IntegrationTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/IntegrationTest.php index 24dbe37..6955018 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/IntegrationTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/IntegrationTest.php @@ -16,8 +16,7 @@ class IntegrationTest extends TestCase const TIMEOUT = 5.0; /** @test */ - public function gettingStuffFromGoogleShouldWork() - { + public function gettingStuffFromGoogleShouldWork() { $loop = Factory::create(); $connector = new Connector($loop); @@ -34,8 +33,7 @@ class IntegrationTest extends TestCase } /** @test */ - public function gettingEncryptedStuffFromGoogleShouldWork() - { + public function gettingEncryptedStuffFromGoogleShouldWork() { if (!function_exists('stream_socket_enable_crypto')) { $this->markTestSkipped('Not supported on your platform (outdated HHVM?)'); } @@ -53,8 +51,7 @@ class IntegrationTest extends TestCase } /** @test */ - public function gettingEncryptedStuffFromGoogleShouldWorkIfHostIsResolvedFirst() - { + public function gettingEncryptedStuffFromGoogleShouldWorkIfHostIsResolvedFirst() { if (!function_exists('stream_socket_enable_crypto')) { $this->markTestSkipped('Not supported on your platform (outdated HHVM?)'); } @@ -82,8 +79,7 @@ class IntegrationTest extends TestCase } /** @test */ - public function gettingPlaintextStuffFromEncryptedGoogleShouldNotWork() - { + public function gettingPlaintextStuffFromEncryptedGoogleShouldNotWork() { $loop = Factory::create(); $connector = new Connector($loop); @@ -99,8 +95,7 @@ class IntegrationTest extends TestCase $this->assertNotRegExp('#^HTTP/1\.0#', $response); } - public function testConnectingFailsIfDnsUsesInvalidResolver() - { + public function testConnectingFailsIfDnsUsesInvalidResolver() { $loop = Factory::create(); $factory = new ResolverFactory(); @@ -114,8 +109,7 @@ class IntegrationTest extends TestCase Block\await($connector->connect('google.com:80'), $loop, self::TIMEOUT); } - public function testConnectingFailsIfTimeoutIsTooSmall() - { + public function testConnectingFailsIfTimeoutIsTooSmall() { if (!function_exists('stream_socket_enable_crypto')) { $this->markTestSkipped('Not supported on your platform (outdated HHVM?)'); } @@ -130,8 +124,7 @@ class IntegrationTest extends TestCase Block\await($connector->connect('google.com:80'), $loop, self::TIMEOUT); } - public function testSelfSignedRejectsIfVerificationIsEnabled() - { + public function testSelfSignedRejectsIfVerificationIsEnabled() { if (!function_exists('stream_socket_enable_crypto')) { $this->markTestSkipped('Not supported on your platform (outdated HHVM?)'); } @@ -140,7 +133,7 @@ class IntegrationTest extends TestCase $connector = new Connector($loop, array( 'tls' => array( - 'verify_peer' => true + 'verify_peer' => TRUE ) )); @@ -148,8 +141,7 @@ class IntegrationTest extends TestCase Block\await($connector->connect('tls://self-signed.badssl.com:443'), $loop, self::TIMEOUT); } - public function testSelfSignedResolvesIfVerificationIsDisabled() - { + public function testSelfSignedResolvesIfVerificationIsDisabled() { if (!function_exists('stream_socket_enable_crypto')) { $this->markTestSkipped('Not supported on your platform (outdated HHVM?)'); } @@ -158,7 +150,7 @@ class IntegrationTest extends TestCase $connector = new Connector($loop, array( 'tls' => array( - 'verify_peer' => false + 'verify_peer' => FALSE ) )); @@ -166,6 +158,6 @@ class IntegrationTest extends TestCase $conn->close(); // if we reach this, then everything is good - $this->assertNull(null); + $this->assertNull(NULL); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/LimitingServerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/LimitingServerTest.php index 2cc9a58..14f8847 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/LimitingServerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/LimitingServerTest.php @@ -9,8 +9,7 @@ use Clue\React\Block; class LimitingServerTest extends TestCase { - public function testGetAddressWillBePassedThroughToTcpServer() - { + public function testGetAddressWillBePassedThroughToTcpServer() { $tcp = $this->getMockBuilder('React\Socket\ServerInterface')->getMock(); $tcp->expects($this->once())->method('getAddress')->willReturn('127.0.0.1:1234'); @@ -19,8 +18,7 @@ class LimitingServerTest extends TestCase $this->assertEquals('127.0.0.1:1234', $server->getAddress()); } - public function testPauseWillBePassedThroughToTcpServer() - { + public function testPauseWillBePassedThroughToTcpServer() { $tcp = $this->getMockBuilder('React\Socket\ServerInterface')->getMock(); $tcp->expects($this->once())->method('pause'); @@ -29,8 +27,7 @@ class LimitingServerTest extends TestCase $server->pause(); } - public function testPauseTwiceWillBePassedThroughToTcpServerOnce() - { + public function testPauseTwiceWillBePassedThroughToTcpServerOnce() { $tcp = $this->getMockBuilder('React\Socket\ServerInterface')->getMock(); $tcp->expects($this->once())->method('pause'); @@ -40,8 +37,7 @@ class LimitingServerTest extends TestCase $server->pause(); } - public function testResumeWillBePassedThroughToTcpServer() - { + public function testResumeWillBePassedThroughToTcpServer() { $tcp = $this->getMockBuilder('React\Socket\ServerInterface')->getMock(); $tcp->expects($this->once())->method('resume'); @@ -51,8 +47,7 @@ class LimitingServerTest extends TestCase $server->resume(); } - public function testResumeTwiceWillBePassedThroughToTcpServerOnce() - { + public function testResumeTwiceWillBePassedThroughToTcpServerOnce() { $tcp = $this->getMockBuilder('React\Socket\ServerInterface')->getMock(); $tcp->expects($this->once())->method('resume'); @@ -63,8 +58,7 @@ class LimitingServerTest extends TestCase $server->resume(); } - public function testCloseWillBePassedThroughToTcpServer() - { + public function testCloseWillBePassedThroughToTcpServer() { $tcp = $this->getMockBuilder('React\Socket\ServerInterface')->getMock(); $tcp->expects($this->once())->method('close'); @@ -73,8 +67,7 @@ class LimitingServerTest extends TestCase $server->close(); } - public function testSocketErrorWillBeForwarded() - { + public function testSocketErrorWillBeForwarded() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $tcp = new TcpServer(0, $loop); @@ -86,8 +79,7 @@ class LimitingServerTest extends TestCase $tcp->emit('error', array(new \RuntimeException('test'))); } - public function testSocketConnectionWillBeForwarded() - { + public function testSocketConnectionWillBeForwarded() { $connection = $this->getMockBuilder('React\Socket\ConnectionInterface')->getMock(); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -103,8 +95,7 @@ class LimitingServerTest extends TestCase $this->assertEquals(array($connection), $server->getConnections()); } - public function testSocketConnectionWillBeClosedOnceLimitIsReached() - { + public function testSocketConnectionWillBeClosedOnceLimitIsReached() { $first = $this->getMockBuilder('React\Socket\ConnectionInterface')->getMock(); $first->expects($this->never())->method('close'); $second = $this->getMockBuilder('React\Socket\ConnectionInterface')->getMock(); @@ -122,8 +113,7 @@ class LimitingServerTest extends TestCase $tcp->emit('connection', array($second)); } - public function testPausingServerWillBePausedOnceLimitIsReached() - { + public function testPausingServerWillBePausedOnceLimitIsReached() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $loop->expects($this->once())->method('addReadStream'); $loop->expects($this->once())->method('removeReadStream'); @@ -132,13 +122,12 @@ class LimitingServerTest extends TestCase $connection = $this->getMockBuilder('React\Socket\ConnectionInterface')->getMock(); - $server = new LimitingServer($tcp, 1, true); + $server = new LimitingServer($tcp, 1, TRUE); $tcp->emit('connection', array($connection)); } - public function testSocketDisconnectionWillRemoveFromList() - { + public function testSocketDisconnectionWillRemoveFromList() { $loop = Factory::create(); $tcp = new TcpServer(0, $loop); @@ -155,12 +144,11 @@ class LimitingServerTest extends TestCase $this->assertEquals(array(), $server->getConnections()); } - public function testPausingServerWillEmitOnlyOneButAcceptTwoConnectionsDueToOperatingSystem() - { + public function testPausingServerWillEmitOnlyOneButAcceptTwoConnectionsDueToOperatingSystem() { $loop = Factory::create(); $server = new TcpServer(0, $loop); - $server = new LimitingServer($server, 1, true); + $server = new LimitingServer($server, 1, TRUE); $server->on('connection', $this->expectCallableOnce()); $server->on('error', $this->expectCallableNever()); @@ -173,15 +161,14 @@ class LimitingServerTest extends TestCase fclose($second); } - public function testPausingServerWillEmitTwoConnectionsFromBacklog() - { + public function testPausingServerWillEmitTwoConnectionsFromBacklog() { $loop = Factory::create(); $twice = $this->createCallableMock(); $twice->expects($this->exactly(2))->method('__invoke'); $server = new TcpServer(0, $loop); - $server = new LimitingServer($server, 1, true); + $server = new LimitingServer($server, 1, TRUE); $server->on('connection', $twice); $server->on('error', $this->expectCallableNever()); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/SecureConnectorTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/SecureConnectorTest.php index 0b3a702..da90340 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/SecureConnectorTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/SecureConnectorTest.php @@ -11,8 +11,7 @@ class SecureConnectorTest extends TestCase private $tcp; private $connector; - public function setUp() - { + public function setUp() { if (!function_exists('stream_socket_enable_crypto')) { $this->markTestSkipped('Not supported on your platform (outdated HHVM?)'); } @@ -22,9 +21,9 @@ class SecureConnectorTest extends TestCase $this->connector = new SecureConnector($this->tcp, $this->loop); } - public function testConnectionWillWaitForTcpConnection() - { - $pending = new Promise\Promise(function () { }); + public function testConnectionWillWaitForTcpConnection() { + $pending = new Promise\Promise(function () { + }); $this->tcp->expects($this->once())->method('connect')->with($this->equalTo('example.com:80'))->will($this->returnValue($pending)); $promise = $this->connector->connect('example.com:80'); @@ -32,26 +31,27 @@ class SecureConnectorTest extends TestCase $this->assertInstanceOf('React\Promise\PromiseInterface', $promise); } - public function testConnectionWithCompleteUriWillBePassedThroughExpectForScheme() - { - $pending = new Promise\Promise(function () { }); + public function testConnectionWithCompleteUriWillBePassedThroughExpectForScheme() { + $pending = new Promise\Promise(function () { + }); $this->tcp->expects($this->once())->method('connect')->with($this->equalTo('example.com:80/path?query#fragment'))->will($this->returnValue($pending)); $this->connector->connect('tls://example.com:80/path?query#fragment'); } - public function testConnectionToInvalidSchemeWillReject() - { + public function testConnectionToInvalidSchemeWillReject() { $this->tcp->expects($this->never())->method('connect'); $promise = $this->connector->connect('tcp://example.com:80'); - $promise->then(null, $this->expectCallableOnce()); + $promise->then(NULL, $this->expectCallableOnce()); } - public function testCancelDuringTcpConnectionCancelsTcpConnection() - { - $pending = new Promise\Promise(function () { }, function () { throw new \Exception(); }); + public function testCancelDuringTcpConnectionCancelsTcpConnection() { + $pending = new Promise\Promise(function () { + }, function () { + throw new \Exception(); + }); $this->tcp->expects($this->once())->method('connect')->with($this->equalTo('example.com:80'))->will($this->returnValue($pending)); $promise = $this->connector->connect('example.com:80'); @@ -60,8 +60,7 @@ class SecureConnectorTest extends TestCase $promise->then($this->expectCallableNever(), $this->expectCallableOnce()); } - public function testConnectionWillBeClosedAndRejectedIfConnectioIsNoStream() - { + public function testConnectionWillBeClosedAndRejectedIfConnectioIsNoStream() { $connection = $this->getMockBuilder('React\Socket\ConnectionInterface')->getMock(); $connection->expects($this->once())->method('close'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/SecureIntegrationTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/SecureIntegrationTest.php index 8c9ba14..846d01d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/SecureIntegrationTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/SecureIntegrationTest.php @@ -22,8 +22,7 @@ class SecureIntegrationTest extends TestCase private $connector; private $address; - public function setUp() - { + public function setUp() { if (!function_exists('stream_socket_enable_crypto')) { $this->markTestSkipped('Not supported on your platform (outdated HHVM?)'); } @@ -34,30 +33,27 @@ class SecureIntegrationTest extends TestCase 'local_cert' => __DIR__ . '/../examples/localhost.pem' )); $this->address = $this->server->getAddress(); - $this->connector = new SecureConnector(new TcpConnector($this->loop), $this->loop, array('verify_peer' => false)); + $this->connector = new SecureConnector(new TcpConnector($this->loop), $this->loop, array('verify_peer' => FALSE)); } - public function tearDown() - { - if ($this->server !== null) { + public function tearDown() { + if ($this->server !== NULL) { $this->server->close(); - $this->server = null; + $this->server = NULL; } } - public function testConnectToServer() - { + public function testConnectToServer() { $client = Block\await($this->connector->connect($this->address), $this->loop, self::TIMEOUT); /* @var $client ConnectionInterface */ $client->close(); // if we reach this, then everything is good - $this->assertNull(null); + $this->assertNull(NULL); } - public function testConnectToServerEmitsConnection() - { + public function testConnectToServerEmitsConnection() { $promiseServer = $this->createPromiseForEvent($this->server, 'connection', $this->expectCallableOnce()); $promiseClient = $this->connector->connect($this->address); @@ -68,8 +64,7 @@ class SecureIntegrationTest extends TestCase $client->close(); } - public function testSendSmallDataToServerReceivesOneChunk() - { + public function testSendSmallDataToServerReceivesOneChunk() { // server expects one connection which emits one data event $received = new Deferred(); $this->server->on('connection', function (ConnectionInterface $peer) use ($received) { @@ -91,8 +86,7 @@ class SecureIntegrationTest extends TestCase $this->assertEquals('hello', $data); } - public function testSendDataWithEndToServerReceivesAllData() - { + public function testSendDataWithEndToServerReceivesAllData() { $disconnected = new Deferred(); $this->server->on('connection', function (ConnectionInterface $peer) use ($disconnected) { $received = ''; @@ -116,8 +110,7 @@ class SecureIntegrationTest extends TestCase $this->assertEquals($data, $received); } - public function testSendDataWithoutEndingToServerReceivesAllData() - { + public function testSendDataWithoutEndingToServerReceivesAllData() { $received = ''; $this->server->on('connection', function (ConnectionInterface $peer) use (&$received) { $peer->on('data', function ($chunk) use (&$received) { @@ -139,8 +132,7 @@ class SecureIntegrationTest extends TestCase $this->assertEquals($data, $received); } - public function testConnectToServerWhichSendsSmallDataReceivesOneChunk() - { + public function testConnectToServerWhichSendsSmallDataReceivesOneChunk() { $this->server->on('connection', function (ConnectionInterface $peer) { $peer->write('hello'); }); @@ -155,8 +147,7 @@ class SecureIntegrationTest extends TestCase $client->close(); } - public function testConnectToServerWhichSendsDataWithEndReceivesAllData() - { + public function testConnectToServerWhichSendsDataWithEndReceivesAllData() { $data = str_repeat('b', 100000); $this->server->on('connection', function (ConnectionInterface $peer) use ($data) { $peer->end($data); @@ -171,8 +162,7 @@ class SecureIntegrationTest extends TestCase $this->assertEquals($data, $received); } - public function testConnectToServerWhichSendsDataWithoutEndingReceivesAllData() - { + public function testConnectToServerWhichSendsDataWithoutEndingReceivesAllData() { $data = str_repeat('c', 100000); $this->server->on('connection', function (ConnectionInterface $peer) use ($data) { $peer->write($data); @@ -193,8 +183,7 @@ class SecureIntegrationTest extends TestCase $this->assertEquals($data, $received); } - private function createPromiseForEvent(EventEmitterInterface $emitter, $event, $fn) - { + private function createPromiseForEvent(EventEmitterInterface $emitter, $event, $fn) { return new Promise(function ($resolve) use ($emitter, $event, $fn) { $emitter->on($event, function () use ($resolve, $fn) { $resolve(call_user_func_array($fn, func_get_args())); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/SecureServerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/SecureServerTest.php index 92c641f..0df4b04 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/SecureServerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/SecureServerTest.php @@ -7,15 +7,13 @@ use React\Socket\TcpServer; class SecureServerTest extends TestCase { - public function setUp() - { + public function setUp() { if (!function_exists('stream_socket_enable_crypto')) { $this->markTestSkipped('Not supported on your platform (outdated HHVM?)'); } } - public function testGetAddressWillBePassedThroughToTcpServer() - { + public function testGetAddressWillBePassedThroughToTcpServer() { $tcp = $this->getMockBuilder('React\Socket\ServerInterface')->getMock(); $tcp->expects($this->once())->method('getAddress')->willReturn('tcp://127.0.0.1:1234'); @@ -26,10 +24,9 @@ class SecureServerTest extends TestCase $this->assertEquals('tls://127.0.0.1:1234', $server->getAddress()); } - public function testGetAddressWillReturnNullIfTcpServerReturnsNull() - { + public function testGetAddressWillReturnNullIfTcpServerReturnsNull() { $tcp = $this->getMockBuilder('React\Socket\ServerInterface')->getMock(); - $tcp->expects($this->once())->method('getAddress')->willReturn(null); + $tcp->expects($this->once())->method('getAddress')->willReturn(NULL); $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); @@ -38,8 +35,7 @@ class SecureServerTest extends TestCase $this->assertNull($server->getAddress()); } - public function testPauseWillBePassedThroughToTcpServer() - { + public function testPauseWillBePassedThroughToTcpServer() { $tcp = $this->getMockBuilder('React\Socket\ServerInterface')->getMock(); $tcp->expects($this->once())->method('pause'); @@ -50,8 +46,7 @@ class SecureServerTest extends TestCase $server->pause(); } - public function testResumeWillBePassedThroughToTcpServer() - { + public function testResumeWillBePassedThroughToTcpServer() { $tcp = $this->getMockBuilder('React\Socket\ServerInterface')->getMock(); $tcp->expects($this->once())->method('resume'); @@ -62,8 +57,7 @@ class SecureServerTest extends TestCase $server->resume(); } - public function testCloseWillBePassedThroughToTcpServer() - { + public function testCloseWillBePassedThroughToTcpServer() { $tcp = $this->getMockBuilder('React\Socket\ServerInterface')->getMock(); $tcp->expects($this->once())->method('close'); @@ -74,8 +68,7 @@ class SecureServerTest extends TestCase $server->close(); } - public function testConnectionWillBeEndedWithErrorIfItIsNotAStream() - { + public function testConnectionWillBeEndedWithErrorIfItIsNotAStream() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $tcp = new TcpServer(0, $loop); @@ -90,8 +83,7 @@ class SecureServerTest extends TestCase $tcp->emit('connection', array($connection)); } - public function testSocketErrorWillBeForwarded() - { + public function testSocketErrorWillBeForwarded() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $tcp = new TcpServer(0, $loop); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/ServerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/ServerTest.php index 14fdb2c..62e4e4e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/ServerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/ServerTest.php @@ -13,8 +13,7 @@ class ServerTest extends TestCase { const TIMEOUT = 0.1; - public function testCreateServerWithZeroPortAssignsRandomPort() - { + public function testCreateServerWithZeroPortAssignsRandomPort() { $loop = Factory::create(); $server = new Server(0, $loop); @@ -25,15 +24,13 @@ class ServerTest extends TestCase /** * @expectedException InvalidArgumentException */ - public function testConstructorThrowsForInvalidUri() - { + public function testConstructorThrowsForInvalidUri() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $server = new Server('invalid URI', $loop); } - public function testConstructorCreatesExpectedTcpServer() - { + public function testConstructorCreatesExpectedTcpServer() { $loop = Factory::create(); $server = new Server(0, $loop); @@ -48,8 +45,7 @@ class ServerTest extends TestCase $server->close(); } - public function testConstructorCreatesExpectedUnixServer() - { + public function testConstructorCreatesExpectedUnixServer() { $loop = Factory::create(); $server = new Server($this->getRandomSocketUri(), $loop); @@ -64,8 +60,7 @@ class ServerTest extends TestCase $server->close(); } - public function testEmitsConnectionForNewConnection() - { + public function testEmitsConnectionForNewConnection() { $loop = Factory::create(); $server = new Server(0, $loop); @@ -76,8 +71,7 @@ class ServerTest extends TestCase Block\sleep(0.1, $loop); } - public function testDoesNotEmitConnectionForNewConnectionToPausedServer() - { + public function testDoesNotEmitConnectionForNewConnectionToPausedServer() { $loop = Factory::create(); $server = new Server(0, $loop); @@ -89,8 +83,7 @@ class ServerTest extends TestCase Block\sleep(0.1, $loop); } - public function testDoesEmitConnectionForNewConnectionToResumedServer() - { + public function testDoesEmitConnectionForNewConnectionToResumedServer() { $loop = Factory::create(); $server = new Server(0, $loop); @@ -105,8 +98,7 @@ class ServerTest extends TestCase Block\sleep(0.1, $loop); } - public function testDoesNotAllowConnectionToClosedServer() - { + public function testDoesNotAllowConnectionToClosedServer() { $loop = Factory::create(); $server = new Server(0, $loop); @@ -121,8 +113,7 @@ class ServerTest extends TestCase $this->assertFalse($client); } - public function testEmitsConnectionWithInheritedContextOptions() - { + public function testEmitsConnectionWithInheritedContextOptions() { if (defined('HHVM_VERSION') && version_compare(HHVM_VERSION, '3.13', '<')) { // https://3v4l.org/hB4Tc $this->markTestSkipped('Not supported on legacy HHVM < 3.13'); @@ -134,7 +125,7 @@ class ServerTest extends TestCase 'backlog' => 4 )); - $all = null; + $all = NULL; $server->on('connection', function (ConnectionInterface $conn) use (&$all) { $all = stream_context_get_options($conn->stream); }); @@ -146,8 +137,7 @@ class ServerTest extends TestCase $this->assertEquals(array('socket' => array('backlog' => 4)), $all); } - public function testDoesNotEmitSecureConnectionForNewPlainConnection() - { + public function testDoesNotEmitSecureConnectionForNewPlainConnection() { if (!function_exists('stream_socket_enable_crypto')) { $this->markTestSkipped('Not supported on your platform (outdated HHVM?)'); } @@ -166,8 +156,7 @@ class ServerTest extends TestCase Block\sleep(0.1, $loop); } - private function getRandomSocketUri() - { - return "unix://" . sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid(rand(), true) . '.sock'; + private function getRandomSocketUri() { + return "unix://" . sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid(rand(), TRUE) . '.sock'; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/Stub/CallableStub.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/Stub/CallableStub.php index 1b197eb..f1f66de 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/Stub/CallableStub.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/Stub/CallableStub.php @@ -4,7 +4,6 @@ namespace React\Tests\Socket\Stub; class CallableStub { - public function __invoke() - { + public function __invoke() { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/Stub/ConnectionStub.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/Stub/ConnectionStub.php index 844b2ad..16172c6 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/Stub/ConnectionStub.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/Stub/ConnectionStub.php @@ -11,53 +11,43 @@ class ConnectionStub extends EventEmitter implements ConnectionInterface { private $data = ''; - public function isReadable() - { - return true; + public function isReadable() { + return TRUE; } - public function isWritable() - { - return true; + public function isWritable() { + return TRUE; } - public function pause() - { + public function pause() { } - public function resume() - { + public function resume() { } - public function pipe(WritableStreamInterface $dest, array $options = array()) - { + public function pipe(WritableStreamInterface $dest, array $options = array()) { Util::pipe($this, $dest, $options); return $dest; } - public function write($data) - { + public function write($data) { $this->data .= $data; - return true; + return TRUE; } - public function end($data = null) - { + public function end($data = NULL) { } - public function close() - { + public function close() { } - public function getData() - { + public function getData() { return $this->data; } - public function getRemoteAddress() - { + public function getRemoteAddress() { return '127.0.0.1'; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/Stub/ServerStub.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/Stub/ServerStub.php index d9e74f4..1cac041 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/Stub/ServerStub.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/Stub/ServerStub.php @@ -7,12 +7,10 @@ use React\Socket\ServerInterface; class ServerStub extends EventEmitter implements ServerInterface { - public function getAddress() - { + public function getAddress() { return '127.0.0.1:80'; } - public function close() - { + public function close() { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/TcpConnectorTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/TcpConnectorTest.php index e3575a7..b7c2bd7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/TcpConnectorTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/TcpConnectorTest.php @@ -13,29 +13,27 @@ class TcpConnectorTest extends TestCase const TIMEOUT = 0.1; /** @test */ - public function connectionToEmptyPortShouldFail() - { + public function connectionToEmptyPortShouldFail() { $loop = Factory::create(); $connector = new TcpConnector($loop); $connector->connect('127.0.0.1:9999') - ->then($this->expectCallableNever(), $this->expectCallableOnce()); + ->then($this->expectCallableNever(), $this->expectCallableOnce()); $loop->run(); } /** @test */ - public function connectionToTcpServerShouldAddResourceToLoop() - { + public function connectionToTcpServerShouldAddResourceToLoop() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $connector = new TcpConnector($loop); $server = new TcpServer(0, $loop); - $valid = false; + $valid = FALSE; $loop->expects($this->once())->method('addWriteStream')->with($this->callback(function ($arg) use (&$valid) { $valid = is_resource($arg); - return true; + return TRUE; })); $connector->connect($server->getAddress()); @@ -43,8 +41,7 @@ class TcpConnectorTest extends TestCase } /** @test */ - public function connectionToTcpServerShouldSucceed() - { + public function connectionToTcpServerShouldSucceed() { $loop = Factory::create(); $server = new TcpServer(9999, $loop); @@ -61,8 +58,7 @@ class TcpConnectorTest extends TestCase } /** @test */ - public function connectionToTcpServerShouldSucceedWithRemoteAdressSameAsTarget() - { + public function connectionToTcpServerShouldSucceedWithRemoteAdressSameAsTarget() { $loop = Factory::create(); $server = new TcpServer(9999, $loop); @@ -79,8 +75,7 @@ class TcpConnectorTest extends TestCase } /** @test */ - public function connectionToTcpServerShouldSucceedWithLocalAdressOnLocalhost() - { + public function connectionToTcpServerShouldSucceedWithLocalAdressOnLocalhost() { $loop = Factory::create(); $server = new TcpServer(9999, $loop); @@ -98,8 +93,7 @@ class TcpConnectorTest extends TestCase } /** @test */ - public function connectionToTcpServerShouldSucceedWithNullAddressesAfterConnectionClosed() - { + public function connectionToTcpServerShouldSucceedWithNullAddressesAfterConnectionClosed() { $loop = Factory::create(); $server = new TcpServer(9999, $loop); @@ -117,8 +111,7 @@ class TcpConnectorTest extends TestCase } /** @test */ - public function connectionToTcpServerWillCloseWhenOtherSideCloses() - { + public function connectionToTcpServerWillCloseWhenOtherSideCloses() { $loop = Factory::create(); // immediately close connection and server once connection is in @@ -139,8 +132,7 @@ class TcpConnectorTest extends TestCase } /** @test */ - public function connectionToEmptyIp6PortShouldFail() - { + public function connectionToEmptyIp6PortShouldFail() { $loop = Factory::create(); $connector = new TcpConnector($loop); @@ -152,8 +144,7 @@ class TcpConnectorTest extends TestCase } /** @test */ - public function connectionToIp6TcpServerShouldSucceed() - { + public function connectionToIp6TcpServerShouldSucceed() { $loop = Factory::create(); try { @@ -179,8 +170,7 @@ class TcpConnectorTest extends TestCase } /** @test */ - public function connectionToHostnameShouldFailImmediately() - { + public function connectionToHostnameShouldFailImmediately() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $connector = new TcpConnector($loop); @@ -191,8 +181,7 @@ class TcpConnectorTest extends TestCase } /** @test */ - public function connectionToInvalidPortShouldFailImmediately() - { + public function connectionToInvalidPortShouldFailImmediately() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $connector = new TcpConnector($loop); @@ -203,8 +192,7 @@ class TcpConnectorTest extends TestCase } /** @test */ - public function connectionToInvalidSchemeShouldFailImmediately() - { + public function connectionToInvalidSchemeShouldFailImmediately() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $connector = new TcpConnector($loop); @@ -215,8 +203,7 @@ class TcpConnectorTest extends TestCase } /** @test */ - public function cancellingConnectionShouldRemoveResourceFromLoopAndCloseResource() - { + public function cancellingConnectionShouldRemoveResourceFromLoopAndCloseResource() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $connector = new TcpConnector($loop); @@ -225,12 +212,12 @@ class TcpConnectorTest extends TestCase $loop->expects($this->once())->method('addWriteStream'); $promise = $connector->connect($server->getAddress()); - $resource = null; - $valid = false; + $resource = NULL; + $valid = FALSE; $loop->expects($this->once())->method('removeWriteStream')->with($this->callback(function ($arg) use (&$resource, &$valid) { $resource = $arg; $valid = is_resource($arg); - return true; + return TRUE; })); $promise->cancel(); @@ -239,8 +226,7 @@ class TcpConnectorTest extends TestCase } /** @test */ - public function cancellingConnectionShouldRejectPromise() - { + public function cancellingConnectionShouldRejectPromise() { $loop = Factory::create(); $connector = new TcpConnector($loop); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/TcpServerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/TcpServerTest.php index 72b3c28..c1dade3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/TcpServerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/TcpServerTest.php @@ -13,8 +13,7 @@ class TcpServerTest extends TestCase private $server; private $port; - private function createLoop() - { + private function createLoop() { return Factory::create(); } @@ -22,8 +21,7 @@ class TcpServerTest extends TestCase * @covers React\Socket\TcpServer::__construct * @covers React\Socket\TcpServer::getAddress */ - public function setUp() - { + public function setUp() { $this->loop = $this->createLoop(); $this->server = new TcpServer(0, $this->loop); @@ -33,9 +31,8 @@ class TcpServerTest extends TestCase /** * @covers React\Socket\TcpServer::handleConnection */ - public function testConnection() - { - $client = stream_socket_client('tcp://localhost:'.$this->port); + public function testConnection() { + $client = stream_socket_client('tcp://localhost:' . $this->port); $this->server->on('connection', $this->expectCallableOnce()); @@ -45,11 +42,10 @@ class TcpServerTest extends TestCase /** * @covers React\Socket\TcpServer::handleConnection */ - public function testConnectionWithManyClients() - { - $client1 = stream_socket_client('tcp://localhost:'.$this->port); - $client2 = stream_socket_client('tcp://localhost:'.$this->port); - $client3 = stream_socket_client('tcp://localhost:'.$this->port); + public function testConnectionWithManyClients() { + $client1 = stream_socket_client('tcp://localhost:' . $this->port); + $client2 = stream_socket_client('tcp://localhost:' . $this->port); + $client3 = stream_socket_client('tcp://localhost:' . $this->port); $this->server->on('connection', $this->expectCallableExactly(3)); $this->tick(); @@ -57,9 +53,8 @@ class TcpServerTest extends TestCase $this->tick(); } - public function testDataEventWillNotBeEmittedWhenClientSendsNoData() - { - $client = stream_socket_client('tcp://localhost:'.$this->port); + public function testDataEventWillNotBeEmittedWhenClientSendsNoData() { + $client = stream_socket_client('tcp://localhost:' . $this->port); $mock = $this->expectCallableNever(); @@ -70,9 +65,8 @@ class TcpServerTest extends TestCase $this->tick(); } - public function testDataWillBeEmittedWithDataClientSends() - { - $client = stream_socket_client('tcp://localhost:'.$this->port); + public function testDataWillBeEmittedWithDataClientSends() { + $client = stream_socket_client('tcp://localhost:' . $this->port); fwrite($client, "foo\n"); @@ -85,8 +79,7 @@ class TcpServerTest extends TestCase $this->tick(); } - public function testDataWillBeEmittedEvenWhenClientShutsDownAfterSending() - { + public function testDataWillBeEmittedEvenWhenClientShutsDownAfterSending() { $client = stream_socket_client('tcp://localhost:' . $this->port); fwrite($client, "foo\n"); stream_socket_shutdown($client, STREAM_SHUT_WR); @@ -100,41 +93,37 @@ class TcpServerTest extends TestCase $this->tick(); } - public function testLoopWillEndWhenServerIsClosed() - { + public function testLoopWillEndWhenServerIsClosed() { // explicitly unset server because we already call close() $this->server->close(); - $this->server = null; + $this->server = NULL; $this->loop->run(); // if we reach this, then everything is good - $this->assertNull(null); + $this->assertNull(NULL); } - public function testCloseTwiceIsNoOp() - { + public function testCloseTwiceIsNoOp() { $this->server->close(); $this->server->close(); // if we reach this, then everything is good - $this->assertNull(null); + $this->assertNull(NULL); } - public function testGetAddressAfterCloseReturnsNull() - { + public function testGetAddressAfterCloseReturnsNull() { $this->server->close(); $this->assertNull($this->server->getAddress()); } - public function testLoopWillEndWhenServerIsClosedAfterSingleConnection() - { + public function testLoopWillEndWhenServerIsClosedAfterSingleConnection() { $client = stream_socket_client('tcp://localhost:' . $this->port); // explicitly unset server because we only accept a single connection // and then already call close() $server = $this->server; - $this->server = null; + $this->server = NULL; $server->on('connection', function ($conn) use ($server) { $conn->close(); @@ -144,11 +133,10 @@ class TcpServerTest extends TestCase $this->loop->run(); // if we reach this, then everything is good - $this->assertNull(null); + $this->assertNull(NULL); } - public function testDataWillBeEmittedInMultipleChunksWhenClientSendsExcessiveAmounts() - { + public function testDataWillBeEmittedInMultipleChunksWhenClientSendsExcessiveAmounts() { $client = stream_socket_client('tcp://localhost:' . $this->port); $stream = new DuplexResourceStream($client, $this->loop); @@ -160,7 +148,7 @@ class TcpServerTest extends TestCase // explicitly unset server because we only accept a single connection // and then already call close() $server = $this->server; - $this->server = null; + $this->server = NULL; $received = 0; $server->on('connection', function ($conn) use ($mock, &$received, $server) { @@ -180,9 +168,8 @@ class TcpServerTest extends TestCase $this->assertEquals($bytes, $received); } - public function testConnectionDoesNotEndWhenClientDoesNotClose() - { - $client = stream_socket_client('tcp://localhost:'.$this->port); + public function testConnectionDoesNotEndWhenClientDoesNotClose() { + $client = stream_socket_client('tcp://localhost:' . $this->port); $mock = $this->expectCallableNever(); @@ -196,9 +183,8 @@ class TcpServerTest extends TestCase /** * @covers React\Socket\Connection::end */ - public function testConnectionDoesEndWhenClientCloses() - { - $client = stream_socket_client('tcp://localhost:'.$this->port); + public function testConnectionDoesEndWhenClientCloses() { + $client = stream_socket_client('tcp://localhost:' . $this->port); fclose($client); @@ -211,16 +197,14 @@ class TcpServerTest extends TestCase $this->tick(); } - public function testCtorAddsResourceToLoop() - { + public function testCtorAddsResourceToLoop() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $loop->expects($this->once())->method('addReadStream'); $server = new TcpServer(0, $loop); } - public function testResumeWithoutPauseIsNoOp() - { + public function testResumeWithoutPauseIsNoOp() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $loop->expects($this->once())->method('addReadStream'); @@ -228,8 +212,7 @@ class TcpServerTest extends TestCase $server->resume(); } - public function testPauseRemovesResourceFromLoop() - { + public function testPauseRemovesResourceFromLoop() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $loop->expects($this->once())->method('removeReadStream'); @@ -237,8 +220,7 @@ class TcpServerTest extends TestCase $server->pause(); } - public function testPauseAfterPauseIsNoOp() - { + public function testPauseAfterPauseIsNoOp() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $loop->expects($this->once())->method('removeReadStream'); @@ -247,8 +229,7 @@ class TcpServerTest extends TestCase $server->pause(); } - public function testCloseRemovesResourceFromLoop() - { + public function testCloseRemovesResourceFromLoop() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $loop->expects($this->once())->method('removeReadStream'); @@ -259,8 +240,7 @@ class TcpServerTest extends TestCase /** * @expectedException RuntimeException */ - public function testListenOnBusyPortThrows() - { + public function testListenOnBusyPortThrows() { if (DIRECTORY_SEPARATOR === '\\') { $this->markTestSkipped('Windows supports listening on same port multiple times'); } @@ -271,15 +251,13 @@ class TcpServerTest extends TestCase /** * @covers React\Socket\TcpServer::close */ - public function tearDown() - { + public function tearDown() { if ($this->server) { $this->server->close(); } } - private function tick() - { + private function tick() { Block\sleep(0, $this->loop); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/TestCase.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/TestCase.php index e87fc2f..e0a53e2 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/TestCase.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/TestCase.php @@ -10,8 +10,7 @@ use PHPUnit\Framework\TestCase as BaseTestCase; class TestCase extends BaseTestCase { - protected function expectCallableExactly($amount) - { + protected function expectCallableExactly($amount) { $mock = $this->createCallableMock(); $mock ->expects($this->exactly($amount)) @@ -20,8 +19,7 @@ class TestCase extends BaseTestCase return $mock; } - protected function expectCallableOnce() - { + protected function expectCallableOnce() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -30,8 +28,7 @@ class TestCase extends BaseTestCase return $mock; } - protected function expectCallableOnceWith($value) - { + protected function expectCallableOnceWith($value) { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -41,8 +38,7 @@ class TestCase extends BaseTestCase return $mock; } - protected function expectCallableNever() - { + protected function expectCallableNever() { $mock = $this->createCallableMock(); $mock ->expects($this->never()) @@ -51,13 +47,11 @@ class TestCase extends BaseTestCase return $mock; } - protected function createCallableMock() - { + protected function createCallableMock() { return $this->getMockBuilder('React\Tests\Socket\Stub\CallableStub')->getMock(); } - protected function buffer(ReadableStreamInterface $stream, LoopInterface $loop, $timeout) - { + protected function buffer(ReadableStreamInterface $stream, LoopInterface $loop, $timeout) { if (!$stream->isReadable()) { return ''; } @@ -82,15 +76,14 @@ class TestCase extends BaseTestCase ), $loop, $timeout); } - public function setExpectedException($exception, $exceptionMessage = '', $exceptionCode = null) - { + public function setExpectedException($exception, $exceptionMessage = '', $exceptionCode = NULL) { if (method_exists($this, 'expectException')) { // PHPUnit 5+ $this->expectException($exception); if ($exceptionMessage !== '') { $this->expectExceptionMessage($exceptionMessage); } - if ($exceptionCode !== null) { + if ($exceptionCode !== NULL) { $this->expectExceptionCode($exceptionCode); } } else { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/TimeoutConnectorTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/TimeoutConnectorTest.php index 64787d9..2baa0a5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/TimeoutConnectorTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/TimeoutConnectorTest.php @@ -8,9 +8,9 @@ use React\EventLoop\Factory; class TimeoutConnectorTest extends TestCase { - public function testRejectsOnTimeout() - { - $promise = new Promise\Promise(function () { }); + public function testRejectsOnTimeout() { + $promise = new Promise\Promise(function () { + }); $connector = $this->getMockBuilder('React\Socket\ConnectorInterface')->getMock(); $connector->expects($this->once())->method('connect')->with('google.com:80')->will($this->returnValue($promise)); @@ -27,8 +27,7 @@ class TimeoutConnectorTest extends TestCase $loop->run(); } - public function testRejectsWhenConnectorRejects() - { + public function testRejectsWhenConnectorRejects() { $promise = Promise\reject(new \RuntimeException()); $connector = $this->getMockBuilder('React\Socket\ConnectorInterface')->getMock(); @@ -46,8 +45,7 @@ class TimeoutConnectorTest extends TestCase $loop->run(); } - public function testResolvesWhenConnectorResolves() - { + public function testResolvesWhenConnectorResolves() { $promise = Promise\resolve(); $connector = $this->getMockBuilder('React\Socket\ConnectorInterface')->getMock(); @@ -65,9 +63,9 @@ class TimeoutConnectorTest extends TestCase $loop->run(); } - public function testRejectsAndCancelsPendingPromiseOnTimeout() - { - $promise = new Promise\Promise(function () { }, $this->expectCallableOnce()); + public function testRejectsAndCancelsPendingPromiseOnTimeout() { + $promise = new Promise\Promise(function () { + }, $this->expectCallableOnce()); $connector = $this->getMockBuilder('React\Socket\ConnectorInterface')->getMock(); $connector->expects($this->once())->method('connect')->with('google.com:80')->will($this->returnValue($promise)); @@ -84,9 +82,11 @@ class TimeoutConnectorTest extends TestCase $loop->run(); } - public function testCancelsPendingPromiseOnCancel() - { - $promise = new Promise\Promise(function () { }, function () { throw new \Exception(); }); + public function testCancelsPendingPromiseOnCancel() { + $promise = new Promise\Promise(function () { + }, function () { + throw new \Exception(); + }); $connector = $this->getMockBuilder('React\Socket\ConnectorInterface')->getMock(); $connector->expects($this->once())->method('connect')->with('google.com:80')->will($this->returnValue($promise)); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/UnixConnectorTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/UnixConnectorTest.php index 1564064..61e6806 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/UnixConnectorTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/UnixConnectorTest.php @@ -10,26 +10,22 @@ class UnixConnectorTest extends TestCase private $loop; private $connector; - public function setUp() - { + public function setUp() { $this->loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $this->connector = new UnixConnector($this->loop); } - public function testInvalid() - { + public function testInvalid() { $promise = $this->connector->connect('google.com:80'); - $promise->then(null, $this->expectCallableOnce()); + $promise->then(NULL, $this->expectCallableOnce()); } - public function testInvalidScheme() - { + public function testInvalidScheme() { $promise = $this->connector->connect('tcp://google.com:80'); - $promise->then(null, $this->expectCallableOnce()); + $promise->then(NULL, $this->expectCallableOnce()); } - public function testValid() - { + public function testValid() { // random unix domain socket path $path = sys_get_temp_dir() . '/test' . uniqid() . '.sock'; @@ -38,7 +34,7 @@ class UnixConnectorTest extends TestCase // skip test if we can not create a test server (Windows etc.) if (!$server) { - $this->markTestSkipped('Unable to create socket "' . $path . '": ' . $errstr . '(' . $errno .')'); + $this->markTestSkipped('Unable to create socket "' . $path . '": ' . $errstr . '(' . $errno . ')'); return; } @@ -47,8 +43,8 @@ class UnixConnectorTest extends TestCase $promise->then($this->expectCallableOnce()); // remember remote and local address of this connection and close again - $remote = $local = false; - $promise->then(function(ConnectionInterface $conn) use (&$remote, &$local) { + $remote = $local = FALSE; + $promise->then(function (ConnectionInterface $conn) use (&$remote, &$local) { $remote = $conn->getRemoteAddress(); $local = $conn->getLocalAddress(); $conn->close(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/UnixServerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/UnixServerTest.php index 10f7e4f..0375375 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/UnixServerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/socket/tests/UnixServerTest.php @@ -17,8 +17,7 @@ class UnixServerTest extends TestCase * @covers React\Socket\UnixServer::__construct * @covers React\Socket\UnixServer::getAddress */ - public function setUp() - { + public function setUp() { $this->loop = Factory::create(); $this->uds = $this->getRandomSocketUri(); $this->server = new UnixServer($this->uds, $this->loop); @@ -27,8 +26,7 @@ class UnixServerTest extends TestCase /** * @covers React\Socket\UnixServer::handleConnection */ - public function testConnection() - { + public function testConnection() { $client = stream_socket_client($this->uds); $this->server->on('connection', $this->expectCallableOnce()); @@ -38,8 +36,7 @@ class UnixServerTest extends TestCase /** * @covers React\Socket\UnixServer::handleConnection */ - public function testConnectionWithManyClients() - { + public function testConnectionWithManyClients() { $client1 = stream_socket_client($this->uds); $client2 = stream_socket_client($this->uds); $client3 = stream_socket_client($this->uds); @@ -50,8 +47,7 @@ class UnixServerTest extends TestCase $this->tick(); } - public function testDataEventWillNotBeEmittedWhenClientSendsNoData() - { + public function testDataEventWillNotBeEmittedWhenClientSendsNoData() { $client = stream_socket_client($this->uds); $mock = $this->expectCallableNever(); @@ -63,8 +59,7 @@ class UnixServerTest extends TestCase $this->tick(); } - public function testDataWillBeEmittedWithDataClientSends() - { + public function testDataWillBeEmittedWithDataClientSends() { $client = stream_socket_client($this->uds); fwrite($client, "foo\n"); @@ -78,8 +73,7 @@ class UnixServerTest extends TestCase $this->tick(); } - public function testDataWillBeEmittedEvenWhenClientShutsDownAfterSending() - { + public function testDataWillBeEmittedEvenWhenClientShutsDownAfterSending() { $client = stream_socket_client($this->uds); fwrite($client, "foo\n"); stream_socket_shutdown($client, STREAM_SHUT_WR); @@ -93,41 +87,37 @@ class UnixServerTest extends TestCase $this->tick(); } - public function testLoopWillEndWhenServerIsClosed() - { + public function testLoopWillEndWhenServerIsClosed() { // explicitly unset server because we already call close() $this->server->close(); - $this->server = null; + $this->server = NULL; $this->loop->run(); // if we reach this, then everything is good - $this->assertNull(null); + $this->assertNull(NULL); } - public function testCloseTwiceIsNoOp() - { + public function testCloseTwiceIsNoOp() { $this->server->close(); $this->server->close(); // if we reach this, then everything is good - $this->assertNull(null); + $this->assertNull(NULL); } - public function testGetAddressAfterCloseReturnsNull() - { + public function testGetAddressAfterCloseReturnsNull() { $this->server->close(); $this->assertNull($this->server->getAddress()); } - public function testLoopWillEndWhenServerIsClosedAfterSingleConnection() - { + public function testLoopWillEndWhenServerIsClosedAfterSingleConnection() { $client = stream_socket_client($this->uds); // explicitly unset server because we only accept a single connection // and then already call close() $server = $this->server; - $this->server = null; + $this->server = NULL; $server->on('connection', function ($conn) use ($server) { $conn->close(); @@ -137,11 +127,10 @@ class UnixServerTest extends TestCase $this->loop->run(); // if we reach this, then everything is good - $this->assertNull(null); + $this->assertNull(NULL); } - public function testDataWillBeEmittedInMultipleChunksWhenClientSendsExcessiveAmounts() - { + public function testDataWillBeEmittedInMultipleChunksWhenClientSendsExcessiveAmounts() { $client = stream_socket_client($this->uds); $stream = new DuplexResourceStream($client, $this->loop); @@ -153,7 +142,7 @@ class UnixServerTest extends TestCase // explicitly unset server because we only accept a single connection // and then already call close() $server = $this->server; - $this->server = null; + $this->server = NULL; $received = 0; $server->on('connection', function ($conn) use ($mock, &$received, $server) { @@ -173,8 +162,7 @@ class UnixServerTest extends TestCase $this->assertEquals($bytes, $received); } - public function testConnectionDoesNotEndWhenClientDoesNotClose() - { + public function testConnectionDoesNotEndWhenClientDoesNotClose() { $client = stream_socket_client($this->uds); $mock = $this->expectCallableNever(); @@ -189,8 +177,7 @@ class UnixServerTest extends TestCase /** * @covers React\Socket\Connection::end */ - public function testConnectionDoesEndWhenClientCloses() - { + public function testConnectionDoesEndWhenClientCloses() { $client = stream_socket_client($this->uds); fclose($client); @@ -204,16 +191,14 @@ class UnixServerTest extends TestCase $this->tick(); } - public function testCtorAddsResourceToLoop() - { + public function testCtorAddsResourceToLoop() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $loop->expects($this->once())->method('addReadStream'); $server = new UnixServer($this->getRandomSocketUri(), $loop); } - public function testResumeWithoutPauseIsNoOp() - { + public function testResumeWithoutPauseIsNoOp() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $loop->expects($this->once())->method('addReadStream'); @@ -221,8 +206,7 @@ class UnixServerTest extends TestCase $server->resume(); } - public function testPauseRemovesResourceFromLoop() - { + public function testPauseRemovesResourceFromLoop() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $loop->expects($this->once())->method('removeReadStream'); @@ -230,8 +214,7 @@ class UnixServerTest extends TestCase $server->pause(); } - public function testPauseAfterPauseIsNoOp() - { + public function testPauseAfterPauseIsNoOp() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $loop->expects($this->once())->method('removeReadStream'); @@ -240,8 +223,7 @@ class UnixServerTest extends TestCase $server->pause(); } - public function testCloseRemovesResourceFromLoop() - { + public function testCloseRemovesResourceFromLoop() { $loop = $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); $loop->expects($this->once())->method('removeReadStream'); @@ -252,8 +234,7 @@ class UnixServerTest extends TestCase /** * @expectedException RuntimeException */ - public function testListenOnBusyPortThrows() - { + public function testListenOnBusyPortThrows() { if (DIRECTORY_SEPARATOR === '\\') { $this->markTestSkipped('Windows supports listening on same port multiple times'); } @@ -264,20 +245,17 @@ class UnixServerTest extends TestCase /** * @covers React\Socket\UnixServer::close */ - public function tearDown() - { + public function tearDown() { if ($this->server) { $this->server->close(); } } - private function getRandomSocketUri() - { - return "unix://" . sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid(rand(), true) . '.sock'; + private function getRandomSocketUri() { + return "unix://" . sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid(rand(), TRUE) . '.sock'; } - private function tick() - { + private function tick() { Block\sleep(0, $this->loop); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/composer.json index f6faa66..0b81f3f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/composer.json @@ -1,25 +1,34 @@ { - "name": "react/stream", - "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", - "keywords": ["event-driven", "readable", "writable", "stream", "non-blocking", "io", "pipe", "ReactPHP"], - "license": "MIT", - "require": { - "php": ">=5.3.8", - "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", - "evenement/evenement": "^3.0 || ^2.0 || ^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35", - "clue/stream-filter": "~1.2" - }, - "autoload": { - "psr-4": { - "React\\Stream\\": "src" - } - }, - "autoload-dev": { - "psr-4": { - "React\\Tests\\Stream\\": "tests" - } + "name": "react/stream", + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "readable", + "writable", + "stream", + "non-blocking", + "io", + "pipe", + "ReactPHP" + ], + "license": "MIT", + "require": { + "php": ">=5.3.8", + "react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3.5", + "evenement/evenement": "^3.0 || ^2.0 || ^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35", + "clue/stream-filter": "~1.2" + }, + "autoload": { + "psr-4": { + "React\\Stream\\": "src" } + }, + "autoload-dev": { + "psr-4": { + "React\\Tests\\Stream\\": "tests" + } + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/examples/91-benchmark-throughput.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/examples/91-benchmark-throughput.php index ecf695c..35619eb 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/examples/91-benchmark-throughput.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/examples/91-benchmark-throughput.php @@ -21,7 +21,7 @@ if (DIRECTORY_SEPARATOR === '\\') { $args = getopt('i:o:t:'); $if = isset($args['i']) ? $args['i'] : '/dev/zero'; $of = isset($args['o']) ? $args['o'] : '/dev/null'; -$t = isset($args['t']) ? $args['t'] : 1; +$t = isset($args['t']) ? $args['t'] : 1; // passing file descriptors requires mapping paths (https://bugs.php.net/bug.php?id=53465) $if = str_replace('/dev/fd/', 'php://fd/', $if); @@ -34,7 +34,7 @@ $info = new React\Stream\WritableResourceStream(STDERR, $loop); if (extension_loaded('xdebug')) { $info->write('NOTICE: The "xdebug" extension is loaded, this has a major impact on performance.' . PHP_EOL); } -$info->write('piping from ' . $if . ' to ' . $of . ' (for max ' . $t . ' second(s)) ...'. PHP_EOL); +$info->write('piping from ' . $if . ' to ' . $of . ' (for max ' . $t . ' second(s)) ...' . PHP_EOL); // setup input and output streams and pipe inbetween $fh = fopen($if, 'r'); @@ -43,20 +43,20 @@ $out = new React\Stream\WritableResourceStream(fopen($of, 'w'), $loop); $in->pipe($out); // stop input stream in $t seconds -$start = microtime(true); +$start = microtime(TRUE); $timeout = $loop->addTimer($t, function () use ($in, &$bytes) { $in->close(); }); // print stream position once stream closes $in->on('close', function () use ($fh, $start, $loop, $timeout, $info) { - $t = microtime(true) - $start; + $t = microtime(TRUE) - $start; $loop->cancelTimer($timeout); $bytes = ftell($fh); $info->write('read ' . $bytes . ' byte(s) in ' . round($t, 3) . ' second(s) => ' . round($bytes / 1024 / 1024 / $t, 1) . ' MiB/s' . PHP_EOL); - $info->write('peak memory usage of ' . round(memory_get_peak_usage(true) / 1024 / 1024, 1) . ' MiB' . PHP_EOL); + $info->write('peak memory usage of ' . round(memory_get_peak_usage(TRUE) / 1024 / 1024, 1) . ' MiB' . PHP_EOL); }); $loop->run(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/CompositeStream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/CompositeStream.php index 153f2a3..eec280a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/CompositeStream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/CompositeStream.php @@ -8,10 +8,9 @@ final class CompositeStream extends EventEmitter implements DuplexStreamInterfac { private $readable; private $writable; - private $closed = false; + private $closed = FALSE; - public function __construct(ReadableStreamInterface $readable, WritableStreamInterface $writable) - { + public function __construct(ReadableStreamInterface $readable, WritableStreamInterface $writable) { $this->readable = $readable; $this->writable = $writable; @@ -26,18 +25,15 @@ final class CompositeStream extends EventEmitter implements DuplexStreamInterfac $this->writable->on('close', array($this, 'close')); } - public function isReadable() - { + public function isReadable() { return $this->readable->isReadable(); } - public function pause() - { + public function pause() { $this->readable->pause(); } - public function resume() - { + public function resume() { if (!$this->writable->isWritable()) { return; } @@ -45,34 +41,29 @@ final class CompositeStream extends EventEmitter implements DuplexStreamInterfac $this->readable->resume(); } - public function pipe(WritableStreamInterface $dest, array $options = array()) - { + public function pipe(WritableStreamInterface $dest, array $options = array()) { return Util::pipe($this, $dest, $options); } - public function isWritable() - { + public function isWritable() { return $this->writable->isWritable(); } - public function write($data) - { + public function write($data) { return $this->writable->write($data); } - public function end($data = null) - { + public function end($data = NULL) { $this->readable->pause(); $this->writable->end($data); } - public function close() - { + public function close() { if ($this->closed) { return; } - $this->closed = true; + $this->closed = TRUE; $this->readable->close(); $this->writable->close(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/DuplexResourceStream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/DuplexResourceStream.php index 982ebb0..7872edb 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/DuplexResourceStream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/DuplexResourceStream.php @@ -30,26 +30,25 @@ final class DuplexResourceStream extends EventEmitter implements DuplexStreamInt private $bufferSize; private $buffer; - private $readable = true; - private $writable = true; - private $closing = false; - private $listening = false; + private $readable = TRUE; + private $writable = TRUE; + private $closing = FALSE; + private $listening = FALSE; - public function __construct($stream, LoopInterface $loop, $readChunkSize = null, WritableStreamInterface $buffer = null) - { + public function __construct($stream, LoopInterface $loop, $readChunkSize = NULL, WritableStreamInterface $buffer = NULL) { if (!is_resource($stream) || get_resource_type($stream) !== "stream") { - throw new InvalidArgumentException('First parameter must be a valid stream resource'); + throw new InvalidArgumentException('First parameter must be a valid stream resource'); } // ensure resource is opened for reading and wrting (fopen mode must contain "+") $meta = stream_get_meta_data($stream); - if (isset($meta['mode']) && $meta['mode'] !== '' && strpos($meta['mode'], '+') === false) { + if (isset($meta['mode']) && $meta['mode'] !== '' && strpos($meta['mode'], '+') === FALSE) { throw new InvalidArgumentException('Given stream resource is not opened in read and write mode'); } // this class relies on non-blocking I/O in order to not interrupt the event loop // e.g. pipes on Windows do not support this: https://bugs.php.net/bug.php?id=47918 - if (stream_set_blocking($stream, 0) !== true) { + if (stream_set_blocking($stream, 0) !== TRUE) { throw new \RuntimeException('Unable to set stream resource to non-blocking mode'); } @@ -65,13 +64,13 @@ final class DuplexResourceStream extends EventEmitter implements DuplexStreamInt stream_set_read_buffer($stream, 0); } - if ($buffer === null) { + if ($buffer === NULL) { $buffer = new WritableResourceStream($stream, $loop); } $this->stream = $stream; $this->loop = $loop; - $this->bufferSize = ($readChunkSize === null) ? 65536 : (int)$readChunkSize; + $this->bufferSize = ($readChunkSize === NULL) ? 65536 : (int)$readChunkSize; $this->buffer = $buffer; $that = $this; @@ -89,51 +88,45 @@ final class DuplexResourceStream extends EventEmitter implements DuplexStreamInt $this->resume(); } - public function isReadable() - { + public function isReadable() { return $this->readable; } - public function isWritable() - { + public function isWritable() { return $this->writable; } - public function pause() - { + public function pause() { if ($this->listening) { $this->loop->removeReadStream($this->stream); - $this->listening = false; + $this->listening = FALSE; } } - public function resume() - { + public function resume() { if (!$this->listening && $this->readable) { $this->loop->addReadStream($this->stream, array($this, 'handleData')); - $this->listening = true; + $this->listening = TRUE; } } - public function write($data) - { + public function write($data) { if (!$this->writable) { - return false; + return FALSE; } return $this->buffer->write($data); } - public function close() - { + public function close() { if (!$this->writable && !$this->closing) { return; } - $this->closing = false; + $this->closing = FALSE; - $this->readable = false; - $this->writable = false; + $this->readable = FALSE; + $this->writable = FALSE; $this->emit('close'); $this->pause(); @@ -145,30 +138,27 @@ final class DuplexResourceStream extends EventEmitter implements DuplexStreamInt } } - public function end($data = null) - { + public function end($data = NULL) { if (!$this->writable) { return; } - $this->closing = true; + $this->closing = TRUE; - $this->readable = false; - $this->writable = false; + $this->readable = FALSE; + $this->writable = FALSE; $this->pause(); $this->buffer->end($data); } - public function pipe(WritableStreamInterface $dest, array $options = array()) - { + public function pipe(WritableStreamInterface $dest, array $options = array()) { return Util::pipe($this, $dest, $options); } /** @internal */ - public function handleData($stream) - { - $error = null; + public function handleData($stream) { + $error = NULL; set_error_handler(function ($errno, $errstr, $errfile, $errline) use (&$error) { $error = new \ErrorException( $errstr, @@ -183,7 +173,7 @@ final class DuplexResourceStream extends EventEmitter implements DuplexStreamInt restore_error_handler(); - if ($error !== null) { + if ($error !== NULL) { $this->emit('error', array(new \RuntimeException('Unable to read from stream: ' . $error->getMessage(), 0, $error))); $this->close(); return; @@ -191,7 +181,7 @@ final class DuplexResourceStream extends EventEmitter implements DuplexStreamInt if ($data !== '') { $this->emit('data', array($data)); - } else{ + } else { // no data read => we reached the end and close the stream $this->emit('end'); $this->close(); @@ -210,15 +200,14 @@ final class DuplexResourceStream extends EventEmitter implements DuplexStreamInt * * @codeCoverageIgnore */ - private function isLegacyPipe($resource) - { + private function isLegacyPipe($resource) { if (PHP_VERSION_ID < 50428 || (PHP_VERSION_ID >= 50500 && PHP_VERSION_ID < 50512)) { $meta = stream_get_meta_data($resource); if (isset($meta['stream_type']) && $meta['stream_type'] === 'STDIO') { - return true; + return TRUE; } } - return false; + return FALSE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/ReadableResourceStream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/ReadableResourceStream.php index 015a96b..b313479 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/ReadableResourceStream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/ReadableResourceStream.php @@ -35,13 +35,12 @@ final class ReadableResourceStream extends EventEmitter implements ReadableStrea */ private $bufferSize; - private $closed = false; - private $listening = false; + private $closed = FALSE; + private $listening = FALSE; - public function __construct($stream, LoopInterface $loop, $readChunkSize = null) - { + public function __construct($stream, LoopInterface $loop, $readChunkSize = NULL) { if (!is_resource($stream) || get_resource_type($stream) !== "stream") { - throw new InvalidArgumentException('First parameter must be a valid stream resource'); + throw new InvalidArgumentException('First parameter must be a valid stream resource'); } // ensure resource is opened for reading (fopen mode must contain "r" or "+") @@ -52,7 +51,7 @@ final class ReadableResourceStream extends EventEmitter implements ReadableStrea // this class relies on non-blocking I/O in order to not interrupt the event loop // e.g. pipes on Windows do not support this: https://bugs.php.net/bug.php?id=47918 - if (stream_set_blocking($stream, 0) !== true) { + if (stream_set_blocking($stream, 0) !== TRUE) { throw new \RuntimeException('Unable to set stream resource to non-blocking mode'); } @@ -70,44 +69,39 @@ final class ReadableResourceStream extends EventEmitter implements ReadableStrea $this->stream = $stream; $this->loop = $loop; - $this->bufferSize = ($readChunkSize === null) ? 65536 : (int)$readChunkSize; + $this->bufferSize = ($readChunkSize === NULL) ? 65536 : (int)$readChunkSize; $this->resume(); } - public function isReadable() - { + public function isReadable() { return !$this->closed; } - public function pause() - { + public function pause() { if ($this->listening) { $this->loop->removeReadStream($this->stream); - $this->listening = false; + $this->listening = FALSE; } } - public function resume() - { + public function resume() { if (!$this->listening && !$this->closed) { $this->loop->addReadStream($this->stream, array($this, 'handleData')); - $this->listening = true; + $this->listening = TRUE; } } - public function pipe(WritableStreamInterface $dest, array $options = array()) - { + public function pipe(WritableStreamInterface $dest, array $options = array()) { return Util::pipe($this, $dest, $options); } - public function close() - { + public function close() { if ($this->closed) { return; } - $this->closed = true; + $this->closed = TRUE; $this->emit('close'); $this->pause(); @@ -119,9 +113,8 @@ final class ReadableResourceStream extends EventEmitter implements ReadableStrea } /** @internal */ - public function handleData() - { - $error = null; + public function handleData() { + $error = NULL; set_error_handler(function ($errno, $errstr, $errfile, $errline) use (&$error) { $error = new \ErrorException( $errstr, @@ -136,7 +129,7 @@ final class ReadableResourceStream extends EventEmitter implements ReadableStrea restore_error_handler(); - if ($error !== null) { + if ($error !== NULL) { $this->emit('error', array(new \RuntimeException('Unable to read from stream: ' . $error->getMessage(), 0, $error))); $this->close(); return; @@ -144,7 +137,7 @@ final class ReadableResourceStream extends EventEmitter implements ReadableStrea if ($data !== '') { $this->emit('data', array($data)); - } else{ + } else { // no data read => we reached the end and close the stream $this->emit('end'); $this->close(); @@ -163,15 +156,14 @@ final class ReadableResourceStream extends EventEmitter implements ReadableStrea * * @codeCoverageIgnore */ - private function isLegacyPipe($resource) - { + private function isLegacyPipe($resource) { if (PHP_VERSION_ID < 50428 || (PHP_VERSION_ID >= 50500 && PHP_VERSION_ID < 50512)) { $meta = stream_get_meta_data($resource); if (isset($meta['stream_type']) && $meta['stream_type'] === 'STDIO') { - return true; + return TRUE; } } - return false; + return FALSE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/ThroughStream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/ThroughStream.php index da2fbb0..3bfd709 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/ThroughStream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/ThroughStream.php @@ -75,85 +75,77 @@ use InvalidArgumentException; */ final class ThroughStream extends EventEmitter implements DuplexStreamInterface { - private $readable = true; - private $writable = true; - private $closed = false; - private $paused = false; - private $drain = false; + private $readable = TRUE; + private $writable = TRUE; + private $closed = FALSE; + private $paused = FALSE; + private $drain = FALSE; private $callback; - public function __construct($callback = null) - { - if ($callback !== null && !is_callable($callback)) { + public function __construct($callback = NULL) { + if ($callback !== NULL && !is_callable($callback)) { throw new InvalidArgumentException('Invalid transformation callback given'); } $this->callback = $callback; } - public function pause() - { - $this->paused = true; + public function pause() { + $this->paused = TRUE; } - public function resume() - { + public function resume() { if ($this->drain) { - $this->drain = false; + $this->drain = FALSE; $this->emit('drain'); } - $this->paused = false; + $this->paused = FALSE; } - public function pipe(WritableStreamInterface $dest, array $options = array()) - { + public function pipe(WritableStreamInterface $dest, array $options = array()) { return Util::pipe($this, $dest, $options); } - public function isReadable() - { + public function isReadable() { return $this->readable; } - public function isWritable() - { + public function isWritable() { return $this->writable; } - public function write($data) - { + public function write($data) { if (!$this->writable) { - return false; + return FALSE; } - if ($this->callback !== null) { + if ($this->callback !== NULL) { try { $data = call_user_func($this->callback, $data); } catch (\Exception $e) { $this->emit('error', array($e)); $this->close(); - return false; + return FALSE; } } $this->emit('data', array($data)); if ($this->paused) { - $this->drain = true; - return false; + $this->drain = TRUE; + return FALSE; } - return true; + return TRUE; } - public function end($data = null) - { + public function end($data = NULL) { if (!$this->writable) { return; } - if (null !== $data) { + if (NULL !== $data) { $this->write($data); // return if write() already caused the stream to close @@ -162,27 +154,26 @@ final class ThroughStream extends EventEmitter implements DuplexStreamInterface } } - $this->readable = false; - $this->writable = false; - $this->paused = true; - $this->drain = false; + $this->readable = FALSE; + $this->writable = FALSE; + $this->paused = TRUE; + $this->drain = FALSE; $this->emit('end'); $this->close(); } - public function close() - { + public function close() { if ($this->closed) { return; } - $this->readable = false; - $this->writable = false; - $this->closed = true; - $this->paused = true; - $this->drain = false; - $this->callback = null; + $this->readable = FALSE; + $this->writable = FALSE; + $this->closed = TRUE; + $this->paused = TRUE; + $this->drain = FALSE; + $this->callback = NULL; $this->emit('close'); $this->removeAllListeners(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/Util.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/Util.php index 14ddcfc..b7294bf 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/Util.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/Util.php @@ -13,8 +13,7 @@ final class Util * @return WritableStreamInterface $dest stream as-is * @see ReadableStreamInterface::pipe() for more details */ - public static function pipe(ReadableStreamInterface $source, WritableStreamInterface $dest, array $options = array()) - { + public static function pipe(ReadableStreamInterface $source, WritableStreamInterface $dest, array $options = array()) { // source not readable => NO-OP if (!$source->isReadable()) { return $dest; @@ -33,7 +32,7 @@ final class Util $source->on('data', $dataer = function ($data) use ($source, $dest) { $feedMore = $dest->write($data); - if (false === $feedMore) { + if (FALSE === $feedMore) { $source->pause(); } }); @@ -51,7 +50,7 @@ final class Util }); // forward end event from source as $dest->end() - $end = isset($options['end']) ? $options['end'] : true; + $end = isset($options['end']) ? $options['end'] : TRUE; if ($end) { $source->on('end', $ender = function () use ($dest) { $dest->end(); @@ -64,8 +63,7 @@ final class Util return $dest; } - public static function forwardEvents($source, $target, array $events) - { + public static function forwardEvents($source, $target, array $events) { foreach ($events as $event) { $source->on($event, function () use ($event, $target) { $target->emit($event, func_get_args()); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/WritableResourceStream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/WritableResourceStream.php index 7e04205..c394382 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/WritableResourceStream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/WritableResourceStream.php @@ -12,13 +12,12 @@ final class WritableResourceStream extends EventEmitter implements WritableStrea private $softLimit; private $writeChunkSize; - private $listening = false; - private $writable = true; - private $closed = false; + private $listening = FALSE; + private $writable = TRUE; + private $closed = FALSE; private $data = ''; - public function __construct($stream, LoopInterface $loop, $writeBufferSoftLimit = null, $writeChunkSize = null) - { + public function __construct($stream, LoopInterface $loop, $writeBufferSoftLimit = NULL, $writeChunkSize = NULL) { if (!is_resource($stream) || get_resource_type($stream) !== "stream") { throw new \InvalidArgumentException('First parameter must be a valid stream resource'); } @@ -31,31 +30,29 @@ final class WritableResourceStream extends EventEmitter implements WritableStrea // this class relies on non-blocking I/O in order to not interrupt the event loop // e.g. pipes on Windows do not support this: https://bugs.php.net/bug.php?id=47918 - if (stream_set_blocking($stream, 0) !== true) { + if (stream_set_blocking($stream, 0) !== TRUE) { throw new \RuntimeException('Unable to set stream resource to non-blocking mode'); } $this->stream = $stream; $this->loop = $loop; - $this->softLimit = ($writeBufferSoftLimit === null) ? 65536 : (int)$writeBufferSoftLimit; - $this->writeChunkSize = ($writeChunkSize === null) ? -1 : (int)$writeChunkSize; + $this->softLimit = ($writeBufferSoftLimit === NULL) ? 65536 : (int)$writeBufferSoftLimit; + $this->writeChunkSize = ($writeChunkSize === NULL) ? -1 : (int)$writeChunkSize; } - public function isWritable() - { + public function isWritable() { return $this->writable; } - public function write($data) - { + public function write($data) { if (!$this->writable) { - return false; + return FALSE; } $this->data .= $data; if (!$this->listening && $this->data !== '') { - $this->listening = true; + $this->listening = TRUE; $this->loop->addWriteStream($this->stream, array($this, 'handleWrite')); } @@ -63,13 +60,12 @@ final class WritableResourceStream extends EventEmitter implements WritableStrea return !isset($this->data[$this->softLimit - 1]); } - public function end($data = null) - { - if (null !== $data) { + public function end($data = NULL) { + if (NULL !== $data) { $this->write($data); } - $this->writable = false; + $this->writable = FALSE; // close immediately if buffer is already empty // otherwise wait for buffer to flush first @@ -78,19 +74,18 @@ final class WritableResourceStream extends EventEmitter implements WritableStrea } } - public function close() - { + public function close() { if ($this->closed) { return; } if ($this->listening) { - $this->listening = false; + $this->listening = FALSE; $this->loop->removeWriteStream($this->stream); } - $this->closed = true; - $this->writable = false; + $this->closed = TRUE; + $this->writable = FALSE; $this->data = ''; $this->emit('close'); @@ -102,9 +97,8 @@ final class WritableResourceStream extends EventEmitter implements WritableStrea } /** @internal */ - public function handleWrite() - { - $error = null; + public function handleWrite() { + $error = NULL; set_error_handler(function ($errno, $errstr, $errfile, $errline) use (&$error) { $error = array( 'message' => $errstr, @@ -129,8 +123,8 @@ final class WritableResourceStream extends EventEmitter implements WritableStrea // to keep the stream open for further tries to write. // Should this turn out to be a permanent error later, it will eventually // send *nothing* and we can detect this. - if ($sent === 0 || $sent === false) { - if ($error !== null) { + if ($sent === 0 || $sent === FALSE) { + if ($error !== NULL) { $error = new \ErrorException( $error['message'], 0, @@ -140,14 +134,14 @@ final class WritableResourceStream extends EventEmitter implements WritableStrea ); } - $this->emit('error', array(new \RuntimeException('Unable to write to stream: ' . ($error !== null ? $error->getMessage() : 'Unknown error'), 0, $error))); + $this->emit('error', array(new \RuntimeException('Unable to write to stream: ' . ($error !== NULL ? $error->getMessage() : 'Unknown error'), 0, $error))); $this->close(); return; } $exceeded = isset($this->data[$this->softLimit - 1]); - $this->data = (string) substr($this->data, $sent); + $this->data = (string)substr($this->data, $sent); // buffer has been above limit and is now below limit if ($exceeded && !isset($this->data[$this->softLimit - 1])) { @@ -159,7 +153,7 @@ final class WritableResourceStream extends EventEmitter implements WritableStrea // stop waiting for resource to be writable if ($this->listening) { $this->loop->removeWriteStream($this->stream); - $this->listening = false; + $this->listening = FALSE; } // buffer is end()ing and now completely empty => close buffer diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/WritableStreamInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/WritableStreamInterface.php index 3bc932e..316a221 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/WritableStreamInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/src/WritableStreamInterface.php @@ -292,7 +292,7 @@ interface WritableStreamInterface extends EventEmitterInterface * @param mixed|string|null $data * @return void */ - public function end($data = null); + public function end($data = NULL); /** * Closes the stream (forcefully). diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/CallableStub.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/CallableStub.php index 31cc834..6e03e74 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/CallableStub.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/CallableStub.php @@ -4,7 +4,6 @@ namespace React\Tests\Stream; class CallableStub { - public function __invoke() - { + public function __invoke() { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/CompositeStreamTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/CompositeStreamTest.php index df89c3e..c68a4aa 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/CompositeStreamTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/CompositeStreamTest.php @@ -11,13 +11,12 @@ use React\Stream\ThroughStream; class CompositeStreamTest extends TestCase { /** @test */ - public function itShouldCloseReadableIfNotWritable() - { + public function itShouldCloseReadableIfNotWritable() { $readable = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock(); $readable ->expects($this->once()) ->method('isReadable') - ->willReturn(true); + ->willReturn(TRUE); $readable ->expects($this->once()) ->method('close'); @@ -26,7 +25,7 @@ class CompositeStreamTest extends TestCase $writable ->expects($this->once()) ->method('isWritable') - ->willReturn(false); + ->willReturn(FALSE); $composite = new CompositeStream($readable, $writable); @@ -35,13 +34,12 @@ class CompositeStreamTest extends TestCase } /** @test */ - public function itShouldCloseWritableIfNotReadable() - { + public function itShouldCloseWritableIfNotReadable() { $readable = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock(); $readable ->expects($this->once()) ->method('isReadable') - ->willReturn(false); + ->willReturn(FALSE); $writable = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock(); $writable @@ -55,13 +53,12 @@ class CompositeStreamTest extends TestCase } /** @test */ - public function itShouldForwardWritableCallsToWritableStream() - { + public function itShouldForwardWritableCallsToWritableStream() { $readable = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock(); $readable ->expects($this->once()) ->method('isReadable') - ->willReturn(true); + ->willReturn(TRUE); $writable = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock(); $writable @@ -71,7 +68,7 @@ class CompositeStreamTest extends TestCase $writable ->expects($this->exactly(2)) ->method('isWritable') - ->willReturn(true); + ->willReturn(TRUE); $composite = new CompositeStream($readable, $writable); $composite->write('foo'); @@ -79,13 +76,12 @@ class CompositeStreamTest extends TestCase } /** @test */ - public function itShouldForwardReadableCallsToReadableStream() - { + public function itShouldForwardReadableCallsToReadableStream() { $readable = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock(); $readable ->expects($this->exactly(2)) ->method('isReadable') - ->willReturn(true); + ->willReturn(TRUE); $readable ->expects($this->once()) ->method('pause'); @@ -97,7 +93,7 @@ class CompositeStreamTest extends TestCase $writable ->expects($this->any()) ->method('isWritable') - ->willReturn(true); + ->willReturn(TRUE); $composite = new CompositeStream($readable, $writable); $composite->isReadable(); @@ -106,13 +102,12 @@ class CompositeStreamTest extends TestCase } /** @test */ - public function itShouldNotForwardResumeIfStreamIsNotWritable() - { + public function itShouldNotForwardResumeIfStreamIsNotWritable() { $readable = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock(); $readable ->expects($this->once()) ->method('isReadable') - ->willReturn(true); + ->willReturn(TRUE); $readable ->expects($this->never()) ->method('resume'); @@ -121,26 +116,25 @@ class CompositeStreamTest extends TestCase $writable ->expects($this->exactly(2)) ->method('isWritable') - ->willReturnOnConsecutiveCalls(true, false); + ->willReturnOnConsecutiveCalls(TRUE, FALSE); $composite = new CompositeStream($readable, $writable); $composite->resume(); } /** @test */ - public function endShouldDelegateToWritableWithData() - { + public function endShouldDelegateToWritableWithData() { $readable = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock(); $readable ->expects($this->once()) ->method('isReadable') - ->willReturn(true); + ->willReturn(TRUE); $writable = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock(); $writable ->expects($this->once()) ->method('isWritable') - ->willReturn(true); + ->willReturn(TRUE); $writable ->expects($this->once()) ->method('end') @@ -151,13 +145,12 @@ class CompositeStreamTest extends TestCase } /** @test */ - public function closeShouldCloseBothStreams() - { + public function closeShouldCloseBothStreams() { $readable = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock(); $readable ->expects($this->once()) ->method('isReadable') - ->willReturn(true); + ->willReturn(TRUE); $readable ->expects($this->once()) ->method('close'); @@ -166,7 +159,7 @@ class CompositeStreamTest extends TestCase $writable ->expects($this->once()) ->method('isWritable') - ->willReturn(true); + ->willReturn(TRUE); $writable ->expects($this->once()) ->method('close'); @@ -176,8 +169,7 @@ class CompositeStreamTest extends TestCase } /** @test */ - public function itShouldForwardCloseOnlyOnce() - { + public function itShouldForwardCloseOnlyOnce() { $readable = new ThroughStream(); $writable = new ThroughStream(); @@ -189,8 +181,7 @@ class CompositeStreamTest extends TestCase } /** @test */ - public function itShouldForwardCloseAndRemoveAllListeners() - { + public function itShouldForwardCloseAndRemoveAllListeners() { $in = new ThroughStream(); $composite = new CompositeStream($in, $in); @@ -208,8 +199,7 @@ class CompositeStreamTest extends TestCase } /** @test */ - public function itShouldReceiveForwardedEvents() - { + public function itShouldReceiveForwardedEvents() { $readable = new ThroughStream(); $writable = new ThroughStream(); @@ -222,16 +212,15 @@ class CompositeStreamTest extends TestCase } /** @test */ - public function itShouldHandlePipingCorrectly() - { + public function itShouldHandlePipingCorrectly() { $readable = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock(); $readable ->expects($this->once()) ->method('isReadable') - ->willReturn(true); + ->willReturn(TRUE); $writable = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock(); - $writable->expects($this->any())->method('isWritable')->willReturn(True); + $writable->expects($this->any())->method('isWritable')->willReturn(TRUE); $writable ->expects($this->once()) ->method('write') @@ -245,17 +234,16 @@ class CompositeStreamTest extends TestCase } /** @test */ - public function itShouldForwardPipeCallsToReadableStream() - { + public function itShouldForwardPipeCallsToReadableStream() { $readable = new ThroughStream(); $writable = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock(); - $writable->expects($this->any())->method('isWritable')->willReturn(True); + $writable->expects($this->any())->method('isWritable')->willReturn(TRUE); $composite = new CompositeStream($readable, $writable); $output = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock(); - $output->expects($this->any())->method('isWritable')->willReturn(True); + $output->expects($this->any())->method('isWritable')->willReturn(TRUE); $output ->expects($this->once()) ->method('write') diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/DuplexResourceStreamIntegrationTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/DuplexResourceStreamIntegrationTest.php index fb5f02a..506c3d6 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/DuplexResourceStreamIntegrationTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/DuplexResourceStreamIntegrationTest.php @@ -14,12 +14,11 @@ use React\EventLoop\StreamSelectLoop; class DuplexResourceStreamIntegrationTest extends TestCase { - public function loopProvider() - { + public function loopProvider() { return array( array( - function() { - return true; + function () { + return TRUE; }, function () { return new StreamSelectLoop(); @@ -55,9 +54,8 @@ class DuplexResourceStreamIntegrationTest extends TestCase /** * @dataProvider loopProvider */ - public function testBufferReadsLargeChunks($condition, $loopFactory) - { - if (true !== $condition()) { + public function testBufferReadsLargeChunks($condition, $loopFactory) { + if (TRUE !== $condition()) { return $this->markTestSkipped('Loop implementation not available'); } @@ -91,9 +89,8 @@ class DuplexResourceStreamIntegrationTest extends TestCase /** * @dataProvider loopProvider */ - public function testWriteLargeChunk($condition, $loopFactory) - { - if (true !== $condition()) { + public function testWriteLargeChunk($condition, $loopFactory) { + if (TRUE !== $condition()) { return $this->markTestSkipped('Loop implementation not available'); } @@ -131,9 +128,8 @@ class DuplexResourceStreamIntegrationTest extends TestCase /** * @dataProvider loopProvider */ - public function testDoesNotEmitDataIfNothingHasBeenWritten($condition, $loopFactory) - { - if (true !== $condition()) { + public function testDoesNotEmitDataIfNothingHasBeenWritten($condition, $loopFactory) { + if (TRUE !== $condition()) { return $this->markTestSkipped('Loop implementation not available'); } @@ -159,9 +155,8 @@ class DuplexResourceStreamIntegrationTest extends TestCase /** * @dataProvider loopProvider */ - public function testDoesNotWriteDataIfRemoteSideFromPairHasBeenClosed($condition, $loopFactory) - { - if (true !== $condition()) { + public function testDoesNotWriteDataIfRemoteSideFromPairHasBeenClosed($condition, $loopFactory) { + if (TRUE !== $condition()) { return $this->markTestSkipped('Loop implementation not available'); } @@ -189,9 +184,8 @@ class DuplexResourceStreamIntegrationTest extends TestCase /** * @dataProvider loopProvider */ - public function testDoesNotWriteDataIfServerSideHasBeenClosed($condition, $loopFactory) - { - if (true !== $condition()) { + public function testDoesNotWriteDataIfServerSideHasBeenClosed($condition, $loopFactory) { + if (TRUE !== $condition()) { return $this->markTestSkipped('Loop implementation not available'); } @@ -199,7 +193,7 @@ class DuplexResourceStreamIntegrationTest extends TestCase $server = stream_socket_server('tcp://127.0.0.1:0'); - $client = stream_socket_client(stream_socket_get_name($server, false)); + $client = stream_socket_client(stream_socket_get_name($server, FALSE)); $peer = stream_socket_accept($server); $streamA = new DuplexResourceStream($client, $loop); @@ -222,9 +216,8 @@ class DuplexResourceStreamIntegrationTest extends TestCase /** * @dataProvider loopProvider */ - public function testDoesNotWriteDataIfClientSideHasBeenClosed($condition, $loopFactory) - { - if (true !== $condition()) { + public function testDoesNotWriteDataIfClientSideHasBeenClosed($condition, $loopFactory) { + if (TRUE !== $condition()) { return $this->markTestSkipped('Loop implementation not available'); } @@ -232,7 +225,7 @@ class DuplexResourceStreamIntegrationTest extends TestCase $server = stream_socket_server('tcp://127.0.0.1:0'); - $client = stream_socket_client(stream_socket_get_name($server, false)); + $client = stream_socket_client(stream_socket_get_name($server, FALSE)); $peer = stream_socket_accept($server); $streamA = new DuplexResourceStream($peer, $loop); @@ -255,9 +248,8 @@ class DuplexResourceStreamIntegrationTest extends TestCase /** * @dataProvider loopProvider */ - public function testReadsSingleChunkFromProcessPipe($condition, $loopFactory) - { - if (true !== $condition()) { + public function testReadsSingleChunkFromProcessPipe($condition, $loopFactory) { + if (TRUE !== $condition()) { return $this->markTestSkipped('Loop implementation not available'); } @@ -274,9 +266,8 @@ class DuplexResourceStreamIntegrationTest extends TestCase /** * @dataProvider loopProvider */ - public function testReadsMultipleChunksFromProcessPipe($condition, $loopFactory) - { - if (true !== $condition()) { + public function testReadsMultipleChunksFromProcessPipe($condition, $loopFactory) { + if (TRUE !== $condition()) { return $this->markTestSkipped('Loop implementation not available'); } @@ -300,9 +291,8 @@ class DuplexResourceStreamIntegrationTest extends TestCase /** * @dataProvider loopProvider */ - public function testReadsLongChunksFromProcessPipe($condition, $loopFactory) - { - if (true !== $condition()) { + public function testReadsLongChunksFromProcessPipe($condition, $loopFactory) { + if (TRUE !== $condition()) { return $this->markTestSkipped('Loop implementation not available'); } @@ -326,9 +316,8 @@ class DuplexResourceStreamIntegrationTest extends TestCase /** * @dataProvider loopProvider */ - public function testReadsNothingFromProcessPipeWithNoOutput($condition, $loopFactory) - { - if (true !== $condition()) { + public function testReadsNothingFromProcessPipeWithNoOutput($condition, $loopFactory) { + if (TRUE !== $condition()) { return $this->markTestSkipped('Loop implementation not available'); } @@ -342,8 +331,7 @@ class DuplexResourceStreamIntegrationTest extends TestCase $loop->run(); } - private function loopTick(LoopInterface $loop) - { + private function loopTick(LoopInterface $loop) { $loop->addTimer(0, function () use ($loop) { $loop->stop(); }); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/DuplexResourceStreamTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/DuplexResourceStreamTest.php index 3212ae8..537140c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/DuplexResourceStreamTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/DuplexResourceStreamTest.php @@ -12,8 +12,7 @@ class DuplexResourceStreamTest extends TestCase * @covers React\Stream\DuplexResourceStream::__construct * @doesNotPerformAssertions */ - public function testConstructor() - { + public function testConstructor() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -24,8 +23,7 @@ class DuplexResourceStreamTest extends TestCase * @covers React\Stream\DuplexResourceStream::__construct * @doesNotPerformAssertions */ - public function testConstructorWithExcessiveMode() - { + public function testConstructorWithExcessiveMode() { // excessive flags are ignored for temp streams, so we have to use a file stream $name = tempnam(sys_get_temp_dir(), 'test'); $stream = @fopen($name, 'r+eANYTHING'); @@ -40,8 +38,7 @@ class DuplexResourceStreamTest extends TestCase * @covers React\Stream\DuplexResourceStream::__construct * @expectedException InvalidArgumentException */ - public function testConstructorThrowsExceptionOnInvalidStream() - { + public function testConstructorThrowsExceptionOnInvalidStream() { $loop = $this->createLoopMock(); new DuplexResourceStream('breakme', $loop); @@ -51,8 +48,7 @@ class DuplexResourceStreamTest extends TestCase * @covers React\Stream\DuplexResourceStream::__construct * @expectedException InvalidArgumentException */ - public function testConstructorThrowsExceptionOnWriteOnlyStream() - { + public function testConstructorThrowsExceptionOnWriteOnlyStream() { if (defined('HHVM_VERSION')) { $this->markTestSkipped('HHVM does not report fopen mode for STDOUT'); } @@ -66,8 +62,7 @@ class DuplexResourceStreamTest extends TestCase * @covers React\Stream\DuplexResourceStream::__construct * @expectedException InvalidArgumentException */ - public function testConstructorThrowsExceptionOnWriteOnlyStreamWithExcessiveMode() - { + public function testConstructorThrowsExceptionOnWriteOnlyStreamWithExcessiveMode() { // excessive flags are ignored for temp streams, so we have to use a file stream $name = tempnam(sys_get_temp_dir(), 'test'); $stream = fopen($name, 'weANYTHING'); @@ -81,8 +76,7 @@ class DuplexResourceStreamTest extends TestCase * @covers React\Stream\DuplexResourceStream::__construct * @expectedException RunTimeException */ - public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking() - { + public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking() { if (!in_array('blocking', stream_get_wrappers())) { stream_wrapper_register('blocking', 'React\Tests\Stream\EnforceBlockingWrapper'); } @@ -97,18 +91,16 @@ class DuplexResourceStreamTest extends TestCase * @covers React\Stream\DuplexResourceStream::__construct * @doesNotPerformAssertions */ - public function testConstructorAcceptsBuffer() - { + public function testConstructorAcceptsBuffer() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $buffer = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock(); - $conn = new DuplexResourceStream($stream, $loop, null, $buffer); + $conn = new DuplexResourceStream($stream, $loop, NULL, $buffer); } - public function testCloseShouldEmitCloseEvent() - { + public function testCloseShouldEmitCloseEvent() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -121,21 +113,19 @@ class DuplexResourceStreamTest extends TestCase $this->assertFalse($conn->isReadable()); } - public function testEndShouldEndBuffer() - { + public function testEndShouldEndBuffer() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $buffer = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock(); $buffer->expects($this->once())->method('end')->with('foo'); - $conn = new DuplexResourceStream($stream, $loop, null, $buffer); + $conn = new DuplexResourceStream($stream, $loop, NULL, $buffer); $conn->end('foo'); } - public function testEndAfterCloseIsNoOp() - { + public function testEndAfterCloseIsNoOp() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -151,12 +141,11 @@ class DuplexResourceStreamTest extends TestCase * @covers React\Stream\DuplexResourceStream::__construct * @covers React\Stream\DuplexResourceStream::handleData */ - public function testDataEvent() - { + public function testDataEvent() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); - $capturedData = null; + $capturedData = NULL; $conn = new DuplexResourceStream($stream, $loop); $conn->on('data', function ($data) use (&$capturedData) { @@ -174,12 +163,11 @@ class DuplexResourceStreamTest extends TestCase * @covers React\Stream\DuplexResourceStream::__construct * @covers React\Stream\DuplexResourceStream::handleData */ - public function testDataEventDoesEmitOneChunkMatchingBufferSize() - { + public function testDataEventDoesEmitOneChunkMatchingBufferSize() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); - $capturedData = null; + $capturedData = NULL; $conn = new DuplexResourceStream($stream, $loop, 4321); $conn->on('data', function ($data) use (&$capturedData) { @@ -199,12 +187,11 @@ class DuplexResourceStreamTest extends TestCase * @covers React\Stream\DuplexResourceStream::__construct * @covers React\Stream\DuplexResourceStream::handleData */ - public function testDataEventDoesEmitOneChunkUntilStreamEndsWhenBufferSizeIsInfinite() - { + public function testDataEventDoesEmitOneChunkUntilStreamEndsWhenBufferSizeIsInfinite() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); - $capturedData = null; + $capturedData = NULL; $conn = new DuplexResourceStream($stream, $loop, -1); @@ -224,8 +211,7 @@ class DuplexResourceStreamTest extends TestCase /** * @covers React\Stream\DuplexResourceStream::handleData */ - public function testEmptyStreamShouldNotEmitData() - { + public function testEmptyStreamShouldNotEmitData() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -238,8 +224,7 @@ class DuplexResourceStreamTest extends TestCase /** * @covers React\Stream\DuplexResourceStream::write */ - public function testWrite() - { + public function testWrite() { $stream = fopen('php://temp', 'r+'); $loop = $this->createWriteableLoopMock(); @@ -255,8 +240,7 @@ class DuplexResourceStreamTest extends TestCase * @covers React\Stream\DuplexResourceStream::isReadable * @covers React\Stream\DuplexResourceStream::isWritable */ - public function testEnd() - { + public function testEnd() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -271,8 +255,7 @@ class DuplexResourceStreamTest extends TestCase /** * @covers React\Stream\DuplexResourceStream::end */ - public function testEndRemovesReadStreamFromLoop() - { + public function testEndRemovesReadStreamFromLoop() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $loop->expects($this->once())->method('addReadStream')->with($stream); @@ -285,8 +268,7 @@ class DuplexResourceStreamTest extends TestCase /** * @covers React\Stream\DuplexResourceStream::pause */ - public function testPauseRemovesReadStreamFromLoop() - { + public function testPauseRemovesReadStreamFromLoop() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $loop->expects($this->once())->method('addReadStream')->with($stream); @@ -300,8 +282,7 @@ class DuplexResourceStreamTest extends TestCase /** * @covers React\Stream\DuplexResourceStream::pause */ - public function testResumeDoesAddStreamToLoopOnlyOnce() - { + public function testResumeDoesAddStreamToLoopOnlyOnce() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $loop->expects($this->once())->method('addReadStream')->with($stream); @@ -314,8 +295,7 @@ class DuplexResourceStreamTest extends TestCase /** * @covers React\Stream\DuplexResourceStream::close */ - public function testCloseRemovesReadStreamFromLoop() - { + public function testCloseRemovesReadStreamFromLoop() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $loop->expects($this->once())->method('addReadStream')->with($stream); @@ -328,8 +308,7 @@ class DuplexResourceStreamTest extends TestCase /** * @covers React\Stream\DuplexResourceStream::close */ - public function testCloseAfterPauseRemovesReadStreamFromLoopOnlyOnce() - { + public function testCloseAfterPauseRemovesReadStreamFromLoopOnlyOnce() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $loop->expects($this->once())->method('addReadStream')->with($stream); @@ -343,8 +322,7 @@ class DuplexResourceStreamTest extends TestCase /** * @covers React\Stream\DuplexResourceStream::close */ - public function testResumeAfterCloseDoesAddReadStreamToLoopOnlyOnce() - { + public function testResumeAfterCloseDoesAddReadStreamToLoopOnlyOnce() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $loop->expects($this->once())->method('addReadStream')->with($stream); @@ -354,8 +332,7 @@ class DuplexResourceStreamTest extends TestCase $conn->resume(); } - public function testEndedStreamsShouldNotWrite() - { + public function testEndedStreamsShouldNotWrite() { $file = tempnam(sys_get_temp_dir(), 'reactphptest_'); $stream = fopen($file, 'r+'); $loop = $this->createWriteableLoopMock(); @@ -373,8 +350,7 @@ class DuplexResourceStreamTest extends TestCase unlink($file); } - public function testPipeShouldReturnDestination() - { + public function testPipeShouldReturnDestination() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -384,13 +360,12 @@ class DuplexResourceStreamTest extends TestCase $this->assertSame($dest, $conn->pipe($dest)); } - public function testBufferEventsShouldBubbleUp() - { + public function testBufferEventsShouldBubbleUp() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $buffer = new WritableResourceStream($stream, $loop); - $conn = new DuplexResourceStream($stream, $loop, null, $buffer); + $conn = new DuplexResourceStream($stream, $loop, NULL, $buffer); $conn->on('drain', $this->expectCallableOnce()); $conn->on('error', $this->expectCallableOnce()); @@ -402,8 +377,7 @@ class DuplexResourceStreamTest extends TestCase /** * @covers React\Stream\DuplexResourceStream::handleData */ - public function testClosingStreamInDataEventShouldNotTriggerError() - { + public function testClosingStreamInDataEventShouldNotTriggerError() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -422,8 +396,7 @@ class DuplexResourceStreamTest extends TestCase /** * @covers React\Stream\DuplexResourceStream::handleData */ - public function testDataFiltered() - { + public function testDataFiltered() { $stream = fopen('php://temp', 'r+'); // add a filter which removes every 'a' when reading @@ -433,7 +406,7 @@ class DuplexResourceStreamTest extends TestCase $loop = $this->createLoopMock(); - $capturedData = null; + $capturedData = NULL; $conn = new DuplexResourceStream($stream, $loop); $conn->on('data', function ($data) use (&$capturedData) { @@ -450,13 +423,12 @@ class DuplexResourceStreamTest extends TestCase /** * @covers React\Stream\DuplexResourceStream::handleData */ - public function testDataErrorShouldEmitErrorAndClose() - { + public function testDataErrorShouldEmitErrorAndClose() { $stream = fopen('php://temp', 'r+'); // add a filter which returns an error when encountering an 'a' when reading Filter\append($stream, function ($chunk) { - if (strpos($chunk, 'a') !== false) { + if (strpos($chunk, 'a') !== FALSE) { throw new \Exception('Invalid'); } return $chunk; @@ -475,8 +447,7 @@ class DuplexResourceStreamTest extends TestCase $conn->handleData($stream); } - private function createWriteableLoopMock() - { + private function createWriteableLoopMock() { $loop = $this->createLoopMock(); $loop ->expects($this->once()) @@ -488,8 +459,7 @@ class DuplexResourceStreamTest extends TestCase return $loop; } - private function createLoopMock() - { + private function createLoopMock() { return $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/EnforceBlockingWrapper.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/EnforceBlockingWrapper.php index 39c0487..b2f4a82 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/EnforceBlockingWrapper.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/EnforceBlockingWrapper.php @@ -9,27 +9,23 @@ namespace React\Tests\Stream; */ class EnforceBlockingWrapper { - public function stream_open($path, $mode, $options, &$opened_path) - { - return true; + public function stream_open($path, $mode, $options, &$opened_path) { + return TRUE; } - public function stream_cast($cast_as) - { - return false; + public function stream_cast($cast_as) { + return FALSE; } - public function stream_eof() - { - return false; + public function stream_eof() { + return FALSE; } - public function stream_set_option($option, $arg1, $arg2) - { + public function stream_set_option($option, $arg1, $arg2) { if ($option === STREAM_OPTION_BLOCKING) { - return false; + return FALSE; } - return true; + return TRUE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/FunctionalInternetTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/FunctionalInternetTest.php index 4d31e8e..12a8f30 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/FunctionalInternetTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/FunctionalInternetTest.php @@ -12,8 +12,7 @@ use React\Stream\WritableResourceStream; */ class FunctionalInternetTest extends TestCase { - public function testUploadKilobytePlain() - { + public function testUploadKilobytePlain() { $size = 1000; $stream = stream_socket_client('tcp://httpbin.org:80'); @@ -34,8 +33,7 @@ class FunctionalInternetTest extends TestCase $this->assertNotEquals('', $buffer); } - public function testUploadBiggerBlockPlain() - { + public function testUploadBiggerBlockPlain() { $size = 50 * 1000; $stream = stream_socket_client('tcp://httpbin.org:80'); @@ -56,8 +54,7 @@ class FunctionalInternetTest extends TestCase $this->assertNotEquals('', $buffer); } - public function testUploadKilobyteSecure() - { + public function testUploadKilobyteSecure() { $size = 1000; $stream = stream_socket_client('tls://httpbin.org:443'); @@ -78,8 +75,7 @@ class FunctionalInternetTest extends TestCase $this->assertNotEquals('', $buffer); } - public function testUploadBiggerBlockSecureRequiresSmallerChunkSize() - { + public function testUploadBiggerBlockSecureRequiresSmallerChunkSize() { $size = 50 * 1000; $stream = stream_socket_client('tls://httpbin.org:443'); @@ -87,8 +83,8 @@ class FunctionalInternetTest extends TestCase $stream = new DuplexResourceStream( $stream, $loop, - null, - new WritableResourceStream($stream, $loop, null, 8192) + NULL, + new WritableResourceStream($stream, $loop, NULL, 8192) ); $buffer = ''; @@ -105,8 +101,7 @@ class FunctionalInternetTest extends TestCase $this->assertNotEquals('', $buffer); } - private function awaitStreamClose(DuplexResourceStream $stream, LoopInterface $loop, $timeout = 10.0) - { + private function awaitStreamClose(DuplexResourceStream $stream, LoopInterface $loop, $timeout = 10.0) { $stream->on('close', function () use ($loop) { $loop->stop(); }); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/ReadableResourceStreamTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/ReadableResourceStreamTest.php index 20da96f..715d987 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/ReadableResourceStreamTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/ReadableResourceStreamTest.php @@ -11,8 +11,7 @@ class ReadableResourceStreamTest extends TestCase * @covers React\Stream\ReadableResourceStream::__construct * @doesNotPerformAssertions */ - public function testConstructor() - { + public function testConstructor() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -23,8 +22,7 @@ class ReadableResourceStreamTest extends TestCase * @covers React\Stream\ReadableResourceStream::__construct * @doesNotPerformAssertions */ - public function testConstructorWithExcessiveMode() - { + public function testConstructorWithExcessiveMode() { // excessive flags are ignored for temp streams, so we have to use a file stream $name = tempnam(sys_get_temp_dir(), 'test'); $stream = @fopen($name, 'r+eANYTHING'); @@ -39,19 +37,17 @@ class ReadableResourceStreamTest extends TestCase * @covers React\Stream\ReadableResourceStream::__construct * @expectedException InvalidArgumentException */ - public function testConstructorThrowsExceptionOnInvalidStream() - { + public function testConstructorThrowsExceptionOnInvalidStream() { $loop = $this->createLoopMock(); - new ReadableResourceStream(false, $loop); + new ReadableResourceStream(FALSE, $loop); } /** * @covers React\Stream\ReadableResourceStream::__construct * @expectedException InvalidArgumentException */ - public function testConstructorThrowsExceptionOnWriteOnlyStream() - { + public function testConstructorThrowsExceptionOnWriteOnlyStream() { if (defined('HHVM_VERSION')) { $this->markTestSkipped('HHVM does not report fopen mode for STDOUT'); } @@ -65,8 +61,7 @@ class ReadableResourceStreamTest extends TestCase * @covers React\Stream\ReadableResourceStream::__construct * @expectedException InvalidArgumentException */ - public function testConstructorThrowsExceptionOnWriteOnlyStreamWithExcessiveMode() - { + public function testConstructorThrowsExceptionOnWriteOnlyStreamWithExcessiveMode() { // excessive flags are ignored for temp streams, so we have to use a file stream $name = tempnam(sys_get_temp_dir(), 'test'); $stream = fopen($name, 'weANYTHING'); @@ -80,8 +75,7 @@ class ReadableResourceStreamTest extends TestCase * @covers React\Stream\ReadableResourceStream::__construct * @expectedException RuntimeException */ - public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking() - { + public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking() { if (!in_array('blocking', stream_get_wrappers())) { stream_wrapper_register('blocking', 'React\Tests\Stream\EnforceBlockingWrapper'); } @@ -93,8 +87,7 @@ class ReadableResourceStreamTest extends TestCase } - public function testCloseShouldEmitCloseEvent() - { + public function testCloseShouldEmitCloseEvent() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -106,8 +99,7 @@ class ReadableResourceStreamTest extends TestCase $this->assertFalse($conn->isReadable()); } - public function testCloseTwiceShouldEmitCloseEventOnce() - { + public function testCloseTwiceShouldEmitCloseEventOnce() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -122,12 +114,11 @@ class ReadableResourceStreamTest extends TestCase * @covers React\Stream\ReadableResourceStream::__construct * @covers React\Stream\ReadableResourceStream::handleData */ - public function testDataEvent() - { + public function testDataEvent() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); - $capturedData = null; + $capturedData = NULL; $conn = new ReadableResourceStream($stream, $loop); $conn->on('data', function ($data) use (&$capturedData) { @@ -145,12 +136,11 @@ class ReadableResourceStreamTest extends TestCase * @covers React\Stream\ReadableResourceStream::__construct * @covers React\Stream\ReadableResourceStream::handleData */ - public function testDataEventDoesEmitOneChunkMatchingBufferSize() - { + public function testDataEventDoesEmitOneChunkMatchingBufferSize() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); - $capturedData = null; + $capturedData = NULL; $conn = new ReadableResourceStream($stream, $loop, 4321); $conn->on('data', function ($data) use (&$capturedData) { @@ -170,12 +160,11 @@ class ReadableResourceStreamTest extends TestCase * @covers React\Stream\ReadableResourceStream::__construct * @covers React\Stream\ReadableResourceStream::handleData */ - public function testDataEventDoesEmitOneChunkUntilStreamEndsWhenBufferSizeIsInfinite() - { + public function testDataEventDoesEmitOneChunkUntilStreamEndsWhenBufferSizeIsInfinite() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); - $capturedData = null; + $capturedData = NULL; $conn = new ReadableResourceStream($stream, $loop, -1); @@ -195,8 +184,7 @@ class ReadableResourceStreamTest extends TestCase /** * @covers React\Stream\ReadableResourceStream::handleData */ - public function testEmptyStreamShouldNotEmitData() - { + public function testEmptyStreamShouldNotEmitData() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -206,8 +194,7 @@ class ReadableResourceStreamTest extends TestCase $conn->handleData($stream); } - public function testPipeShouldReturnDestination() - { + public function testPipeShouldReturnDestination() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -220,8 +207,7 @@ class ReadableResourceStreamTest extends TestCase /** * @covers React\Stream\ReadableResourceStream::handleData */ - public function testClosingStreamInDataEventShouldNotTriggerError() - { + public function testClosingStreamInDataEventShouldNotTriggerError() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -240,8 +226,7 @@ class ReadableResourceStreamTest extends TestCase /** * @covers React\Stream\ReadableResourceStream::pause */ - public function testPauseRemovesReadStreamFromLoop() - { + public function testPauseRemovesReadStreamFromLoop() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $loop->expects($this->once())->method('addReadStream')->with($stream); @@ -255,8 +240,7 @@ class ReadableResourceStreamTest extends TestCase /** * @covers React\Stream\ReadableResourceStream::pause */ - public function testResumeDoesAddStreamToLoopOnlyOnce() - { + public function testResumeDoesAddStreamToLoopOnlyOnce() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $loop->expects($this->once())->method('addReadStream')->with($stream); @@ -269,8 +253,7 @@ class ReadableResourceStreamTest extends TestCase /** * @covers React\Stream\ReadableResourceStream::close */ - public function testCloseRemovesReadStreamFromLoop() - { + public function testCloseRemovesReadStreamFromLoop() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $loop->expects($this->once())->method('addReadStream')->with($stream); @@ -283,8 +266,7 @@ class ReadableResourceStreamTest extends TestCase /** * @covers React\Stream\ReadableResourceStream::close */ - public function testCloseAfterPauseRemovesReadStreamFromLoopOnce() - { + public function testCloseAfterPauseRemovesReadStreamFromLoopOnce() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $loop->expects($this->once())->method('addReadStream')->with($stream); @@ -298,8 +280,7 @@ class ReadableResourceStreamTest extends TestCase /** * @covers React\Stream\ReadableResourceStream::close */ - public function testResumeAfterCloseDoesAddReadStreamToLoopOnlyOnce() - { + public function testResumeAfterCloseDoesAddReadStreamToLoopOnlyOnce() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $loop->expects($this->once())->method('addReadStream')->with($stream); @@ -312,8 +293,7 @@ class ReadableResourceStreamTest extends TestCase /** * @covers React\Stream\ReadableResourceStream::handleData */ - public function testDataFiltered() - { + public function testDataFiltered() { $stream = fopen('php://temp', 'r+'); // add a filter which removes every 'a' when reading @@ -323,7 +303,7 @@ class ReadableResourceStreamTest extends TestCase $loop = $this->createLoopMock(); - $capturedData = null; + $capturedData = NULL; $conn = new ReadableResourceStream($stream, $loop); $conn->on('data', function ($data) use (&$capturedData) { @@ -340,13 +320,12 @@ class ReadableResourceStreamTest extends TestCase /** * @covers React\Stream\ReadableResourceStream::handleData */ - public function testDataErrorShouldEmitErrorAndClose() - { + public function testDataErrorShouldEmitErrorAndClose() { $stream = fopen('php://temp', 'r+'); // add a filter which returns an error when encountering an 'a' when reading Filter\append($stream, function ($chunk) { - if (strpos($chunk, 'a') !== false) { + if (strpos($chunk, 'a') !== FALSE) { throw new \Exception('Invalid'); } return $chunk; @@ -365,8 +344,7 @@ class ReadableResourceStreamTest extends TestCase $conn->handleData($stream); } - private function createLoopMock() - { + private function createLoopMock() { return $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/Stub/ReadableStreamStub.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/Stub/ReadableStreamStub.php index 6984f24..e73b68d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/Stub/ReadableStreamStub.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/Stub/ReadableStreamStub.php @@ -9,51 +9,43 @@ use React\Stream\Util; class ReadableStreamStub extends EventEmitter implements ReadableStreamInterface { - public $readable = true; - public $paused = false; + public $readable = TRUE; + public $paused = FALSE; - public function isReadable() - { - return true; + public function isReadable() { + return TRUE; } // trigger data event - public function write($data) - { + public function write($data) { $this->emit('data', array($data)); } // trigger error event - public function error($error) - { + public function error($error) { $this->emit('error', array($error)); } // trigger end event - public function end() - { + public function end() { $this->emit('end', array()); } - public function pause() - { - $this->paused = true; + public function pause() { + $this->paused = TRUE; } - public function resume() - { - $this->paused = false; + public function resume() { + $this->paused = FALSE; } - public function close() - { - $this->readable = false; + public function close() { + $this->readable = FALSE; $this->emit('close'); } - public function pipe(WritableStreamInterface $dest, array $options = array()) - { + public function pipe(WritableStreamInterface $dest, array $options = array()) { Util::pipe($this, $dest, $options); return $dest; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/TestCase.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/TestCase.php index c8fc1db..9b70f2f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/TestCase.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/TestCase.php @@ -6,8 +6,7 @@ use PHPUnit\Framework\TestCase as BaseTestCase; class TestCase extends BaseTestCase { - protected function expectCallableExactly($amount) - { + protected function expectCallableExactly($amount) { $mock = $this->createCallableMock(); $mock ->expects($this->exactly($amount)) @@ -16,8 +15,7 @@ class TestCase extends BaseTestCase return $mock; } - protected function expectCallableOnce() - { + protected function expectCallableOnce() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) @@ -26,8 +24,7 @@ class TestCase extends BaseTestCase return $mock; } - protected function expectCallableOnceWith($value) - { + protected function expectCallableOnceWith($value) { $callback = $this->createCallableMock(); $callback ->expects($this->once()) @@ -37,8 +34,7 @@ class TestCase extends BaseTestCase return $callback; } - protected function expectCallableNever() - { + protected function expectCallableNever() { $mock = $this->createCallableMock(); $mock ->expects($this->never()) @@ -47,8 +43,7 @@ class TestCase extends BaseTestCase return $mock; } - protected function createCallableMock() - { + protected function createCallableMock() { return $this->getMockBuilder('React\Tests\Stream\CallableStub')->getMock(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/ThroughStreamTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/ThroughStreamTest.php index a98badf..ccbb4ff 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/ThroughStreamTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/ThroughStreamTest.php @@ -13,14 +13,12 @@ class ThroughStreamTest extends TestCase * @test * @expectedException InvalidArgumentException */ - public function itShouldRejectInvalidCallback() - { + public function itShouldRejectInvalidCallback() { new ThroughStream(123); } /** @test */ - public function itShouldReturnTrueForAnyDataWrittenToIt() - { + public function itShouldReturnTrueForAnyDataWrittenToIt() { $through = new ThroughStream(); $ret = $through->write('foo'); @@ -28,32 +26,28 @@ class ThroughStreamTest extends TestCase } /** @test */ - public function itShouldEmitAnyDataWrittenToIt() - { + public function itShouldEmitAnyDataWrittenToIt() { $through = new ThroughStream(); $through->on('data', $this->expectCallableOnceWith('foo')); $through->write('foo'); } /** @test */ - public function itShouldEmitAnyDataWrittenToItPassedThruFunction() - { + public function itShouldEmitAnyDataWrittenToItPassedThruFunction() { $through = new ThroughStream('strtoupper'); $through->on('data', $this->expectCallableOnceWith('FOO')); $through->write('foo'); } /** @test */ - public function itShouldEmitAnyDataWrittenToItPassedThruCallback() - { + public function itShouldEmitAnyDataWrittenToItPassedThruCallback() { $through = new ThroughStream('strtoupper'); $through->on('data', $this->expectCallableOnceWith('FOO')); $through->write('foo'); } /** @test */ - public function itShouldEmitErrorAndCloseIfCallbackThrowsException() - { + public function itShouldEmitErrorAndCloseIfCallbackThrowsException() { $through = new ThroughStream(function () { throw new \RuntimeException(); }); @@ -69,8 +63,7 @@ class ThroughStreamTest extends TestCase } /** @test */ - public function itShouldEmitErrorAndCloseIfCallbackThrowsExceptionOnEnd() - { + public function itShouldEmitErrorAndCloseIfCallbackThrowsExceptionOnEnd() { $through = new ThroughStream(function () { throw new \RuntimeException(); }); @@ -86,8 +79,7 @@ class ThroughStreamTest extends TestCase } /** @test */ - public function itShouldReturnFalseForAnyDataWrittenToItWhenPaused() - { + public function itShouldReturnFalseForAnyDataWrittenToItWhenPaused() { $through = new ThroughStream(); $through->pause(); $ret = $through->write('foo'); @@ -96,8 +88,7 @@ class ThroughStreamTest extends TestCase } /** @test */ - public function itShouldEmitDrainOnResumeAfterReturnFalseForAnyDataWrittenToItWhenPaused() - { + public function itShouldEmitDrainOnResumeAfterReturnFalseForAnyDataWrittenToItWhenPaused() { $through = new ThroughStream(); $through->pause(); $through->write('foo'); @@ -107,8 +98,7 @@ class ThroughStreamTest extends TestCase } /** @test */ - public function itShouldReturnTrueForAnyDataWrittenToItWhenResumedAfterPause() - { + public function itShouldReturnTrueForAnyDataWrittenToItWhenResumedAfterPause() { $through = new ThroughStream(); $through->on('drain', $this->expectCallableNever()); $through->pause(); @@ -119,8 +109,7 @@ class ThroughStreamTest extends TestCase } /** @test */ - public function pipingStuffIntoItShouldWork() - { + public function pipingStuffIntoItShouldWork() { $readable = new ThroughStream(); $through = new ThroughStream(); @@ -131,8 +120,7 @@ class ThroughStreamTest extends TestCase } /** @test */ - public function endShouldEmitEndAndClose() - { + public function endShouldEmitEndAndClose() { $through = new ThroughStream(); $through->on('data', $this->expectCallableNever()); $through->on('end', $this->expectCallableOnce()); @@ -141,8 +129,7 @@ class ThroughStreamTest extends TestCase } /** @test */ - public function endShouldCloseTheStream() - { + public function endShouldCloseTheStream() { $through = new ThroughStream(); $through->on('data', $this->expectCallableNever()); $through->end(); @@ -152,8 +139,7 @@ class ThroughStreamTest extends TestCase } /** @test */ - public function endShouldWriteDataBeforeClosing() - { + public function endShouldWriteDataBeforeClosing() { $through = new ThroughStream(); $through->on('data', $this->expectCallableOnceWith('foo')); $through->end('foo'); @@ -163,8 +149,7 @@ class ThroughStreamTest extends TestCase } /** @test */ - public function endTwiceShouldOnlyEmitOnce() - { + public function endTwiceShouldOnlyEmitOnce() { $through = new ThroughStream(); $through->on('data', $this->expectCallableOnce('first')); $through->end('first'); @@ -172,8 +157,7 @@ class ThroughStreamTest extends TestCase } /** @test */ - public function writeAfterEndShouldReturnFalse() - { + public function writeAfterEndShouldReturnFalse() { $through = new ThroughStream(); $through->on('data', $this->expectCallableNever()); $through->end(); @@ -182,8 +166,7 @@ class ThroughStreamTest extends TestCase } /** @test */ - public function writeDataWillCloseStreamShouldReturnFalse() - { + public function writeDataWillCloseStreamShouldReturnFalse() { $through = new ThroughStream(); $through->on('data', array($through, 'close')); @@ -191,8 +174,7 @@ class ThroughStreamTest extends TestCase } /** @test */ - public function writeDataToPausedShouldReturnFalse() - { + public function writeDataToPausedShouldReturnFalse() { $through = new ThroughStream(); $through->pause(); @@ -200,8 +182,7 @@ class ThroughStreamTest extends TestCase } /** @test */ - public function writeDataToResumedShouldReturnTrue() - { + public function writeDataToResumedShouldReturnTrue() { $through = new ThroughStream(); $through->pause(); $through->resume(); @@ -210,22 +191,19 @@ class ThroughStreamTest extends TestCase } /** @test */ - public function itShouldBeReadableByDefault() - { + public function itShouldBeReadableByDefault() { $through = new ThroughStream(); $this->assertTrue($through->isReadable()); } /** @test */ - public function itShouldBeWritableByDefault() - { + public function itShouldBeWritableByDefault() { $through = new ThroughStream(); $this->assertTrue($through->isWritable()); } /** @test */ - public function closeShouldCloseOnce() - { + public function closeShouldCloseOnce() { $through = new ThroughStream(); $through->on('close', $this->expectCallableOnce()); @@ -237,8 +215,7 @@ class ThroughStreamTest extends TestCase } /** @test */ - public function doubleCloseShouldCloseOnce() - { + public function doubleCloseShouldCloseOnce() { $through = new ThroughStream(); $through->on('close', $this->expectCallableOnce()); @@ -251,10 +228,9 @@ class ThroughStreamTest extends TestCase } /** @test */ - public function pipeShouldPipeCorrectly() - { + public function pipeShouldPipeCorrectly() { $output = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock(); - $output->expects($this->any())->method('isWritable')->willReturn(True); + $output->expects($this->any())->method('isWritable')->willReturn(TRUE); $output ->expects($this->once()) ->method('write') diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/UtilTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/UtilTest.php index 3d113ab..871351e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/UtilTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/UtilTest.php @@ -12,8 +12,7 @@ use React\Stream\ThroughStream; */ class UtilTest extends TestCase { - public function testPipeReturnsDestinationStream() - { + public function testPipeReturnsDestinationStream() { $readable = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock(); $writable = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock(); @@ -23,13 +22,12 @@ class UtilTest extends TestCase $this->assertSame($writable, $ret); } - public function testPipeNonReadableSourceShouldDoNothing() - { + public function testPipeNonReadableSourceShouldDoNothing() { $readable = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock(); $readable ->expects($this->any()) ->method('isReadable') - ->willReturn(false); + ->willReturn(FALSE); $writable = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock(); $writable @@ -42,13 +40,12 @@ class UtilTest extends TestCase Util::pipe($readable, $writable); } - public function testPipeIntoNonWritableDestinationShouldPauseSource() - { + public function testPipeIntoNonWritableDestinationShouldPauseSource() { $readable = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock(); $readable ->expects($this->any()) ->method('isReadable') - ->willReturn(true); + ->willReturn(TRUE); $readable ->expects($this->once()) ->method('pause'); @@ -57,7 +54,7 @@ class UtilTest extends TestCase $writable ->expects($this->any()) ->method('isWritable') - ->willReturn(false); + ->willReturn(FALSE); $writable ->expects($this->never()) ->method('end'); @@ -65,13 +62,12 @@ class UtilTest extends TestCase Util::pipe($readable, $writable); } - public function testPipeClosingDestPausesSource() - { + public function testPipeClosingDestPausesSource() { $readable = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock(); $readable ->expects($this->any()) ->method('isReadable') - ->willReturn(true); + ->willReturn(TRUE); $readable ->expects($this->once()) ->method('pause'); @@ -83,15 +79,14 @@ class UtilTest extends TestCase $writable->close(); } - public function testPipeWithEnd() - { + public function testPipeWithEnd() { $readable = new Stub\ReadableStreamStub(); $writable = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock(); $writable ->expects($this->any()) ->method('isWritable') - ->willReturn(true); + ->willReturn(TRUE); $writable ->expects($this->once()) ->method('end'); @@ -101,38 +96,36 @@ class UtilTest extends TestCase $readable->end(); } - public function testPipeWithoutEnd() - { + public function testPipeWithoutEnd() { $readable = new Stub\ReadableStreamStub(); $writable = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock(); $writable ->expects($this->any()) ->method('isWritable') - ->willReturn(true); + ->willReturn(TRUE); $writable ->expects($this->never()) ->method('end'); - Util::pipe($readable, $writable, array('end' => false)); + Util::pipe($readable, $writable, array('end' => FALSE)); $readable->end(); } - public function testPipeWithTooSlowWritableShouldPauseReadable() - { + public function testPipeWithTooSlowWritableShouldPauseReadable() { $readable = new Stub\ReadableStreamStub(); $writable = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock(); $writable ->expects($this->any()) ->method('isWritable') - ->willReturn(true); + ->willReturn(TRUE); $writable ->expects($this->once()) ->method('write') ->with('some data') - ->will($this->returnValue(false)); + ->will($this->returnValue(FALSE)); $readable->pipe($writable); @@ -141,17 +134,16 @@ class UtilTest extends TestCase $this->assertTrue($readable->paused); } - public function testPipeWithTooSlowWritableShouldResumeOnDrain() - { + public function testPipeWithTooSlowWritableShouldResumeOnDrain() { $readable = new Stub\ReadableStreamStub(); - $onDrain = null; + $onDrain = NULL; $writable = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock(); $writable ->expects($this->any()) ->method('isWritable') - ->willReturn(true); + ->willReturn(TRUE); $writable ->expects($this->any()) ->method('on') @@ -170,8 +162,7 @@ class UtilTest extends TestCase $this->assertFalse($readable->paused); } - public function testPipeWithWritableResourceStream() - { + public function testPipeWithWritableResourceStream() { $readable = new Stub\ReadableStreamStub(); $stream = fopen('php://temp', 'r+'); @@ -188,8 +179,7 @@ class UtilTest extends TestCase $this->assertSame('hello, I am some random data', stream_get_contents($stream)); } - public function testPipeSetsUpListeners() - { + public function testPipeSetsUpListeners() { $source = new ThroughStream(); $dest = new ThroughStream(); @@ -204,8 +194,7 @@ class UtilTest extends TestCase $this->assertCount(1, $dest->listeners('drain')); } - public function testPipeClosingSourceRemovesListeners() - { + public function testPipeClosingSourceRemovesListeners() { $source = new ThroughStream(); $dest = new ThroughStream(); @@ -218,8 +207,7 @@ class UtilTest extends TestCase $this->assertCount(0, $dest->listeners('drain')); } - public function testPipeClosingDestRemovesListeners() - { + public function testPipeClosingDestRemovesListeners() { $source = new ThroughStream(); $dest = new ThroughStream(); @@ -232,12 +220,11 @@ class UtilTest extends TestCase $this->assertCount(0, $dest->listeners('drain')); } - public function testPipeDuplexIntoSelfEndsOnEnd() - { + public function testPipeDuplexIntoSelfEndsOnEnd() { $readable = $this->getMockBuilder('React\Stream\ReadableStreamInterface')->getMock(); - $readable->expects($this->any())->method('isReadable')->willReturn(true); + $readable->expects($this->any())->method('isReadable')->willReturn(TRUE); $writable = $this->getMockBuilder('React\Stream\WritableStreamInterface')->getMock(); - $writable->expects($this->any())->method('isWritable')->willReturn(true); + $writable->expects($this->any())->method('isWritable')->willReturn(TRUE); $duplex = new CompositeStream($readable, $writable); Util::pipe($duplex, $duplex); @@ -248,8 +235,7 @@ class UtilTest extends TestCase } /** @test */ - public function forwardEventsShouldSetupForwards() - { + public function forwardEventsShouldSetupForwards() { $source = new ThroughStream(); $target = new ThroughStream(); @@ -261,13 +247,11 @@ class UtilTest extends TestCase $source->emit('foo', array('bar')); } - private function createLoopMock() - { + private function createLoopMock() { return $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); } - private function notEqualTo($value) - { + private function notEqualTo($value) { return new \PHPUnit_Framework_Constraint_Not($value); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/WritableStreamResourceTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/WritableStreamResourceTest.php index 05bce9c..c5df772 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/WritableStreamResourceTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/react/stream/tests/WritableStreamResourceTest.php @@ -11,8 +11,7 @@ class WritableResourceStreamTest extends TestCase * @covers React\Stream\WritableResourceStream::__construct * @doesNotPerformAssertions */ - public function testConstructor() - { + public function testConstructor() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -23,8 +22,7 @@ class WritableResourceStreamTest extends TestCase * @covers React\Stream\WritableResourceStream::__construct * @doesNotPerformAssertions */ - public function testConstructorWithExcessiveMode() - { + public function testConstructorWithExcessiveMode() { // excessive flags are ignored for temp streams, so we have to use a file stream $name = tempnam(sys_get_temp_dir(), 'test'); $stream = @fopen($name, 'w+eANYTHING'); @@ -39,9 +37,8 @@ class WritableResourceStreamTest extends TestCase * @covers React\Stream\WritableResourceStream::__construct * @expectedException InvalidArgumentException */ - public function testConstructorThrowsIfNotAValidStreamResource() - { - $stream = null; + public function testConstructorThrowsIfNotAValidStreamResource() { + $stream = NULL; $loop = $this->createLoopMock(); new WritableResourceStream($stream, $loop); @@ -51,8 +48,7 @@ class WritableResourceStreamTest extends TestCase * @covers React\Stream\WritableResourceStream::__construct * @expectedException InvalidArgumentException */ - public function testConstructorThrowsExceptionOnReadOnlyStream() - { + public function testConstructorThrowsExceptionOnReadOnlyStream() { $stream = fopen('php://temp', 'r'); $loop = $this->createLoopMock(); @@ -63,8 +59,7 @@ class WritableResourceStreamTest extends TestCase * @covers React\Stream\WritableResourceStream::__construct * @expectedException InvalidArgumentException */ - public function testConstructorThrowsExceptionOnReadOnlyStreamWithExcessiveMode() - { + public function testConstructorThrowsExceptionOnReadOnlyStreamWithExcessiveMode() { // excessive flags are ignored for temp streams, so we have to use a file stream $name = tempnam(sys_get_temp_dir(), 'test'); $stream = fopen($name, 'reANYTHING'); @@ -78,8 +73,7 @@ class WritableResourceStreamTest extends TestCase * @covers React\Stream\WritableResourceStream::__construct * @expectedException RuntimeException */ - public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking() - { + public function testConstructorThrowsExceptionIfStreamDoesNotSupportNonBlocking() { if (!in_array('blocking', stream_get_wrappers())) { stream_wrapper_register('blocking', 'React\Tests\Stream\EnforceBlockingWrapper'); } @@ -94,8 +88,7 @@ class WritableResourceStreamTest extends TestCase * @covers React\Stream\WritableResourceStream::write * @covers React\Stream\WritableResourceStream::handleWrite */ - public function testWrite() - { + public function testWrite() { $stream = fopen('php://temp', 'r+'); $loop = $this->createWriteableLoopMock(); @@ -110,8 +103,7 @@ class WritableResourceStreamTest extends TestCase /** * @covers React\Stream\WritableResourceStream::write */ - public function testWriteWithDataDoesAddResourceToLoop() - { + public function testWriteWithDataDoesAddResourceToLoop() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $loop->expects($this->once())->method('addWriteStream')->with($this->equalTo($stream)); @@ -125,8 +117,7 @@ class WritableResourceStreamTest extends TestCase * @covers React\Stream\WritableResourceStream::write * @covers React\Stream\WritableResourceStream::handleWrite */ - public function testEmptyWriteDoesNotAddToLoop() - { + public function testEmptyWriteDoesNotAddToLoop() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $loop->expects($this->never())->method('addWriteStream'); @@ -134,32 +125,30 @@ class WritableResourceStreamTest extends TestCase $buffer = new WritableResourceStream($stream, $loop); $buffer->write(""); - $buffer->write(null); + $buffer->write(NULL); } /** * @covers React\Stream\WritableResourceStream::write * @covers React\Stream\WritableResourceStream::handleWrite */ - public function testWriteReturnsFalseWhenWritableResourceStreamIsFull() - { + public function testWriteReturnsFalseWhenWritableResourceStreamIsFull() { $stream = fopen('php://temp', 'r+'); $loop = $this->createWriteableLoopMock(); - $loop->preventWrites = true; + $loop->preventWrites = TRUE; $buffer = new WritableResourceStream($stream, $loop, 4); $buffer->on('error', $this->expectCallableNever()); $this->assertTrue($buffer->write("foo")); - $loop->preventWrites = false; + $loop->preventWrites = FALSE; $this->assertFalse($buffer->write("bar\n")); } /** * @covers React\Stream\WritableResourceStream::write */ - public function testWriteReturnsFalseWhenWritableResourceStreamIsExactlyFull() - { + public function testWriteReturnsFalseWhenWritableResourceStreamIsExactlyFull() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -172,8 +161,7 @@ class WritableResourceStreamTest extends TestCase * @covers React\Stream\WritableResourceStream::write * @covers React\Stream\WritableResourceStream::handleWrite */ - public function testWriteDetectsWhenOtherSideIsClosed() - { + public function testWriteDetectsWhenOtherSideIsClosed() { list($a, $b) = stream_socket_pair(STREAM_PF_UNIX, STREAM_SOCK_STREAM, STREAM_IPPROTO_IP); $loop = $this->createWriteableLoopMock(); @@ -190,8 +178,7 @@ class WritableResourceStreamTest extends TestCase * @covers React\Stream\WritableResourceStream::write * @covers React\Stream\WritableResourceStream::handleWrite */ - public function testEmitsDrainAfterWriteWhichExceedsBuffer() - { + public function testEmitsDrainAfterWriteWhichExceedsBuffer() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -207,8 +194,7 @@ class WritableResourceStreamTest extends TestCase * @covers React\Stream\WritableResourceStream::write * @covers React\Stream\WritableResourceStream::handleWrite */ - public function testWriteInDrain() - { + public function testWriteInDrain() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -231,8 +217,7 @@ class WritableResourceStreamTest extends TestCase * @covers React\Stream\WritableResourceStream::write * @covers React\Stream\WritableResourceStream::handleWrite */ - public function testDrainAfterWrite() - { + public function testDrainAfterWrite() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -247,8 +232,7 @@ class WritableResourceStreamTest extends TestCase /** * @covers React\Stream\WritableResourceStream::handleWrite */ - public function testDrainAfterWriteWillRemoveResourceFromLoopWithoutClosing() - { + public function testDrainAfterWriteWillRemoveResourceFromLoopWithoutClosing() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $loop->expects($this->once())->method('removeWriteStream')->with($stream); @@ -266,8 +250,7 @@ class WritableResourceStreamTest extends TestCase /** * @covers React\Stream\WritableResourceStream::handleWrite */ - public function testClosingDuringDrainAfterWriteWillRemoveResourceFromLoopOnceAndClose() - { + public function testClosingDuringDrainAfterWriteWillRemoveResourceFromLoopOnceAndClose() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $loop->expects($this->once())->method('removeWriteStream')->with($stream); @@ -287,8 +270,7 @@ class WritableResourceStreamTest extends TestCase /** * @covers React\Stream\WritableResourceStream::end */ - public function testEndWithoutDataClosesImmediatelyIfWritableResourceStreamIsEmpty() - { + public function testEndWithoutDataClosesImmediatelyIfWritableResourceStreamIsEmpty() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -304,8 +286,7 @@ class WritableResourceStreamTest extends TestCase /** * @covers React\Stream\WritableResourceStream::end */ - public function testEndWithoutDataDoesNotCloseIfWritableResourceStreamIsFull() - { + public function testEndWithoutDataDoesNotCloseIfWritableResourceStreamIsFull() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -323,8 +304,7 @@ class WritableResourceStreamTest extends TestCase /** * @covers React\Stream\WritableResourceStream::end */ - public function testEndWithDataClosesImmediatelyIfWritableResourceStreamFlushes() - { + public function testEndWithDataClosesImmediatelyIfWritableResourceStreamFlushes() { $stream = fopen('php://temp', 'r+'); $filterBuffer = ''; $loop = $this->createLoopMock(); @@ -349,8 +329,7 @@ class WritableResourceStreamTest extends TestCase /** * @covers React\Stream\WritableResourceStream::end */ - public function testEndWithDataDoesNotCloseImmediatelyIfWritableResourceStreamIsFull() - { + public function testEndWithDataDoesNotCloseImmediatelyIfWritableResourceStreamIsFull() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -372,8 +351,7 @@ class WritableResourceStreamTest extends TestCase * @covers React\Stream\WritableResourceStream::isWritable * @covers React\Stream\WritableResourceStream::close */ - public function testClose() - { + public function testClose() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -391,8 +369,7 @@ class WritableResourceStreamTest extends TestCase /** * @covers React\Stream\WritableResourceStream::close */ - public function testClosingAfterWriteRemovesStreamFromLoop() - { + public function testClosingAfterWriteRemovesStreamFromLoop() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $buffer = new WritableResourceStream($stream, $loop); @@ -406,8 +383,7 @@ class WritableResourceStreamTest extends TestCase /** * @covers React\Stream\WritableResourceStream::close */ - public function testClosingWithoutWritingDoesNotRemoveStreamFromLoop() - { + public function testClosingWithoutWritingDoesNotRemoveStreamFromLoop() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); $buffer = new WritableResourceStream($stream, $loop); @@ -420,8 +396,7 @@ class WritableResourceStreamTest extends TestCase /** * @covers React\Stream\WritableResourceStream::close */ - public function testDoubleCloseWillEmitOnlyOnce() - { + public function testDoubleCloseWillEmitOnlyOnce() { $stream = fopen('php://temp', 'r+'); $loop = $this->createLoopMock(); @@ -436,8 +411,7 @@ class WritableResourceStreamTest extends TestCase * @covers React\Stream\WritableResourceStream::write * @covers React\Stream\WritableResourceStream::close */ - public function testWritingToClosedWritableResourceStreamShouldNotWriteToStream() - { + public function testWritingToClosedWritableResourceStreamShouldNotWriteToStream() { $stream = fopen('php://temp', 'r+'); $filterBuffer = ''; $loop = $this->createLoopMock(); @@ -460,12 +434,11 @@ class WritableResourceStreamTest extends TestCase /** * @covers React\Stream\WritableResourceStream::handleWrite */ - public function testErrorWhenStreamResourceIsInvalid() - { + public function testErrorWhenStreamResourceIsInvalid() { $stream = fopen('php://temp', 'r+'); $loop = $this->createWriteableLoopMock(); - $error = null; + $error = NULL; $buffer = new WritableResourceStream($stream, $loop); $buffer->on('error', function ($message) use (&$error) { @@ -481,11 +454,10 @@ class WritableResourceStreamTest extends TestCase // the error messages differ between PHP versions, let's just check substrings $this->assertContains('Unable to write to stream: ', $error->getMessage()); - $this->assertContains(' not a valid stream resource', $error->getMessage(), '', true); + $this->assertContains(' not a valid stream resource', $error->getMessage(), '', TRUE); } - public function testWritingToClosedStream() - { + public function testWritingToClosedStream() { if ('Darwin' === PHP_OS) { $this->markTestSkipped('OS X issue with shutting down pair for writing'); } @@ -493,10 +465,10 @@ class WritableResourceStreamTest extends TestCase list($a, $b) = stream_socket_pair(STREAM_PF_UNIX, STREAM_SOCK_STREAM, STREAM_IPPROTO_IP); $loop = $this->createLoopMock(); - $error = null; + $error = NULL; $buffer = new WritableResourceStream($a, $loop); - $buffer->on('error', function($message) use (&$error) { + $buffer->on('error', function ($message) use (&$error) { $error = $message; }); @@ -511,10 +483,9 @@ class WritableResourceStreamTest extends TestCase $this->assertSame('Unable to write to stream: fwrite(): send of 3 bytes failed with errno=32 Broken pipe', $error->getMessage()); } - private function createWriteableLoopMock() - { + private function createWriteableLoopMock() { $loop = $this->createLoopMock(); - $loop->preventWrites = false; + $loop->preventWrites = FALSE; $loop ->expects($this->any()) ->method('addWriteStream') @@ -527,8 +498,7 @@ class WritableResourceStreamTest extends TestCase return $loop; } - private function createLoopMock() - { + private function createLoopMock() { return $this->getMockBuilder('React\EventLoop\LoopInterface')->getMock(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/AcceptHeader.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/AcceptHeader.php index d174026..db41756 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/AcceptHeader.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/AcceptHeader.php @@ -29,13 +29,12 @@ class AcceptHeader /** * @var bool */ - private $sorted = true; + private $sorted = TRUE; /** * @param AcceptHeaderItem[] $items */ - public function __construct(array $items) - { + public function __construct(array $items) { foreach ($items as $item) { $this->add($item); } @@ -48,8 +47,7 @@ class AcceptHeader * * @return self */ - public static function fromString($headerValue) - { + public static function fromString($headerValue) { $index = 0; return new self(array_map(function ($itemValue) use (&$index) { @@ -65,8 +63,7 @@ class AcceptHeader * * @return string */ - public function __toString() - { + public function __toString() { return implode(',', $this->items); } @@ -77,8 +74,7 @@ class AcceptHeader * * @return bool */ - public function has($value) - { + public function has($value) { return isset($this->items[$value]); } @@ -89,9 +85,8 @@ class AcceptHeader * * @return AcceptHeaderItem|null */ - public function get($value) - { - return isset($this->items[$value]) ? $this->items[$value] : null; + public function get($value) { + return isset($this->items[$value]) ? $this->items[$value] : NULL; } /** @@ -99,10 +94,9 @@ class AcceptHeader * * @return $this */ - public function add(AcceptHeaderItem $item) - { + public function add(AcceptHeaderItem $item) { $this->items[$item->getValue()] = $item; - $this->sorted = false; + $this->sorted = FALSE; return $this; } @@ -112,8 +106,7 @@ class AcceptHeader * * @return AcceptHeaderItem[] */ - public function all() - { + public function all() { $this->sort(); return $this->items; @@ -126,8 +119,7 @@ class AcceptHeader * * @return self */ - public function filter($pattern) - { + public function filter($pattern) { return new self(array_filter($this->items, function (AcceptHeaderItem $item) use ($pattern) { return preg_match($pattern, $item->getValue()); })); @@ -138,18 +130,16 @@ class AcceptHeader * * @return AcceptHeaderItem|null */ - public function first() - { + public function first() { $this->sort(); - return !empty($this->items) ? reset($this->items) : null; + return !empty($this->items) ? reset($this->items) : NULL; } /** * Sorts items by descending quality. */ - private function sort() - { + private function sort() { if (!$this->sorted) { uasort($this->items, function (AcceptHeaderItem $a, AcceptHeaderItem $b) { $qA = $a->getQuality(); @@ -162,7 +152,7 @@ class AcceptHeader return $qA > $qB ? -1 : 1; }); - $this->sorted = true; + $this->sorted = TRUE; } } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/AcceptHeaderItem.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/AcceptHeaderItem.php index c69dbbb..bbb1e0a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/AcceptHeaderItem.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/AcceptHeaderItem.php @@ -25,10 +25,9 @@ class AcceptHeaderItem /** * @param string $value - * @param array $attributes + * @param array $attributes */ - public function __construct($value, array $attributes = array()) - { + public function __construct($value, array $attributes = array()) { $this->value = $value; foreach ($attributes as $name => $value) { $this->setAttribute($name, $value); @@ -42,19 +41,18 @@ class AcceptHeaderItem * * @return self */ - public static function fromString($itemValue) - { + public static function fromString($itemValue) { $bits = preg_split('/\s*(?:;*("[^"]+");*|;*(\'[^\']+\');*|;+)\s*/', $itemValue, 0, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); $value = array_shift($bits); $attributes = array(); - $lastNullAttribute = null; + $lastNullAttribute = NULL; foreach ($bits as $bit) { if (($start = substr($bit, 0, 1)) === ($end = substr($bit, -1)) && ('"' === $start || '\'' === $start)) { $attributes[$lastNullAttribute] = substr($bit, 1, -1); - } elseif ('=' === $end) { + } else if ('=' === $end) { $lastNullAttribute = $bit = substr($bit, 0, -1); - $attributes[$bit] = null; + $attributes[$bit] = NULL; } else { $parts = explode('=', $bit); $attributes[$parts[0]] = isset($parts[1]) && strlen($parts[1]) > 0 ? $parts[1] : ''; @@ -69,13 +67,12 @@ class AcceptHeaderItem * * @return string */ - public function __toString() - { - $string = $this->value.($this->quality < 1 ? ';q='.$this->quality : ''); + public function __toString() { + $string = $this->value . ($this->quality < 1 ? ';q=' . $this->quality : ''); if (count($this->attributes) > 0) { - $string .= ';'.implode(';', array_map(function ($name, $value) { - return sprintf(preg_match('/[,;=]/', $value) ? '%s="%s"' : '%s=%s', $name, $value); - }, array_keys($this->attributes), $this->attributes)); + $string .= ';' . implode(';', array_map(function ($name, $value) { + return sprintf(preg_match('/[,;=]/', $value) ? '%s="%s"' : '%s=%s', $name, $value); + }, array_keys($this->attributes), $this->attributes)); } return $string; @@ -88,8 +85,7 @@ class AcceptHeaderItem * * @return $this */ - public function setValue($value) - { + public function setValue($value) { $this->value = $value; return $this; @@ -100,8 +96,7 @@ class AcceptHeaderItem * * @return string */ - public function getValue() - { + public function getValue() { return $this->value; } @@ -112,8 +107,7 @@ class AcceptHeaderItem * * @return $this */ - public function setQuality($quality) - { + public function setQuality($quality) { $this->quality = $quality; return $this; @@ -124,8 +118,7 @@ class AcceptHeaderItem * * @return float */ - public function getQuality() - { + public function getQuality() { return $this->quality; } @@ -136,8 +129,7 @@ class AcceptHeaderItem * * @return $this */ - public function setIndex($index) - { + public function setIndex($index) { $this->index = $index; return $this; @@ -148,8 +140,7 @@ class AcceptHeaderItem * * @return int */ - public function getIndex() - { + public function getIndex() { return $this->index; } @@ -160,8 +151,7 @@ class AcceptHeaderItem * * @return bool */ - public function hasAttribute($name) - { + public function hasAttribute($name) { return isset($this->attributes[$name]); } @@ -169,12 +159,11 @@ class AcceptHeaderItem * Returns an attribute by its name. * * @param string $name - * @param mixed $default + * @param mixed $default * * @return mixed */ - public function getAttribute($name, $default = null) - { + public function getAttribute($name, $default = NULL) { return isset($this->attributes[$name]) ? $this->attributes[$name] : $default; } @@ -183,8 +172,7 @@ class AcceptHeaderItem * * @return array */ - public function getAttributes() - { + public function getAttributes() { return $this->attributes; } @@ -196,12 +184,11 @@ class AcceptHeaderItem * * @return $this */ - public function setAttribute($name, $value) - { + public function setAttribute($name, $value) { if ('q' === $name) { - $this->quality = (float) $value; + $this->quality = (float)$value; } else { - $this->attributes[$name] = (string) $value; + $this->attributes[$name] = (string)$value; } return $this; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ApacheRequest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ApacheRequest.php index 84803eb..8b8fae1 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ApacheRequest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ApacheRequest.php @@ -21,19 +21,17 @@ class ApacheRequest extends Request /** * {@inheritdoc} */ - protected function prepareRequestUri() - { + protected function prepareRequestUri() { return $this->server->get('REQUEST_URI'); } /** * {@inheritdoc} */ - protected function prepareBaseUrl() - { + protected function prepareBaseUrl() { $baseUrl = $this->server->get('SCRIPT_NAME'); - if (false === strpos($this->server->get('REQUEST_URI'), $baseUrl)) { + if (FALSE === strpos($this->server->get('REQUEST_URI'), $baseUrl)) { // assume mod_rewrite return rtrim(dirname($baseUrl), '/\\'); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/BinaryFileResponse.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/BinaryFileResponse.php index 1010223..15acbfe 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/BinaryFileResponse.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/BinaryFileResponse.php @@ -25,7 +25,7 @@ use Symfony\Component\HttpFoundation\File\Exception\FileException; */ class BinaryFileResponse extends Response { - protected static $trustXSendfileTypeHeader = false; + protected static $trustXSendfileTypeHeader = FALSE; /** * @var File @@ -33,20 +33,19 @@ class BinaryFileResponse extends Response protected $file; protected $offset; protected $maxlen; - protected $deleteFileAfterSend = false; + protected $deleteFileAfterSend = FALSE; /** - * @param \SplFileInfo|string $file The file to stream - * @param int $status The response status code - * @param array $headers An array of response headers - * @param bool $public Files are public by default - * @param null|string $contentDisposition The type of Content-Disposition to set automatically with the filename - * @param bool $autoEtag Whether the ETag header should be automatically set - * @param bool $autoLastModified Whether the Last-Modified header should be automatically set + * @param \SplFileInfo|string $file The file to stream + * @param int $status The response status code + * @param array $headers An array of response headers + * @param bool $public Files are public by default + * @param null|string $contentDisposition The type of Content-Disposition to set automatically with the filename + * @param bool $autoEtag Whether the ETag header should be automatically set + * @param bool $autoLastModified Whether the Last-Modified header should be automatically set */ - public function __construct($file, $status = 200, $headers = array(), $public = true, $contentDisposition = null, $autoEtag = false, $autoLastModified = true) - { - parent::__construct(null, $status, $headers); + public function __construct($file, $status = 200, $headers = array(), $public = TRUE, $contentDisposition = NULL, $autoEtag = FALSE, $autoLastModified = TRUE) { + parent::__construct(NULL, $status, $headers); $this->setFile($file, $contentDisposition, $autoEtag, $autoLastModified); @@ -56,40 +55,38 @@ class BinaryFileResponse extends Response } /** - * @param \SplFileInfo|string $file The file to stream - * @param int $status The response status code - * @param array $headers An array of response headers - * @param bool $public Files are public by default - * @param null|string $contentDisposition The type of Content-Disposition to set automatically with the filename - * @param bool $autoEtag Whether the ETag header should be automatically set - * @param bool $autoLastModified Whether the Last-Modified header should be automatically set + * @param \SplFileInfo|string $file The file to stream + * @param int $status The response status code + * @param array $headers An array of response headers + * @param bool $public Files are public by default + * @param null|string $contentDisposition The type of Content-Disposition to set automatically with the filename + * @param bool $autoEtag Whether the ETag header should be automatically set + * @param bool $autoLastModified Whether the Last-Modified header should be automatically set * * @return static */ - public static function create($file = null, $status = 200, $headers = array(), $public = true, $contentDisposition = null, $autoEtag = false, $autoLastModified = true) - { + public static function create($file = NULL, $status = 200, $headers = array(), $public = TRUE, $contentDisposition = NULL, $autoEtag = FALSE, $autoLastModified = TRUE) { return new static($file, $status, $headers, $public, $contentDisposition, $autoEtag, $autoLastModified); } /** * Sets the file to stream. * - * @param \SplFileInfo|string $file The file to stream - * @param string $contentDisposition - * @param bool $autoEtag - * @param bool $autoLastModified + * @param \SplFileInfo|string $file The file to stream + * @param string $contentDisposition + * @param bool $autoEtag + * @param bool $autoLastModified * * @return $this * * @throws FileException */ - public function setFile($file, $contentDisposition = null, $autoEtag = false, $autoLastModified = true) - { + public function setFile($file, $contentDisposition = NULL, $autoEtag = FALSE, $autoLastModified = TRUE) { if (!$file instanceof File) { if ($file instanceof \SplFileInfo) { $file = new File($file->getPathname()); } else { - $file = new File((string) $file); + $file = new File((string)$file); } } @@ -119,16 +116,14 @@ class BinaryFileResponse extends Response * * @return File The file to stream */ - public function getFile() - { + public function getFile() { return $this->file; } /** * Automatically sets the Last-Modified header according the file modification date. */ - public function setAutoLastModified() - { + public function setAutoLastModified() { $this->setLastModified(\DateTime::createFromFormat('U', $this->file->getMTime())); return $this; @@ -137,9 +132,8 @@ class BinaryFileResponse extends Response /** * Automatically sets the ETag header according to the checksum of the file. */ - public function setAutoEtag() - { - $this->setEtag(base64_encode(hash_file('sha256', $this->file->getPathname(), true))); + public function setAutoEtag() { + $this->setEtag(base64_encode(hash_file('sha256', $this->file->getPathname(), TRUE))); return $this; } @@ -147,20 +141,19 @@ class BinaryFileResponse extends Response /** * Sets the Content-Disposition header with the given filename. * - * @param string $disposition ResponseHeaderBag::DISPOSITION_INLINE or ResponseHeaderBag::DISPOSITION_ATTACHMENT - * @param string $filename Optionally use this UTF-8 encoded filename instead of the real name of the file + * @param string $disposition ResponseHeaderBag::DISPOSITION_INLINE or ResponseHeaderBag::DISPOSITION_ATTACHMENT + * @param string $filename Optionally use this UTF-8 encoded filename instead of the real name of the file * @param string $filenameFallback A fallback filename, containing only ASCII characters. Defaults to an automatically encoded filename * * @return $this */ - public function setContentDisposition($disposition, $filename = '', $filenameFallback = '') - { + public function setContentDisposition($disposition, $filename = '', $filenameFallback = '') { if ('' === $filename) { $filename = $this->file->getFilename(); } - if ('' === $filenameFallback && (!preg_match('/^[\x20-\x7e]*$/', $filename) || false !== strpos($filename, '%'))) { - $encoding = mb_detect_encoding($filename, null, true) ?: '8bit'; + if ('' === $filenameFallback && (!preg_match('/^[\x20-\x7e]*$/', $filename) || FALSE !== strpos($filename, '%'))) { + $encoding = mb_detect_encoding($filename, NULL, TRUE) ?: '8bit'; for ($i = 0, $filenameLength = mb_strlen($filename, $encoding); $i < $filenameLength; ++$i) { $char = mb_substr($filename, $i, 1, $encoding); @@ -182,8 +175,7 @@ class BinaryFileResponse extends Response /** * {@inheritdoc} */ - public function prepare(Request $request) - { + public function prepare(Request $request) { if (!$this->headers->has('Content-Type')) { $this->headers->set('Content-Type', $this->file->getMimeType() ?: 'application/octet-stream'); } @@ -197,14 +189,14 @@ class BinaryFileResponse extends Response $this->offset = 0; $this->maxlen = -1; - if (false === $fileSize = $this->file->getSize()) { + if (FALSE === $fileSize = $this->file->getSize()) { return $this; } $this->headers->set('Content-Length', $fileSize); if (!$this->headers->has('Accept-Ranges')) { // Only accept ranges on safe HTTP methods - $this->headers->set('Accept-Ranges', $request->isMethodSafe(false) ? 'bytes' : 'none'); + $this->headers->set('Accept-Ranges', $request->isMethodSafe(FALSE) ? 'bytes' : 'none'); } if (self::$trustXSendfileTypeHeader && $request->headers->has('X-Sendfile-Type')) { @@ -212,7 +204,7 @@ class BinaryFileResponse extends Response $type = $request->headers->get('X-Sendfile-Type'); $path = $this->file->getRealPath(); // Fall back to scheme://path for stream wrapped locations. - if (false === $path) { + if (FALSE === $path) { $path = $this->file->getPathname(); } if ('x-accel-redirect' === strtolower($type)) { @@ -226,7 +218,7 @@ class BinaryFileResponse extends Response $location = trim($mapping[1]); if (substr($path, 0, strlen($pathPrefix)) === $pathPrefix) { - $path = $location.substr($path, strlen($pathPrefix)); + $path = $location . substr($path, strlen($pathPrefix)); break; } } @@ -234,27 +226,27 @@ class BinaryFileResponse extends Response } $this->headers->set($type, $path); $this->maxlen = 0; - } elseif ($request->headers->has('Range')) { + } else if ($request->headers->has('Range')) { // Process the range headers. if (!$request->headers->has('If-Range') || $this->hasValidIfRangeHeader($request->headers->get('If-Range'))) { $range = $request->headers->get('Range'); list($start, $end) = explode('-', substr($range, 6), 2) + array(0); - $end = ('' === $end) ? $fileSize - 1 : (int) $end; + $end = ('' === $end) ? $fileSize - 1 : (int)$end; if ('' === $start) { $start = $fileSize - $end; $end = $fileSize - 1; } else { - $start = (int) $start; + $start = (int)$start; } if ($start <= $end) { if ($start < 0 || $end > $fileSize - 1) { $this->setStatusCode(416); $this->headers->set('Content-Range', sprintf('bytes */%s', $fileSize)); - } elseif (0 !== $start || $end !== $fileSize - 1) { + } else if (0 !== $start || $end !== $fileSize - 1) { $this->maxlen = $end < $fileSize ? $end - $start + 1 : -1; $this->offset = $start; @@ -269,17 +261,16 @@ class BinaryFileResponse extends Response return $this; } - private function hasValidIfRangeHeader($header) - { + private function hasValidIfRangeHeader($header) { if ($this->getEtag() === $header) { - return true; + return TRUE; } - if (null === $lastModified = $this->getLastModified()) { - return false; + if (NULL === $lastModified = $this->getLastModified()) { + return FALSE; } - return $lastModified->format('D, d M Y H:i:s').' GMT' === $header; + return $lastModified->format('D, d M Y H:i:s') . ' GMT' === $header; } /** @@ -287,8 +278,7 @@ class BinaryFileResponse extends Response * * {@inheritdoc} */ - public function sendContent() - { + public function sendContent() { if (!$this->isSuccessful()) { return parent::sendContent(); } @@ -317,9 +307,8 @@ class BinaryFileResponse extends Response * * @throws \LogicException when the content is not null */ - public function setContent($content) - { - if (null !== $content) { + public function setContent($content) { + if (NULL !== $content) { throw new \LogicException('The content cannot be set on a BinaryFileResponse instance.'); } } @@ -329,17 +318,15 @@ class BinaryFileResponse extends Response * * @return false */ - public function getContent() - { - return false; + public function getContent() { + return FALSE; } /** * Trust X-Sendfile-Type header. */ - public static function trustXSendfileTypeHeader() - { - self::$trustXSendfileTypeHeader = true; + public static function trustXSendfileTypeHeader() { + self::$trustXSendfileTypeHeader = TRUE; } /** @@ -350,8 +337,7 @@ class BinaryFileResponse extends Response * * @return $this */ - public function deleteFileAfterSend($shouldDelete) - { + public function deleteFileAfterSend($shouldDelete) { $this->deleteFileAfterSend = $shouldDelete; return $this; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Cookie.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Cookie.php index 4519a6a..5350e7f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Cookie.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Cookie.php @@ -35,25 +35,24 @@ class Cookie * Creates cookie from raw header string. * * @param string $cookie - * @param bool $decode + * @param bool $decode * * @return static */ - public static function fromString($cookie, $decode = false) - { + public static function fromString($cookie, $decode = FALSE) { $data = array( 'expires' => 0, 'path' => '/', - 'domain' => null, - 'secure' => false, - 'httponly' => false, + 'domain' => NULL, + 'secure' => FALSE, + 'httponly' => FALSE, 'raw' => !$decode, - 'samesite' => null, + 'samesite' => NULL, ); foreach (explode(';', $cookie) as $part) { - if (false === strpos($part, '=')) { + if (FALSE === strpos($part, '=')) { $key = trim($part); - $value = true; + $value = TRUE; } else { list($key, $value) = explode('=', trim($part), 2); $key = trim($key); @@ -61,7 +60,7 @@ class Cookie } if (!isset($data['name'])) { $data['name'] = $decode ? urldecode($key) : $key; - $data['value'] = true === $value ? null : ($decode ? urldecode($value) : $value); + $data['value'] = TRUE === $value ? NULL : ($decode ? urldecode($value) : $value); continue; } switch ($key = strtolower($key)) { @@ -69,7 +68,7 @@ class Cookie case 'value': break; case 'max-age': - $data['expires'] = time() + (int) $value; + $data['expires'] = time() + (int)$value; break; default: $data[$key] = $value; @@ -81,20 +80,19 @@ class Cookie } /** - * @param string $name The name of the cookie - * @param string|null $value The value of the cookie - * @param int|string|\DateTimeInterface $expire The time the cookie expires - * @param string $path The path on the server in which the cookie will be available on - * @param string|null $domain The domain that the cookie is available to - * @param bool $secure Whether the cookie should only be transmitted over a secure HTTPS connection from the client - * @param bool $httpOnly Whether the cookie will be made accessible only through the HTTP protocol - * @param bool $raw Whether the cookie value should be sent with no url encoding - * @param string|null $sameSite Whether the cookie will be available for cross-site requests + * @param string $name The name of the cookie + * @param string|null $value The value of the cookie + * @param int|string|\DateTimeInterface $expire The time the cookie expires + * @param string $path The path on the server in which the cookie will be available on + * @param string|null $domain The domain that the cookie is available to + * @param bool $secure Whether the cookie should only be transmitted over a secure HTTPS connection from the client + * @param bool $httpOnly Whether the cookie will be made accessible only through the HTTP protocol + * @param bool $raw Whether the cookie value should be sent with no url encoding + * @param string|null $sameSite Whether the cookie will be available for cross-site requests * * @throws \InvalidArgumentException */ - public function __construct($name, $value = null, $expire = 0, $path = '/', $domain = null, $secure = false, $httpOnly = true, $raw = false, $sameSite = null) - { + public function __construct($name, $value = NULL, $expire = 0, $path = '/', $domain = NULL, $secure = FALSE, $httpOnly = TRUE, $raw = FALSE, $sameSite = NULL) { // from PHP source code if (preg_match("/[=,; \t\r\n\013\014]/", $name)) { throw new \InvalidArgumentException(sprintf('The cookie name "%s" contains invalid characters.', $name)); @@ -107,10 +105,10 @@ class Cookie // convert expiration time to a Unix timestamp if ($expire instanceof \DateTimeInterface) { $expire = $expire->format('U'); - } elseif (!is_numeric($expire)) { + } else if (!is_numeric($expire)) { $expire = strtotime($expire); - if (false === $expire) { + if (FALSE === $expire) { throw new \InvalidArgumentException('The cookie expiration time is not valid.'); } } @@ -118,17 +116,17 @@ class Cookie $this->name = $name; $this->value = $value; $this->domain = $domain; - $this->expire = 0 < $expire ? (int) $expire : 0; + $this->expire = 0 < $expire ? (int)$expire : 0; $this->path = empty($path) ? '/' : $path; - $this->secure = (bool) $secure; - $this->httpOnly = (bool) $httpOnly; - $this->raw = (bool) $raw; + $this->secure = (bool)$secure; + $this->httpOnly = (bool)$httpOnly; + $this->raw = (bool)$raw; - if (null !== $sameSite) { + if (NULL !== $sameSite) { $sameSite = strtolower($sameSite); } - if (!in_array($sameSite, array(self::SAMESITE_LAX, self::SAMESITE_STRICT, null), true)) { + if (!in_array($sameSite, array(self::SAMESITE_LAX, self::SAMESITE_STRICT, NULL), TRUE)) { throw new \InvalidArgumentException('The "sameSite" parameter value is not valid.'); } @@ -140,38 +138,37 @@ class Cookie * * @return string The cookie */ - public function __toString() - { - $str = ($this->isRaw() ? $this->getName() : urlencode($this->getName())).'='; + public function __toString() { + $str = ($this->isRaw() ? $this->getName() : urlencode($this->getName())) . '='; - if ('' === (string) $this->getValue()) { - $str .= 'deleted; expires='.gmdate('D, d-M-Y H:i:s T', time() - 31536001).'; max-age=-31536001'; + if ('' === (string)$this->getValue()) { + $str .= 'deleted; expires=' . gmdate('D, d-M-Y H:i:s T', time() - 31536001) . '; max-age=-31536001'; } else { $str .= $this->isRaw() ? $this->getValue() : rawurlencode($this->getValue()); if (0 !== $this->getExpiresTime()) { - $str .= '; expires='.gmdate('D, d-M-Y H:i:s T', $this->getExpiresTime()).'; max-age='.$this->getMaxAge(); + $str .= '; expires=' . gmdate('D, d-M-Y H:i:s T', $this->getExpiresTime()) . '; max-age=' . $this->getMaxAge(); } } if ($this->getPath()) { - $str .= '; path='.$this->getPath(); + $str .= '; path=' . $this->getPath(); } if ($this->getDomain()) { - $str .= '; domain='.$this->getDomain(); + $str .= '; domain=' . $this->getDomain(); } - if (true === $this->isSecure()) { + if (TRUE === $this->isSecure()) { $str .= '; secure'; } - if (true === $this->isHttpOnly()) { + if (TRUE === $this->isHttpOnly()) { $str .= '; httponly'; } - if (null !== $this->getSameSite()) { - $str .= '; samesite='.$this->getSameSite(); + if (NULL !== $this->getSameSite()) { + $str .= '; samesite=' . $this->getSameSite(); } return $str; @@ -182,8 +179,7 @@ class Cookie * * @return string */ - public function getName() - { + public function getName() { return $this->name; } @@ -192,8 +188,7 @@ class Cookie * * @return string|null */ - public function getValue() - { + public function getValue() { return $this->value; } @@ -202,8 +197,7 @@ class Cookie * * @return string|null */ - public function getDomain() - { + public function getDomain() { return $this->domain; } @@ -212,8 +206,7 @@ class Cookie * * @return int */ - public function getExpiresTime() - { + public function getExpiresTime() { return $this->expire; } @@ -222,8 +215,7 @@ class Cookie * * @return int */ - public function getMaxAge() - { + public function getMaxAge() { return 0 !== $this->expire ? $this->expire - time() : 0; } @@ -232,8 +224,7 @@ class Cookie * * @return string */ - public function getPath() - { + public function getPath() { return $this->path; } @@ -242,8 +233,7 @@ class Cookie * * @return bool */ - public function isSecure() - { + public function isSecure() { return $this->secure; } @@ -252,8 +242,7 @@ class Cookie * * @return bool */ - public function isHttpOnly() - { + public function isHttpOnly() { return $this->httpOnly; } @@ -262,8 +251,7 @@ class Cookie * * @return bool */ - public function isCleared() - { + public function isCleared() { return $this->expire < time(); } @@ -272,8 +260,7 @@ class Cookie * * @return bool */ - public function isRaw() - { + public function isRaw() { return $this->raw; } @@ -282,8 +269,7 @@ class Cookie * * @return string|null */ - public function getSameSite() - { + public function getSameSite() { return $this->sameSite; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ExpressionRequestMatcher.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ExpressionRequestMatcher.php index e9c8441..19d7db3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ExpressionRequestMatcher.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ExpressionRequestMatcher.php @@ -23,25 +23,23 @@ class ExpressionRequestMatcher extends RequestMatcher private $language; private $expression; - public function setExpression(ExpressionLanguage $language, $expression) - { + public function setExpression(ExpressionLanguage $language, $expression) { $this->language = $language; $this->expression = $expression; } - public function matches(Request $request) - { + public function matches(Request $request) { if (!$this->language) { throw new \LogicException('Unable to match the request as the expression language is not available.'); } return $this->language->evaluate($this->expression, array( - 'request' => $request, - 'method' => $request->getMethod(), - 'path' => rawurldecode($request->getPathInfo()), - 'host' => $request->getHost(), - 'ip' => $request->getClientIp(), - 'attributes' => $request->attributes->all(), - )) && parent::matches($request); + 'request' => $request, + 'method' => $request->getMethod(), + 'path' => rawurldecode($request->getPathInfo()), + 'host' => $request->getHost(), + 'ip' => $request->getClientIp(), + 'attributes' => $request->attributes->all(), + )) && parent::matches($request); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/Exception/AccessDeniedException.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/Exception/AccessDeniedException.php index 3b8e41d..cecc0ac 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/Exception/AccessDeniedException.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/Exception/AccessDeniedException.php @@ -21,8 +21,7 @@ class AccessDeniedException extends FileException /** * @param string $path The path to the accessed file */ - public function __construct($path) - { + public function __construct($path) { parent::__construct(sprintf('The file %s could not be accessed', $path)); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/Exception/FileNotFoundException.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/Exception/FileNotFoundException.php index bfcc37e..b7f2029 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/Exception/FileNotFoundException.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/Exception/FileNotFoundException.php @@ -21,8 +21,7 @@ class FileNotFoundException extends FileException /** * @param string $path The path to the file that was not found */ - public function __construct($path) - { + public function __construct($path) { parent::__construct(sprintf('The file "%s" does not exist', $path)); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/Exception/UnexpectedTypeException.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/Exception/UnexpectedTypeException.php index 0444b87..fa86492 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/Exception/UnexpectedTypeException.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/Exception/UnexpectedTypeException.php @@ -13,8 +13,7 @@ namespace Symfony\Component\HttpFoundation\File\Exception; class UnexpectedTypeException extends FileException { - public function __construct($value, $expectedType) - { + public function __construct($value, $expectedType) { parent::__construct(sprintf('Expected argument of type %s, %s given', $expectedType, is_object($value) ? get_class($value) : gettype($value))); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/File.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/File.php index e2a6768..57581dc 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/File.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/File.php @@ -26,13 +26,12 @@ class File extends \SplFileInfo /** * Constructs a new file from the given path. * - * @param string $path The path to the file - * @param bool $checkPath Whether to check the path or not + * @param string $path The path to the file + * @param bool $checkPath Whether to check the path or not * * @throws FileNotFoundException If the given path is not a file */ - public function __construct($path, $checkPath = true) - { + public function __construct($path, $checkPath = TRUE) { if ($checkPath && !is_file($path)) { throw new FileNotFoundException($path); } @@ -53,8 +52,7 @@ class File extends \SplFileInfo * @see ExtensionGuesser * @see getMimeType() */ - public function guessExtension() - { + public function guessExtension() { $type = $this->getMimeType(); $guesser = ExtensionGuesser::getInstance(); @@ -72,8 +70,7 @@ class File extends \SplFileInfo * * @see MimeTypeGuesser */ - public function getMimeType() - { + public function getMimeType() { $guesser = MimeTypeGuesser::getInstance(); return $guesser->guess($this->getPathname()); @@ -83,14 +80,13 @@ class File extends \SplFileInfo * Moves the file to a new location. * * @param string $directory The destination folder - * @param string $name The new file name + * @param string $name The new file name * * @return self A File object representing the new file * * @throws FileException if the target file could not be created */ - public function move($directory, $name = null) - { + public function move($directory, $name = NULL) { $target = $this->getTargetFile($directory, $name); if (!@rename($this->getPathname(), $target)) { @@ -103,19 +99,18 @@ class File extends \SplFileInfo return $target; } - protected function getTargetFile($directory, $name = null) - { + protected function getTargetFile($directory, $name = NULL) { if (!is_dir($directory)) { - if (false === @mkdir($directory, 0777, true) && !is_dir($directory)) { + if (FALSE === @mkdir($directory, 0777, TRUE) && !is_dir($directory)) { throw new FileException(sprintf('Unable to create the "%s" directory', $directory)); } - } elseif (!is_writable($directory)) { + } else if (!is_writable($directory)) { throw new FileException(sprintf('Unable to write in the "%s" directory', $directory)); } - $target = rtrim($directory, '/\\').DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name)); + $target = rtrim($directory, '/\\') . DIRECTORY_SEPARATOR . (NULL === $name ? $this->getBasename() : $this->getName($name)); - return new self($target, false); + return new self($target, FALSE); } /** @@ -125,11 +120,10 @@ class File extends \SplFileInfo * * @return string containing */ - protected function getName($name) - { + protected function getName($name) { $originalName = str_replace('\\', '/', $name); $pos = strrpos($originalName, '/'); - $originalName = false === $pos ? $originalName : substr($originalName, $pos + 1); + $originalName = FALSE === $pos ? $originalName : substr($originalName, $pos + 1); return $originalName; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/ExtensionGuesser.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/ExtensionGuesser.php index 263fb32..af2e7a5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/ExtensionGuesser.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/ExtensionGuesser.php @@ -30,7 +30,7 @@ class ExtensionGuesser implements ExtensionGuesserInterface * * @var ExtensionGuesser */ - private static $instance = null; + private static $instance = NULL; /** * All registered ExtensionGuesserInterface instances. @@ -44,9 +44,8 @@ class ExtensionGuesser implements ExtensionGuesserInterface * * @return self */ - public static function getInstance() - { - if (null === self::$instance) { + public static function getInstance() { + if (NULL === self::$instance) { self::$instance = new self(); } @@ -56,8 +55,7 @@ class ExtensionGuesser implements ExtensionGuesserInterface /** * Registers all natively provided extension guessers. */ - private function __construct() - { + private function __construct() { $this->register(new MimeTypeExtensionGuesser()); } @@ -66,8 +64,7 @@ class ExtensionGuesser implements ExtensionGuesserInterface * * When guessing, this guesser is preferred over previously registered ones. */ - public function register(ExtensionGuesserInterface $guesser) - { + public function register(ExtensionGuesserInterface $guesser) { array_unshift($this->guessers, $guesser); } @@ -83,10 +80,9 @@ class ExtensionGuesser implements ExtensionGuesserInterface * * @return string The guessed extension or NULL, if none could be guessed */ - public function guess($mimeType) - { + public function guess($mimeType) { foreach ($this->guessers as $guesser) { - if (null !== $extension = $guesser->guess($mimeType)) { + if (NULL !== $extension = $guesser->guess($mimeType)) { return $extension; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/FileBinaryMimeTypeGuesser.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/FileBinaryMimeTypeGuesser.php index c2ac676..cdd5edb 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/FileBinaryMimeTypeGuesser.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/FileBinaryMimeTypeGuesser.php @@ -31,8 +31,7 @@ class FileBinaryMimeTypeGuesser implements MimeTypeGuesserInterface * * @param string $cmd The command to run to get the mime type of a file */ - public function __construct($cmd = 'file -b --mime %s 2>/dev/null') - { + public function __construct($cmd = 'file -b --mime %s 2>/dev/null') { $this->cmd = $cmd; } @@ -41,16 +40,14 @@ class FileBinaryMimeTypeGuesser implements MimeTypeGuesserInterface * * @return bool */ - public static function isSupported() - { + public static function isSupported() { return '\\' !== DIRECTORY_SEPARATOR && function_exists('passthru') && function_exists('escapeshellarg'); } /** * {@inheritdoc} */ - public function guess($path) - { + public function guess($path) { if (!is_file($path)) { throw new FileNotFoundException($path); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/FileinfoMimeTypeGuesser.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/FileinfoMimeTypeGuesser.php index 9b42835..9ea874b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/FileinfoMimeTypeGuesser.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/FileinfoMimeTypeGuesser.php @@ -28,8 +28,7 @@ class FileinfoMimeTypeGuesser implements MimeTypeGuesserInterface * * @see http://www.php.net/manual/en/function.finfo-open.php */ - public function __construct($magicFile = null) - { + public function __construct($magicFile = NULL) { $this->magicFile = $magicFile; } @@ -38,16 +37,14 @@ class FileinfoMimeTypeGuesser implements MimeTypeGuesserInterface * * @return bool */ - public static function isSupported() - { + public static function isSupported() { return function_exists('finfo_open'); } /** * {@inheritdoc} */ - public function guess($path) - { + public function guess($path) { if (!is_file($path)) { throw new FileNotFoundException($path); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/MimeTypeExtensionGuesser.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/MimeTypeExtensionGuesser.php index 77bf51b..66cddbf 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/MimeTypeExtensionGuesser.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/MimeTypeExtensionGuesser.php @@ -801,8 +801,7 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface /** * {@inheritdoc} */ - public function guess($mimeType) - { - return isset($this->defaultExtensions[$mimeType]) ? $this->defaultExtensions[$mimeType] : null; + public function guess($mimeType) { + return isset($this->defaultExtensions[$mimeType]) ? $this->defaultExtensions[$mimeType] : NULL; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/MimeTypeGuesser.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/MimeTypeGuesser.php index e3ef45e..256b195 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/MimeTypeGuesser.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/MimeType/MimeTypeGuesser.php @@ -44,7 +44,7 @@ class MimeTypeGuesser implements MimeTypeGuesserInterface * * @var MimeTypeGuesser */ - private static $instance = null; + private static $instance = NULL; /** * All registered MimeTypeGuesserInterface instances. @@ -58,9 +58,8 @@ class MimeTypeGuesser implements MimeTypeGuesserInterface * * @return self */ - public static function getInstance() - { - if (null === self::$instance) { + public static function getInstance() { + if (NULL === self::$instance) { self::$instance = new self(); } @@ -70,16 +69,14 @@ class MimeTypeGuesser implements MimeTypeGuesserInterface /** * Resets the singleton instance. */ - public static function reset() - { - self::$instance = null; + public static function reset() { + self::$instance = NULL; } /** * Registers all natively provided mime type guessers. */ - private function __construct() - { + private function __construct() { if (FileBinaryMimeTypeGuesser::isSupported()) { $this->register(new FileBinaryMimeTypeGuesser()); } @@ -94,8 +91,7 @@ class MimeTypeGuesser implements MimeTypeGuesserInterface * * When guessing, this guesser is preferred over previously registered ones. */ - public function register(MimeTypeGuesserInterface $guesser) - { + public function register(MimeTypeGuesserInterface $guesser) { array_unshift($this->guessers, $guesser); } @@ -115,8 +111,7 @@ class MimeTypeGuesser implements MimeTypeGuesserInterface * @throws FileNotFoundException * @throws AccessDeniedException */ - public function guess($path) - { + public function guess($path) { if (!is_file($path)) { throw new FileNotFoundException($path); } @@ -134,7 +129,7 @@ class MimeTypeGuesser implements MimeTypeGuesserInterface } foreach ($this->guessers as $guesser) { - if (null !== $mimeType = $guesser->guess($path)) { + if (NULL !== $mimeType = $guesser->guess($path)) { return $mimeType; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/Stream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/Stream.php index 69ae74c..f48bcdd 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/Stream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/Stream.php @@ -21,8 +21,7 @@ class Stream extends File /** * {@inheritdoc} */ - public function getSize() - { - return false; + public function getSize() { + return FALSE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/UploadedFile.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/UploadedFile.php index 082d8d5..93382e7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/UploadedFile.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/File/UploadedFile.php @@ -24,7 +24,7 @@ use Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser; */ class UploadedFile extends File { - private $test = false; + private $test = FALSE; private $originalName; private $mimeType; private $size; @@ -44,24 +44,23 @@ class UploadedFile extends File * * Calling any other method on an non-valid instance will cause an unpredictable result. * - * @param string $path The full temporary path to the file - * @param string $originalName The original file name of the uploaded file - * @param string|null $mimeType The type of the file as provided by PHP; null defaults to application/octet-stream - * @param int|null $size The file size provided by the uploader - * @param int|null $error The error constant of the upload (one of PHP's UPLOAD_ERR_XXX constants); null defaults to UPLOAD_ERR_OK - * @param bool $test Whether the test mode is active + * @param string $path The full temporary path to the file + * @param string $originalName The original file name of the uploaded file + * @param string|null $mimeType The type of the file as provided by PHP; null defaults to application/octet-stream + * @param int|null $size The file size provided by the uploader + * @param int|null $error The error constant of the upload (one of PHP's UPLOAD_ERR_XXX constants); null defaults to UPLOAD_ERR_OK + * @param bool $test Whether the test mode is active * Local files are used in test mode hence the code should not enforce HTTP uploads * * @throws FileException If file_uploads is disabled * @throws FileNotFoundException If the file does not exist */ - public function __construct($path, $originalName, $mimeType = null, $size = null, $error = null, $test = false) - { + public function __construct($path, $originalName, $mimeType = NULL, $size = NULL, $error = NULL, $test = FALSE) { $this->originalName = $this->getName($originalName); $this->mimeType = $mimeType ?: 'application/octet-stream'; $this->size = $size; $this->error = $error ?: UPLOAD_ERR_OK; - $this->test = (bool) $test; + $this->test = (bool)$test; parent::__construct($path, UPLOAD_ERR_OK === $this->error); } @@ -74,8 +73,7 @@ class UploadedFile extends File * * @return string|null The original name */ - public function getClientOriginalName() - { + public function getClientOriginalName() { return $this->originalName; } @@ -87,8 +85,7 @@ class UploadedFile extends File * * @return string The extension */ - public function getClientOriginalExtension() - { + public function getClientOriginalExtension() { return pathinfo($this->originalName, PATHINFO_EXTENSION); } @@ -105,8 +102,7 @@ class UploadedFile extends File * * @see getMimeType() */ - public function getClientMimeType() - { + public function getClientMimeType() { return $this->mimeType; } @@ -127,8 +123,7 @@ class UploadedFile extends File * @see guessExtension() * @see getClientMimeType() */ - public function guessClientExtension() - { + public function guessClientExtension() { $type = $this->getClientMimeType(); $guesser = ExtensionGuesser::getInstance(); @@ -143,8 +138,7 @@ class UploadedFile extends File * * @return int|null The file size */ - public function getClientSize() - { + public function getClientSize() { return $this->size; } @@ -156,8 +150,7 @@ class UploadedFile extends File * * @return int The upload error */ - public function getError() - { + public function getError() { return $this->error; } @@ -166,8 +159,7 @@ class UploadedFile extends File * * @return bool True if the file has been uploaded with HTTP and no error occurred */ - public function isValid() - { + public function isValid() { $isOk = UPLOAD_ERR_OK === $this->error; return $this->test ? $isOk : $isOk && is_uploaded_file($this->getPathname()); @@ -177,14 +169,13 @@ class UploadedFile extends File * Moves the file to a new location. * * @param string $directory The destination folder - * @param string $name The new file name + * @param string $name The new file name * * @return File A File object representing the new file * * @throws FileException if, for any reason, the file could not have been moved */ - public function move($directory, $name = null) - { + public function move($directory, $name = NULL) { if ($this->isValid()) { if ($this->test) { return parent::move($directory, $name); @@ -210,8 +201,7 @@ class UploadedFile extends File * * @return int The maximum size of an uploaded file in bytes */ - public static function getMaxFilesize() - { + public static function getMaxFilesize() { $iniMax = strtolower(ini_get('upload_max_filesize')); if ('' === $iniMax) { @@ -221,20 +211,24 @@ class UploadedFile extends File $max = ltrim($iniMax, '+'); if (0 === strpos($max, '0x')) { $max = intval($max, 16); - } elseif (0 === strpos($max, '0')) { + } else if (0 === strpos($max, '0')) { $max = intval($max, 8); } else { - $max = (int) $max; + $max = (int)$max; } switch (substr($iniMax, -1)) { - case 't': $max *= 1024; + case 't': + $max *= 1024; // no break - case 'g': $max *= 1024; + case 'g': + $max *= 1024; // no break - case 'm': $max *= 1024; + case 'm': + $max *= 1024; // no break - case 'k': $max *= 1024; + case 'k': + $max *= 1024; } return $max; @@ -245,8 +239,7 @@ class UploadedFile extends File * * @return string The error message regarding the specified error code */ - public function getErrorMessage() - { + public function getErrorMessage() { static $errors = array( UPLOAD_ERR_INI_SIZE => 'The file "%s" exceeds your upload_max_filesize ini directive (limit is %d KiB).', UPLOAD_ERR_FORM_SIZE => 'The file "%s" exceeds the upload limit defined in your form.', diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/FileBag.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/FileBag.php index 5edd0e6..9d344e8 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/FileBag.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/FileBag.php @@ -26,16 +26,14 @@ class FileBag extends ParameterBag /** * @param array $parameters An array of HTTP files */ - public function __construct(array $parameters = array()) - { + public function __construct(array $parameters = array()) { $this->replace($parameters); } /** * {@inheritdoc} */ - public function replace(array $files = array()) - { + public function replace(array $files = array()) { $this->parameters = array(); $this->add($files); } @@ -43,8 +41,7 @@ class FileBag extends ParameterBag /** * {@inheritdoc} */ - public function set($key, $value) - { + public function set($key, $value) { if (!is_array($value) && !$value instanceof UploadedFile) { throw new \InvalidArgumentException('An uploaded file must be an array or an instance of UploadedFile.'); } @@ -55,8 +52,7 @@ class FileBag extends ParameterBag /** * {@inheritdoc} */ - public function add(array $files = array()) - { + public function add(array $files = array()) { foreach ($files as $key => $file) { $this->set($key, $file); } @@ -69,8 +65,7 @@ class FileBag extends ParameterBag * * @return UploadedFile[]|UploadedFile|null A (multi-dimensional) array of UploadedFile instances */ - protected function convertFileInformation($file) - { + protected function convertFileInformation($file) { if ($file instanceof UploadedFile) { return $file; } @@ -82,7 +77,7 @@ class FileBag extends ParameterBag if ($keys == self::$fileKeys) { if (UPLOAD_ERR_NO_FILE == $file['error']) { - $file = null; + $file = NULL; } else { $file = new UploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['size'], $file['error']); } @@ -111,8 +106,7 @@ class FileBag extends ParameterBag * * @return array */ - protected function fixPhpFilesArray($data) - { + protected function fixPhpFilesArray($data) { if (!is_array($data)) { return $data; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/HeaderBag.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/HeaderBag.php index 7aaa52a..6bcba55 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/HeaderBag.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/HeaderBag.php @@ -24,8 +24,7 @@ class HeaderBag implements \IteratorAggregate, \Countable /** * @param array $headers An array of HTTP headers */ - public function __construct(array $headers = array()) - { + public function __construct(array $headers = array()) { foreach ($headers as $key => $values) { $this->set($key, $values); } @@ -36,8 +35,7 @@ class HeaderBag implements \IteratorAggregate, \Countable * * @return string The headers */ - public function __toString() - { + public function __toString() { if (!$headers = $this->all()) { return ''; } @@ -48,7 +46,7 @@ class HeaderBag implements \IteratorAggregate, \Countable foreach ($headers as $name => $values) { $name = implode('-', array_map('ucfirst', explode('-', $name))); foreach ($values as $value) { - $content .= sprintf("%-{$max}s %s\r\n", $name.':', $value); + $content .= sprintf("%-{$max}s %s\r\n", $name . ':', $value); } } @@ -60,8 +58,7 @@ class HeaderBag implements \IteratorAggregate, \Countable * * @return array An array of headers */ - public function all() - { + public function all() { return $this->headers; } @@ -70,8 +67,7 @@ class HeaderBag implements \IteratorAggregate, \Countable * * @return array An array of parameter keys */ - public function keys() - { + public function keys() { return array_keys($this->all()); } @@ -80,8 +76,7 @@ class HeaderBag implements \IteratorAggregate, \Countable * * @param array $headers An array of HTTP headers */ - public function replace(array $headers = array()) - { + public function replace(array $headers = array()) { $this->headers = array(); $this->add($headers); } @@ -91,8 +86,7 @@ class HeaderBag implements \IteratorAggregate, \Countable * * @param array $headers An array of HTTP headers */ - public function add(array $headers) - { + public function add(array $headers) { foreach ($headers as $key => $values) { $this->set($key, $values); } @@ -101,20 +95,19 @@ class HeaderBag implements \IteratorAggregate, \Countable /** * Returns a header value by name. * - * @param string $key The header name + * @param string $key The header name * @param string|string[] $default The default value - * @param bool $first Whether to return the first value or all header values + * @param bool $first Whether to return the first value or all header values * * @return string|string[] The first header value or default value if $first is true, an array of values otherwise */ - public function get($key, $default = null, $first = true) - { + public function get($key, $default = NULL, $first = TRUE) { $key = str_replace('_', '-', strtolower($key)); $headers = $this->all(); if (!array_key_exists($key, $headers)) { - if (null === $default) { - return $first ? null : array(); + if (NULL === $default) { + return $first ? NULL : array(); } return $first ? $default : array($default); @@ -130,24 +123,23 @@ class HeaderBag implements \IteratorAggregate, \Countable /** * Sets a header by name. * - * @param string $key The key - * @param string|string[] $values The value or an array of values - * @param bool $replace Whether to replace the actual value or not (true by default) + * @param string $key The key + * @param string|string[] $values The value or an array of values + * @param bool $replace Whether to replace the actual value or not (true by default) */ - public function set($key, $values, $replace = true) - { + public function set($key, $values, $replace = TRUE) { $key = str_replace('_', '-', strtolower($key)); if (\is_array($values)) { $values = array_values($values); - if (true === $replace || !isset($this->headers[$key])) { + if (TRUE === $replace || !isset($this->headers[$key])) { $this->headers[$key] = $values; } else { $this->headers[$key] = array_merge($this->headers[$key], $values); } } else { - if (true === $replace || !isset($this->headers[$key])) { + if (TRUE === $replace || !isset($this->headers[$key])) { $this->headers[$key] = array($values); } else { $this->headers[$key][] = $values; @@ -166,22 +158,20 @@ class HeaderBag implements \IteratorAggregate, \Countable * * @return bool true if the parameter exists, false otherwise */ - public function has($key) - { + public function has($key) { return array_key_exists(str_replace('_', '-', strtolower($key)), $this->all()); } /** * Returns true if the given HTTP header contains the given value. * - * @param string $key The HTTP header name + * @param string $key The HTTP header name * @param string $value The HTTP value * * @return bool true if the value is contained in the header, false otherwise */ - public function contains($key, $value) - { - return in_array($value, $this->get($key, null, false)); + public function contains($key, $value) { + return in_array($value, $this->get($key, NULL, FALSE)); } /** @@ -189,8 +179,7 @@ class HeaderBag implements \IteratorAggregate, \Countable * * @param string $key The HTTP header name */ - public function remove($key) - { + public function remove($key) { $key = str_replace('_', '-', strtolower($key)); unset($this->headers[$key]); @@ -203,20 +192,19 @@ class HeaderBag implements \IteratorAggregate, \Countable /** * Returns the HTTP header value converted to a date. * - * @param string $key The parameter key + * @param string $key The parameter key * @param \DateTime $default The default value * * @return null|\DateTime The parsed DateTime or the default value if the header does not exist * * @throws \RuntimeException When the HTTP header is not parseable */ - public function getDate($key, \DateTime $default = null) - { - if (null === $value = $this->get($key)) { + public function getDate($key, \DateTime $default = NULL) { + if (NULL === $value = $this->get($key)) { return $default; } - if (false === $date = \DateTime::createFromFormat(DATE_RFC2822, $value)) { + if (FALSE === $date = \DateTime::createFromFormat(DATE_RFC2822, $value)) { throw new \RuntimeException(sprintf('The %s HTTP header is not parseable (%s).', $key, $value)); } @@ -226,11 +214,10 @@ class HeaderBag implements \IteratorAggregate, \Countable /** * Adds a custom Cache-Control directive. * - * @param string $key The Cache-Control directive name - * @param mixed $value The Cache-Control directive value + * @param string $key The Cache-Control directive name + * @param mixed $value The Cache-Control directive value */ - public function addCacheControlDirective($key, $value = true) - { + public function addCacheControlDirective($key, $value = TRUE) { $this->cacheControl[$key] = $value; $this->set('Cache-Control', $this->getCacheControlHeader()); @@ -243,8 +230,7 @@ class HeaderBag implements \IteratorAggregate, \Countable * * @return bool true if the directive exists, false otherwise */ - public function hasCacheControlDirective($key) - { + public function hasCacheControlDirective($key) { return array_key_exists($key, $this->cacheControl); } @@ -255,9 +241,8 @@ class HeaderBag implements \IteratorAggregate, \Countable * * @return mixed|null The directive value if defined, null otherwise */ - public function getCacheControlDirective($key) - { - return array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : null; + public function getCacheControlDirective($key) { + return array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : NULL; } /** @@ -265,8 +250,7 @@ class HeaderBag implements \IteratorAggregate, \Countable * * @param string $key The Cache-Control directive */ - public function removeCacheControlDirective($key) - { + public function removeCacheControlDirective($key) { unset($this->cacheControl[$key]); $this->set('Cache-Control', $this->getCacheControlHeader()); @@ -277,8 +261,7 @@ class HeaderBag implements \IteratorAggregate, \Countable * * @return \ArrayIterator An \ArrayIterator instance */ - public function getIterator() - { + public function getIterator() { return new \ArrayIterator($this->headers); } @@ -287,21 +270,19 @@ class HeaderBag implements \IteratorAggregate, \Countable * * @return int The number of headers */ - public function count() - { + public function count() { return count($this->headers); } - protected function getCacheControlHeader() - { + protected function getCacheControlHeader() { $parts = array(); ksort($this->cacheControl); foreach ($this->cacheControl as $key => $value) { - if (true === $value) { + if (TRUE === $value) { $parts[] = $key; } else { if (preg_match('#[^a-zA-Z0-9._-]#', $value)) { - $value = '"'.$value.'"'; + $value = '"' . $value . '"'; } $parts[] = "$key=$value"; @@ -318,12 +299,11 @@ class HeaderBag implements \IteratorAggregate, \Countable * * @return array An array representing the attribute values */ - protected function parseCacheControl($header) - { + protected function parseCacheControl($header) { $cacheControl = array(); preg_match_all('#([a-zA-Z][a-zA-Z_-]*)\s*(?:=(?:"([^"]*)"|([^ \t",;]*)))?#', $header, $matches, PREG_SET_ORDER); foreach ($matches as $match) { - $cacheControl[strtolower($match[1])] = isset($match[3]) ? $match[3] : (isset($match[2]) ? $match[2] : true); + $cacheControl[strtolower($match[1])] = isset($match[3]) ? $match[3] : (isset($match[2]) ? $match[2] : TRUE); } return $cacheControl; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/IpUtils.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/IpUtils.php index 86d135b..feeef30 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/IpUtils.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/IpUtils.php @@ -23,20 +23,18 @@ class IpUtils /** * This class should not be instantiated. */ - private function __construct() - { + private function __construct() { } /** * Checks if an IPv4 or IPv6 address is contained in the list of given IPs or subnets. * - * @param string $requestIp IP to check - * @param string|array $ips List of IPs or subnets (can be a string if only a single one) + * @param string $requestIp IP to check + * @param string|array $ips List of IPs or subnets (can be a string if only a single one) * * @return bool Whether the IP is valid */ - public static function checkIp($requestIp, $ips) - { + public static function checkIp($requestIp, $ips) { if (!is_array($ips)) { $ips = array($ips); } @@ -45,11 +43,11 @@ class IpUtils foreach ($ips as $ip) { if (self::$method($requestIp, $ip)) { - return true; + return TRUE; } } - return false; + return FALSE; } /** @@ -57,22 +55,21 @@ class IpUtils * In case a subnet is given, it checks if it contains the request IP. * * @param string $requestIp IPv4 address to check - * @param string $ip IPv4 address or subnet in CIDR notation + * @param string $ip IPv4 address or subnet in CIDR notation * * @return bool Whether the request IP matches the IP, or whether the request IP is within the CIDR subnet */ - public static function checkIp4($requestIp, $ip) - { - $cacheKey = $requestIp.'-'.$ip; + public static function checkIp4($requestIp, $ip) { + $cacheKey = $requestIp . '-' . $ip; if (isset(self::$checkedIps[$cacheKey])) { return self::$checkedIps[$cacheKey]; } if (!filter_var($requestIp, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { - return self::$checkedIps[$cacheKey] = false; + return self::$checkedIps[$cacheKey] = FALSE; } - if (false !== strpos($ip, '/')) { + if (FALSE !== strpos($ip, '/')) { list($address, $netmask) = explode('/', $ip, 2); if ('0' === $netmask) { @@ -80,15 +77,15 @@ class IpUtils } if ($netmask < 0 || $netmask > 32) { - return self::$checkedIps[$cacheKey] = false; + return self::$checkedIps[$cacheKey] = FALSE; } } else { $address = $ip; $netmask = 32; } - if (false === ip2long($address)) { - return self::$checkedIps[$cacheKey] = false; + if (FALSE === ip2long($address)) { + return self::$checkedIps[$cacheKey] = FALSE; } return self::$checkedIps[$cacheKey] = 0 === substr_compare(sprintf('%032b', ip2long($requestIp)), sprintf('%032b', ip2long($address)), 0, $netmask); @@ -103,15 +100,14 @@ class IpUtils * @see https://github.com/dsp/v6tools * * @param string $requestIp IPv6 address to check - * @param string $ip IPv6 address or subnet in CIDR notation + * @param string $ip IPv6 address or subnet in CIDR notation * * @return bool Whether the IP is valid * * @throws \RuntimeException When IPV6 support is not enabled */ - public static function checkIp6($requestIp, $ip) - { - $cacheKey = $requestIp.'-'.$ip; + public static function checkIp6($requestIp, $ip) { + $cacheKey = $requestIp . '-' . $ip; if (isset(self::$checkedIps[$cacheKey])) { return self::$checkedIps[$cacheKey]; } @@ -120,15 +116,15 @@ class IpUtils throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".'); } - if (false !== strpos($ip, '/')) { + if (FALSE !== strpos($ip, '/')) { list($address, $netmask) = explode('/', $ip, 2); if ('0' === $netmask) { - return (bool) unpack('n*', @inet_pton($address)); + return (bool)unpack('n*', @inet_pton($address)); } if ($netmask < 1 || $netmask > 128) { - return self::$checkedIps[$cacheKey] = false; + return self::$checkedIps[$cacheKey] = FALSE; } } else { $address = $ip; @@ -139,7 +135,7 @@ class IpUtils $bytesTest = unpack('n*', @inet_pton($requestIp)); if (!$bytesAddr || !$bytesTest) { - return self::$checkedIps[$cacheKey] = false; + return self::$checkedIps[$cacheKey] = FALSE; } for ($i = 1, $ceil = ceil($netmask / 16); $i <= $ceil; ++$i) { @@ -147,10 +143,10 @@ class IpUtils $left = ($left <= 16) ? $left : 16; $mask = ~(0xffff >> $left) & 0xffff; if (($bytesAddr[$i] & $mask) != ($bytesTest[$i] & $mask)) { - return self::$checkedIps[$cacheKey] = false; + return self::$checkedIps[$cacheKey] = FALSE; } } - return self::$checkedIps[$cacheKey] = true; + return self::$checkedIps[$cacheKey] = TRUE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/JsonResponse.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/JsonResponse.php index 137ac33..411c4f3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/JsonResponse.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/JsonResponse.php @@ -34,16 +34,15 @@ class JsonResponse extends Response protected $encodingOptions = self::DEFAULT_ENCODING_OPTIONS; /** - * @param mixed $data The response data - * @param int $status The response status code + * @param mixed $data The response data + * @param int $status The response status code * @param array $headers An array of response headers - * @param bool $json If the data is already a JSON string + * @param bool $json If the data is already a JSON string */ - public function __construct($data = null, $status = 200, $headers = array(), $json = false) - { + public function __construct($data = NULL, $status = 200, $headers = array(), $json = FALSE) { parent::__construct('', $status, $headers); - if (null === $data) { + if (NULL === $data) { $data = new \ArrayObject(); } @@ -58,23 +57,21 @@ class JsonResponse extends Response * return JsonResponse::create($data, 200) * ->setSharedMaxAge(300); * - * @param mixed $data The json response data - * @param int $status The response status code + * @param mixed $data The json response data + * @param int $status The response status code * @param array $headers An array of response headers * * @return static */ - public static function create($data = null, $status = 200, $headers = array()) - { + public static function create($data = NULL, $status = 200, $headers = array()) { return new static($data, $status, $headers); } /** * Make easier the creation of JsonResponse from raw json. */ - public static function fromJsonString($data = null, $status = 200, $headers = array()) - { - return new static($data, $status, $headers, true); + public static function fromJsonString($data = NULL, $status = 200, $headers = array()) { + return new static($data, $status, $headers, TRUE); } /** @@ -86,9 +83,8 @@ class JsonResponse extends Response * * @throws \InvalidArgumentException When the callback name is not valid */ - public function setCallback($callback = null) - { - if (null !== $callback) { + public function setCallback($callback = NULL) { + if (NULL !== $callback) { // partially taken from http://www.geekality.net/2011/08/03/valid-javascript-identifier/ // partially taken from https://github.com/willdurand/JsonpCallbackValidator // JsonpCallbackValidator is released under the MIT License. See https://github.com/willdurand/JsonpCallbackValidator/blob/v1.1.0/LICENSE for details. @@ -96,12 +92,12 @@ class JsonResponse extends Response $pattern = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*(?:\[(?:"(?:\\\.|[^"\\\])*"|\'(?:\\\.|[^\'\\\])*\'|\d+)\])*?$/u'; $reserved = array( 'break', 'do', 'instanceof', 'typeof', 'case', 'else', 'new', 'var', 'catch', 'finally', 'return', 'void', 'continue', 'for', 'switch', 'while', - 'debugger', 'function', 'this', 'with', 'default', 'if', 'throw', 'delete', 'in', 'try', 'class', 'enum', 'extends', 'super', 'const', 'export', + 'debugger', 'function', 'this', 'with', 'default', 'if', 'throw', 'delete', 'in', 'try', 'class', 'enum', 'extends', 'super', 'const', 'export', 'import', 'implements', 'let', 'private', 'public', 'yield', 'interface', 'package', 'protected', 'static', 'null', 'true', 'false', ); $parts = explode('.', $callback); foreach ($parts as $part) { - if (!preg_match($pattern, $part) || in_array($part, $reserved, true)) { + if (!preg_match($pattern, $part) || in_array($part, $reserved, TRUE)) { throw new \InvalidArgumentException('The callback name is not valid.'); } } @@ -121,8 +117,7 @@ class JsonResponse extends Response * * @throws \InvalidArgumentException */ - public function setJson($json) - { + public function setJson($json) { $this->data = $json; return $this->update(); @@ -137,16 +132,17 @@ class JsonResponse extends Response * * @throws \InvalidArgumentException */ - public function setData($data = array()) - { + public function setData($data = array()) { if (defined('HHVM_VERSION')) { // HHVM does not trigger any warnings and let exceptions // thrown from a JsonSerializable object pass through. // If only PHP did the same... $data = json_encode($data, $this->encodingOptions); } else { - if (!interface_exists('JsonSerializable', false)) { - set_error_handler(function () { return false; }); + if (!interface_exists('JsonSerializable', FALSE)) { + set_error_handler(function () { + return FALSE; + }); try { $data = @json_encode($data, $this->encodingOptions); } finally { @@ -176,8 +172,7 @@ class JsonResponse extends Response * * @return int */ - public function getEncodingOptions() - { + public function getEncodingOptions() { return $this->encodingOptions; } @@ -188,9 +183,8 @@ class JsonResponse extends Response * * @return $this */ - public function setEncodingOptions($encodingOptions) - { - $this->encodingOptions = (int) $encodingOptions; + public function setEncodingOptions($encodingOptions) { + $this->encodingOptions = (int)$encodingOptions; return $this->setData(json_decode($this->data)); } @@ -200,9 +194,8 @@ class JsonResponse extends Response * * @return $this */ - protected function update() - { - if (null !== $this->callback) { + protected function update() { + if (NULL !== $this->callback) { // Not using application/javascript for compatibility reasons with older browsers. $this->headers->set('Content-Type', 'text/javascript'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ParameterBag.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ParameterBag.php index 257ef8b..3116b82 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ParameterBag.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ParameterBag.php @@ -26,8 +26,7 @@ class ParameterBag implements \IteratorAggregate, \Countable /** * @param array $parameters An array of parameters */ - public function __construct(array $parameters = array()) - { + public function __construct(array $parameters = array()) { $this->parameters = $parameters; } @@ -36,8 +35,7 @@ class ParameterBag implements \IteratorAggregate, \Countable * * @return array An array of parameters */ - public function all() - { + public function all() { return $this->parameters; } @@ -46,8 +44,7 @@ class ParameterBag implements \IteratorAggregate, \Countable * * @return array An array of parameter keys */ - public function keys() - { + public function keys() { return array_keys($this->parameters); } @@ -56,8 +53,7 @@ class ParameterBag implements \IteratorAggregate, \Countable * * @param array $parameters An array of parameters */ - public function replace(array $parameters = array()) - { + public function replace(array $parameters = array()) { $this->parameters = $parameters; } @@ -66,32 +62,29 @@ class ParameterBag implements \IteratorAggregate, \Countable * * @param array $parameters An array of parameters */ - public function add(array $parameters = array()) - { + public function add(array $parameters = array()) { $this->parameters = array_replace($this->parameters, $parameters); } /** * Returns a parameter by name. * - * @param string $key The key - * @param mixed $default The default value if the parameter key does not exist + * @param string $key The key + * @param mixed $default The default value if the parameter key does not exist * * @return mixed */ - public function get($key, $default = null) - { + public function get($key, $default = NULL) { return array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default; } /** * Sets a parameter by name. * - * @param string $key The key - * @param mixed $value The value + * @param string $key The key + * @param mixed $value The value */ - public function set($key, $value) - { + public function set($key, $value) { $this->parameters[$key] = $value; } @@ -102,8 +95,7 @@ class ParameterBag implements \IteratorAggregate, \Countable * * @return bool true if the parameter exists, false otherwise */ - public function has($key) - { + public function has($key) { return array_key_exists($key, $this->parameters); } @@ -112,47 +104,43 @@ class ParameterBag implements \IteratorAggregate, \Countable * * @param string $key The key */ - public function remove($key) - { + public function remove($key) { unset($this->parameters[$key]); } /** * Returns the alphabetic characters of the parameter value. * - * @param string $key The parameter key + * @param string $key The parameter key * @param string $default The default value if the parameter key does not exist * * @return string The filtered value */ - public function getAlpha($key, $default = '') - { + public function getAlpha($key, $default = '') { return preg_replace('/[^[:alpha:]]/', '', $this->get($key, $default)); } /** * Returns the alphabetic characters and digits of the parameter value. * - * @param string $key The parameter key + * @param string $key The parameter key * @param string $default The default value if the parameter key does not exist * * @return string The filtered value */ - public function getAlnum($key, $default = '') - { + public function getAlnum($key, $default = '') { return preg_replace('/[^[:alnum:]]/', '', $this->get($key, $default)); } /** * Returns the digits of the parameter value. * - * @param string $key The parameter key + * @param string $key The parameter key * @param string $default The default value if the parameter key does not exist * * @return string The filtered value */ - public function getDigits($key, $default = '') - { + public function getDigits($key, $default = '') { // we need to remove - and + because they're allowed in the filter return str_replace(array('-', '+'), '', $this->filter($key, $default, FILTER_SANITIZE_NUMBER_INT)); } @@ -160,43 +148,40 @@ class ParameterBag implements \IteratorAggregate, \Countable /** * Returns the parameter value converted to integer. * - * @param string $key The parameter key - * @param int $default The default value if the parameter key does not exist + * @param string $key The parameter key + * @param int $default The default value if the parameter key does not exist * * @return int The filtered value */ - public function getInt($key, $default = 0) - { - return (int) $this->get($key, $default); + public function getInt($key, $default = 0) { + return (int)$this->get($key, $default); } /** * Returns the parameter value converted to boolean. * - * @param string $key The parameter key - * @param mixed $default The default value if the parameter key does not exist + * @param string $key The parameter key + * @param mixed $default The default value if the parameter key does not exist * * @return bool The filtered value */ - public function getBoolean($key, $default = false) - { + public function getBoolean($key, $default = FALSE) { return $this->filter($key, $default, FILTER_VALIDATE_BOOLEAN); } /** * Filter key. * - * @param string $key Key - * @param mixed $default Default = null - * @param int $filter FILTER_* constant - * @param mixed $options Filter options + * @param string $key Key + * @param mixed $default Default = null + * @param int $filter FILTER_* constant + * @param mixed $options Filter options * * @see http://php.net/manual/en/function.filter-var.php * * @return mixed */ - public function filter($key, $default = null, $filter = FILTER_DEFAULT, $options = array()) - { + public function filter($key, $default = NULL, $filter = FILTER_DEFAULT, $options = array()) { $value = $this->get($key, $default); // Always turn $options into an array - this allows filter_var option shortcuts. @@ -217,8 +202,7 @@ class ParameterBag implements \IteratorAggregate, \Countable * * @return \ArrayIterator An \ArrayIterator instance */ - public function getIterator() - { + public function getIterator() { return new \ArrayIterator($this->parameters); } @@ -227,8 +211,7 @@ class ParameterBag implements \IteratorAggregate, \Countable * * @return int The number of parameters */ - public function count() - { + public function count() { return count($this->parameters); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/RedirectResponse.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/RedirectResponse.php index 01681dc..cfc2a97 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/RedirectResponse.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/RedirectResponse.php @@ -23,17 +23,16 @@ class RedirectResponse extends Response /** * Creates a redirect response so that it conforms to the rules defined for a redirect status code. * - * @param string $url The URL to redirect to. The URL should be a full URL, with schema etc., + * @param string $url The URL to redirect to. The URL should be a full URL, with schema etc., * but practically every browser redirects on paths only as well - * @param int $status The status code (302 by default) - * @param array $headers The headers (Location is always set to the given URL) + * @param int $status The status code (302 by default) + * @param array $headers The headers (Location is always set to the given URL) * * @throws \InvalidArgumentException * * @see http://tools.ietf.org/html/rfc2616#section-10.3 */ - public function __construct($url, $status = 302, $headers = array()) - { + public function __construct($url, $status = 302, $headers = array()) { parent::__construct('', $status, $headers); $this->setTargetUrl($url); @@ -50,14 +49,13 @@ class RedirectResponse extends Response /** * Factory method for chainability. * - * @param string $url The url to redirect to - * @param int $status The response status code - * @param array $headers An array of response headers + * @param string $url The url to redirect to + * @param int $status The response status code + * @param array $headers An array of response headers * * @return static */ - public static function create($url = '', $status = 302, $headers = array()) - { + public static function create($url = '', $status = 302, $headers = array()) { return new static($url, $status, $headers); } @@ -66,8 +64,7 @@ class RedirectResponse extends Response * * @return string target URL */ - public function getTargetUrl() - { + public function getTargetUrl() { return $this->targetUrl; } @@ -80,8 +77,7 @@ class RedirectResponse extends Response * * @throws \InvalidArgumentException */ - public function setTargetUrl($url) - { + public function setTargetUrl($url) { if (empty($url)) { throw new \InvalidArgumentException('Cannot redirect to an empty URL.'); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Request.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Request.php index 164fb4e..4f95400 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Request.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Request.php @@ -92,7 +92,7 @@ class Request self::HEADER_CLIENT_PORT => 'X_FORWARDED_PORT', ); - protected static $httpMethodParameterOverride = false; + protected static $httpMethodParameterOverride = FALSE; /** * Custom parameters. @@ -220,8 +220,8 @@ class Request protected static $requestFactory; - private $isHostValid = true; - private $isForwardedValid = true; + private $isHostValid = TRUE; + private $isForwardedValid = TRUE; private static $trustedHeaderSet = -1; @@ -242,16 +242,15 @@ class Request ); /** - * @param array $query The GET parameters - * @param array $request The POST parameters - * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) - * @param array $cookies The COOKIE parameters - * @param array $files The FILES parameters - * @param array $server The SERVER parameters - * @param string|resource|null $content The raw body data + * @param array $query The GET parameters + * @param array $request The POST parameters + * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) + * @param array $cookies The COOKIE parameters + * @param array $files The FILES parameters + * @param array $server The SERVER parameters + * @param string|resource|null $content The raw body data */ - public function __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) - { + public function __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = NULL) { $this->initialize($query, $request, $attributes, $cookies, $files, $server, $content); } @@ -260,16 +259,15 @@ class Request * * This method also re-initializes all properties. * - * @param array $query The GET parameters - * @param array $request The POST parameters - * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) - * @param array $cookies The COOKIE parameters - * @param array $files The FILES parameters - * @param array $server The SERVER parameters - * @param string|resource|null $content The raw body data + * @param array $query The GET parameters + * @param array $request The POST parameters + * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) + * @param array $cookies The COOKIE parameters + * @param array $files The FILES parameters + * @param array $server The SERVER parameters + * @param string|resource|null $content The raw body data */ - public function initialize(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) - { + public function initialize(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = NULL) { $this->request = new ParameterBag($request); $this->query = new ParameterBag($query); $this->attributes = new ParameterBag($attributes); @@ -279,16 +277,16 @@ class Request $this->headers = new HeaderBag($this->server->getHeaders()); $this->content = $content; - $this->languages = null; - $this->charsets = null; - $this->encodings = null; - $this->acceptableContentTypes = null; - $this->pathInfo = null; - $this->requestUri = null; - $this->baseUrl = null; - $this->basePath = null; - $this->method = null; - $this->format = null; + $this->languages = NULL; + $this->charsets = NULL; + $this->encodings = NULL; + $this->acceptableContentTypes = NULL; + $this->pathInfo = NULL; + $this->requestUri = NULL; + $this->baseUrl = NULL; + $this->basePath = NULL; + $this->method = NULL; + $this->format = NULL; } /** @@ -296,8 +294,7 @@ class Request * * @return static */ - public static function createFromGlobals() - { + public static function createFromGlobals() { // With the php's bug #66606, the php's built-in web server // stores the Content-Type and Content-Length header values in // HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH fields. @@ -329,18 +326,17 @@ class Request * The information contained in the URI always take precedence * over the other information (server and parameters). * - * @param string $uri The URI - * @param string $method The HTTP method - * @param array $parameters The query (GET) or request (POST) parameters - * @param array $cookies The request cookies ($_COOKIE) - * @param array $files The request files ($_FILES) - * @param array $server The server parameters ($_SERVER) - * @param string|resource|null $content The raw body data + * @param string $uri The URI + * @param string $method The HTTP method + * @param array $parameters The query (GET) or request (POST) parameters + * @param array $cookies The request cookies ($_COOKIE) + * @param array $files The request files ($_FILES) + * @param array $server The server parameters ($_SERVER) + * @param string|resource|null $content The raw body data * * @return static */ - public static function create($uri, $method = 'GET', $parameters = array(), $cookies = array(), $files = array(), $server = array(), $content = null) - { + public static function create($uri, $method = 'GET', $parameters = array(), $cookies = array(), $files = array(), $server = array(), $content = NULL) { $server = array_replace(array( 'SERVER_NAME' => 'localhost', 'SERVER_PORT' => 80, @@ -377,7 +373,7 @@ class Request if (isset($components['port'])) { $server['SERVER_PORT'] = $components['port']; - $server['HTTP_HOST'] = $server['HTTP_HOST'].':'.$components['port']; + $server['HTTP_HOST'] = $server['HTTP_HOST'] . ':' . $components['port']; } if (isset($components['user'])) { @@ -399,7 +395,7 @@ class Request if (!isset($server['CONTENT_TYPE'])) { $server['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'; } - // no break + // no break case 'PATCH': $request = $parameters; $query = array(); @@ -421,11 +417,11 @@ class Request $query = $qs; $queryString = $components['query']; } - } elseif ($query) { + } else if ($query) { $queryString = http_build_query($query, '', '&'); } - $server['REQUEST_URI'] = $components['path'].('' !== $queryString ? '?'.$queryString : ''); + $server['REQUEST_URI'] = $components['path'] . ('' !== $queryString ? '?' . $queryString : ''); $server['QUERY_STRING'] = $queryString; return self::createRequestFromFactory($query, $request, array(), $cookies, $files, $server, $content); @@ -440,62 +436,60 @@ class Request * * @param callable|null $callable A PHP callable */ - public static function setFactory($callable) - { + public static function setFactory($callable) { self::$requestFactory = $callable; } /** * Clones a request and overrides some of its parameters. * - * @param array $query The GET parameters - * @param array $request The POST parameters + * @param array $query The GET parameters + * @param array $request The POST parameters * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) - * @param array $cookies The COOKIE parameters - * @param array $files The FILES parameters - * @param array $server The SERVER parameters + * @param array $cookies The COOKIE parameters + * @param array $files The FILES parameters + * @param array $server The SERVER parameters * * @return static */ - public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) - { + public function duplicate(array $query = NULL, array $request = NULL, array $attributes = NULL, array $cookies = NULL, array $files = NULL, array $server = NULL) { $dup = clone $this; - if (null !== $query) { + if (NULL !== $query) { $dup->query = new ParameterBag($query); } - if (null !== $request) { + if (NULL !== $request) { $dup->request = new ParameterBag($request); } - if (null !== $attributes) { + if (NULL !== $attributes) { $dup->attributes = new ParameterBag($attributes); } - if (null !== $cookies) { + if (NULL !== $cookies) { $dup->cookies = new ParameterBag($cookies); } - if (null !== $files) { + if (NULL !== $files) { $dup->files = new FileBag($files); } - if (null !== $server) { + if (NULL !== $server) { $dup->server = new ServerBag($server); $dup->headers = new HeaderBag($dup->server->getHeaders()); } - $dup->languages = null; - $dup->charsets = null; - $dup->encodings = null; - $dup->acceptableContentTypes = null; - $dup->pathInfo = null; - $dup->requestUri = null; - $dup->baseUrl = null; - $dup->basePath = null; - $dup->method = null; - $dup->format = null; + $dup->languages = NULL; + $dup->charsets = NULL; + $dup->encodings = NULL; + $dup->acceptableContentTypes = NULL; + $dup->pathInfo = NULL; + $dup->requestUri = NULL; + $dup->baseUrl = NULL; + $dup->basePath = NULL; + $dup->method = NULL; + $dup->format = NULL; if (!$dup->get('_format') && $this->get('_format')) { $dup->attributes->set('_format', $this->get('_format')); } - if (!$dup->getRequestFormat(null)) { - $dup->setRequestFormat($this->getRequestFormat(null)); + if (!$dup->getRequestFormat(NULL)) { + $dup->setRequestFormat($this->getRequestFormat(NULL)); } return $dup; @@ -507,8 +501,7 @@ class Request * Note that the session is not cloned as duplicated requests * are most of the time sub-requests of the main one. */ - public function __clone() - { + public function __clone() { $this->query = clone $this->query; $this->request = clone $this->request; $this->attributes = clone $this->attributes; @@ -523,8 +516,7 @@ class Request * * @return string The request */ - public function __toString() - { + public function __toString() { try { $content = $this->getContent(); } catch (\LogicException $e) { @@ -535,17 +527,17 @@ class Request $cookies = array(); foreach ($this->cookies as $k => $v) { - $cookies[] = $k.'='.$v; + $cookies[] = $k . '=' . $v; } if (!empty($cookies)) { - $cookieHeader = 'Cookie: '.implode('; ', $cookies)."\r\n"; + $cookieHeader = 'Cookie: ' . implode('; ', $cookies) . "\r\n"; } return - sprintf('%s %s %s', $this->getMethod(), $this->getRequestUri(), $this->server->get('SERVER_PROTOCOL'))."\r\n". - $this->headers. - $cookieHeader."\r\n". + sprintf('%s %s %s', $this->getMethod(), $this->getRequestUri(), $this->server->get('SERVER_PROTOCOL')) . "\r\n" . + $this->headers . + $cookieHeader . "\r\n" . $content; } @@ -555,8 +547,7 @@ class Request * It overrides $_GET, $_POST, $_REQUEST, $_SERVER, $_COOKIE. * $_FILES is never overridden, see rfc1867 */ - public function overrideGlobals() - { + public function overrideGlobals() { $this->server->set('QUERY_STRING', static::normalizeQueryString(http_build_query($this->query->all(), '', '&'))); $_GET = $this->query->all(); @@ -569,7 +560,7 @@ class Request if (in_array($key, array('CONTENT_TYPE', 'CONTENT_LENGTH'))) { $_SERVER[$key] = implode(', ', $value); } else { - $_SERVER['HTTP_'.$key] = implode(', ', $value); + $_SERVER['HTTP_' . $key] = implode(', ', $value); } } @@ -589,13 +580,12 @@ class Request * * You should only list the reverse proxies that you manage directly. * - * @param array $proxies A list of trusted proxies - * @param int $trustedHeaderSet A bit field of Request::HEADER_*, to set which headers to trust from your proxies + * @param array $proxies A list of trusted proxies + * @param int $trustedHeaderSet A bit field of Request::HEADER_*, to set which headers to trust from your proxies * * @throws \InvalidArgumentException When $trustedHeaderSet is invalid */ - public static function setTrustedProxies(array $proxies/*, int $trustedHeaderSet*/) - { + public static function setTrustedProxies(array $proxies/*, int $trustedHeaderSet*/) { self::$trustedProxies = $proxies; if (2 > func_num_args()) { @@ -603,10 +593,10 @@ class Request return; } - $trustedHeaderSet = (int) func_get_arg(1); + $trustedHeaderSet = (int)func_get_arg(1); foreach (self::$trustedHeaderNames as $header => $name) { - self::$trustedHeaders[$header] = $header & $trustedHeaderSet ? $name : null; + self::$trustedHeaders[$header] = $header & $trustedHeaderSet ? $name : NULL; } self::$trustedHeaderSet = $trustedHeaderSet; } @@ -616,8 +606,7 @@ class Request * * @return array An array of trusted proxies */ - public static function getTrustedProxies() - { + public static function getTrustedProxies() { return self::$trustedProxies; } @@ -626,8 +615,7 @@ class Request * * @return int A bit field of Request::HEADER_* that defines which headers are trusted from your proxies */ - public static function getTrustedHeaderSet() - { + public static function getTrustedHeaderSet() { return self::$trustedHeaderSet; } @@ -638,8 +626,7 @@ class Request * * @param array $hostPatterns A list of trusted host patterns */ - public static function setTrustedHosts(array $hostPatterns) - { + public static function setTrustedHosts(array $hostPatterns) { self::$trustedHostPatterns = array_map(function ($hostPattern) { return sprintf('#%s#i', $hostPattern); }, $hostPatterns); @@ -652,8 +639,7 @@ class Request * * @return array An array of trusted host patterns */ - public static function getTrustedHosts() - { + public static function getTrustedHosts() { return self::$trustedHostPatterns; } @@ -670,34 +656,33 @@ class Request * * Setting an empty value allows to disable the trusted header for the given key. * - * @param string $key The header key + * @param string $key The header key * @param string $value The header name * * @throws \InvalidArgumentException * * @deprecated since version 3.3, to be removed in 4.0. Use the $trustedHeaderSet argument of the Request::setTrustedProxies() method instead. */ - public static function setTrustedHeaderName($key, $value) - { + public static function setTrustedHeaderName($key, $value) { @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the $trustedHeaderSet argument of the Request::setTrustedProxies() method instead.', __METHOD__), E_USER_DEPRECATED); if ('forwarded' === $key) { $key = self::HEADER_FORWARDED; - } elseif ('client_ip' === $key) { + } else if ('client_ip' === $key) { $key = self::HEADER_CLIENT_IP; - } elseif ('client_host' === $key) { + } else if ('client_host' === $key) { $key = self::HEADER_CLIENT_HOST; - } elseif ('client_proto' === $key) { + } else if ('client_proto' === $key) { $key = self::HEADER_CLIENT_PROTO; - } elseif ('client_port' === $key) { + } else if ('client_port' === $key) { $key = self::HEADER_CLIENT_PORT; - } elseif (!array_key_exists($key, self::$trustedHeaders)) { + } else if (!array_key_exists($key, self::$trustedHeaders)) { throw new \InvalidArgumentException(sprintf('Unable to set the trusted header name for key "%s".', $key)); } self::$trustedHeaders[$key] = $value; - if (null !== $value) { + if (NULL !== $value) { self::$trustedHeaderNames[$key] = $value; self::$trustedHeaderSet |= $key; } else { @@ -716,8 +701,7 @@ class Request * * @deprecated since version 3.3, to be removed in 4.0. Use the Request::getTrustedHeaderSet() method instead. */ - public static function getTrustedHeaderName($key) - { + public static function getTrustedHeaderName($key) { if (2 > func_num_args() || func_get_arg(1)) { @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the Request::getTrustedHeaderSet() method instead.', __METHOD__), E_USER_DEPRECATED); } @@ -739,8 +723,7 @@ class Request * * @return string A normalized query string for the Request */ - public static function normalizeQueryString($qs) - { + public static function normalizeQueryString($qs) { if ('' == $qs) { return ''; } @@ -762,7 +745,7 @@ class Request // PHP also converts "+" to spaces when filling the global _GET or when using the function parse_str. This is why we use urldecode and then normalize to // RFC 3986 with rawurlencode. $parts[] = isset($keyValuePair[1]) ? - rawurlencode(urldecode($keyValuePair[0])).'='.rawurlencode(urldecode($keyValuePair[1])) : + rawurlencode(urldecode($keyValuePair[0])) . '=' . rawurlencode(urldecode($keyValuePair[1])) : rawurlencode(urldecode($keyValuePair[0])); $order[] = urldecode($keyValuePair[0]); } @@ -783,9 +766,8 @@ class Request * * The HTTP method can only be overridden when the real HTTP method is POST. */ - public static function enableHttpMethodParameterOverride() - { - self::$httpMethodParameterOverride = true; + public static function enableHttpMethodParameterOverride() { + self::$httpMethodParameterOverride = TRUE; } /** @@ -793,8 +775,7 @@ class Request * * @return bool True when the _method request parameter is enabled, false otherwise */ - public static function getHttpMethodParameterOverride() - { + public static function getHttpMethodParameterOverride() { return self::$httpMethodParameterOverride; } @@ -807,13 +788,12 @@ class Request * * Order of precedence: PATH (routing placeholders or custom attributes), GET, BODY * - * @param string $key The key - * @param mixed $default The default value if the parameter key does not exist + * @param string $key The key + * @param mixed $default The default value if the parameter key does not exist * * @return mixed */ - public function get($key, $default = null) - { + public function get($key, $default = NULL) { if ($this !== $result = $this->attributes->get($key, $this)) { return $result; } @@ -834,8 +814,7 @@ class Request * * @return SessionInterface|null The session */ - public function getSession() - { + public function getSession() { return $this->session; } @@ -845,8 +824,7 @@ class Request * * @return bool */ - public function hasPreviousSession() - { + public function hasPreviousSession() { // the check for $this->session avoids malicious users trying to fake a session cookie with proper name return $this->hasSession() && $this->cookies->has($this->session->getName()); } @@ -860,9 +838,8 @@ class Request * * @return bool true when the Request contains a Session object, false otherwise */ - public function hasSession() - { - return null !== $this->session; + public function hasSession() { + return NULL !== $this->session; } /** @@ -870,8 +847,7 @@ class Request * * @param SessionInterface $session The Session */ - public function setSession(SessionInterface $session) - { + public function setSession(SessionInterface $session) { $this->session = $session; } @@ -888,8 +864,7 @@ class Request * * @see getClientIp() */ - public function getClientIps() - { + public function getClientIps() { $ip = $this->server->get('REMOTE_ADDR'); if (!$this->isFromTrustedProxy()) { @@ -917,8 +892,7 @@ class Request * @see getClientIps() * @see http://en.wikipedia.org/wiki/X-Forwarded-For */ - public function getClientIp() - { + public function getClientIp() { $ipAddresses = $this->getClientIps(); return $ipAddresses[0]; @@ -929,8 +903,7 @@ class Request * * @return string */ - public function getScriptName() - { + public function getScriptName() { return $this->server->get('SCRIPT_NAME', $this->server->get('ORIG_SCRIPT_NAME', '')); } @@ -948,9 +921,8 @@ class Request * * @return string The raw path (i.e. not urldecoded) */ - public function getPathInfo() - { - if (null === $this->pathInfo) { + public function getPathInfo() { + if (NULL === $this->pathInfo) { $this->pathInfo = $this->preparePathInfo(); } @@ -969,9 +941,8 @@ class Request * * @return string The raw path (i.e. not urldecoded) */ - public function getBasePath() - { - if (null === $this->basePath) { + public function getBasePath() { + if (NULL === $this->basePath) { $this->basePath = $this->prepareBasePath(); } @@ -988,9 +959,8 @@ class Request * * @return string The raw URL (i.e. not urldecoded) */ - public function getBaseUrl() - { - if (null === $this->baseUrl) { + public function getBaseUrl() { + if (NULL === $this->baseUrl) { $this->baseUrl = $this->prepareBaseUrl(); } @@ -1002,8 +972,7 @@ class Request * * @return string */ - public function getScheme() - { + public function getScheme() { return $this->isSecure() ? 'https' : 'http'; } @@ -1021,13 +990,12 @@ class Request * * @return int|string can be a string if fetched from the server bag */ - public function getPort() - { + public function getPort() { if ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_CLIENT_PORT)) { $host = $host[0]; - } elseif ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_CLIENT_HOST)) { + } else if ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_CLIENT_HOST)) { $host = $host[0]; - } elseif (!$host = $this->headers->get('HOST')) { + } else if (!$host = $this->headers->get('HOST')) { return $this->server->get('SERVER_PORT'); } @@ -1037,8 +1005,8 @@ class Request $pos = strrpos($host, ':'); } - if (false !== $pos) { - return (int) substr($host, $pos + 1); + if (FALSE !== $pos) { + return (int)substr($host, $pos + 1); } return 'https' === $this->getScheme() ? 443 : 80; @@ -1049,8 +1017,7 @@ class Request * * @return string|null */ - public function getUser() - { + public function getUser() { return $this->headers->get('PHP_AUTH_USER'); } @@ -1059,8 +1026,7 @@ class Request * * @return string|null */ - public function getPassword() - { + public function getPassword() { return $this->headers->get('PHP_AUTH_PW'); } @@ -1069,8 +1035,7 @@ class Request * * @return string A user name and, optionally, scheme-specific information about how to gain authorization to access the server */ - public function getUserInfo() - { + public function getUserInfo() { $userinfo = $this->getUser(); $pass = $this->getPassword(); @@ -1088,8 +1053,7 @@ class Request * * @return string */ - public function getHttpHost() - { + public function getHttpHost() { $scheme = $this->getScheme(); $port = $this->getPort(); @@ -1097,7 +1061,7 @@ class Request return $this->getHost(); } - return $this->getHost().':'.$port; + return $this->getHost() . ':' . $port; } /** @@ -1105,9 +1069,8 @@ class Request * * @return string The raw URI (i.e. not URI decoded) */ - public function getRequestUri() - { - if (null === $this->requestUri) { + public function getRequestUri() { + if (NULL === $this->requestUri) { $this->requestUri = $this->prepareRequestUri(); } @@ -1122,9 +1085,8 @@ class Request * * @return string The scheme and HTTP host */ - public function getSchemeAndHttpHost() - { - return $this->getScheme().'://'.$this->getHttpHost(); + public function getSchemeAndHttpHost() { + return $this->getScheme() . '://' . $this->getHttpHost(); } /** @@ -1134,13 +1096,12 @@ class Request * * @see getQueryString() */ - public function getUri() - { - if (null !== $qs = $this->getQueryString()) { - $qs = '?'.$qs; + public function getUri() { + if (NULL !== $qs = $this->getQueryString()) { + $qs = '?' . $qs; } - return $this->getSchemeAndHttpHost().$this->getBaseUrl().$this->getPathInfo().$qs; + return $this->getSchemeAndHttpHost() . $this->getBaseUrl() . $this->getPathInfo() . $qs; } /** @@ -1150,9 +1111,8 @@ class Request * * @return string The normalized URI for the path */ - public function getUriForPath($path) - { - return $this->getSchemeAndHttpHost().$this->getBaseUrl().$path; + public function getUriForPath($path) { + return $this->getSchemeAndHttpHost() . $this->getBaseUrl() . $path; } /** @@ -1174,8 +1134,7 @@ class Request * * @return string The relative target path */ - public function getRelativeUriForPath($path) - { + public function getRelativeUriForPath($path) { // be sure that we are dealing with an absolute path if (!isset($path[0]) || '/' !== $path[0]) { return $path; @@ -1199,14 +1158,14 @@ class Request } $targetDirs[] = $targetFile; - $path = str_repeat('../', count($sourceDirs)).implode('/', $targetDirs); + $path = str_repeat('../', count($sourceDirs)) . implode('/', $targetDirs); // A reference to the same base directory or an empty subdirectory must be prefixed with "./". // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used // as the first segment of a relative-path reference, as it would be mistaken for a scheme name // (see http://tools.ietf.org/html/rfc3986#section-4.2). return !isset($path[0]) || '/' === $path[0] - || false !== ($colonPos = strpos($path, ':')) && ($colonPos < ($slashPos = strpos($path, '/')) || false === $slashPos) + || FALSE !== ($colonPos = strpos($path, ':')) && ($colonPos < ($slashPos = strpos($path, '/')) || FALSE === $slashPos) ? "./$path" : $path; } @@ -1218,11 +1177,10 @@ class Request * * @return string|null A normalized query string for the Request */ - public function getQueryString() - { + public function getQueryString() { $qs = static::normalizeQueryString($this->server->get('QUERY_STRING')); - return '' === $qs ? null : $qs; + return '' === $qs ? NULL : $qs; } /** @@ -1239,10 +1197,9 @@ class Request * * @return bool */ - public function isSecure() - { + public function isSecure() { if ($this->isFromTrustedProxy() && $proto = $this->getTrustedValues(self::HEADER_CLIENT_PROTO)) { - return in_array(strtolower($proto[0]), array('https', 'on', 'ssl', '1'), true); + return in_array(strtolower($proto[0]), array('https', 'on', 'ssl', '1'), TRUE); } $https = $this->server->get('HTTPS'); @@ -1266,11 +1223,10 @@ class Request * * @throws SuspiciousOperationException when the host name is invalid or not trusted */ - public function getHost() - { + public function getHost() { if ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_CLIENT_HOST)) { $host = $host[0]; - } elseif (!$host = $this->headers->get('HOST')) { + } else if (!$host = $this->headers->get('HOST')) { if (!$host = $this->server->get('SERVER_NAME')) { $host = $this->server->get('SERVER_ADDR', ''); } @@ -1287,7 +1243,7 @@ class Request if (!$this->isHostValid) { return ''; } - $this->isHostValid = false; + $this->isHostValid = FALSE; throw new SuspiciousOperationException(sprintf('Invalid Host "%s".', $host)); } @@ -1310,7 +1266,7 @@ class Request if (!$this->isHostValid) { return ''; } - $this->isHostValid = false; + $this->isHostValid = FALSE; throw new SuspiciousOperationException(sprintf('Untrusted Host "%s".', $host)); } @@ -1323,9 +1279,8 @@ class Request * * @param string $method */ - public function setMethod($method) - { - $this->method = null; + public function setMethod($method) { + $this->method = NULL; $this->server->set('REQUEST_METHOD', $method); } @@ -1344,15 +1299,14 @@ class Request * * @see getRealMethod() */ - public function getMethod() - { - if (null === $this->method) { + public function getMethod() { + if (NULL === $this->method) { $this->method = strtoupper($this->server->get('REQUEST_METHOD', 'GET')); if ('POST' === $this->method) { if ($method = $this->headers->get('X-HTTP-METHOD-OVERRIDE')) { $this->method = strtoupper($method); - } elseif (self::$httpMethodParameterOverride) { + } else if (self::$httpMethodParameterOverride) { $this->method = strtoupper($this->request->get('_method', $this->query->get('_method', 'POST'))); } } @@ -1368,8 +1322,7 @@ class Request * * @see getMethod() */ - public function getRealMethod() - { + public function getRealMethod() { return strtoupper($this->server->get('REQUEST_METHOD', 'GET')); } @@ -1380,13 +1333,12 @@ class Request * * @return string The associated mime type (null if not found) */ - public function getMimeType($format) - { - if (null === static::$formats) { + public function getMimeType($format) { + if (NULL === static::$formats) { static::initializeFormats(); } - return isset(static::$formats[$format]) ? static::$formats[$format][0] : null; + return isset(static::$formats[$format]) ? static::$formats[$format][0] : NULL; } /** @@ -1396,9 +1348,8 @@ class Request * * @return array The associated mime types */ - public static function getMimeTypes($format) - { - if (null === static::$formats) { + public static function getMimeTypes($format) { + if (NULL === static::$formats) { static::initializeFormats(); } @@ -1412,22 +1363,21 @@ class Request * * @return string|null The format (null if not found) */ - public function getFormat($mimeType) - { - $canonicalMimeType = null; - if (false !== $pos = strpos($mimeType, ';')) { + public function getFormat($mimeType) { + $canonicalMimeType = NULL; + if (FALSE !== $pos = strpos($mimeType, ';')) { $canonicalMimeType = substr($mimeType, 0, $pos); } - if (null === static::$formats) { + if (NULL === static::$formats) { static::initializeFormats(); } foreach (static::$formats as $format => $mimeTypes) { - if (in_array($mimeType, (array) $mimeTypes)) { + if (in_array($mimeType, (array)$mimeTypes)) { return $format; } - if (null !== $canonicalMimeType && in_array($canonicalMimeType, (array) $mimeTypes)) { + if (NULL !== $canonicalMimeType && in_array($canonicalMimeType, (array)$mimeTypes)) { return $format; } } @@ -1436,12 +1386,11 @@ class Request /** * Associates a format with mime types. * - * @param string $format The format + * @param string $format The format * @param string|array $mimeTypes The associated mime types (the preferred one must be the first as it will be used as the content type) */ - public function setFormat($format, $mimeTypes) - { - if (null === static::$formats) { + public function setFormat($format, $mimeTypes) { + if (NULL === static::$formats) { static::initializeFormats(); } @@ -1461,13 +1410,12 @@ class Request * * @return string The request format */ - public function getRequestFormat($default = 'html') - { - if (null === $this->format) { + public function getRequestFormat($default = 'html') { + if (NULL === $this->format) { $this->format = $this->attributes->get('_format'); } - return null === $this->format ? $default : $this->format; + return NULL === $this->format ? $default : $this->format; } /** @@ -1475,8 +1423,7 @@ class Request * * @param string $format The request format */ - public function setRequestFormat($format) - { + public function setRequestFormat($format) { $this->format = $format; } @@ -1485,8 +1432,7 @@ class Request * * @return string|null The format (null if no content type is present) */ - public function getContentType() - { + public function getContentType() { return $this->getFormat($this->headers->get('CONTENT_TYPE')); } @@ -1495,11 +1441,10 @@ class Request * * @param string $locale */ - public function setDefaultLocale($locale) - { + public function setDefaultLocale($locale) { $this->defaultLocale = $locale; - if (null === $this->locale) { + if (NULL === $this->locale) { $this->setPhpDefaultLocale($locale); } } @@ -1509,8 +1454,7 @@ class Request * * @return string */ - public function getDefaultLocale() - { + public function getDefaultLocale() { return $this->defaultLocale; } @@ -1519,8 +1463,7 @@ class Request * * @param string $locale */ - public function setLocale($locale) - { + public function setLocale($locale) { $this->setPhpDefaultLocale($this->locale = $locale); } @@ -1529,9 +1472,8 @@ class Request * * @return string */ - public function getLocale() - { - return null === $this->locale ? $this->defaultLocale : $this->locale; + public function getLocale() { + return NULL === $this->locale ? $this->defaultLocale : $this->locale; } /** @@ -1541,8 +1483,7 @@ class Request * * @return bool */ - public function isMethod($method) - { + public function isMethod($method) { return $this->getMethod() === strtoupper($method); } @@ -1555,8 +1496,7 @@ class Request * * @return bool */ - public function isMethodSafe(/* $andCacheable = true */) - { + public function isMethodSafe(/* $andCacheable = true */) { if (!func_num_args() || func_get_arg(0)) { // This deprecation should be turned into a BadMethodCallException in 4.0 (without adding the argument in the signature) // then setting $andCacheable to false should be deprecated in 4.1 @@ -1573,8 +1513,7 @@ class Request * * @return bool */ - public function isMethodIdempotent() - { + public function isMethodIdempotent() { return in_array($this->getMethod(), array('HEAD', 'GET', 'PUT', 'DELETE', 'TRACE', 'OPTIONS', 'PURGE')); } @@ -1585,8 +1524,7 @@ class Request * * @return bool */ - public function isMethodCacheable() - { + public function isMethodCacheable() { return in_array($this->getMethod(), array('GET', 'HEAD')); } @@ -1601,13 +1539,12 @@ class Request * * @return string */ - public function getProtocolVersion() - { + public function getProtocolVersion() { if ($this->isFromTrustedProxy()) { preg_match('~^(HTTP/)?([1-9]\.[0-9]) ~', $this->headers->get('Via'), $matches); if ($matches) { - return 'HTTP/'.$matches[2]; + return 'HTTP/' . $matches[2]; } } @@ -1623,14 +1560,13 @@ class Request * * @throws \LogicException */ - public function getContent($asResource = false) - { + public function getContent($asResource = FALSE) { $currentContentIsResource = is_resource($this->content); - if (\PHP_VERSION_ID < 50600 && false === $this->content) { + if (\PHP_VERSION_ID < 50600 && FALSE === $this->content) { throw new \LogicException('getContent() can only be called once when using the resource return type and PHP below 5.6.'); } - if (true === $asResource) { + if (TRUE === $asResource) { if ($currentContentIsResource) { rewind($this->content); @@ -1646,7 +1582,7 @@ class Request return $resource; } - $this->content = false; + $this->content = FALSE; return fopen('php://input', 'rb'); } @@ -1657,7 +1593,7 @@ class Request return stream_get_contents($this->content); } - if (null === $this->content || false === $this->content) { + if (NULL === $this->content || FALSE === $this->content) { $this->content = file_get_contents('php://input'); } @@ -1669,16 +1605,14 @@ class Request * * @return array The entity tags */ - public function getETags() - { - return preg_split('/\s*,\s*/', $this->headers->get('if_none_match'), null, PREG_SPLIT_NO_EMPTY); + public function getETags() { + return preg_split('/\s*,\s*/', $this->headers->get('if_none_match'), NULL, PREG_SPLIT_NO_EMPTY); } /** * @return bool */ - public function isNoCache() - { + public function isNoCache() { return $this->headers->hasCacheControlDirective('no-cache') || 'no-cache' == $this->headers->get('Pragma'); } @@ -1689,12 +1623,11 @@ class Request * * @return string|null The preferred locale */ - public function getPreferredLanguage(array $locales = null) - { + public function getPreferredLanguage(array $locales = NULL) { $preferredLanguages = $this->getLanguages(); if (empty($locales)) { - return isset($preferredLanguages[0]) ? $preferredLanguages[0] : null; + return isset($preferredLanguages[0]) ? $preferredLanguages[0] : NULL; } if (!$preferredLanguages) { @@ -1704,7 +1637,7 @@ class Request $extendedPreferredLanguages = array(); foreach ($preferredLanguages as $language) { $extendedPreferredLanguages[] = $language; - if (false !== $position = strpos($language, '_')) { + if (FALSE !== $position = strpos($language, '_')) { $superLanguage = substr($language, 0, $position); if (!in_array($superLanguage, $preferredLanguages)) { $extendedPreferredLanguages[] = $superLanguage; @@ -1722,16 +1655,15 @@ class Request * * @return array Languages ordered in the user browser preferences */ - public function getLanguages() - { - if (null !== $this->languages) { + public function getLanguages() { + if (NULL !== $this->languages) { return $this->languages; } $languages = AcceptHeader::fromString($this->headers->get('Accept-Language'))->all(); $this->languages = array(); foreach ($languages as $lang => $acceptHeaderItem) { - if (false !== strpos($lang, '-')) { + if (FALSE !== strpos($lang, '-')) { $codes = explode('-', $lang); if ('i' === $codes[0]) { // Language not listed in ISO 639 that are not variants @@ -1745,7 +1677,7 @@ class Request if (0 === $i) { $lang = strtolower($codes[0]); } else { - $lang .= '_'.strtoupper($codes[$i]); + $lang .= '_' . strtoupper($codes[$i]); } } } @@ -1762,9 +1694,8 @@ class Request * * @return array List of charsets in preferable order */ - public function getCharsets() - { - if (null !== $this->charsets) { + public function getCharsets() { + if (NULL !== $this->charsets) { return $this->charsets; } @@ -1776,9 +1707,8 @@ class Request * * @return array List of encodings in preferable order */ - public function getEncodings() - { - if (null !== $this->encodings) { + public function getEncodings() { + if (NULL !== $this->encodings) { return $this->encodings; } @@ -1790,9 +1720,8 @@ class Request * * @return array List of content types in preferable order */ - public function getAcceptableContentTypes() - { - if (null !== $this->acceptableContentTypes) { + public function getAcceptableContentTypes() { + if (NULL !== $this->acceptableContentTypes) { return $this->acceptableContentTypes; } @@ -1809,8 +1738,7 @@ class Request * * @return bool true if the request is an XMLHttpRequest, false otherwise */ - public function isXmlHttpRequest() - { + public function isXmlHttpRequest() { return 'XMLHttpRequest' == $this->headers->get('X-Requested-With'); } @@ -1822,8 +1750,7 @@ class Request * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) */ - protected function prepareRequestUri() - { + protected function prepareRequestUri() { $requestUri = ''; if ($this->headers->has('X_ORIGINAL_URL')) { @@ -1833,27 +1760,27 @@ class Request $this->server->remove('HTTP_X_ORIGINAL_URL'); $this->server->remove('UNENCODED_URL'); $this->server->remove('IIS_WasUrlRewritten'); - } elseif ($this->headers->has('X_REWRITE_URL')) { + } else if ($this->headers->has('X_REWRITE_URL')) { // IIS with ISAPI_Rewrite $requestUri = $this->headers->get('X_REWRITE_URL'); $this->headers->remove('X_REWRITE_URL'); - } elseif ('1' == $this->server->get('IIS_WasUrlRewritten') && '' != $this->server->get('UNENCODED_URL')) { + } else if ('1' == $this->server->get('IIS_WasUrlRewritten') && '' != $this->server->get('UNENCODED_URL')) { // IIS7 with URL Rewrite: make sure we get the unencoded URL (double slash problem) $requestUri = $this->server->get('UNENCODED_URL'); $this->server->remove('UNENCODED_URL'); $this->server->remove('IIS_WasUrlRewritten'); - } elseif ($this->server->has('REQUEST_URI')) { + } else if ($this->server->has('REQUEST_URI')) { $requestUri = $this->server->get('REQUEST_URI'); // HTTP proxy reqs setup request URI with scheme and host [and port] + the URL path, only use URL path $schemeAndHttpHost = $this->getSchemeAndHttpHost(); if (0 === strpos($requestUri, $schemeAndHttpHost)) { $requestUri = substr($requestUri, strlen($schemeAndHttpHost)); } - } elseif ($this->server->has('ORIG_PATH_INFO')) { + } else if ($this->server->has('ORIG_PATH_INFO')) { // IIS 5.0, PHP as CGI $requestUri = $this->server->get('ORIG_PATH_INFO'); if ('' != $this->server->get('QUERY_STRING')) { - $requestUri .= '?'.$this->server->get('QUERY_STRING'); + $requestUri .= '?' . $this->server->get('QUERY_STRING'); } $this->server->remove('ORIG_PATH_INFO'); } @@ -1869,15 +1796,14 @@ class Request * * @return string */ - protected function prepareBaseUrl() - { + protected function prepareBaseUrl() { $filename = basename($this->server->get('SCRIPT_FILENAME')); if (basename($this->server->get('SCRIPT_NAME')) === $filename) { $baseUrl = $this->server->get('SCRIPT_NAME'); - } elseif (basename($this->server->get('PHP_SELF')) === $filename) { + } else if (basename($this->server->get('PHP_SELF')) === $filename) { $baseUrl = $this->server->get('PHP_SELF'); - } elseif (basename($this->server->get('ORIG_SCRIPT_NAME')) === $filename) { + } else if (basename($this->server->get('ORIG_SCRIPT_NAME')) === $filename) { $baseUrl = $this->server->get('ORIG_SCRIPT_NAME'); // 1and1 shared hosting compatibility } else { // Backtrack up the script_filename to find the portion matching @@ -1891,29 +1817,29 @@ class Request $baseUrl = ''; do { $seg = $segs[$index]; - $baseUrl = '/'.$seg.$baseUrl; + $baseUrl = '/' . $seg . $baseUrl; ++$index; - } while ($last > $index && (false !== $pos = strpos($path, $baseUrl)) && 0 != $pos); + } while ($last > $index && (FALSE !== $pos = strpos($path, $baseUrl)) && 0 != $pos); } // Does the baseUrl have anything in common with the request_uri? $requestUri = $this->getRequestUri(); if ('' !== $requestUri && '/' !== $requestUri[0]) { - $requestUri = '/'.$requestUri; + $requestUri = '/' . $requestUri; } - if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, $baseUrl)) { + if ($baseUrl && FALSE !== $prefix = $this->getUrlencodedPrefix($requestUri, $baseUrl)) { // full $baseUrl matches return $prefix; } - if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, rtrim(dirname($baseUrl), '/'.DIRECTORY_SEPARATOR).'/')) { + if ($baseUrl && FALSE !== $prefix = $this->getUrlencodedPrefix($requestUri, rtrim(dirname($baseUrl), '/' . DIRECTORY_SEPARATOR) . '/')) { // directory portion of $baseUrl matches - return rtrim($prefix, '/'.DIRECTORY_SEPARATOR); + return rtrim($prefix, '/' . DIRECTORY_SEPARATOR); } $truncatedRequestUri = $requestUri; - if (false !== $pos = strpos($requestUri, '?')) { + if (FALSE !== $pos = strpos($requestUri, '?')) { $truncatedRequestUri = substr($requestUri, 0, $pos); } @@ -1926,11 +1852,11 @@ class Request // If using mod_rewrite or ISAPI_Rewrite strip the script filename // out of baseUrl. $pos !== 0 makes sure it is not matching a value // from PATH_INFO or QUERY_STRING - if (strlen($requestUri) >= strlen($baseUrl) && (false !== $pos = strpos($requestUri, $baseUrl)) && 0 !== $pos) { + if (strlen($requestUri) >= strlen($baseUrl) && (FALSE !== $pos = strpos($requestUri, $baseUrl)) && 0 !== $pos) { $baseUrl = substr($requestUri, 0, $pos + strlen($baseUrl)); } - return rtrim($baseUrl, '/'.DIRECTORY_SEPARATOR); + return rtrim($baseUrl, '/' . DIRECTORY_SEPARATOR); } /** @@ -1938,8 +1864,7 @@ class Request * * @return string base path */ - protected function prepareBasePath() - { + protected function prepareBasePath() { $baseUrl = $this->getBaseUrl(); if (empty($baseUrl)) { return ''; @@ -1964,38 +1889,36 @@ class Request * * @return string path info */ - protected function preparePathInfo() - { - if (null === ($requestUri = $this->getRequestUri())) { + protected function preparePathInfo() { + if (NULL === ($requestUri = $this->getRequestUri())) { return '/'; } // Remove the query string from REQUEST_URI - if (false !== $pos = strpos($requestUri, '?')) { + if (FALSE !== $pos = strpos($requestUri, '?')) { $requestUri = substr($requestUri, 0, $pos); } if ('' !== $requestUri && '/' !== $requestUri[0]) { - $requestUri = '/'.$requestUri; + $requestUri = '/' . $requestUri; } - if (null === ($baseUrl = $this->getBaseUrl())) { + if (NULL === ($baseUrl = $this->getBaseUrl())) { return $requestUri; } $pathInfo = substr($requestUri, strlen($baseUrl)); - if (false === $pathInfo || '' === $pathInfo) { + if (FALSE === $pathInfo || '' === $pathInfo) { // If substr() returns false then PATH_INFO is set to an empty string return '/'; } - return (string) $pathInfo; + return (string)$pathInfo; } /** * Initializes HTTP request formats. */ - protected static function initializeFormats() - { + protected static function initializeFormats() { static::$formats = array( 'html' => array('text/html', 'application/xhtml+xml'), 'txt' => array('text/plain'), @@ -2016,13 +1939,12 @@ class Request * * @param string $locale */ - private function setPhpDefaultLocale($locale) - { + private function setPhpDefaultLocale($locale) { // if either the class Locale doesn't exist, or an exception is thrown when // setting the default locale, the intl module is not installed, and // the call can be ignored: try { - if (class_exists('Locale', false)) { + if (class_exists('Locale', FALSE)) { \Locale::setDefault($locale); } } catch (\Exception $e) { @@ -2038,10 +1960,9 @@ class Request * * @return string|false The prefix as it is encoded in $string, or false */ - private function getUrlencodedPrefix($string, $prefix) - { + private function getUrlencodedPrefix($string, $prefix) { if (0 !== strpos(rawurldecode($string), $prefix)) { - return false; + return FALSE; } $len = strlen($prefix); @@ -2050,11 +1971,10 @@ class Request return $match[0]; } - return false; + return FALSE; } - private static function createRequestFromFactory(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) - { + private static function createRequestFromFactory(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = NULL) { if (self::$requestFactory) { $request = call_user_func(self::$requestFactory, $query, $request, $attributes, $cookies, $files, $server, $content); @@ -2076,19 +1996,17 @@ class Request * * @return bool true if the request came from a trusted proxy, false otherwise */ - public function isFromTrustedProxy() - { + public function isFromTrustedProxy() { return self::$trustedProxies && IpUtils::checkIp($this->server->get('REMOTE_ADDR'), self::$trustedProxies); } - private function getTrustedValues($type, $ip = null) - { + private function getTrustedValues($type, $ip = NULL) { $clientValues = array(); $forwardedValues = array(); if (self::$trustedHeaders[$type] && $this->headers->has(self::$trustedHeaders[$type])) { foreach (explode(',', $this->headers->get(self::$trustedHeaders[$type])) as $v) { - $clientValues[] = (self::HEADER_CLIENT_PORT === $type ? '0.0.0.0:' : '').trim($v); + $clientValues[] = (self::HEADER_CLIENT_PORT === $type ? '0.0.0.0:' : '') . trim($v); } } @@ -2097,7 +2015,7 @@ class Request $forwardedValues = preg_match_all(sprintf('{(?:%s)=(?:"?\[?)([a-zA-Z0-9\.:_\-/]*+)}', self::$forwardedParams[$type]), $forwardedValues, $matches) ? $matches[1] : array(); } - if (null !== $ip) { + if (NULL !== $ip) { $clientValues = $this->normalizeAndFilterClientIps($clientValues, $ip); $forwardedValues = $this->normalizeAndFilterClientIps($forwardedValues, $ip); } @@ -2111,20 +2029,19 @@ class Request } if (!$this->isForwardedValid) { - return null !== $ip ? array('0.0.0.0', $ip) : array(); + return NULL !== $ip ? array('0.0.0.0', $ip) : array(); } - $this->isForwardedValid = false; + $this->isForwardedValid = FALSE; throw new ConflictingHeadersException(sprintf('The request has both a trusted "%s" header and a trusted "%s" header, conflicting with each other. You should either configure your proxy to remove one of them, or configure your project to distrust the offending one.', self::$trustedHeaders[self::HEADER_FORWARDED], self::$trustedHeaders[$type])); } - private function normalizeAndFilterClientIps(array $clientIps, $ip) - { + private function normalizeAndFilterClientIps(array $clientIps, $ip) { if (!$clientIps) { return array(); } $clientIps[] = $ip; // Complete the IP chain with the IP the request actually came from - $firstTrustedIp = null; + $firstTrustedIp = NULL; foreach ($clientIps as $key => $clientIp) { // Remove port (unfortunately, it does happen) @@ -2142,7 +2059,7 @@ class Request unset($clientIps[$key]); // Fallback to this when the client IP falls into the range of trusted proxies - if (null === $firstTrustedIp) { + if (NULL === $firstTrustedIp) { $firstTrustedIp = $clientIp; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/RequestMatcher.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/RequestMatcher.php index 076d077..076d431 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/RequestMatcher.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/RequestMatcher.php @@ -49,15 +49,14 @@ class RequestMatcher implements RequestMatcherInterface private $schemes = array(); /** - * @param string|null $path - * @param string|null $host + * @param string|null $path + * @param string|null $host * @param string|string[]|null $methods * @param string|string[]|null $ips - * @param array $attributes + * @param array $attributes * @param string|string[]|null $schemes */ - public function __construct($path = null, $host = null, $methods = null, $ips = null, array $attributes = array(), $schemes = null) - { + public function __construct($path = NULL, $host = NULL, $methods = NULL, $ips = NULL, array $attributes = array(), $schemes = NULL) { $this->matchPath($path); $this->matchHost($host); $this->matchMethod($methods); @@ -74,9 +73,8 @@ class RequestMatcher implements RequestMatcherInterface * * @param string|string[]|null $scheme An HTTP scheme or an array of HTTP schemes */ - public function matchScheme($scheme) - { - $this->schemes = null !== $scheme ? array_map('strtolower', (array) $scheme) : array(); + public function matchScheme($scheme) { + $this->schemes = NULL !== $scheme ? array_map('strtolower', (array)$scheme) : array(); } /** @@ -84,8 +82,7 @@ class RequestMatcher implements RequestMatcherInterface * * @param string|null $regexp A Regexp */ - public function matchHost($regexp) - { + public function matchHost($regexp) { $this->host = $regexp; } @@ -94,8 +91,7 @@ class RequestMatcher implements RequestMatcherInterface * * @param string|null $regexp A Regexp */ - public function matchPath($regexp) - { + public function matchPath($regexp) { $this->path = $regexp; } @@ -104,8 +100,7 @@ class RequestMatcher implements RequestMatcherInterface * * @param string $ip A specific IP address or a range specified using IP/netmask like 192.168.1.0/24 */ - public function matchIp($ip) - { + public function matchIp($ip) { $this->matchIps($ip); } @@ -114,9 +109,8 @@ class RequestMatcher implements RequestMatcherInterface * * @param string|string[]|null $ips A specific IP address or a range specified using IP/netmask like 192.168.1.0/24 */ - public function matchIps($ips) - { - $this->ips = null !== $ips ? (array) $ips : array(); + public function matchIps($ips) { + $this->ips = NULL !== $ips ? (array)$ips : array(); } /** @@ -124,51 +118,48 @@ class RequestMatcher implements RequestMatcherInterface * * @param string|string[]|null $method An HTTP method or an array of HTTP methods */ - public function matchMethod($method) - { - $this->methods = null !== $method ? array_map('strtoupper', (array) $method) : array(); + public function matchMethod($method) { + $this->methods = NULL !== $method ? array_map('strtoupper', (array)$method) : array(); } /** * Adds a check for request attribute. * - * @param string $key The request attribute name + * @param string $key The request attribute name * @param string $regexp A Regexp */ - public function matchAttribute($key, $regexp) - { + public function matchAttribute($key, $regexp) { $this->attributes[$key] = $regexp; } /** * {@inheritdoc} */ - public function matches(Request $request) - { - if ($this->schemes && !in_array($request->getScheme(), $this->schemes, true)) { - return false; + public function matches(Request $request) { + if ($this->schemes && !in_array($request->getScheme(), $this->schemes, TRUE)) { + return FALSE; } - if ($this->methods && !in_array($request->getMethod(), $this->methods, true)) { - return false; + if ($this->methods && !in_array($request->getMethod(), $this->methods, TRUE)) { + return FALSE; } foreach ($this->attributes as $key => $pattern) { - if (!preg_match('{'.$pattern.'}', $request->attributes->get($key))) { - return false; + if (!preg_match('{' . $pattern . '}', $request->attributes->get($key))) { + return FALSE; } } - if (null !== $this->path && !preg_match('{'.$this->path.'}', rawurldecode($request->getPathInfo()))) { - return false; + if (NULL !== $this->path && !preg_match('{' . $this->path . '}', rawurldecode($request->getPathInfo()))) { + return FALSE; } - if (null !== $this->host && !preg_match('{'.$this->host.'}i', $request->getHost())) { - return false; + if (NULL !== $this->host && !preg_match('{' . $this->host . '}i', $request->getHost())) { + return FALSE; } if (IpUtils::checkIp($request->getClientIp(), $this->ips)) { - return true; + return TRUE; } // Note to future implementors: add additional checks above the diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/RequestStack.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/RequestStack.php index 3d9cfd0..0fce44c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/RequestStack.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/RequestStack.php @@ -29,8 +29,7 @@ class RequestStack * This method should generally not be called directly as the stack * management should be taken care of by the application itself. */ - public function push(Request $request) - { + public function push(Request $request) { $this->requests[] = $request; } @@ -44,8 +43,7 @@ class RequestStack * * @return Request|null */ - public function pop() - { + public function pop() { if (!$this->requests) { return; } @@ -56,9 +54,8 @@ class RequestStack /** * @return Request|null */ - public function getCurrentRequest() - { - return end($this->requests) ?: null; + public function getCurrentRequest() { + return end($this->requests) ?: NULL; } /** @@ -70,8 +67,7 @@ class RequestStack * * @return Request|null */ - public function getMasterRequest() - { + public function getMasterRequest() { if (!$this->requests) { return; } @@ -90,8 +86,7 @@ class RequestStack * * @return Request|null */ - public function getParentRequest() - { + public function getParentRequest() { $pos = count($this->requests) - 2; if (!isset($this->requests[$pos])) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Response.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Response.php index 6f8a623..364b608 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Response.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Response.php @@ -189,13 +189,12 @@ class Response /** * @param mixed $content The response content, see setContent() - * @param int $status The response status code + * @param int $status The response status code * @param array $headers An array of response headers * * @throws \InvalidArgumentException When the HTTP status code is not valid */ - public function __construct($content = '', $status = 200, $headers = array()) - { + public function __construct($content = '', $status = 200, $headers = array()) { $this->headers = new ResponseHeaderBag($headers); $this->setContent($content); $this->setStatusCode($status); @@ -211,13 +210,12 @@ class Response * ->setSharedMaxAge(300); * * @param mixed $content The response content, see setContent() - * @param int $status The response status code + * @param int $status The response status code * @param array $headers An array of response headers * * @return static */ - public static function create($content = '', $status = 200, $headers = array()) - { + public static function create($content = '', $status = 200, $headers = array()) { return new static($content, $status, $headers); } @@ -232,19 +230,17 @@ class Response * * @see prepare() */ - public function __toString() - { + public function __toString() { return - sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText)."\r\n". - $this->headers."\r\n". + sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText) . "\r\n" . + $this->headers . "\r\n" . $this->getContent(); } /** * Clones the current Response instance. */ - public function __clone() - { + public function __clone() { $this->headers = clone $this->headers; } @@ -257,19 +253,18 @@ class Response * * @return $this */ - public function prepare(Request $request) - { + public function prepare(Request $request) { $headers = $this->headers; if ($this->isInformational() || $this->isEmpty()) { - $this->setContent(null); + $this->setContent(NULL); $headers->remove('Content-Type'); $headers->remove('Content-Length'); } else { // Content-type based on the Request if (!$headers->has('Content-Type')) { $format = $request->getRequestFormat(); - if (null !== $format && $mimeType = $request->getMimeType($format)) { + if (NULL !== $format && $mimeType = $request->getMimeType($format)) { $headers->set('Content-Type', $mimeType); } } @@ -277,10 +272,10 @@ class Response // Fix Content-Type $charset = $this->charset ?: 'UTF-8'; if (!$headers->has('Content-Type')) { - $headers->set('Content-Type', 'text/html; charset='.$charset); - } elseif (0 === stripos($headers->get('Content-Type'), 'text/') && false === stripos($headers->get('Content-Type'), 'charset')) { + $headers->set('Content-Type', 'text/html; charset=' . $charset); + } else if (0 === stripos($headers->get('Content-Type'), 'text/') && FALSE === stripos($headers->get('Content-Type'), 'charset')) { // add the charset - $headers->set('Content-Type', $headers->get('Content-Type').'; charset='.$charset); + $headers->set('Content-Type', $headers->get('Content-Type') . '; charset=' . $charset); } // Fix Content-Length @@ -291,7 +286,7 @@ class Response if ($request->isMethod('HEAD')) { // cf. RFC2616 14.13 $length = $headers->get('Content-Length'); - $this->setContent(null); + $this->setContent(NULL); if ($length) { $headers->set('Content-Length', $length); } @@ -304,7 +299,7 @@ class Response } // Check if we need to send extra expire info headers - if ('1.0' == $this->getProtocolVersion() && false !== strpos($this->headers->get('Cache-Control'), 'no-cache')) { + if ('1.0' == $this->getProtocolVersion() && FALSE !== strpos($this->headers->get('Cache-Control'), 'no-cache')) { $this->headers->set('pragma', 'no-cache'); $this->headers->set('expires', -1); } @@ -319,8 +314,7 @@ class Response * * @return $this */ - public function sendHeaders() - { + public function sendHeaders() { // headers have already been sent by the developer if (headers_sent()) { return $this; @@ -329,12 +323,12 @@ class Response // headers foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) { foreach ($values as $value) { - header($name.': '.$value, false, $this->statusCode); + header($name . ': ' . $value, FALSE, $this->statusCode); } } // status - header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode); + header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), TRUE, $this->statusCode); // cookies foreach ($this->headers->getCookies() as $cookie) { @@ -353,8 +347,7 @@ class Response * * @return $this */ - public function sendContent() - { + public function sendContent() { echo $this->content; return $this; @@ -365,15 +358,14 @@ class Response * * @return $this */ - public function send() - { + public function send() { $this->sendHeaders(); $this->sendContent(); if (function_exists('fastcgi_finish_request')) { fastcgi_finish_request(); - } elseif (!\in_array(PHP_SAPI, array('cli', 'phpdbg'), true)) { - static::closeOutputBuffers(0, true); + } else if (!\in_array(PHP_SAPI, array('cli', 'phpdbg'), TRUE)) { + static::closeOutputBuffers(0, TRUE); } return $this; @@ -390,13 +382,12 @@ class Response * * @throws \UnexpectedValueException */ - public function setContent($content) - { - if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable(array($content, '__toString'))) { + public function setContent($content) { + if (NULL !== $content && !is_string($content) && !is_numeric($content) && !is_callable(array($content, '__toString'))) { throw new \UnexpectedValueException(sprintf('The Response content must be a string or object implementing __toString(), "%s" given.', gettype($content))); } - $this->content = (string) $content; + $this->content = (string)$content; return $this; } @@ -406,8 +397,7 @@ class Response * * @return string Content */ - public function getContent() - { + public function getContent() { return $this->content; } @@ -420,8 +410,7 @@ class Response * * @final since version 3.2 */ - public function setProtocolVersion($version) - { + public function setProtocolVersion($version) { $this->version = $version; return $this; @@ -434,8 +423,7 @@ class Response * * @final since version 3.2 */ - public function getProtocolVersion() - { + public function getProtocolVersion() { return $this->version; } @@ -445,7 +433,7 @@ class Response * If the status text is null it will be automatically populated for the known * status codes and left empty otherwise. * - * @param int $code HTTP status code + * @param int $code HTTP status code * @param mixed $text HTTP status text * * @return $this @@ -454,20 +442,19 @@ class Response * * @final since version 3.2 */ - public function setStatusCode($code, $text = null) - { - $this->statusCode = $code = (int) $code; + public function setStatusCode($code, $text = NULL) { + $this->statusCode = $code = (int)$code; if ($this->isInvalid()) { throw new \InvalidArgumentException(sprintf('The HTTP status code "%s" is not valid.', $code)); } - if (null === $text) { + if (NULL === $text) { $this->statusText = isset(self::$statusTexts[$code]) ? self::$statusTexts[$code] : 'unknown status'; return $this; } - if (false === $text) { + if (FALSE === $text) { $this->statusText = ''; return $this; @@ -485,8 +472,7 @@ class Response * * @final since version 3.2 */ - public function getStatusCode() - { + public function getStatusCode() { return $this->statusCode; } @@ -499,8 +485,7 @@ class Response * * @final since version 3.2 */ - public function setCharset($charset) - { + public function setCharset($charset) { $this->charset = $charset; return $this; @@ -513,8 +498,7 @@ class Response * * @final since version 3.2 */ - public function getCharset() - { + public function getCharset() { return $this->charset; } @@ -531,14 +515,13 @@ class Response * * @final since version 3.3 */ - public function isCacheable() - { + public function isCacheable() { if (!in_array($this->statusCode, array(200, 203, 300, 301, 302, 404, 410))) { - return false; + return FALSE; } if ($this->headers->hasCacheControlDirective('no-store') || $this->headers->getCacheControlDirective('private')) { - return false; + return FALSE; } return $this->isValidateable() || $this->isFresh(); @@ -555,8 +538,7 @@ class Response * * @final since version 3.3 */ - public function isFresh() - { + public function isFresh() { return $this->getTtl() > 0; } @@ -568,8 +550,7 @@ class Response * * @final since version 3.3 */ - public function isValidateable() - { + public function isValidateable() { return $this->headers->has('Last-Modified') || $this->headers->has('ETag'); } @@ -582,8 +563,7 @@ class Response * * @final since version 3.2 */ - public function setPrivate() - { + public function setPrivate() { $this->headers->removeCacheControlDirective('public'); $this->headers->addCacheControlDirective('private'); @@ -599,8 +579,7 @@ class Response * * @final since version 3.2 */ - public function setPublic() - { + public function setPublic() { $this->headers->addCacheControlDirective('public'); $this->headers->removeCacheControlDirective('private'); @@ -616,8 +595,7 @@ class Response * * @final */ - public function setImmutable($immutable = true) - { + public function setImmutable($immutable = TRUE) { if ($immutable) { $this->headers->addCacheControlDirective('immutable'); } else { @@ -634,8 +612,7 @@ class Response * * @final */ - public function isImmutable() - { + public function isImmutable() { return $this->headers->hasCacheControlDirective('immutable'); } @@ -651,8 +628,7 @@ class Response * * @final since version 3.3 */ - public function mustRevalidate() - { + public function mustRevalidate() { return $this->headers->hasCacheControlDirective('must-revalidate') || $this->headers->hasCacheControlDirective('proxy-revalidate'); } @@ -665,8 +641,7 @@ class Response * * @final since version 3.2 */ - public function getDate() - { + public function getDate() { return $this->headers->getDate('Date'); } @@ -677,10 +652,9 @@ class Response * * @final since version 3.2 */ - public function setDate(\DateTime $date) - { + public function setDate(\DateTime $date) { $date->setTimezone(new \DateTimeZone('UTC')); - $this->headers->set('Date', $date->format('D, d M Y H:i:s').' GMT'); + $this->headers->set('Date', $date->format('D, d M Y H:i:s') . ' GMT'); return $this; } @@ -692,10 +666,9 @@ class Response * * @final since version 3.2 */ - public function getAge() - { - if (null !== $age = $this->headers->get('Age')) { - return (int) $age; + public function getAge() { + if (NULL !== $age = $this->headers->get('Age')) { + return (int)$age; } return max(time() - $this->getDate()->format('U'), 0); @@ -706,8 +679,7 @@ class Response * * @return $this */ - public function expire() - { + public function expire() { if ($this->isFresh()) { $this->headers->set('Age', $this->getMaxAge()); } @@ -722,8 +694,7 @@ class Response * * @final since version 3.2 */ - public function getExpires() - { + public function getExpires() { try { return $this->headers->getDate('Expires'); } catch (\RuntimeException $e) { @@ -743,14 +714,13 @@ class Response * * @final since version 3.2 */ - public function setExpires(\DateTime $date = null) - { - if (null === $date) { + public function setExpires(\DateTime $date = NULL) { + if (NULL === $date) { $this->headers->remove('Expires'); } else { $date = clone $date; $date->setTimezone(new \DateTimeZone('UTC')); - $this->headers->set('Expires', $date->format('D, d M Y H:i:s').' GMT'); + $this->headers->set('Expires', $date->format('D, d M Y H:i:s') . ' GMT'); } return $this; @@ -767,17 +737,16 @@ class Response * * @final since version 3.2 */ - public function getMaxAge() - { + public function getMaxAge() { if ($this->headers->hasCacheControlDirective('s-maxage')) { - return (int) $this->headers->getCacheControlDirective('s-maxage'); + return (int)$this->headers->getCacheControlDirective('s-maxage'); } if ($this->headers->hasCacheControlDirective('max-age')) { - return (int) $this->headers->getCacheControlDirective('max-age'); + return (int)$this->headers->getCacheControlDirective('max-age'); } - if (null !== $this->getExpires()) { + if (NULL !== $this->getExpires()) { return $this->getExpires()->format('U') - $this->getDate()->format('U'); } } @@ -793,8 +762,7 @@ class Response * * @final since version 3.2 */ - public function setMaxAge($value) - { + public function setMaxAge($value) { $this->headers->addCacheControlDirective('max-age', $value); return $this; @@ -811,8 +779,7 @@ class Response * * @final since version 3.2 */ - public function setSharedMaxAge($value) - { + public function setSharedMaxAge($value) { $this->setPublic(); $this->headers->addCacheControlDirective('s-maxage', $value); @@ -831,9 +798,8 @@ class Response * * @final since version 3.2 */ - public function getTtl() - { - if (null !== $maxAge = $this->getMaxAge()) { + public function getTtl() { + if (NULL !== $maxAge = $this->getMaxAge()) { return $maxAge - $this->getAge(); } } @@ -849,8 +815,7 @@ class Response * * @final since version 3.2 */ - public function setTtl($seconds) - { + public function setTtl($seconds) { $this->setSharedMaxAge($this->getAge() + $seconds); return $this; @@ -867,8 +832,7 @@ class Response * * @final since version 3.2 */ - public function setClientTtl($seconds) - { + public function setClientTtl($seconds) { $this->setMaxAge($this->getAge() + $seconds); return $this; @@ -883,8 +847,7 @@ class Response * * @final since version 3.2 */ - public function getLastModified() - { + public function getLastModified() { return $this->headers->getDate('Last-Modified'); } @@ -899,14 +862,13 @@ class Response * * @final since version 3.2 */ - public function setLastModified(\DateTime $date = null) - { - if (null === $date) { + public function setLastModified(\DateTime $date = NULL) { + if (NULL === $date) { $this->headers->remove('Last-Modified'); } else { $date = clone $date; $date->setTimezone(new \DateTimeZone('UTC')); - $this->headers->set('Last-Modified', $date->format('D, d M Y H:i:s').' GMT'); + $this->headers->set('Last-Modified', $date->format('D, d M Y H:i:s') . ' GMT'); } return $this; @@ -919,8 +881,7 @@ class Response * * @final since version 3.2 */ - public function getEtag() - { + public function getEtag() { return $this->headers->get('ETag'); } @@ -928,22 +889,21 @@ class Response * Sets the ETag value. * * @param string|null $etag The ETag unique identifier or null to remove the header - * @param bool $weak Whether you want a weak ETag or not + * @param bool $weak Whether you want a weak ETag or not * * @return $this * * @final since version 3.2 */ - public function setEtag($etag = null, $weak = false) - { - if (null === $etag) { + public function setEtag($etag = NULL, $weak = FALSE) { + if (NULL === $etag) { $this->headers->remove('Etag'); } else { if (0 !== strpos($etag, '"')) { - $etag = '"'.$etag.'"'; + $etag = '"' . $etag . '"'; } - $this->headers->set('ETag', (true === $weak ? 'W/' : '').$etag); + $this->headers->set('ETag', (TRUE === $weak ? 'W/' : '') . $etag); } return $this; @@ -962,8 +922,7 @@ class Response * * @final since version 3.3 */ - public function setCache(array $options) - { + public function setCache(array $options) { if ($diff = array_diff(array_keys($options), array('etag', 'last_modified', 'max_age', 's_maxage', 'private', 'public', 'immutable'))) { throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', array_values($diff)))); } @@ -1001,7 +960,7 @@ class Response } if (isset($options['immutable'])) { - $this->setImmutable((bool) $options['immutable']); + $this->setImmutable((bool)$options['immutable']); } return $this; @@ -1019,10 +978,9 @@ class Response * * @final since version 3.3 */ - public function setNotModified() - { + public function setNotModified() { $this->setStatusCode(304); - $this->setContent(null); + $this->setContent(NULL); // remove headers that MUST NOT be included with 304 Not Modified responses foreach (array('Allow', 'Content-Encoding', 'Content-Language', 'Content-Length', 'Content-MD5', 'Content-Type', 'Last-Modified') as $header) { @@ -1039,9 +997,8 @@ class Response * * @final since version 3.2 */ - public function hasVary() - { - return null !== $this->headers->get('Vary'); + public function hasVary() { + return NULL !== $this->headers->get('Vary'); } /** @@ -1051,9 +1008,8 @@ class Response * * @final since version 3.2 */ - public function getVary() - { - if (!$vary = $this->headers->get('Vary', null, false)) { + public function getVary() { + if (!$vary = $this->headers->get('Vary', NULL, FALSE)) { return array(); } @@ -1069,14 +1025,13 @@ class Response * Sets the Vary header. * * @param string|array $headers - * @param bool $replace Whether to replace the actual value or not (true by default) + * @param bool $replace Whether to replace the actual value or not (true by default) * * @return $this * * @final since version 3.2 */ - public function setVary($headers, $replace = true) - { + public function setVary($headers, $replace = TRUE) { $this->headers->set('Vary', $headers, $replace); return $this; @@ -1093,13 +1048,12 @@ class Response * * @final since version 3.3 */ - public function isNotModified(Request $request) - { + public function isNotModified(Request $request) { if (!$request->isMethodCacheable()) { - return false; + return FALSE; } - $notModified = false; + $notModified = FALSE; $lastModified = $this->headers->get('Last-Modified'); $modifiedSince = $request->headers->get('If-Modified-Since'); @@ -1127,8 +1081,7 @@ class Response * * @final since version 3.2 */ - public function isInvalid() - { + public function isInvalid() { return $this->statusCode < 100 || $this->statusCode >= 600; } @@ -1139,8 +1092,7 @@ class Response * * @final since version 3.3 */ - public function isInformational() - { + public function isInformational() { return $this->statusCode >= 100 && $this->statusCode < 200; } @@ -1151,8 +1103,7 @@ class Response * * @final since version 3.2 */ - public function isSuccessful() - { + public function isSuccessful() { return $this->statusCode >= 200 && $this->statusCode < 300; } @@ -1163,8 +1114,7 @@ class Response * * @final since version 3.2 */ - public function isRedirection() - { + public function isRedirection() { return $this->statusCode >= 300 && $this->statusCode < 400; } @@ -1175,8 +1125,7 @@ class Response * * @final since version 3.2 */ - public function isClientError() - { + public function isClientError() { return $this->statusCode >= 400 && $this->statusCode < 500; } @@ -1187,8 +1136,7 @@ class Response * * @final since version 3.3 */ - public function isServerError() - { + public function isServerError() { return $this->statusCode >= 500 && $this->statusCode < 600; } @@ -1199,8 +1147,7 @@ class Response * * @final since version 3.2 */ - public function isOk() - { + public function isOk() { return 200 === $this->statusCode; } @@ -1211,8 +1158,7 @@ class Response * * @final since version 3.2 */ - public function isForbidden() - { + public function isForbidden() { return 403 === $this->statusCode; } @@ -1223,8 +1169,7 @@ class Response * * @final since version 3.2 */ - public function isNotFound() - { + public function isNotFound() { return 404 === $this->statusCode; } @@ -1237,9 +1182,8 @@ class Response * * @final since version 3.2 */ - public function isRedirect($location = null) - { - return in_array($this->statusCode, array(201, 301, 302, 303, 307, 308)) && (null === $location ?: $location == $this->headers->get('Location')); + public function isRedirect($location = NULL) { + return in_array($this->statusCode, array(201, 301, 302, 303, 307, 308)) && (NULL === $location ?: $location == $this->headers->get('Location')); } /** @@ -1249,8 +1193,7 @@ class Response * * @final since version 3.2 */ - public function isEmpty() - { + public function isEmpty() { return in_array($this->statusCode, array(204, 304)); } @@ -1259,14 +1202,13 @@ class Response * * Resulting level can be greater than target level if a non-removable buffer has been encountered. * - * @param int $targetLevel The target output buffering level - * @param bool $flush Whether to flush or clean the buffers + * @param int $targetLevel The target output buffering level + * @param bool $flush Whether to flush or clean the buffers * * @final since version 3.3 */ - public static function closeOutputBuffers($targetLevel, $flush) - { - $status = ob_get_status(true); + public static function closeOutputBuffers($targetLevel, $flush) { + $status = ob_get_status(TRUE); $level = count($status); // PHP_OUTPUT_HANDLER_* are not defined on HHVM 3.3 $flags = defined('PHP_OUTPUT_HANDLER_REMOVABLE') ? PHP_OUTPUT_HANDLER_REMOVABLE | ($flush ? PHP_OUTPUT_HANDLER_FLUSHABLE : PHP_OUTPUT_HANDLER_CLEANABLE) : -1; @@ -1287,10 +1229,9 @@ class Response * * @final since version 3.3 */ - protected function ensureIEOverSSLCompatibility(Request $request) - { - if (false !== stripos($this->headers->get('Content-Disposition'), 'attachment') && 1 == preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT'), $match) && true === $request->isSecure()) { - if ((int) preg_replace('/(MSIE )(.*?);/', '$2', $match[0]) < 9) { + protected function ensureIEOverSSLCompatibility(Request $request) { + if (FALSE !== stripos($this->headers->get('Content-Disposition'), 'attachment') && 1 == preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT'), $match) && TRUE === $request->isSecure()) { + if ((int)preg_replace('/(MSIE )(.*?);/', '$2', $match[0]) < 9) { $this->headers->remove('Cache-Control'); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ResponseHeaderBag.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ResponseHeaderBag.php index 11a8593..470b883 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ResponseHeaderBag.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ResponseHeaderBag.php @@ -28,8 +28,7 @@ class ResponseHeaderBag extends HeaderBag protected $cookies = array(); protected $headerNames = array(); - public function __construct(array $headers = array()) - { + public function __construct(array $headers = array()) { parent::__construct($headers); if (!isset($this->headers['cache-control'])) { @@ -47,8 +46,7 @@ class ResponseHeaderBag extends HeaderBag * * @return array An array of headers */ - public function allPreserveCase() - { + public function allPreserveCase() { $headers = array(); foreach ($this->all() as $name => $value) { $headers[isset($this->headerNames[$name]) ? $this->headerNames[$name] : $name] = $value; @@ -57,8 +55,7 @@ class ResponseHeaderBag extends HeaderBag return $headers; } - public function allPreserveCaseWithoutCookies() - { + public function allPreserveCaseWithoutCookies() { $headers = $this->allPreserveCase(); if (isset($this->headerNames['set-cookie'])) { unset($headers[$this->headerNames['set-cookie']]); @@ -70,8 +67,7 @@ class ResponseHeaderBag extends HeaderBag /** * {@inheritdoc} */ - public function replace(array $headers = array()) - { + public function replace(array $headers = array()) { $this->headerNames = array(); parent::replace($headers); @@ -88,11 +84,10 @@ class ResponseHeaderBag extends HeaderBag /** * {@inheritdoc} */ - public function all() - { + public function all() { $headers = parent::all(); foreach ($this->getCookies() as $cookie) { - $headers['set-cookie'][] = (string) $cookie; + $headers['set-cookie'][] = (string)$cookie; } return $headers; @@ -101,15 +96,14 @@ class ResponseHeaderBag extends HeaderBag /** * {@inheritdoc} */ - public function set($key, $values, $replace = true) - { + public function set($key, $values, $replace = TRUE) { $uniqueKey = str_replace('_', '-', strtolower($key)); if ('set-cookie' === $uniqueKey) { if ($replace) { $this->cookies = array(); } - foreach ((array) $values as $cookie) { + foreach ((array)$values as $cookie) { $this->setCookie(Cookie::fromString($cookie)); } $this->headerNames[$uniqueKey] = $key; @@ -122,7 +116,7 @@ class ResponseHeaderBag extends HeaderBag parent::set($key, $values, $replace); // ensure the cache-control header has sensible defaults - if (\in_array($uniqueKey, array('cache-control', 'etag', 'last-modified', 'expires'), true)) { + if (\in_array($uniqueKey, array('cache-control', 'etag', 'last-modified', 'expires'), TRUE)) { $computed = $this->computeCacheControlValue(); $this->headers['cache-control'] = array($computed); $this->headerNames['cache-control'] = 'Cache-Control'; @@ -133,8 +127,7 @@ class ResponseHeaderBag extends HeaderBag /** * {@inheritdoc} */ - public function remove($key) - { + public function remove($key) { $uniqueKey = str_replace('_', '-', strtolower($key)); unset($this->headerNames[$uniqueKey]); @@ -158,21 +151,18 @@ class ResponseHeaderBag extends HeaderBag /** * {@inheritdoc} */ - public function hasCacheControlDirective($key) - { + public function hasCacheControlDirective($key) { return array_key_exists($key, $this->computedCacheControl); } /** * {@inheritdoc} */ - public function getCacheControlDirective($key) - { - return array_key_exists($key, $this->computedCacheControl) ? $this->computedCacheControl[$key] : null; + public function getCacheControlDirective($key) { + return array_key_exists($key, $this->computedCacheControl) ? $this->computedCacheControl[$key] : NULL; } - public function setCookie(Cookie $cookie) - { + public function setCookie(Cookie $cookie) { $this->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie; $this->headerNames['set-cookie'] = 'Set-Cookie'; } @@ -184,9 +174,8 @@ class ResponseHeaderBag extends HeaderBag * @param string $path * @param string $domain */ - public function removeCookie($name, $path = '/', $domain = null) - { - if (null === $path) { + public function removeCookie($name, $path = '/', $domain = NULL) { + if (NULL === $path) { $path = '/'; } @@ -214,8 +203,7 @@ class ResponseHeaderBag extends HeaderBag * * @throws \InvalidArgumentException When the $format is invalid */ - public function getCookies($format = self::COOKIES_FLAT) - { + public function getCookies($format = self::COOKIES_FLAT) { if (!in_array($format, array(self::COOKIES_FLAT, self::COOKIES_ARRAY))) { throw new \InvalidArgumentException(sprintf('Format "%s" invalid (%s).', $format, implode(', ', array(self::COOKIES_FLAT, self::COOKIES_ARRAY)))); } @@ -242,19 +230,18 @@ class ResponseHeaderBag extends HeaderBag * @param string $name * @param string $path * @param string $domain - * @param bool $secure - * @param bool $httpOnly + * @param bool $secure + * @param bool $httpOnly */ - public function clearCookie($name, $path = '/', $domain = null, $secure = false, $httpOnly = true) - { - $this->setCookie(new Cookie($name, null, 1, $path, $domain, $secure, $httpOnly)); + public function clearCookie($name, $path = '/', $domain = NULL, $secure = FALSE, $httpOnly = TRUE) { + $this->setCookie(new Cookie($name, NULL, 1, $path, $domain, $secure, $httpOnly)); } /** * Generates a HTTP Content-Disposition field-value. * - * @param string $disposition One of "inline" or "attachment" - * @param string $filename A unicode string + * @param string $disposition One of "inline" or "attachment" + * @param string $filename A unicode string * @param string $filenameFallback A string containing only ASCII characters that * is semantically equivalent to $filename. If the filename is already ASCII, * it can be omitted, or just copied from $filename @@ -265,8 +252,7 @@ class ResponseHeaderBag extends HeaderBag * * @see RFC 6266 */ - public function makeDisposition($disposition, $filename, $filenameFallback = '') - { + public function makeDisposition($disposition, $filename, $filenameFallback = '') { if (!in_array($disposition, array(self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE))) { throw new \InvalidArgumentException(sprintf('The disposition must be either "%s" or "%s".', self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE)); } @@ -281,12 +267,12 @@ class ResponseHeaderBag extends HeaderBag } // percent characters aren't safe in fallback. - if (false !== strpos($filenameFallback, '%')) { + if (FALSE !== strpos($filenameFallback, '%')) { throw new \InvalidArgumentException('The filename fallback cannot contain the "%" character.'); } // path separators aren't allowed in either. - if (false !== strpos($filename, '/') || false !== strpos($filename, '\\') || false !== strpos($filenameFallback, '/') || false !== strpos($filenameFallback, '\\')) { + if (FALSE !== strpos($filename, '/') || FALSE !== strpos($filename, '\\') || FALSE !== strpos($filenameFallback, '/') || FALSE !== strpos($filenameFallback, '\\')) { throw new \InvalidArgumentException('The filename and the fallback cannot contain the "/" and "\\" characters.'); } @@ -307,8 +293,7 @@ class ResponseHeaderBag extends HeaderBag * * @return string */ - protected function computeCacheControlValue() - { + protected function computeCacheControlValue() { if (!$this->cacheControl && !$this->has('ETag') && !$this->has('Last-Modified') && !$this->has('Expires')) { return 'no-cache, private'; } @@ -325,16 +310,15 @@ class ResponseHeaderBag extends HeaderBag // public if s-maxage is defined, private otherwise if (!isset($this->cacheControl['s-maxage'])) { - return $header.', private'; + return $header . ', private'; } return $header; } - private function initDate() - { + private function initDate() { $now = \DateTime::createFromFormat('U', time()); $now->setTimezone(new \DateTimeZone('UTC')); - $this->set('Date', $now->format('D, d M Y H:i:s').' GMT'); + $this->set('Date', $now->format('D, d M Y H:i:s') . ' GMT'); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ServerBag.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ServerBag.php index 19d2022..927b4d2 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ServerBag.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/ServerBag.php @@ -25,16 +25,14 @@ class ServerBag extends ParameterBag * * @return array */ - public function getHeaders() - { + public function getHeaders() { $headers = array(); - $contentHeaders = array('CONTENT_LENGTH' => true, 'CONTENT_MD5' => true, 'CONTENT_TYPE' => true); + $contentHeaders = array('CONTENT_LENGTH' => TRUE, 'CONTENT_MD5' => TRUE, 'CONTENT_TYPE' => TRUE); foreach ($this->parameters as $key => $value) { if (0 === strpos($key, 'HTTP_')) { $headers[substr($key, 5)] = $value; - } - // CONTENT_* are not prefixed with HTTP_ - elseif (isset($contentHeaders[$key])) { + } // CONTENT_* are not prefixed with HTTP_ + else if (isset($contentHeaders[$key])) { $headers[$key] = $value; } } @@ -57,25 +55,25 @@ class ServerBag extends ParameterBag * RewriteRule ^(.*)$ app.php [QSA,L] */ - $authorizationHeader = null; + $authorizationHeader = NULL; if (isset($this->parameters['HTTP_AUTHORIZATION'])) { $authorizationHeader = $this->parameters['HTTP_AUTHORIZATION']; - } elseif (isset($this->parameters['REDIRECT_HTTP_AUTHORIZATION'])) { + } else if (isset($this->parameters['REDIRECT_HTTP_AUTHORIZATION'])) { $authorizationHeader = $this->parameters['REDIRECT_HTTP_AUTHORIZATION']; } - if (null !== $authorizationHeader) { + if (NULL !== $authorizationHeader) { if (0 === stripos($authorizationHeader, 'basic ')) { // Decode AUTHORIZATION header into PHP_AUTH_USER and PHP_AUTH_PW when authorization header is basic $exploded = explode(':', base64_decode(substr($authorizationHeader, 6)), 2); if (2 == count($exploded)) { list($headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']) = $exploded; } - } elseif (empty($this->parameters['PHP_AUTH_DIGEST']) && (0 === stripos($authorizationHeader, 'digest '))) { + } else if (empty($this->parameters['PHP_AUTH_DIGEST']) && (0 === stripos($authorizationHeader, 'digest '))) { // In some circumstances PHP_AUTH_DIGEST needs to be set $headers['PHP_AUTH_DIGEST'] = $authorizationHeader; $this->parameters['PHP_AUTH_DIGEST'] = $authorizationHeader; - } elseif (0 === stripos($authorizationHeader, 'bearer ')) { + } else if (0 === stripos($authorizationHeader, 'bearer ')) { /* * XXX: Since there is no PHP_AUTH_BEARER in PHP predefined variables, * I'll just set $headers['AUTHORIZATION'] here. @@ -92,8 +90,8 @@ class ServerBag extends ParameterBag // PHP_AUTH_USER/PHP_AUTH_PW if (isset($headers['PHP_AUTH_USER'])) { - $headers['AUTHORIZATION'] = 'Basic '.base64_encode($headers['PHP_AUTH_USER'].':'.$headers['PHP_AUTH_PW']); - } elseif (isset($headers['PHP_AUTH_DIGEST'])) { + $headers['AUTHORIZATION'] = 'Basic ' . base64_encode($headers['PHP_AUTH_USER'] . ':' . $headers['PHP_AUTH_PW']); + } else if (isset($headers['PHP_AUTH_DIGEST'])) { $headers['AUTHORIZATION'] = $headers['PHP_AUTH_DIGEST']; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php index ea1fda2..fd27030 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php @@ -24,77 +24,67 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta /** * @param string $storageKey The key used to store attributes in the session */ - public function __construct($storageKey = '_sf2_attributes') - { + public function __construct($storageKey = '_sf2_attributes') { $this->storageKey = $storageKey; } /** * {@inheritdoc} */ - public function getName() - { + public function getName() { return $this->name; } - public function setName($name) - { + public function setName($name) { $this->name = $name; } /** * {@inheritdoc} */ - public function initialize(array &$attributes) - { + public function initialize(array &$attributes) { $this->attributes = &$attributes; } /** * {@inheritdoc} */ - public function getStorageKey() - { + public function getStorageKey() { return $this->storageKey; } /** * {@inheritdoc} */ - public function has($name) - { + public function has($name) { return array_key_exists($name, $this->attributes); } /** * {@inheritdoc} */ - public function get($name, $default = null) - { + public function get($name, $default = NULL) { return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default; } /** * {@inheritdoc} */ - public function set($name, $value) - { + public function set($name, $value) { $this->attributes[$name] = $value; } /** * {@inheritdoc} */ - public function all() - { + public function all() { return $this->attributes; } /** * {@inheritdoc} */ - public function replace(array $attributes) - { + public function replace(array $attributes) { $this->attributes = array(); foreach ($attributes as $key => $value) { $this->set($key, $value); @@ -104,9 +94,8 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta /** * {@inheritdoc} */ - public function remove($name) - { - $retval = null; + public function remove($name) { + $retval = NULL; if (array_key_exists($name, $this->attributes)) { $retval = $this->attributes[$name]; unset($this->attributes[$name]); @@ -118,8 +107,7 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta /** * {@inheritdoc} */ - public function clear() - { + public function clear() { $return = $this->attributes; $this->attributes = array(); @@ -131,8 +119,7 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta * * @return \ArrayIterator An \ArrayIterator instance */ - public function getIterator() - { + public function getIterator() { return new \ArrayIterator($this->attributes); } @@ -141,8 +128,7 @@ class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Counta * * @return int The number of attributes */ - public function count() - { + public function count() { return count($this->attributes); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Attribute/AttributeBagInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Attribute/AttributeBagInterface.php index 0d8d179..52a8586 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Attribute/AttributeBagInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Attribute/AttributeBagInterface.php @@ -32,18 +32,18 @@ interface AttributeBagInterface extends SessionBagInterface /** * Returns an attribute. * - * @param string $name The attribute name - * @param mixed $default The default value if not found + * @param string $name The attribute name + * @param mixed $default The default value if not found * * @return mixed */ - public function get($name, $default = null); + public function get($name, $default = NULL); /** * Sets an attribute. * * @param string $name - * @param mixed $value + * @param mixed $value */ public function set($name, $value); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php index abbf37e..c813be8 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Attribute/NamespacedAttributeBag.php @@ -22,11 +22,10 @@ class NamespacedAttributeBag extends AttributeBag private $namespaceCharacter; /** - * @param string $storageKey Session storage key + * @param string $storageKey Session storage key * @param string $namespaceCharacter Namespace character to use in keys */ - public function __construct($storageKey = '_sf2_attributes', $namespaceCharacter = '/') - { + public function __construct($storageKey = '_sf2_attributes', $namespaceCharacter = '/') { $this->namespaceCharacter = $namespaceCharacter; parent::__construct($storageKey); } @@ -34,14 +33,13 @@ class NamespacedAttributeBag extends AttributeBag /** * {@inheritdoc} */ - public function has($name) - { + public function has($name) { // reference mismatch: if fixed, re-introduced in array_key_exists; keep as it is $attributes = $this->resolveAttributePath($name); $name = $this->resolveKey($name); - if (null === $attributes) { - return false; + if (NULL === $attributes) { + return FALSE; } return array_key_exists($name, $attributes); @@ -50,13 +48,12 @@ class NamespacedAttributeBag extends AttributeBag /** * {@inheritdoc} */ - public function get($name, $default = null) - { + public function get($name, $default = NULL) { // reference mismatch: if fixed, re-introduced in array_key_exists; keep as it is $attributes = $this->resolveAttributePath($name); $name = $this->resolveKey($name); - if (null === $attributes) { + if (NULL === $attributes) { return $default; } @@ -66,9 +63,8 @@ class NamespacedAttributeBag extends AttributeBag /** * {@inheritdoc} */ - public function set($name, $value) - { - $attributes = &$this->resolveAttributePath($name, true); + public function set($name, $value) { + $attributes = &$this->resolveAttributePath($name, TRUE); $name = $this->resolveKey($name); $attributes[$name] = $value; } @@ -76,12 +72,11 @@ class NamespacedAttributeBag extends AttributeBag /** * {@inheritdoc} */ - public function remove($name) - { - $retval = null; + public function remove($name) { + $retval = NULL; $attributes = &$this->resolveAttributePath($name); $name = $this->resolveKey($name); - if (null !== $attributes && array_key_exists($name, $attributes)) { + if (NULL !== $attributes && array_key_exists($name, $attributes)) { $retval = $attributes[$name]; unset($attributes[$name]); } @@ -94,13 +89,12 @@ class NamespacedAttributeBag extends AttributeBag * * This method allows structured namespacing of session attributes. * - * @param string $name Key name - * @param bool $writeContext Write context, default false + * @param string $name Key name + * @param bool $writeContext Write context, default false * * @return array */ - protected function &resolveAttributePath($name, $writeContext = false) - { + protected function &resolveAttributePath($name, $writeContext = FALSE) { $array = &$this->attributes; $name = (0 === strpos($name, $this->namespaceCharacter)) ? substr($name, 1) : $name; @@ -123,8 +117,8 @@ class NamespacedAttributeBag extends AttributeBag unset($parts[count($parts) - 1]); foreach ($parts as $part) { - if (null !== $array && !array_key_exists($part, $array)) { - $array[$part] = $writeContext ? array() : null; + if (NULL !== $array && !array_key_exists($part, $array)) { + $array[$part] = $writeContext ? array() : NULL; } $array = &$array[$part]; @@ -142,9 +136,8 @@ class NamespacedAttributeBag extends AttributeBag * * @return string */ - protected function resolveKey($name) - { - if (false !== $pos = strrpos($name, $this->namespaceCharacter)) { + protected function resolveKey($name) { + if (FALSE !== $pos = strrpos($name, $this->namespaceCharacter)) { $name = substr($name, $pos + 1); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php index 77521c2..cce47b5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php @@ -25,29 +25,25 @@ class AutoExpireFlashBag implements FlashBagInterface /** * @param string $storageKey The key used to store flashes in the session */ - public function __construct($storageKey = '_symfony_flashes') - { + public function __construct($storageKey = '_symfony_flashes') { $this->storageKey = $storageKey; } /** * {@inheritdoc} */ - public function getName() - { + public function getName() { return $this->name; } - public function setName($name) - { + public function setName($name) { $this->name = $name; } /** * {@inheritdoc} */ - public function initialize(array &$flashes) - { + public function initialize(array &$flashes) { $this->flashes = &$flashes; // The logic: messages from the last request will be stored in new, so we move them to previous @@ -60,32 +56,28 @@ class AutoExpireFlashBag implements FlashBagInterface /** * {@inheritdoc} */ - public function add($type, $message) - { + public function add($type, $message) { $this->flashes['new'][$type][] = $message; } /** * {@inheritdoc} */ - public function peek($type, array $default = array()) - { + public function peek($type, array $default = array()) { return $this->has($type) ? $this->flashes['display'][$type] : $default; } /** * {@inheritdoc} */ - public function peekAll() - { - return array_key_exists('display', $this->flashes) ? (array) $this->flashes['display'] : array(); + public function peekAll() { + return array_key_exists('display', $this->flashes) ? (array)$this->flashes['display'] : array(); } /** * {@inheritdoc} */ - public function get($type, array $default = array()) - { + public function get($type, array $default = array()) { $return = $default; if (!$this->has($type)) { @@ -103,8 +95,7 @@ class AutoExpireFlashBag implements FlashBagInterface /** * {@inheritdoc} */ - public function all() - { + public function all() { $return = $this->flashes['display']; $this->flashes['display'] = array(); @@ -114,48 +105,42 @@ class AutoExpireFlashBag implements FlashBagInterface /** * {@inheritdoc} */ - public function setAll(array $messages) - { + public function setAll(array $messages) { $this->flashes['new'] = $messages; } /** * {@inheritdoc} */ - public function set($type, $messages) - { - $this->flashes['new'][$type] = (array) $messages; + public function set($type, $messages) { + $this->flashes['new'][$type] = (array)$messages; } /** * {@inheritdoc} */ - public function has($type) - { + public function has($type) { return array_key_exists($type, $this->flashes['display']) && $this->flashes['display'][$type]; } /** * {@inheritdoc} */ - public function keys() - { + public function keys() { return array_keys($this->flashes['display']); } /** * {@inheritdoc} */ - public function getStorageKey() - { + public function getStorageKey() { return $this->storageKey; } /** * {@inheritdoc} */ - public function clear() - { + public function clear() { return $this->all(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Flash/FlashBag.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Flash/FlashBag.php index 12fb740..ab7093e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Flash/FlashBag.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Flash/FlashBag.php @@ -25,61 +25,53 @@ class FlashBag implements FlashBagInterface /** * @param string $storageKey The key used to store flashes in the session */ - public function __construct($storageKey = '_symfony_flashes') - { + public function __construct($storageKey = '_symfony_flashes') { $this->storageKey = $storageKey; } /** * {@inheritdoc} */ - public function getName() - { + public function getName() { return $this->name; } - public function setName($name) - { + public function setName($name) { $this->name = $name; } /** * {@inheritdoc} */ - public function initialize(array &$flashes) - { + public function initialize(array &$flashes) { $this->flashes = &$flashes; } /** * {@inheritdoc} */ - public function add($type, $message) - { + public function add($type, $message) { $this->flashes[$type][] = $message; } /** * {@inheritdoc} */ - public function peek($type, array $default = array()) - { + public function peek($type, array $default = array()) { return $this->has($type) ? $this->flashes[$type] : $default; } /** * {@inheritdoc} */ - public function peekAll() - { + public function peekAll() { return $this->flashes; } /** * {@inheritdoc} */ - public function get($type, array $default = array()) - { + public function get($type, array $default = array()) { if (!$this->has($type)) { return $default; } @@ -94,8 +86,7 @@ class FlashBag implements FlashBagInterface /** * {@inheritdoc} */ - public function all() - { + public function all() { $return = $this->peekAll(); $this->flashes = array(); @@ -105,48 +96,42 @@ class FlashBag implements FlashBagInterface /** * {@inheritdoc} */ - public function set($type, $messages) - { - $this->flashes[$type] = (array) $messages; + public function set($type, $messages) { + $this->flashes[$type] = (array)$messages; } /** * {@inheritdoc} */ - public function setAll(array $messages) - { + public function setAll(array $messages) { $this->flashes = $messages; } /** * {@inheritdoc} */ - public function has($type) - { + public function has($type) { return array_key_exists($type, $this->flashes) && $this->flashes[$type]; } /** * {@inheritdoc} */ - public function keys() - { + public function keys() { return array_keys($this->flashes); } /** * {@inheritdoc} */ - public function getStorageKey() - { + public function getStorageKey() { return $this->storageKey; } /** * {@inheritdoc} */ - public function clear() - { + public function clear() { return $this->all(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php index 80e97f1..44e744c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php @@ -31,7 +31,7 @@ interface FlashBagInterface extends SessionBagInterface /** * Registers a message for a given type. * - * @param string $type + * @param string $type * @param string|array $message */ public function set($type, $message); @@ -39,8 +39,8 @@ interface FlashBagInterface extends SessionBagInterface /** * Gets flash messages for a given type. * - * @param string $type Message category type - * @param array $default Default value if $type does not exist + * @param string $type Message category type + * @param array $default Default value if $type does not exist * * @return array */ @@ -57,7 +57,7 @@ interface FlashBagInterface extends SessionBagInterface * Gets and clears flash from the stack. * * @param string $type - * @param array $default Default value if $type does not exist + * @param array $default Default value if $type does not exist * * @return array */ diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Session.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Session.php index a46cffb..67ba617 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Session.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Session.php @@ -32,12 +32,11 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable private $hasBeenStarted; /** - * @param SessionStorageInterface $storage A SessionStorageInterface instance - * @param AttributeBagInterface $attributes An AttributeBagInterface instance, (defaults null for default AttributeBag) - * @param FlashBagInterface $flashes A FlashBagInterface instance (defaults null for default FlashBag) + * @param SessionStorageInterface $storage A SessionStorageInterface instance + * @param AttributeBagInterface $attributes An AttributeBagInterface instance, (defaults null for default AttributeBag) + * @param FlashBagInterface $flashes A FlashBagInterface instance (defaults null for default FlashBag) */ - public function __construct(SessionStorageInterface $storage = null, AttributeBagInterface $attributes = null, FlashBagInterface $flashes = null) - { + public function __construct(SessionStorageInterface $storage = NULL, AttributeBagInterface $attributes = NULL, FlashBagInterface $flashes = NULL) { $this->storage = $storage ?: new NativeSessionStorage(); $attributes = $attributes ?: new AttributeBag(); @@ -52,72 +51,63 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable /** * {@inheritdoc} */ - public function start() - { + public function start() { return $this->storage->start(); } /** * {@inheritdoc} */ - public function has($name) - { + public function has($name) { return $this->getAttributeBag()->has($name); } /** * {@inheritdoc} */ - public function get($name, $default = null) - { + public function get($name, $default = NULL) { return $this->getAttributeBag()->get($name, $default); } /** * {@inheritdoc} */ - public function set($name, $value) - { + public function set($name, $value) { $this->getAttributeBag()->set($name, $value); } /** * {@inheritdoc} */ - public function all() - { + public function all() { return $this->getAttributeBag()->all(); } /** * {@inheritdoc} */ - public function replace(array $attributes) - { + public function replace(array $attributes) { $this->getAttributeBag()->replace($attributes); } /** * {@inheritdoc} */ - public function remove($name) - { + public function remove($name) { return $this->getAttributeBag()->remove($name); } /** * {@inheritdoc} */ - public function clear() - { + public function clear() { $this->getAttributeBag()->clear(); } /** * {@inheritdoc} */ - public function isStarted() - { + public function isStarted() { return $this->storage->isStarted(); } @@ -126,8 +116,7 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable * * @return \ArrayIterator An \ArrayIterator instance */ - public function getIterator() - { + public function getIterator() { return new \ArrayIterator($this->getAttributeBag()->all()); } @@ -136,8 +125,7 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable * * @return int The number of attributes */ - public function count() - { + public function count() { return count($this->getAttributeBag()->all()); } @@ -146,8 +134,7 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable * * @internal */ - public function hasBeenStarted() - { + public function hasBeenStarted() { return $this->hasBeenStarted; } @@ -156,96 +143,85 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable * * @internal */ - public function isEmpty() - { + public function isEmpty() { foreach ($this->data as &$data) { if (!empty($data)) { - return false; + return FALSE; } } - return true; + return TRUE; } /** * {@inheritdoc} */ - public function invalidate($lifetime = null) - { + public function invalidate($lifetime = NULL) { $this->storage->clear(); - return $this->migrate(true, $lifetime); + return $this->migrate(TRUE, $lifetime); } /** * {@inheritdoc} */ - public function migrate($destroy = false, $lifetime = null) - { + public function migrate($destroy = FALSE, $lifetime = NULL) { return $this->storage->regenerate($destroy, $lifetime); } /** * {@inheritdoc} */ - public function save() - { + public function save() { $this->storage->save(); } /** * {@inheritdoc} */ - public function getId() - { + public function getId() { return $this->storage->getId(); } /** * {@inheritdoc} */ - public function setId($id) - { + public function setId($id) { $this->storage->setId($id); } /** * {@inheritdoc} */ - public function getName() - { + public function getName() { return $this->storage->getName(); } /** * {@inheritdoc} */ - public function setName($name) - { + public function setName($name) { $this->storage->setName($name); } /** * {@inheritdoc} */ - public function getMetadataBag() - { + public function getMetadataBag() { return $this->storage->getMetadataBag(); } /** * {@inheritdoc} */ - public function registerBag(SessionBagInterface $bag) - { + public function registerBag(SessionBagInterface $bag) { $this->storage->registerBag(new SessionBagProxy($bag, $this->data, $this->hasBeenStarted)); } /** * {@inheritdoc} */ - public function getBag($name) - { + public function getBag($name) { return $this->storage->getBag($name)->getBag(); } @@ -254,8 +230,7 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable * * @return FlashBagInterface */ - public function getFlashBag() - { + public function getFlashBag() { return $this->getBag($this->flashName); } @@ -266,8 +241,7 @@ class Session implements SessionInterface, \IteratorAggregate, \Countable * * @return AttributeBagInterface */ - private function getAttributeBag() - { + private function getAttributeBag() { return $this->getBag($this->attributeName); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/SessionBagProxy.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/SessionBagProxy.php index 307836d..1fa2556 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/SessionBagProxy.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/SessionBagProxy.php @@ -22,8 +22,7 @@ final class SessionBagProxy implements SessionBagInterface private $data; private $hasBeenStarted; - public function __construct(SessionBagInterface $bag, array &$data, &$hasBeenStarted) - { + public function __construct(SessionBagInterface $bag, array &$data, &$hasBeenStarted) { $this->bag = $bag; $this->data = &$data; $this->hasBeenStarted = &$hasBeenStarted; @@ -32,33 +31,29 @@ final class SessionBagProxy implements SessionBagInterface /** * @return SessionBagInterface */ - public function getBag() - { + public function getBag() { return $this->bag; } /** * @return bool */ - public function isEmpty() - { + public function isEmpty() { return empty($this->data[$this->bag->getStorageKey()]); } /** * {@inheritdoc} */ - public function getName() - { + public function getName() { return $this->bag->getName(); } /** * {@inheritdoc} */ - public function initialize(array &$array) - { - $this->hasBeenStarted = true; + public function initialize(array &$array) { + $this->hasBeenStarted = TRUE; $this->data[$this->bag->getStorageKey()] = &$array; $this->bag->initialize($array); @@ -67,16 +62,14 @@ final class SessionBagProxy implements SessionBagInterface /** * {@inheritdoc} */ - public function getStorageKey() - { + public function getStorageKey() { return $this->bag->getStorageKey(); } /** * {@inheritdoc} */ - public function clear() - { + public function clear() { return $this->bag->clear(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/SessionInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/SessionInterface.php index 95fca85..cb7fbab 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/SessionInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/SessionInterface.php @@ -70,21 +70,21 @@ interface SessionInterface * * @return bool True if session invalidated, false if error */ - public function invalidate($lifetime = null); + public function invalidate($lifetime = NULL); /** * Migrates the current session to a new session id while maintaining all * session attributes. * - * @param bool $destroy Whether to delete the old session or leave it to garbage collection - * @param int $lifetime Sets the cookie lifetime for the session cookie. A null value + * @param bool $destroy Whether to delete the old session or leave it to garbage collection + * @param int $lifetime Sets the cookie lifetime for the session cookie. A null value * will leave the system settings unchanged, 0 sets the cookie * to expire with browser session. Time is in seconds, and is * not a Unix timestamp. * * @return bool True if session migrated, false if error */ - public function migrate($destroy = false, $lifetime = null); + public function migrate($destroy = FALSE, $lifetime = NULL); /** * Force the session to be saved and closed. @@ -107,18 +107,18 @@ interface SessionInterface /** * Returns an attribute. * - * @param string $name The attribute name - * @param mixed $default The default value if not found + * @param string $name The attribute name + * @param mixed $default The default value if not found * * @return mixed */ - public function get($name, $default = null); + public function get($name, $default = NULL); /** * Sets an attribute. * * @param string $name - * @param mixed $value + * @param mixed $value */ public function set($name, $value); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php index 6ae1355..70d19cc 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php @@ -29,14 +29,13 @@ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \Sess /** * {@inheritdoc} */ - public function open($savePath, $sessionName) - { + public function open($savePath, $sessionName) { $this->sessionName = $sessionName; if (!headers_sent() && !ini_get('session.cache_limiter') && '0' !== ini_get('session.cache_limiter')) { - header(sprintf('Cache-Control: max-age=%d, private, must-revalidate', 60 * (int) ini_get('session.cache_expire'))); + header(sprintf('Cache-Control: max-age=%d, private, must-revalidate', 60 * (int)ini_get('session.cache_expire'))); } - return true; + return TRUE; } /** @@ -64,8 +63,7 @@ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \Sess /** * {@inheritdoc} */ - public function validateId($sessionId) - { + public function validateId($sessionId) { $this->prefetchData = $this->read($sessionId); $this->prefetchId = $sessionId; @@ -75,22 +73,21 @@ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \Sess /** * {@inheritdoc} */ - public function read($sessionId) - { - if (null !== $this->prefetchId) { + public function read($sessionId) { + if (NULL !== $this->prefetchId) { $prefetchId = $this->prefetchId; $prefetchData = $this->prefetchData; - $this->prefetchId = $this->prefetchData = null; + $this->prefetchId = $this->prefetchData = NULL; if ($prefetchId === $sessionId || '' === $prefetchData) { - $this->newSessionId = '' === $prefetchData ? $sessionId : null; + $this->newSessionId = '' === $prefetchData ? $sessionId : NULL; return $prefetchData; } } $data = $this->doRead($sessionId); - $this->newSessionId = '' === $data ? $sessionId : null; + $this->newSessionId = '' === $data ? $sessionId : NULL; if (\PHP_VERSION_ID < 70000) { $this->prefetchData = $data; } @@ -101,24 +98,23 @@ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \Sess /** * {@inheritdoc} */ - public function write($sessionId, $data) - { + public function write($sessionId, $data) { if (\PHP_VERSION_ID < 70000 && $this->prefetchData) { $readData = $this->prefetchData; - $this->prefetchData = null; + $this->prefetchData = NULL; if ($readData === $data) { return $this->updateTimestamp($sessionId, $data); } } - if (null === $this->igbinaryEmptyData) { + if (NULL === $this->igbinaryEmptyData) { // see https://github.com/igbinary/igbinary/issues/146 $this->igbinaryEmptyData = \function_exists('igbinary_serialize') ? igbinary_serialize(array()) : ''; } if ('' === $data || $this->igbinaryEmptyData === $data) { return $this->destroy($sessionId); } - $this->newSessionId = null; + $this->newSessionId = NULL; return $this->doWrite($sessionId, $data); } @@ -126,10 +122,9 @@ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \Sess /** * {@inheritdoc} */ - public function destroy($sessionId) - { + public function destroy($sessionId) { if (\PHP_VERSION_ID < 70000) { - $this->prefetchData = null; + $this->prefetchData = NULL; } if (!headers_sent() && ini_get('session.use_cookies')) { if (!$this->sessionName) { @@ -137,14 +132,14 @@ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \Sess } $sessionCookie = sprintf(' %s=', urlencode($this->sessionName)); $sessionCookieWithId = sprintf('%s%s;', $sessionCookie, urlencode($sessionId)); - $sessionCookieFound = false; + $sessionCookieFound = FALSE; $otherCookies = array(); foreach (headers_list() as $h) { if (0 !== stripos($h, 'Set-Cookie:')) { continue; } if (11 === strpos($h, $sessionCookie, 11)) { - $sessionCookieFound = true; + $sessionCookieFound = TRUE; if (11 !== strpos($h, $sessionCookieWithId, 11)) { $otherCookies[] = $h; @@ -156,7 +151,7 @@ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \Sess if ($sessionCookieFound) { header_remove('Set-Cookie'); foreach ($otherCookies as $h) { - header($h, false); + header($h, FALSE); } } else { setcookie($this->sessionName, '', 0, ini_get('session.cookie_path'), ini_get('session.cookie_domain'), ini_get('session.cookie_secure'), ini_get('session.cookie_httponly')); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php index 90726be..ad0303b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/MemcacheSessionHandler.php @@ -40,12 +40,11 @@ class MemcacheSessionHandler implements \SessionHandlerInterface * * expiretime: The time to live in seconds * * @param \Memcache $memcache A \Memcache instance - * @param array $options An associative array of Memcache options + * @param array $options An associative array of Memcache options * * @throws \InvalidArgumentException When unsupported options are passed */ - public function __construct(\Memcache $memcache, array $options = array()) - { + public function __construct(\Memcache $memcache, array $options = array()) { if ($diff = array_diff(array_keys($options), array('prefix', 'expiretime'))) { throw new \InvalidArgumentException(sprintf( 'The following options are not supported "%s"', implode(', ', $diff) @@ -53,59 +52,53 @@ class MemcacheSessionHandler implements \SessionHandlerInterface } $this->memcache = $memcache; - $this->ttl = isset($options['expiretime']) ? (int) $options['expiretime'] : 86400; + $this->ttl = isset($options['expiretime']) ? (int)$options['expiretime'] : 86400; $this->prefix = isset($options['prefix']) ? $options['prefix'] : 'sf2s'; } /** * {@inheritdoc} */ - public function open($savePath, $sessionName) - { - return true; + public function open($savePath, $sessionName) { + return TRUE; } /** * {@inheritdoc} */ - public function close() - { - return true; + public function close() { + return TRUE; } /** * {@inheritdoc} */ - public function read($sessionId) - { - return $this->memcache->get($this->prefix.$sessionId) ?: ''; + public function read($sessionId) { + return $this->memcache->get($this->prefix . $sessionId) ?: ''; } /** * {@inheritdoc} */ - public function write($sessionId, $data) - { - return $this->memcache->set($this->prefix.$sessionId, $data, 0, time() + $this->ttl); + public function write($sessionId, $data) { + return $this->memcache->set($this->prefix . $sessionId, $data, 0, time() + $this->ttl); } /** * {@inheritdoc} */ - public function destroy($sessionId) - { - $this->memcache->delete($this->prefix.$sessionId); + public function destroy($sessionId) { + $this->memcache->delete($this->prefix . $sessionId); - return true; + return TRUE; } /** * {@inheritdoc} */ - public function gc($maxlifetime) - { + public function gc($maxlifetime) { // not required here because memcache will auto expire the records anyhow. - return true; + return TRUE; } /** @@ -113,8 +106,7 @@ class MemcacheSessionHandler implements \SessionHandlerInterface * * @return \Memcache */ - protected function getMemcache() - { + protected function getMemcache() { return $this->memcache; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php index dd37eae..8e14ee4 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php @@ -41,12 +41,11 @@ class MemcachedSessionHandler extends AbstractSessionHandler * * expiretime: The time to live in seconds. * * @param \Memcached $memcached A \Memcached instance - * @param array $options An associative array of Memcached options + * @param array $options An associative array of Memcached options * * @throws \InvalidArgumentException When unsupported options are passed */ - public function __construct(\Memcached $memcached, array $options = array()) - { + public function __construct(\Memcached $memcached, array $options = array()) { $this->memcached = $memcached; if ($diff = array_diff(array_keys($options), array('prefix', 'expiretime'))) { @@ -55,50 +54,45 @@ class MemcachedSessionHandler extends AbstractSessionHandler )); } - $this->ttl = isset($options['expiretime']) ? (int) $options['expiretime'] : 86400; + $this->ttl = isset($options['expiretime']) ? (int)$options['expiretime'] : 86400; $this->prefix = isset($options['prefix']) ? $options['prefix'] : 'sf2s'; } /** * {@inheritdoc} */ - public function close() - { - return true; + public function close() { + return TRUE; } /** * {@inheritdoc} */ - protected function doRead($sessionId) - { - return $this->memcached->get($this->prefix.$sessionId) ?: ''; + protected function doRead($sessionId) { + return $this->memcached->get($this->prefix . $sessionId) ?: ''; } /** * {@inheritdoc} */ - public function updateTimestamp($sessionId, $data) - { - $this->memcached->touch($this->prefix.$sessionId, time() + $this->ttl); + public function updateTimestamp($sessionId, $data) { + $this->memcached->touch($this->prefix . $sessionId, time() + $this->ttl); - return true; + return TRUE; } /** * {@inheritdoc} */ - protected function doWrite($sessionId, $data) - { - return $this->memcached->set($this->prefix.$sessionId, $data, time() + $this->ttl); + protected function doWrite($sessionId, $data) { + return $this->memcached->set($this->prefix . $sessionId, $data, time() + $this->ttl); } /** * {@inheritdoc} */ - protected function doDestroy($sessionId) - { - $result = $this->memcached->delete($this->prefix.$sessionId); + protected function doDestroy($sessionId) { + $result = $this->memcached->delete($this->prefix . $sessionId); return $result || \Memcached::RES_NOTFOUND == $this->memcached->getResultCode(); } @@ -106,10 +100,9 @@ class MemcachedSessionHandler extends AbstractSessionHandler /** * {@inheritdoc} */ - public function gc($maxlifetime) - { + public function gc($maxlifetime) { // not required here because memcached will auto expire the records anyhow. - return true; + return TRUE; } /** @@ -117,8 +110,7 @@ class MemcachedSessionHandler extends AbstractSessionHandler * * @return \Memcached */ - protected function getMemcached() - { + protected function getMemcached() { return $this->memcached; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php index 7d3fa21..fcaafc8 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php @@ -61,14 +61,13 @@ class MongoDbSessionHandler extends AbstractSessionHandler * If you use such an index, you can drop `gc_probability` to 0 since * no garbage-collection is required. * - * @param \MongoDB\Client $mongo A MongoDB\Client instance - * @param array $options An associative array of field options + * @param \MongoDB\Client $mongo A MongoDB\Client instance + * @param array $options An associative array of field options * * @throws \InvalidArgumentException When MongoClient or Mongo instance not provided * @throws \InvalidArgumentException When "database" or "collection" not provided */ - public function __construct($mongo, array $options) - { + public function __construct($mongo, array $options) { if ($mongo instanceof \MongoClient || $mongo instanceof \Mongo) { @trigger_error(sprintf('Using %s with the legacy mongo extension is deprecated as of 3.4 and will be removed in 4.0. Use it with the mongodb/mongodb package and ext-mongodb instead.', __CLASS__), E_USER_DEPRECATED); } @@ -94,58 +93,54 @@ class MongoDbSessionHandler extends AbstractSessionHandler /** * {@inheritdoc} */ - public function close() - { - return true; + public function close() { + return TRUE; } /** * {@inheritdoc} */ - protected function doDestroy($sessionId) - { + protected function doDestroy($sessionId) { $methodName = $this->mongo instanceof \MongoDB\Client ? 'deleteOne' : 'remove'; $this->getCollection()->$methodName(array( $this->options['id_field'] => $sessionId, )); - return true; + return TRUE; } /** * {@inheritdoc} */ - public function gc($maxlifetime) - { + public function gc($maxlifetime) { $methodName = $this->mongo instanceof \MongoDB\Client ? 'deleteMany' : 'remove'; $this->getCollection()->$methodName(array( $this->options['expiry_field'] => array('$lt' => $this->createDateTime()), )); - return true; + return TRUE; } /** * {@inheritdoc} */ - protected function doWrite($sessionId, $data) - { - $expiry = $this->createDateTime(time() + (int) ini_get('session.gc_maxlifetime')); + protected function doWrite($sessionId, $data) { + $expiry = $this->createDateTime(time() + (int)ini_get('session.gc_maxlifetime')); $fields = array( $this->options['time_field'] => $this->createDateTime(), $this->options['expiry_field'] => $expiry, ); - $options = array('upsert' => true); + $options = array('upsert' => TRUE); if ($this->mongo instanceof \MongoDB\Client) { $fields[$this->options['data_field']] = new \MongoDB\BSON\Binary($data, \MongoDB\BSON\Binary::TYPE_OLD_BINARY); } else { $fields[$this->options['data_field']] = new \MongoBinData($data, \MongoBinData::BYTE_ARRAY); - $options['multiple'] = false; + $options['multiple'] = FALSE; } $methodName = $this->mongo instanceof \MongoDB\Client ? 'updateOne' : 'update'; @@ -156,22 +151,21 @@ class MongoDbSessionHandler extends AbstractSessionHandler $options ); - return true; + return TRUE; } /** * {@inheritdoc} */ - public function updateTimestamp($sessionId, $data) - { - $expiry = $this->createDateTime(time() + (int) ini_get('session.gc_maxlifetime')); + public function updateTimestamp($sessionId, $data) { + $expiry = $this->createDateTime(time() + (int)ini_get('session.gc_maxlifetime')); if ($this->mongo instanceof \MongoDB\Client) { $methodName = 'updateOne'; $options = array(); } else { $methodName = 'update'; - $options = array('multiple' => false); + $options = array('multiple' => FALSE); } $this->getCollection()->$methodName( @@ -183,20 +177,19 @@ class MongoDbSessionHandler extends AbstractSessionHandler $options ); - return true; + return TRUE; } /** * {@inheritdoc} */ - protected function doRead($sessionId) - { + protected function doRead($sessionId) { $dbData = $this->getCollection()->findOne(array( $this->options['id_field'] => $sessionId, $this->options['expiry_field'] => array('$gte' => $this->createDateTime()), )); - if (null === $dbData) { + if (NULL === $dbData) { return ''; } @@ -212,9 +205,8 @@ class MongoDbSessionHandler extends AbstractSessionHandler * * @return \MongoCollection */ - private function getCollection() - { - if (null === $this->collection) { + private function getCollection() { + if (NULL === $this->collection) { $this->collection = $this->mongo->selectCollection($this->options['database'], $this->options['collection']); } @@ -226,8 +218,7 @@ class MongoDbSessionHandler extends AbstractSessionHandler * * @return \Mongo|\MongoClient|\MongoDB\Client */ - protected function getMongo() - { + protected function getMongo() { return $this->mongo; } @@ -240,9 +231,8 @@ class MongoDbSessionHandler extends AbstractSessionHandler * * @return \MongoDate|\MongoDB\BSON\UTCDateTime */ - private function createDateTime($seconds = null) - { - if (null === $seconds) { + private function createDateTime($seconds = NULL) { + if (NULL === $seconds) { $seconds = time(); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php index 4e9704b..45f7ad7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php @@ -28,9 +28,8 @@ class NativeFileSessionHandler extends NativeSessionHandler * @throws \InvalidArgumentException On invalid $savePath * @throws \RuntimeException When failing to create the save directory */ - public function __construct($savePath = null) - { - if (null === $savePath) { + public function __construct($savePath = NULL) { + if (NULL === $savePath) { $savePath = ini_get('session.save_path'); } @@ -45,7 +44,7 @@ class NativeFileSessionHandler extends NativeSessionHandler $baseDir = ltrim(strrchr($savePath, ';'), ';'); } - if ($baseDir && !is_dir($baseDir) && !@mkdir($baseDir, 0777, true) && !is_dir($baseDir)) { + if ($baseDir && !is_dir($baseDir) && !@mkdir($baseDir, 0777, TRUE) && !is_dir($baseDir)) { throw new \RuntimeException(sprintf('Session Storage was not able to create directory "%s"', $baseDir)); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/NativeSessionHandler.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/NativeSessionHandler.php index 9be4528..07d89a0 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/NativeSessionHandler.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/NativeSessionHandler.php @@ -17,8 +17,7 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; */ class NativeSessionHandler extends \SessionHandler { - public function __construct() - { - @trigger_error('The '.__NAMESPACE__.'\NativeSessionHandler class is deprecated since Symfony 3.4 and will be removed in 4.0. Use the \SessionHandler class instead.', E_USER_DEPRECATED); + public function __construct() { + @trigger_error('The ' . __NAMESPACE__ . '\NativeSessionHandler class is deprecated since Symfony 3.4 and will be removed in 4.0. Use the \SessionHandler class instead.', E_USER_DEPRECATED); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php index 8d19315..c6c6903 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php @@ -21,56 +21,49 @@ class NullSessionHandler extends AbstractSessionHandler /** * {@inheritdoc} */ - public function close() - { - return true; + public function close() { + return TRUE; } /** * {@inheritdoc} */ - public function validateId($sessionId) - { - return true; + public function validateId($sessionId) { + return TRUE; } /** * {@inheritdoc} */ - protected function doRead($sessionId) - { + protected function doRead($sessionId) { return ''; } /** * {@inheritdoc} */ - public function updateTimestamp($sessionId, $data) - { - return true; + public function updateTimestamp($sessionId, $data) { + return TRUE; } /** * {@inheritdoc} */ - protected function doWrite($sessionId, $data) - { - return true; + protected function doWrite($sessionId, $data) { + return TRUE; } /** * {@inheritdoc} */ - protected function doDestroy($sessionId) - { - return true; + protected function doDestroy($sessionId) { + return TRUE; } /** * {@inheritdoc} */ - public function gc($maxlifetime) - { - return true; + public function gc($maxlifetime) { + return TRUE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php index c8737be..d2a1230 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php @@ -73,7 +73,7 @@ class PdoSessionHandler extends AbstractSessionHandler /** * @var string|null|false DSN string or null for session.save_path or false when lazy connection disabled */ - private $dsn = false; + private $dsn = FALSE; /** * @var string Database driver @@ -135,17 +135,17 @@ class PdoSessionHandler extends AbstractSessionHandler /** * @var bool True when the current session exists but expired according to session.gc_maxlifetime */ - private $sessionExpired = false; + private $sessionExpired = FALSE; /** * @var bool Whether a transaction is active */ - private $inTransaction = false; + private $inTransaction = FALSE; /** * @var bool Whether gc() has been called */ - private $gcCalled = false; + private $gcCalled = FALSE; /** * You can either pass an existing database connection as PDO instance or @@ -165,12 +165,11 @@ class PdoSessionHandler extends AbstractSessionHandler * * lock_mode: The strategy for locking, see constants [default: LOCK_TRANSACTIONAL] * * @param \PDO|string|null $pdoOrDsn A \PDO instance or DSN string or URL string or null - * @param array $options An associative array of options + * @param array $options An associative array of options * * @throws \InvalidArgumentException When PDO error mode is not PDO::ERRMODE_EXCEPTION */ - public function __construct($pdoOrDsn = null, array $options = array()) - { + public function __construct($pdoOrDsn = NULL, array $options = array()) { if ($pdoOrDsn instanceof \PDO) { if (\PDO::ERRMODE_EXCEPTION !== $pdoOrDsn->getAttribute(\PDO::ATTR_ERRMODE)) { throw new \InvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION))', __CLASS__)); @@ -178,7 +177,7 @@ class PdoSessionHandler extends AbstractSessionHandler $this->pdo = $pdoOrDsn; $this->driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME); - } elseif (is_string($pdoOrDsn) && false !== strpos($pdoOrDsn, '://')) { + } else if (is_string($pdoOrDsn) && FALSE !== strpos($pdoOrDsn, '://')) { $this->dsn = $this->buildDsnFromUrl($pdoOrDsn); } else { $this->dsn = $pdoOrDsn; @@ -206,8 +205,7 @@ class PdoSessionHandler extends AbstractSessionHandler * @throws \PDOException When the table already exists * @throws \DomainException When an unsupported PDO driver is used */ - public function createTable() - { + public function createTable() { // connect if we are not yet $this->getConnection(); @@ -252,19 +250,17 @@ class PdoSessionHandler extends AbstractSessionHandler * * @return bool Whether current session expired */ - public function isSessionExpired() - { + public function isSessionExpired() { return $this->sessionExpired; } /** * {@inheritdoc} */ - public function open($savePath, $sessionName) - { - $this->sessionExpired = false; + public function open($savePath, $sessionName) { + $this->sessionExpired = FALSE; - if (null === $this->pdo) { + if (NULL === $this->pdo) { $this->connect($this->dsn ?: $savePath); } @@ -274,8 +270,7 @@ class PdoSessionHandler extends AbstractSessionHandler /** * {@inheritdoc} */ - public function read($sessionId) - { + public function read($sessionId) { try { return parent::read($sessionId); } catch (\PDOException $e) { @@ -288,20 +283,18 @@ class PdoSessionHandler extends AbstractSessionHandler /** * {@inheritdoc} */ - public function gc($maxlifetime) - { + public function gc($maxlifetime) { // We delay gc() to close() so that it is executed outside the transactional and blocking read-write process. // This way, pruning expired sessions does not block them from being started while the current session is used. - $this->gcCalled = true; + $this->gcCalled = TRUE; - return true; + return TRUE; } /** * {@inheritdoc} */ - protected function doDestroy($sessionId) - { + protected function doDestroy($sessionId) { // delete the record associated with this id $sql = "DELETE FROM $this->table WHERE $this->idCol = :id"; @@ -315,23 +308,22 @@ class PdoSessionHandler extends AbstractSessionHandler throw $e; } - return true; + return TRUE; } /** * {@inheritdoc} */ - protected function doWrite($sessionId, $data) - { - $maxlifetime = (int) ini_get('session.gc_maxlifetime'); + protected function doWrite($sessionId, $data) { + $maxlifetime = (int)ini_get('session.gc_maxlifetime'); try { // We use a single MERGE SQL query when supported by the database. $mergeStmt = $this->getMergeStatement($sessionId, $data, $maxlifetime); - if (null !== $mergeStmt) { + if (NULL !== $mergeStmt) { $mergeStmt->execute(); - return true; + return TRUE; } $updateStmt = $this->getUpdateStatement($sessionId, $data, $maxlifetime); @@ -361,15 +353,14 @@ class PdoSessionHandler extends AbstractSessionHandler throw $e; } - return true; + return TRUE; } /** * {@inheritdoc} */ - public function updateTimestamp($sessionId, $data) - { - $maxlifetime = (int) ini_get('session.gc_maxlifetime'); + public function updateTimestamp($sessionId, $data) { + $maxlifetime = (int)ini_get('session.gc_maxlifetime'); try { $updateStmt = $this->pdo->prepare( @@ -385,14 +376,13 @@ class PdoSessionHandler extends AbstractSessionHandler throw $e; } - return true; + return TRUE; } /** * {@inheritdoc} */ - public function close() - { + public function close() { $this->commit(); while ($unlockStmt = array_shift($this->unlockStatements)) { @@ -400,7 +390,7 @@ class PdoSessionHandler extends AbstractSessionHandler } if ($this->gcCalled) { - $this->gcCalled = false; + $this->gcCalled = FALSE; // delete the session records that have expired if ('mysql' === $this->driver) { @@ -414,11 +404,11 @@ class PdoSessionHandler extends AbstractSessionHandler $stmt->execute(); } - if (false !== $this->dsn) { - $this->pdo = null; // only close lazy-connection + if (FALSE !== $this->dsn) { + $this->pdo = NULL; // only close lazy-connection } - return true; + return TRUE; } /** @@ -426,8 +416,7 @@ class PdoSessionHandler extends AbstractSessionHandler * * @param string $dsn DSN string */ - private function connect($dsn) - { + private function connect($dsn) { $this->pdo = new \PDO($dsn, $this->username, $this->password, $this->connectionOptions); $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $this->driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME); @@ -442,14 +431,13 @@ class PdoSessionHandler extends AbstractSessionHandler * * @todo implement missing support for oci DSN (which look totally different from other PDO ones) */ - private function buildDsnFromUrl($dsnOrUrl) - { + private function buildDsnFromUrl($dsnOrUrl) { // (pdo_)?sqlite3?:///... => (pdo_)?sqlite3?://localhost/... or else the URL will be invalid $url = preg_replace('#^((?:pdo_)?sqlite3?):///#', '$1://localhost/', $dsnOrUrl); $params = parse_url($url); - if (false === $params) { + if (FALSE === $params) { return $dsnOrUrl; // If the URL is not valid, let's assume it might be a DSN already. } @@ -486,25 +474,25 @@ class PdoSessionHandler extends AbstractSessionHandler switch ($driver) { case 'mysql': case 'pgsql': - $dsn = $driver.':'; + $dsn = $driver . ':'; if (isset($params['host']) && '' !== $params['host']) { - $dsn .= 'host='.$params['host'].';'; + $dsn .= 'host=' . $params['host'] . ';'; } if (isset($params['port']) && '' !== $params['port']) { - $dsn .= 'port='.$params['port'].';'; + $dsn .= 'port=' . $params['port'] . ';'; } if (isset($params['path'])) { $dbName = substr($params['path'], 1); // Remove the leading slash - $dsn .= 'dbname='.$dbName.';'; + $dsn .= 'dbname=' . $dbName . ';'; } return $dsn; case 'sqlite': - return 'sqlite:'.substr($params['path'], 1); + return 'sqlite:' . substr($params['path'], 1); case 'sqlsrv': $dsn = 'sqlsrv:server='; @@ -514,12 +502,12 @@ class PdoSessionHandler extends AbstractSessionHandler } if (isset($params['port']) && '' !== $params['port']) { - $dsn .= ','.$params['port']; + $dsn .= ',' . $params['port']; } if (isset($params['path'])) { $dbName = substr($params['path'], 1); // Remove the leading slash - $dsn .= ';Database='.$dbName; + $dsn .= ';Database=' . $dbName; } return $dsn; @@ -541,8 +529,7 @@ class PdoSessionHandler extends AbstractSessionHandler * due to http://www.mysqlperformanceblog.com/2013/12/12/one-more-innodb-gap-lock-to-avoid/ . * So we change it to READ COMMITTED. */ - private function beginTransaction() - { + private function beginTransaction() { if (!$this->inTransaction) { if ('sqlite' === $this->driver) { $this->pdo->exec('BEGIN IMMEDIATE TRANSACTION'); @@ -552,15 +539,14 @@ class PdoSessionHandler extends AbstractSessionHandler } $this->pdo->beginTransaction(); } - $this->inTransaction = true; + $this->inTransaction = TRUE; } } /** * Helper method to commit a transaction. */ - private function commit() - { + private function commit() { if ($this->inTransaction) { try { // commit read-write transaction which also releases the lock @@ -569,7 +555,7 @@ class PdoSessionHandler extends AbstractSessionHandler } else { $this->pdo->commit(); } - $this->inTransaction = false; + $this->inTransaction = FALSE; } catch (\PDOException $e) { $this->rollback(); @@ -581,8 +567,7 @@ class PdoSessionHandler extends AbstractSessionHandler /** * Helper method to rollback a transaction. */ - private function rollback() - { + private function rollback() { // We only need to rollback if we are in a transaction. Otherwise the resulting // error would hide the real problem why rollback was called. We might not be // in a transaction when not using the transactional locking behavior or when @@ -593,7 +578,7 @@ class PdoSessionHandler extends AbstractSessionHandler } else { $this->pdo->rollBack(); } - $this->inTransaction = false; + $this->inTransaction = FALSE; } } @@ -607,8 +592,7 @@ class PdoSessionHandler extends AbstractSessionHandler * * @return string The session data */ - protected function doRead($sessionId) - { + protected function doRead($sessionId) { if (self::LOCK_ADVISORY === $this->lockMode) { $this->unlockStatements[] = $this->doAdvisoryLock($sessionId); } @@ -623,7 +607,7 @@ class PdoSessionHandler extends AbstractSessionHandler if ($sessionRows) { if ($sessionRows[0][1] + $sessionRows[0][2] < time()) { - $this->sessionExpired = true; + $this->sessionExpired = TRUE; return ''; } @@ -656,7 +640,7 @@ class PdoSessionHandler extends AbstractSessionHandler } return ''; - } while (true); + } while (TRUE); } /** @@ -672,8 +656,7 @@ class PdoSessionHandler extends AbstractSessionHandler * - for oci using DBMS_LOCK.REQUEST * - for sqlsrv using sp_getapplock with LockOwner = Session */ - private function doAdvisoryLock($sessionId) - { + private function doAdvisoryLock($sessionId) { switch ($this->driver) { case 'mysql': // should we handle the return value? 0 on timeout, null on error @@ -730,8 +713,7 @@ class PdoSessionHandler extends AbstractSessionHandler * * @return int */ - private function convertStringToInt($string) - { + private function convertStringToInt($string) { if (4 === \PHP_INT_SIZE) { return (ord($string[3]) << 24) + (ord($string[2]) << 16) + (ord($string[1]) << 8) + ord($string[0]); } @@ -749,8 +731,7 @@ class PdoSessionHandler extends AbstractSessionHandler * * @throws \DomainException When an unsupported PDO driver is used */ - private function getSelectSql() - { + private function getSelectSql() { if (self::LOCK_TRANSACTIONAL === $this->lockMode) { $this->beginTransaction(); @@ -775,14 +756,13 @@ class PdoSessionHandler extends AbstractSessionHandler /** * Returns an insert statement supported by the database for writing session data. * - * @param string $sessionId Session ID + * @param string $sessionId Session ID * @param string $sessionData Encoded session data - * @param int $maxlifetime session.gc_maxlifetime + * @param int $maxlifetime session.gc_maxlifetime * * @return \PDOStatement The insert statement */ - private function getInsertStatement($sessionId, $sessionData, $maxlifetime) - { + private function getInsertStatement($sessionId, $sessionData, $maxlifetime) { switch ($this->driver) { case 'oci': $data = fopen('php://memory', 'r+'); @@ -808,14 +788,13 @@ class PdoSessionHandler extends AbstractSessionHandler /** * Returns an update statement supported by the database for writing session data. * - * @param string $sessionId Session ID + * @param string $sessionId Session ID * @param string $sessionData Encoded session data - * @param int $maxlifetime session.gc_maxlifetime + * @param int $maxlifetime session.gc_maxlifetime * * @return \PDOStatement The update statement */ - private function getUpdateStatement($sessionId, $sessionData, $maxlifetime) - { + private function getUpdateStatement($sessionId, $sessionData, $maxlifetime) { switch ($this->driver) { case 'oci': $data = fopen('php://memory', 'r+'); @@ -841,36 +820,35 @@ class PdoSessionHandler extends AbstractSessionHandler /** * Returns a merge/upsert (i.e. insert or update) statement when supported by the database for writing session data. * - * @param string $sessionId Session ID - * @param string $data Encoded session data - * @param int $maxlifetime session.gc_maxlifetime + * @param string $sessionId Session ID + * @param string $data Encoded session data + * @param int $maxlifetime session.gc_maxlifetime * * @return \PDOStatement|null The merge statement or null when not supported */ - private function getMergeStatement($sessionId, $data, $maxlifetime) - { - switch (true) { + private function getMergeStatement($sessionId, $data, $maxlifetime) { + switch (TRUE) { case 'mysql' === $this->driver: - $mergeSql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :lifetime, :time) ". + $mergeSql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :lifetime, :time) " . "ON DUPLICATE KEY UPDATE $this->dataCol = VALUES($this->dataCol), $this->lifetimeCol = VALUES($this->lifetimeCol), $this->timeCol = VALUES($this->timeCol)"; break; case 'sqlsrv' === $this->driver && version_compare($this->pdo->getAttribute(\PDO::ATTR_SERVER_VERSION), '10', '>='): // MERGE is only available since SQL Server 2008 and must be terminated by semicolon // It also requires HOLDLOCK according to http://weblogs.sqlteam.com/dang/archive/2009/01/31/UPSERT-Race-Condition-With-MERGE.aspx - $mergeSql = "MERGE INTO $this->table WITH (HOLDLOCK) USING (SELECT 1 AS dummy) AS src ON ($this->idCol = ?) ". - "WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (?, ?, ?, ?) ". + $mergeSql = "MERGE INTO $this->table WITH (HOLDLOCK) USING (SELECT 1 AS dummy) AS src ON ($this->idCol = ?) " . + "WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (?, ?, ?, ?) " . "WHEN MATCHED THEN UPDATE SET $this->dataCol = ?, $this->lifetimeCol = ?, $this->timeCol = ?;"; break; case 'sqlite' === $this->driver: $mergeSql = "INSERT OR REPLACE INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :lifetime, :time)"; break; case 'pgsql' === $this->driver && version_compare($this->pdo->getAttribute(\PDO::ATTR_SERVER_VERSION), '9.5', '>='): - $mergeSql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :lifetime, :time) ". + $mergeSql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :lifetime, :time) " . "ON CONFLICT ($this->idCol) DO UPDATE SET ($this->dataCol, $this->lifetimeCol, $this->timeCol) = (EXCLUDED.$this->dataCol, EXCLUDED.$this->lifetimeCol, EXCLUDED.$this->timeCol)"; break; default: // MERGE is not supported with LOBs: http://www.oracle.com/technetwork/articles/fuecks-lobs-095315.html - return null; + return NULL; } $mergeStmt = $this->pdo->prepare($mergeSql); @@ -899,9 +877,8 @@ class PdoSessionHandler extends AbstractSessionHandler * * @return \PDO */ - protected function getConnection() - { - if (null === $this->pdo) { + protected function getConnection() { + if (NULL === $this->pdo) { $this->connect($this->dsn ?: ini_get('session.save_path')); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php index 2281192..6234b60 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php @@ -21,8 +21,7 @@ class StrictSessionHandler extends AbstractSessionHandler private $handler; private $doDestroy; - public function __construct(\SessionHandlerInterface $handler) - { + public function __construct(\SessionHandlerInterface $handler) { if ($handler instanceof \SessionUpdateTimestampHandlerInterface) { throw new \LogicException(sprintf('"%s" is already an instance of "SessionUpdateTimestampHandlerInterface", you cannot wrap it with "%s".', get_class($handler), self::class)); } @@ -33,8 +32,7 @@ class StrictSessionHandler extends AbstractSessionHandler /** * {@inheritdoc} */ - public function open($savePath, $sessionName) - { + public function open($savePath, $sessionName) { parent::open($savePath, $sessionName); return $this->handler->open($savePath, $sessionName); @@ -43,33 +41,29 @@ class StrictSessionHandler extends AbstractSessionHandler /** * {@inheritdoc} */ - protected function doRead($sessionId) - { + protected function doRead($sessionId) { return $this->handler->read($sessionId); } /** * {@inheritdoc} */ - public function updateTimestamp($sessionId, $data) - { + public function updateTimestamp($sessionId, $data) { return $this->write($sessionId, $data); } /** * {@inheritdoc} */ - protected function doWrite($sessionId, $data) - { + protected function doWrite($sessionId, $data) { return $this->handler->write($sessionId, $data); } /** * {@inheritdoc} */ - public function destroy($sessionId) - { - $this->doDestroy = true; + public function destroy($sessionId) { + $this->doDestroy = TRUE; $destroyed = parent::destroy($sessionId); return $this->doDestroy ? $this->doDestroy($sessionId) : $destroyed; @@ -78,9 +72,8 @@ class StrictSessionHandler extends AbstractSessionHandler /** * {@inheritdoc} */ - protected function doDestroy($sessionId) - { - $this->doDestroy = false; + protected function doDestroy($sessionId) { + $this->doDestroy = FALSE; return $this->handler->destroy($sessionId); } @@ -88,16 +81,14 @@ class StrictSessionHandler extends AbstractSessionHandler /** * {@inheritdoc} */ - public function close() - { + public function close() { return $this->handler->close(); } /** * {@inheritdoc} */ - public function gc($maxlifetime) - { + public function gc($maxlifetime) { return $this->handler->gc($maxlifetime); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/WriteCheckSessionHandler.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/WriteCheckSessionHandler.php index 1541ec4..dc5424c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/WriteCheckSessionHandler.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Handler/WriteCheckSessionHandler.php @@ -29,48 +29,42 @@ class WriteCheckSessionHandler implements \SessionHandlerInterface */ private $readSessions; - public function __construct(\SessionHandlerInterface $wrappedSessionHandler) - { + public function __construct(\SessionHandlerInterface $wrappedSessionHandler) { $this->wrappedSessionHandler = $wrappedSessionHandler; } /** * {@inheritdoc} */ - public function close() - { + public function close() { return $this->wrappedSessionHandler->close(); } /** * {@inheritdoc} */ - public function destroy($sessionId) - { + public function destroy($sessionId) { return $this->wrappedSessionHandler->destroy($sessionId); } /** * {@inheritdoc} */ - public function gc($maxlifetime) - { + public function gc($maxlifetime) { return $this->wrappedSessionHandler->gc($maxlifetime); } /** * {@inheritdoc} */ - public function open($savePath, $sessionName) - { + public function open($savePath, $sessionName) { return $this->wrappedSessionHandler->open($savePath, $sessionName); } /** * {@inheritdoc} */ - public function read($sessionId) - { + public function read($sessionId) { $session = $this->wrappedSessionHandler->read($sessionId); $this->readSessions[$sessionId] = $session; @@ -81,10 +75,9 @@ class WriteCheckSessionHandler implements \SessionHandlerInterface /** * {@inheritdoc} */ - public function write($sessionId, $data) - { + public function write($sessionId, $data) { if (isset($this->readSessions[$sessionId]) && $data === $this->readSessions[$sessionId]) { - return true; + return TRUE; } return $this->wrappedSessionHandler->write($sessionId, $data); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php index 6f59af4..007f471 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php @@ -54,11 +54,10 @@ class MetadataBag implements SessionBagInterface private $updateThreshold; /** - * @param string $storageKey The key used to store bag in the session - * @param int $updateThreshold The time to wait between two UPDATED updates + * @param string $storageKey The key used to store bag in the session + * @param int $updateThreshold The time to wait between two UPDATED updates */ - public function __construct($storageKey = '_sf2_meta', $updateThreshold = 0) - { + public function __construct($storageKey = '_sf2_meta', $updateThreshold = 0) { $this->storageKey = $storageKey; $this->updateThreshold = $updateThreshold; } @@ -66,8 +65,7 @@ class MetadataBag implements SessionBagInterface /** * {@inheritdoc} */ - public function initialize(array &$array) - { + public function initialize(array &$array) { $this->meta = &$array; if (isset($array[self::CREATED])) { @@ -87,8 +85,7 @@ class MetadataBag implements SessionBagInterface * * @return int */ - public function getLifetime() - { + public function getLifetime() { return $this->meta[self::LIFETIME]; } @@ -100,16 +97,14 @@ class MetadataBag implements SessionBagInterface * to expire with browser session. Time is in seconds, and is * not a Unix timestamp. */ - public function stampNew($lifetime = null) - { + public function stampNew($lifetime = NULL) { $this->stampCreated($lifetime); } /** * {@inheritdoc} */ - public function getStorageKey() - { + public function getStorageKey() { return $this->storageKey; } @@ -118,8 +113,7 @@ class MetadataBag implements SessionBagInterface * * @return int Unix timestamp */ - public function getCreated() - { + public function getCreated() { return $this->meta[self::CREATED]; } @@ -128,24 +122,21 @@ class MetadataBag implements SessionBagInterface * * @return int Unix timestamp */ - public function getLastUsed() - { + public function getLastUsed() { return $this->lastUsed; } /** * {@inheritdoc} */ - public function clear() - { + public function clear() { // nothing to do } /** * {@inheritdoc} */ - public function getName() - { + public function getName() { return $this->name; } @@ -154,15 +145,13 @@ class MetadataBag implements SessionBagInterface * * @param string $name */ - public function setName($name) - { + public function setName($name) { $this->name = $name; } - private function stampCreated($lifetime = null) - { + private function stampCreated($lifetime = NULL) { $timeStamp = time(); $this->meta[self::CREATED] = $this->meta[self::UPDATED] = $this->lastUsed = $timeStamp; - $this->meta[self::LIFETIME] = (null === $lifetime) ? ini_get('session.cookie_lifetime') : $lifetime; + $this->meta[self::LIFETIME] = (NULL === $lifetime) ? ini_get('session.cookie_lifetime') : $lifetime; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php index 027f4ef..3ced5b2 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php @@ -40,12 +40,12 @@ class MockArraySessionStorage implements SessionStorageInterface /** * @var bool */ - protected $started = false; + protected $started = FALSE; /** * @var bool */ - protected $closed = false; + protected $closed = FALSE; /** * @var array @@ -63,27 +63,24 @@ class MockArraySessionStorage implements SessionStorageInterface protected $bags = array(); /** - * @param string $name Session name + * @param string $name Session name * @param MetadataBag $metaBag MetadataBag instance */ - public function __construct($name = 'MOCKSESSID', MetadataBag $metaBag = null) - { + public function __construct($name = 'MOCKSESSID', MetadataBag $metaBag = NULL) { $this->name = $name; $this->setMetadataBag($metaBag); } - public function setSessionData(array $array) - { + public function setSessionData(array $array) { $this->data = $array; } /** * {@inheritdoc} */ - public function start() - { + public function start() { if ($this->started) { - return true; + return TRUE; } if (empty($this->id)) { @@ -92,14 +89,13 @@ class MockArraySessionStorage implements SessionStorageInterface $this->loadSession(); - return true; + return TRUE; } /** * {@inheritdoc} */ - public function regenerate($destroy = false, $lifetime = null) - { + public function regenerate($destroy = FALSE, $lifetime = NULL) { if (!$this->started) { $this->start(); } @@ -107,22 +103,20 @@ class MockArraySessionStorage implements SessionStorageInterface $this->metadataBag->stampNew($lifetime); $this->id = $this->generateId(); - return true; + return TRUE; } /** * {@inheritdoc} */ - public function getId() - { + public function getId() { return $this->id; } /** * {@inheritdoc} */ - public function setId($id) - { + public function setId($id) { if ($this->started) { throw new \LogicException('Cannot set session ID after the session has started.'); } @@ -133,37 +127,33 @@ class MockArraySessionStorage implements SessionStorageInterface /** * {@inheritdoc} */ - public function getName() - { + public function getName() { return $this->name; } /** * {@inheritdoc} */ - public function setName($name) - { + public function setName($name) { $this->name = $name; } /** * {@inheritdoc} */ - public function save() - { + public function save() { if (!$this->started || $this->closed) { throw new \RuntimeException('Trying to save a session that was not started yet or was already closed'); } // nothing to do since we don't persist the session data - $this->closed = false; - $this->started = false; + $this->closed = FALSE; + $this->started = FALSE; } /** * {@inheritdoc} */ - public function clear() - { + public function clear() { // clear out the bags foreach ($this->bags as $bag) { $bag->clear(); @@ -179,16 +169,14 @@ class MockArraySessionStorage implements SessionStorageInterface /** * {@inheritdoc} */ - public function registerBag(SessionBagInterface $bag) - { + public function registerBag(SessionBagInterface $bag) { $this->bags[$bag->getName()] = $bag; } /** * {@inheritdoc} */ - public function getBag($name) - { + public function getBag($name) { if (!isset($this->bags[$name])) { throw new \InvalidArgumentException(sprintf('The SessionBagInterface %s is not registered.', $name)); } @@ -203,14 +191,12 @@ class MockArraySessionStorage implements SessionStorageInterface /** * {@inheritdoc} */ - public function isStarted() - { + public function isStarted() { return $this->started; } - public function setMetadataBag(MetadataBag $bag = null) - { - if (null === $bag) { + public function setMetadataBag(MetadataBag $bag = NULL) { + if (NULL === $bag) { $bag = new MetadataBag(); } @@ -222,8 +208,7 @@ class MockArraySessionStorage implements SessionStorageInterface * * @return MetadataBag */ - public function getMetadataBag() - { + public function getMetadataBag() { return $this->metadataBag; } @@ -235,13 +220,11 @@ class MockArraySessionStorage implements SessionStorageInterface * * @return string */ - protected function generateId() - { - return hash('sha256', uniqid('ss_mock_', true)); + protected function generateId() { + return hash('sha256', uniqid('ss_mock_', TRUE)); } - protected function loadSession() - { + protected function loadSession() { $bags = array_merge($this->bags, array($this->metadataBag)); foreach ($bags as $bag) { @@ -250,7 +233,7 @@ class MockArraySessionStorage implements SessionStorageInterface $bag->initialize($this->data[$key]); } - $this->started = true; - $this->closed = false; + $this->started = TRUE; + $this->closed = FALSE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php index 14f4270..1e59118 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php @@ -27,17 +27,16 @@ class MockFileSessionStorage extends MockArraySessionStorage private $savePath; /** - * @param string $savePath Path of directory to save session files - * @param string $name Session name - * @param MetadataBag $metaBag MetadataBag instance + * @param string $savePath Path of directory to save session files + * @param string $name Session name + * @param MetadataBag $metaBag MetadataBag instance */ - public function __construct($savePath = null, $name = 'MOCKSESSID', MetadataBag $metaBag = null) - { - if (null === $savePath) { + public function __construct($savePath = NULL, $name = 'MOCKSESSID', MetadataBag $metaBag = NULL) { + if (NULL === $savePath) { $savePath = sys_get_temp_dir(); } - if (!is_dir($savePath) && !@mkdir($savePath, 0777, true) && !is_dir($savePath)) { + if (!is_dir($savePath) && !@mkdir($savePath, 0777, TRUE) && !is_dir($savePath)) { throw new \RuntimeException(sprintf('Session Storage was not able to create directory "%s"', $savePath)); } @@ -49,10 +48,9 @@ class MockFileSessionStorage extends MockArraySessionStorage /** * {@inheritdoc} */ - public function start() - { + public function start() { if ($this->started) { - return true; + return TRUE; } if (!$this->id) { @@ -61,16 +59,15 @@ class MockFileSessionStorage extends MockArraySessionStorage $this->read(); - $this->started = true; + $this->started = TRUE; - return true; + return TRUE; } /** * {@inheritdoc} */ - public function regenerate($destroy = false, $lifetime = null) - { + public function regenerate($destroy = FALSE, $lifetime = NULL) { if (!$this->started) { $this->start(); } @@ -85,8 +82,7 @@ class MockFileSessionStorage extends MockArraySessionStorage /** * {@inheritdoc} */ - public function save() - { + public function save() { if (!$this->started) { throw new \RuntimeException('Trying to save a session that was not started yet or was already closed'); } @@ -115,15 +111,14 @@ class MockFileSessionStorage extends MockArraySessionStorage // this is needed for Silex, where the session object is re-used across requests // in functional tests. In Symfony, the container is rebooted, so we don't have // this issue - $this->started = false; + $this->started = FALSE; } /** * Deletes a session from persistent storage. * Deliberately leaves session data in memory intact. */ - private function destroy() - { + private function destroy() { if (is_file($this->getFilePath())) { unlink($this->getFilePath()); } @@ -134,16 +129,14 @@ class MockFileSessionStorage extends MockArraySessionStorage * * @return string File path */ - private function getFilePath() - { - return $this->savePath.'/'.$this->id.'.mocksess'; + private function getFilePath() { + return $this->savePath . '/' . $this->id . '.mocksess'; } /** * Reads session from storage and loads session. */ - private function read() - { + private function read() { $filePath = $this->getFilePath(); $this->data = is_readable($filePath) && is_file($filePath) ? unserialize(file_get_contents($filePath)) : array(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php index 0dfad9a..630c511 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php @@ -31,12 +31,12 @@ class NativeSessionStorage implements SessionStorageInterface /** * @var bool */ - protected $started = false; + protected $started = FALSE; /** * @var bool */ - protected $closed = false; + protected $closed = FALSE; /** * @var AbstractProxy|\SessionHandlerInterface @@ -94,12 +94,11 @@ class NativeSessionStorage implements SessionStorageInterface * trans_sid_hosts, $_SERVER['HTTP_HOST'] * trans_sid_tags, "a=href,area=href,frame=src,form=" * - * @param array $options Session configuration options + * @param array $options Session configuration options * @param \SessionHandlerInterface|null $handler - * @param MetadataBag $metaBag MetadataBag + * @param MetadataBag $metaBag MetadataBag */ - public function __construct(array $options = array(), $handler = null, MetadataBag $metaBag = null) - { + public function __construct(array $options = array(), $handler = NULL, MetadataBag $metaBag = NULL) { $options += array( 'cache_limiter' => '', 'cache_expire' => 0, @@ -119,18 +118,16 @@ class NativeSessionStorage implements SessionStorageInterface * * @return AbstractProxy|\SessionHandlerInterface */ - public function getSaveHandler() - { + public function getSaveHandler() { return $this->saveHandler; } /** * {@inheritdoc} */ - public function start() - { + public function start() { if ($this->started) { - return true; + return TRUE; } if (\PHP_SESSION_ACTIVE === session_status()) { @@ -148,56 +145,51 @@ class NativeSessionStorage implements SessionStorageInterface $this->loadSession(); - return true; + return TRUE; } /** * {@inheritdoc} */ - public function getId() - { + public function getId() { return $this->saveHandler->getId(); } /** * {@inheritdoc} */ - public function setId($id) - { + public function setId($id) { $this->saveHandler->setId($id); } /** * {@inheritdoc} */ - public function getName() - { + public function getName() { return $this->saveHandler->getName(); } /** * {@inheritdoc} */ - public function setName($name) - { + public function setName($name) { $this->saveHandler->setName($name); } /** * {@inheritdoc} */ - public function regenerate($destroy = false, $lifetime = null) - { + public function regenerate($destroy = FALSE, $lifetime = NULL) { // Cannot regenerate the session ID for non-active sessions. if (\PHP_SESSION_ACTIVE !== session_status()) { - return false; + return FALSE; } if (headers_sent()) { - return false; + return FALSE; } - if (null !== $lifetime) { + if (NULL !== $lifetime) { ini_set('session.cookie_lifetime', $lifetime); } @@ -217,8 +209,7 @@ class NativeSessionStorage implements SessionStorageInterface /** * {@inheritdoc} */ - public function save() - { + public function save() { $session = $_SESSION; foreach ($this->bags as $bag) { @@ -236,14 +227,14 @@ class NativeSessionStorage implements SessionStorageInterface }, E_WARNING); try { - $e = null; + $e = NULL; session_write_close(); } catch (\ErrorException $e) { } finally { restore_error_handler(); $_SESSION = $session; } - if (null !== $e) { + if (NULL !== $e) { // The default PHP error message is not very helpful, as it does not give any information on the current save handler. // Therefore, we catch this error and trigger a warning with a better error message $handler = $this->getSaveHandler(); @@ -254,15 +245,14 @@ class NativeSessionStorage implements SessionStorageInterface trigger_error(sprintf('session_write_close(): Failed to write session data with %s handler', get_class($handler)), E_USER_WARNING); } - $this->closed = true; - $this->started = false; + $this->closed = TRUE; + $this->started = FALSE; } /** * {@inheritdoc} */ - public function clear() - { + public function clear() { // clear out the bags foreach ($this->bags as $bag) { $bag->clear(); @@ -278,8 +268,7 @@ class NativeSessionStorage implements SessionStorageInterface /** * {@inheritdoc} */ - public function registerBag(SessionBagInterface $bag) - { + public function registerBag(SessionBagInterface $bag) { if ($this->started) { throw new \LogicException('Cannot register a bag when the session is already started.'); } @@ -290,24 +279,22 @@ class NativeSessionStorage implements SessionStorageInterface /** * {@inheritdoc} */ - public function getBag($name) - { + public function getBag($name) { if (!isset($this->bags[$name])) { throw new \InvalidArgumentException(sprintf('The SessionBagInterface %s is not registered.', $name)); } if (!$this->started && $this->saveHandler->isActive()) { $this->loadSession(); - } elseif (!$this->started) { + } else if (!$this->started) { $this->start(); } return $this->bags[$name]; } - public function setMetadataBag(MetadataBag $metaBag = null) - { - if (null === $metaBag) { + public function setMetadataBag(MetadataBag $metaBag = NULL) { + if (NULL === $metaBag) { $metaBag = new MetadataBag(); } @@ -319,16 +306,14 @@ class NativeSessionStorage implements SessionStorageInterface * * @return MetadataBag */ - public function getMetadataBag() - { + public function getMetadataBag() { return $this->metadataBag; } /** * {@inheritdoc} */ - public function isStarted() - { + public function isStarted() { return $this->started; } @@ -342,8 +327,7 @@ class NativeSessionStorage implements SessionStorageInterface * * @see http://php.net/session.configuration */ - public function setOptions(array $options) - { + public function setOptions(array $options) { if (headers_sent() || \PHP_SESSION_ACTIVE === session_status()) { return; } @@ -363,7 +347,7 @@ class NativeSessionStorage implements SessionStorageInterface foreach ($options as $key => $value) { if (isset($validOptions[$key])) { - ini_set('session.'.$key, $value); + ini_set('session.' . $key, $value); } } } @@ -390,18 +374,17 @@ class NativeSessionStorage implements SessionStorageInterface * * @throws \InvalidArgumentException */ - public function setSaveHandler($saveHandler = null) - { + public function setSaveHandler($saveHandler = NULL) { if (!$saveHandler instanceof AbstractProxy && !$saveHandler instanceof \SessionHandlerInterface && - null !== $saveHandler) { + NULL !== $saveHandler) { throw new \InvalidArgumentException('Must be instance of AbstractProxy; implement \SessionHandlerInterface; or be null.'); } // Wrap $saveHandler in proxy and prevent double wrapping of proxy if (!$saveHandler instanceof AbstractProxy && $saveHandler instanceof \SessionHandlerInterface) { $saveHandler = new SessionHandlerProxy($saveHandler); - } elseif (!$saveHandler instanceof AbstractProxy) { + } else if (!$saveHandler instanceof AbstractProxy) { $saveHandler = new SessionHandlerProxy(new StrictSessionHandler(new \SessionHandler())); } $this->saveHandler = $saveHandler; @@ -411,9 +394,9 @@ class NativeSessionStorage implements SessionStorageInterface } if ($this->saveHandler instanceof SessionHandlerProxy) { - session_set_save_handler($this->saveHandler->getHandler(), false); - } elseif ($this->saveHandler instanceof \SessionHandlerInterface) { - session_set_save_handler($this->saveHandler, false); + session_set_save_handler($this->saveHandler->getHandler(), FALSE); + } else if ($this->saveHandler instanceof \SessionHandlerInterface) { + session_set_save_handler($this->saveHandler, FALSE); } } @@ -425,9 +408,8 @@ class NativeSessionStorage implements SessionStorageInterface * PHP takes the return value from the read() handler, unserializes it * and populates $_SESSION with the result automatically. */ - protected function loadSession(array &$session = null) - { - if (null === $session) { + protected function loadSession(array &$session = NULL) { + if (NULL === $session) { $session = &$_SESSION; } @@ -439,7 +421,7 @@ class NativeSessionStorage implements SessionStorageInterface $bag->initialize($session[$key]); } - $this->started = true; - $this->closed = false; + $this->started = TRUE; + $this->closed = FALSE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php index 662ed50..7198411 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php @@ -20,10 +20,9 @@ class PhpBridgeSessionStorage extends NativeSessionStorage { /** * @param \SessionHandlerInterface|null $handler - * @param MetadataBag $metaBag MetadataBag + * @param MetadataBag $metaBag MetadataBag */ - public function __construct($handler = null, MetadataBag $metaBag = null) - { + public function __construct($handler = NULL, MetadataBag $metaBag = NULL) { $this->setMetadataBag($metaBag); $this->setSaveHandler($handler); } @@ -31,22 +30,20 @@ class PhpBridgeSessionStorage extends NativeSessionStorage /** * {@inheritdoc} */ - public function start() - { + public function start() { if ($this->started) { - return true; + return TRUE; } $this->loadSession(); - return true; + return TRUE; } /** * {@inheritdoc} */ - public function clear() - { + public function clear() { // clear out the bags and nothing else that may be set // since the purpose of this driver is to share a handler foreach ($this->bags as $bag) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php index 09c9248..0f0e6c3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php @@ -21,7 +21,7 @@ abstract class AbstractProxy * * @var bool */ - protected $wrapper = false; + protected $wrapper = FALSE; /** * @var string @@ -33,8 +33,7 @@ abstract class AbstractProxy * * @return string */ - public function getSaveHandlerName() - { + public function getSaveHandlerName() { return $this->saveHandlerName; } @@ -43,8 +42,7 @@ abstract class AbstractProxy * * @return bool */ - public function isSessionHandlerInterface() - { + public function isSessionHandlerInterface() { return $this instanceof \SessionHandlerInterface; } @@ -53,8 +51,7 @@ abstract class AbstractProxy * * @return bool */ - public function isWrapper() - { + public function isWrapper() { return $this->wrapper; } @@ -63,8 +60,7 @@ abstract class AbstractProxy * * @return bool */ - public function isActive() - { + public function isActive() { return \PHP_SESSION_ACTIVE === session_status(); } @@ -73,8 +69,7 @@ abstract class AbstractProxy * * @return string */ - public function getId() - { + public function getId() { return session_id(); } @@ -85,8 +80,7 @@ abstract class AbstractProxy * * @throws \LogicException */ - public function setId($id) - { + public function setId($id) { if ($this->isActive()) { throw new \LogicException('Cannot change the ID of an active session'); } @@ -99,8 +93,7 @@ abstract class AbstractProxy * * @return string */ - public function getName() - { + public function getName() { return session_name(); } @@ -111,8 +104,7 @@ abstract class AbstractProxy * * @throws \LogicException */ - public function setName($name) - { + public function setName($name) { if ($this->isActive()) { throw new \LogicException('Cannot change the name of an active session'); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Proxy/NativeProxy.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Proxy/NativeProxy.php index 082eed1..a5b49d7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Proxy/NativeProxy.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Proxy/NativeProxy.php @@ -11,7 +11,7 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy; -@trigger_error('The '.__NAMESPACE__.'\NativeProxy class is deprecated since Symfony 3.4 and will be removed in 4.0. Use your session handler implementation directly.', E_USER_DEPRECATED); +@trigger_error('The ' . __NAMESPACE__ . '\NativeProxy class is deprecated since Symfony 3.4 and will be removed in 4.0. Use your session handler implementation directly.', E_USER_DEPRECATED); /** * This proxy is built-in session handlers in PHP 5.3.x. @@ -22,8 +22,7 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy; */ class NativeProxy extends AbstractProxy { - public function __construct() - { + public function __construct() { // this makes an educated guess as to what the handler is since it should already be set. $this->saveHandlerName = ini_get('session.save_handler'); } @@ -33,8 +32,7 @@ class NativeProxy extends AbstractProxy * * @return bool False */ - public function isWrapper() - { - return false; + public function isWrapper() { + return FALSE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php index 53c1209..6555bbe 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php @@ -18,8 +18,7 @@ class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterf { protected $handler; - public function __construct(\SessionHandlerInterface $handler) - { + public function __construct(\SessionHandlerInterface $handler) { $this->handler = $handler; $this->wrapper = ($handler instanceof \SessionHandler); $this->saveHandlerName = $this->wrapper ? ini_get('session.save_handler') : 'user'; @@ -28,8 +27,7 @@ class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterf /** * @return \SessionHandlerInterface */ - public function getHandler() - { + public function getHandler() { return $this->handler; } @@ -38,48 +36,42 @@ class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterf /** * {@inheritdoc} */ - public function open($savePath, $sessionName) - { - return (bool) $this->handler->open($savePath, $sessionName); + public function open($savePath, $sessionName) { + return (bool)$this->handler->open($savePath, $sessionName); } /** * {@inheritdoc} */ - public function close() - { - return (bool) $this->handler->close(); + public function close() { + return (bool)$this->handler->close(); } /** * {@inheritdoc} */ - public function read($sessionId) - { - return (string) $this->handler->read($sessionId); + public function read($sessionId) { + return (string)$this->handler->read($sessionId); } /** * {@inheritdoc} */ - public function write($sessionId, $data) - { - return (bool) $this->handler->write($sessionId, $data); + public function write($sessionId, $data) { + return (bool)$this->handler->write($sessionId, $data); } /** * {@inheritdoc} */ - public function destroy($sessionId) - { - return (bool) $this->handler->destroy($sessionId); + public function destroy($sessionId) { + return (bool)$this->handler->destroy($sessionId); } /** * {@inheritdoc} */ - public function gc($maxlifetime) - { - return (bool) $this->handler->gc($maxlifetime); + public function gc($maxlifetime) { + return (bool)$this->handler->gc($maxlifetime); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php index 66e8b33..27dc998 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php @@ -84,8 +84,8 @@ interface SessionStorageInterface * Otherwise session data could get lost again for concurrent requests with the * new ID. One result could be that you get logged out after just logging in. * - * @param bool $destroy Destroy session when regenerating? - * @param int $lifetime Sets the cookie lifetime for the session cookie. A null value + * @param bool $destroy Destroy session when regenerating? + * @param int $lifetime Sets the cookie lifetime for the session cookie. A null value * will leave the system settings unchanged, 0 sets the cookie * to expire with browser session. Time is in seconds, and is * not a Unix timestamp. @@ -94,7 +94,7 @@ interface SessionStorageInterface * * @throws \RuntimeException If an error occurs while regenerating this storage */ - public function regenerate($destroy = false, $lifetime = null); + public function regenerate($destroy = FALSE, $lifetime = NULL); /** * Force the session to be saved and closed. diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/StreamedResponse.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/StreamedResponse.php index 92868d3..5f1e6ea 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/StreamedResponse.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/StreamedResponse.php @@ -32,31 +32,29 @@ class StreamedResponse extends Response /** * @param callable|null $callback A valid PHP callback or null to set it later - * @param int $status The response status code - * @param array $headers An array of response headers + * @param int $status The response status code + * @param array $headers An array of response headers */ - public function __construct(callable $callback = null, $status = 200, $headers = array()) - { - parent::__construct(null, $status, $headers); + public function __construct(callable $callback = NULL, $status = 200, $headers = array()) { + parent::__construct(NULL, $status, $headers); - if (null !== $callback) { + if (NULL !== $callback) { $this->setCallback($callback); } - $this->streamed = false; - $this->headersSent = false; + $this->streamed = FALSE; + $this->headersSent = FALSE; } /** * Factory method for chainability. * * @param callable|null $callback A valid PHP callback or null to set it later - * @param int $status The response status code - * @param array $headers An array of response headers + * @param int $status The response status code + * @param array $headers An array of response headers * * @return static */ - public static function create($callback = null, $status = 200, $headers = array()) - { + public static function create($callback = NULL, $status = 200, $headers = array()) { return new static($callback, $status, $headers); } @@ -67,8 +65,7 @@ class StreamedResponse extends Response * * @return $this */ - public function setCallback(callable $callback) - { + public function setCallback(callable $callback) { $this->callback = $callback; return $this; @@ -81,13 +78,12 @@ class StreamedResponse extends Response * * @return $this */ - public function sendHeaders() - { + public function sendHeaders() { if ($this->headersSent) { return $this; } - $this->headersSent = true; + $this->headersSent = TRUE; return parent::sendHeaders(); } @@ -99,15 +95,14 @@ class StreamedResponse extends Response * * @return $this */ - public function sendContent() - { + public function sendContent() { if ($this->streamed) { return $this; } - $this->streamed = true; + $this->streamed = TRUE; - if (null === $this->callback) { + if (NULL === $this->callback) { throw new \LogicException('The Response callback must not be null.'); } @@ -123,9 +118,8 @@ class StreamedResponse extends Response * * @return $this */ - public function setContent($content) - { - if (null !== $content) { + public function setContent($content) { + if (NULL !== $content) { throw new \LogicException('The content cannot be set on a StreamedResponse instance.'); } @@ -137,8 +131,7 @@ class StreamedResponse extends Response * * @return false */ - public function getContent() - { - return false; + public function getContent() { + return FALSE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/AcceptHeaderItemTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/AcceptHeaderItemTest.php index cb43bb3..604cd90 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/AcceptHeaderItemTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/AcceptHeaderItemTest.php @@ -19,15 +19,13 @@ class AcceptHeaderItemTest extends TestCase /** * @dataProvider provideFromStringData */ - public function testFromString($string, $value, array $attributes) - { + public function testFromString($string, $value, array $attributes) { $item = AcceptHeaderItem::fromString($string); $this->assertEquals($value, $item->getValue()); $this->assertEquals($attributes, $item->getAttributes()); } - public function provideFromStringData() - { + public function provideFromStringData() { return array( array( 'text/html', @@ -51,14 +49,12 @@ class AcceptHeaderItemTest extends TestCase /** * @dataProvider provideToStringData */ - public function testToString($value, array $attributes, $string) - { + public function testToString($value, array $attributes, $string) { $item = new AcceptHeaderItem($value, $attributes); - $this->assertEquals($string, (string) $item); + $this->assertEquals($string, (string)$item); } - public function provideToStringData() - { + public function provideToStringData() { return array( array( 'text/html', array(), @@ -71,8 +67,7 @@ class AcceptHeaderItemTest extends TestCase ); } - public function testValue() - { + public function testValue() { $item = new AcceptHeaderItem('value', array()); $this->assertEquals('value', $item->getValue()); @@ -83,8 +78,7 @@ class AcceptHeaderItemTest extends TestCase $this->assertEquals('1', $item->getValue()); } - public function testQuality() - { + public function testQuality() { $item = new AcceptHeaderItem('value', array()); $this->assertEquals(1.0, $item->getQuality()); @@ -96,8 +90,7 @@ class AcceptHeaderItemTest extends TestCase $this->assertFalse($item->hasAttribute('q')); } - public function testAttribute() - { + public function testAttribute() { $item = new AcceptHeaderItem('value', array()); $this->assertEquals(array(), $item->getAttributes()); $this->assertFalse($item->hasAttribute('test')); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/AcceptHeaderTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/AcceptHeaderTest.php index 9929eac..116dd8d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/AcceptHeaderTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/AcceptHeaderTest.php @@ -17,8 +17,7 @@ use Symfony\Component\HttpFoundation\AcceptHeaderItem; class AcceptHeaderTest extends TestCase { - public function testFirst() - { + public function testFirst() { $header = AcceptHeader::fromString('text/plain; q=0.5, text/html, text/x-dvi; q=0.8, text/x-c'); $this->assertSame('text/html', $header->first()->getValue()); } @@ -26,8 +25,7 @@ class AcceptHeaderTest extends TestCase /** * @dataProvider provideFromStringData */ - public function testFromString($string, array $items) - { + public function testFromString($string, array $items) { $header = AcceptHeader::fromString($string); $parsed = array_values($header->all()); // reset index since the fixtures don't have them set @@ -37,8 +35,7 @@ class AcceptHeaderTest extends TestCase $this->assertEquals($items, $parsed); } - public function provideFromStringData() - { + public function provideFromStringData() { return array( array('', array()), array('gzip', array(new AcceptHeaderItem('gzip'))), @@ -51,14 +48,12 @@ class AcceptHeaderTest extends TestCase /** * @dataProvider provideToStringData */ - public function testToString(array $items, $string) - { + public function testToString(array $items, $string) { $header = new AcceptHeader($items); - $this->assertEquals($string, (string) $header); + $this->assertEquals($string, (string)$header); } - public function provideToStringData() - { + public function provideToStringData() { return array( array(array(), ''), array(array(new AcceptHeaderItem('gzip')), 'gzip'), @@ -70,14 +65,12 @@ class AcceptHeaderTest extends TestCase /** * @dataProvider provideFilterData */ - public function testFilter($string, $filter, array $values) - { + public function testFilter($string, $filter, array $values) { $header = AcceptHeader::fromString($string)->filter($filter); $this->assertEquals($values, array_keys($header->all())); } - public function provideFilterData() - { + public function provideFilterData() { return array( array('fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4', '/fr.*/', array('fr-FR', 'fr')), ); @@ -86,18 +79,16 @@ class AcceptHeaderTest extends TestCase /** * @dataProvider provideSortingData */ - public function testSorting($string, array $values) - { + public function testSorting($string, array $values) { $header = AcceptHeader::fromString($string); $this->assertEquals($values, array_keys($header->all())); } - public function provideSortingData() - { + public function provideSortingData() { return array( - 'quality has priority' => array('*;q=0.3,ISO-8859-1,utf-8;q=0.7', array('ISO-8859-1', 'utf-8', '*')), - 'order matters when q is equal' => array('*;q=0.3,ISO-8859-1;q=0.7,utf-8;q=0.7', array('ISO-8859-1', 'utf-8', '*')), - 'order matters when q is equal2' => array('*;q=0.3,utf-8;q=0.7,ISO-8859-1;q=0.7', array('utf-8', 'ISO-8859-1', '*')), + 'quality has priority' => array('*;q=0.3,ISO-8859-1,utf-8;q=0.7', array('ISO-8859-1', 'utf-8', '*')), + 'order matters when q is equal' => array('*;q=0.3,ISO-8859-1;q=0.7,utf-8;q=0.7', array('ISO-8859-1', 'utf-8', '*')), + 'order matters when q is equal2' => array('*;q=0.3,utf-8;q=0.7,ISO-8859-1;q=0.7', array('utf-8', 'ISO-8859-1', '*')), ); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ApacheRequestTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ApacheRequestTest.php index 157ab90..ea1c545 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ApacheRequestTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ApacheRequestTest.php @@ -19,8 +19,7 @@ class ApacheRequestTest extends TestCase /** * @dataProvider provideServerVars */ - public function testUriMethods($server, $expectedRequestUri, $expectedBaseUrl, $expectedPathInfo) - { + public function testUriMethods($server, $expectedRequestUri, $expectedBaseUrl, $expectedPathInfo) { $request = new ApacheRequest(); $request->server->replace($server); @@ -29,8 +28,7 @@ class ApacheRequestTest extends TestCase $this->assertEquals($expectedPathInfo, $request->getPathInfo(), '->getPathInfo() is correct'); } - public function provideServerVars() - { + public function provideServerVars() { return array( array( array( diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/BinaryFileResponseTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/BinaryFileResponseTest.php index 1b9e589..2efcee2 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/BinaryFileResponseTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/BinaryFileResponseTest.php @@ -19,29 +19,27 @@ use Symfony\Component\HttpFoundation\Tests\File\FakeFile; class BinaryFileResponseTest extends ResponseTestCase { - public function testConstruction() - { - $file = __DIR__.'/../README.md'; - $response = new BinaryFileResponse($file, 404, array('X-Header' => 'Foo'), true, null, true, true); + public function testConstruction() { + $file = __DIR__ . '/../README.md'; + $response = new BinaryFileResponse($file, 404, array('X-Header' => 'Foo'), TRUE, NULL, TRUE, TRUE); $this->assertEquals(404, $response->getStatusCode()); $this->assertEquals('Foo', $response->headers->get('X-Header')); $this->assertTrue($response->headers->has('ETag')); $this->assertTrue($response->headers->has('Last-Modified')); $this->assertFalse($response->headers->has('Content-Disposition')); - $response = BinaryFileResponse::create($file, 404, array(), true, ResponseHeaderBag::DISPOSITION_INLINE); + $response = BinaryFileResponse::create($file, 404, array(), TRUE, ResponseHeaderBag::DISPOSITION_INLINE); $this->assertEquals(404, $response->getStatusCode()); $this->assertFalse($response->headers->has('ETag')); $this->assertEquals('inline; filename="README.md"', $response->headers->get('Content-Disposition')); } - public function testConstructWithNonAsciiFilename() - { - touch(sys_get_temp_dir().'/fööö.html'); + public function testConstructWithNonAsciiFilename() { + touch(sys_get_temp_dir() . '/fööö.html'); - $response = new BinaryFileResponse(sys_get_temp_dir().'/fööö.html', 200, array(), true, 'attachment'); + $response = new BinaryFileResponse(sys_get_temp_dir() . '/fööö.html', 200, array(), TRUE, 'attachment'); - @unlink(sys_get_temp_dir().'/fööö.html'); + @unlink(sys_get_temp_dir() . '/fööö.html'); $this->assertSame('fööö.html', $response->getFile()->getFilename()); } @@ -49,28 +47,24 @@ class BinaryFileResponseTest extends ResponseTestCase /** * @expectedException \LogicException */ - public function testSetContent() - { + public function testSetContent() { $response = new BinaryFileResponse(__FILE__); $response->setContent('foo'); } - public function testGetContent() - { + public function testGetContent() { $response = new BinaryFileResponse(__FILE__); $this->assertFalse($response->getContent()); } - public function testSetContentDispositionGeneratesSafeFallbackFilename() - { + public function testSetContentDispositionGeneratesSafeFallbackFilename() { $response = new BinaryFileResponse(__FILE__); $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, 'föö.html'); $this->assertSame('attachment; filename="f__.html"; filename*=utf-8\'\'f%C3%B6%C3%B6.html', $response->headers->get('Content-Disposition')); } - public function testSetContentDispositionGeneratesSafeFallbackFilenameForWronglyEncodedFilename() - { + public function testSetContentDispositionGeneratesSafeFallbackFilenameForWronglyEncodedFilename() { $response = new BinaryFileResponse(__FILE__); $iso88591EncodedFilename = utf8_decode('föö.html'); @@ -83,9 +77,8 @@ class BinaryFileResponseTest extends ResponseTestCase /** * @dataProvider provideRanges */ - public function testRequests($requestRange, $offset, $length, $responseRange) - { - $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream'))->setAutoEtag(); + public function testRequests($requestRange, $offset, $length, $responseRange) { + $response = BinaryFileResponse::create(__DIR__ . '/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream'))->setAutoEtag(); // do a request to get the ETag $request = Request::create('/'); @@ -97,7 +90,7 @@ class BinaryFileResponseTest extends ResponseTestCase $request->headers->set('If-Range', $etag); $request->headers->set('Range', $requestRange); - $file = fopen(__DIR__.'/File/Fixtures/test.gif', 'r'); + $file = fopen(__DIR__ . '/File/Fixtures/test.gif', 'r'); fseek($file, $offset); $data = fread($file, $length); fclose($file); @@ -115,9 +108,8 @@ class BinaryFileResponseTest extends ResponseTestCase /** * @dataProvider provideRanges */ - public function testRequestsWithoutEtag($requestRange, $offset, $length, $responseRange) - { - $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream')); + public function testRequestsWithoutEtag($requestRange, $offset, $length, $responseRange) { + $response = BinaryFileResponse::create(__DIR__ . '/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream')); // do a request to get the LastModified $request = Request::create('/'); @@ -129,7 +121,7 @@ class BinaryFileResponseTest extends ResponseTestCase $request->headers->set('If-Range', $lastModified); $request->headers->set('Range', $requestRange); - $file = fopen(__DIR__.'/File/Fixtures/test.gif', 'r'); + $file = fopen(__DIR__ . '/File/Fixtures/test.gif', 'r'); fseek($file, $offset); $data = fread($file, $length); fclose($file); @@ -143,8 +135,7 @@ class BinaryFileResponseTest extends ResponseTestCase $this->assertEquals($responseRange, $response->headers->get('Content-Range')); } - public function provideRanges() - { + public function provideRanges() { return array( array('bytes=1-4', 1, 4, 'bytes 1-4/35'), array('bytes=-5', 30, 5, 'bytes 30-34/35'), @@ -154,17 +145,16 @@ class BinaryFileResponseTest extends ResponseTestCase ); } - public function testRangeRequestsWithoutLastModifiedDate() - { + public function testRangeRequestsWithoutLastModifiedDate() { // prevent auto last modified - $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream'), true, null, false, false); + $response = BinaryFileResponse::create(__DIR__ . '/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream'), TRUE, NULL, FALSE, FALSE); // prepare a request for a range of the testing file $request = Request::create('/'); - $request->headers->set('If-Range', date('D, d M Y H:i:s').' GMT'); + $request->headers->set('If-Range', date('D, d M Y H:i:s') . ' GMT'); $request->headers->set('Range', 'bytes=1-4'); - $this->expectOutputString(file_get_contents(__DIR__.'/File/Fixtures/test.gif')); + $this->expectOutputString(file_get_contents(__DIR__ . '/File/Fixtures/test.gif')); $response = clone $response; $response->prepare($request); $response->sendContent(); @@ -176,15 +166,14 @@ class BinaryFileResponseTest extends ResponseTestCase /** * @dataProvider provideFullFileRanges */ - public function testFullFileRequests($requestRange) - { - $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream'))->setAutoEtag(); + public function testFullFileRequests($requestRange) { + $response = BinaryFileResponse::create(__DIR__ . '/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream'))->setAutoEtag(); // prepare a request for a range of the testing file $request = Request::create('/'); $request->headers->set('Range', $requestRange); - $file = fopen(__DIR__.'/File/Fixtures/test.gif', 'r'); + $file = fopen(__DIR__ . '/File/Fixtures/test.gif', 'r'); $data = fread($file, 35); fclose($file); @@ -196,8 +185,7 @@ class BinaryFileResponseTest extends ResponseTestCase $this->assertEquals(200, $response->getStatusCode()); } - public function provideFullFileRanges() - { + public function provideFullFileRanges() { return array( array('bytes=0-'), array('bytes=0-34'), @@ -211,9 +199,8 @@ class BinaryFileResponseTest extends ResponseTestCase /** * @dataProvider provideInvalidRanges */ - public function testInvalidRequests($requestRange) - { - $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream'))->setAutoEtag(); + public function testInvalidRequests($requestRange) { + $response = BinaryFileResponse::create(__DIR__ . '/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream'))->setAutoEtag(); // prepare a request for a range of the testing file $request = Request::create('/'); @@ -227,8 +214,7 @@ class BinaryFileResponseTest extends ResponseTestCase $this->assertEquals('bytes */35', $response->headers->get('Content-Range')); } - public function provideInvalidRanges() - { + public function provideInvalidRanges() { return array( array('bytes=-40'), array('bytes=30-40'), @@ -238,8 +224,7 @@ class BinaryFileResponseTest extends ResponseTestCase /** * @dataProvider provideXSendfileFiles */ - public function testXSendfile($file) - { + public function testXSendfile($file) { $request = Request::create('/'); $request->headers->set('X-Sendfile-Type', 'X-Sendfile'); @@ -253,47 +238,44 @@ class BinaryFileResponseTest extends ResponseTestCase $this->assertContains('README.md', $response->headers->get('X-Sendfile')); } - public function provideXSendfileFiles() - { + public function provideXSendfileFiles() { return array( - array(__DIR__.'/../README.md'), - array('file://'.__DIR__.'/../README.md'), + array(__DIR__ . '/../README.md'), + array('file://' . __DIR__ . '/../README.md'), ); } /** * @dataProvider getSampleXAccelMappings */ - public function testXAccelMapping($realpath, $mapping, $virtual) - { + public function testXAccelMapping($realpath, $mapping, $virtual) { $request = Request::create('/'); $request->headers->set('X-Sendfile-Type', 'X-Accel-Redirect'); $request->headers->set('X-Accel-Mapping', $mapping); - $file = new FakeFile($realpath, __DIR__.'/File/Fixtures/test'); + $file = new FakeFile($realpath, __DIR__ . '/File/Fixtures/test'); BinaryFileResponse::trustXSendfileTypeHeader(); $response = new BinaryFileResponse($file, 200, array('Content-Type' => 'application/octet-stream')); $reflection = new \ReflectionObject($response); $property = $reflection->getProperty('file'); - $property->setAccessible(true); + $property->setAccessible(TRUE); $property->setValue($response, $file); $response->prepare($request); $this->assertEquals($virtual, $response->headers->get('X-Accel-Redirect')); } - public function testDeleteFileAfterSend() - { + public function testDeleteFileAfterSend() { $request = Request::create('/'); - $path = __DIR__.'/File/Fixtures/to_delete'; + $path = __DIR__ . '/File/Fixtures/to_delete'; touch($path); $realPath = realpath($path); $this->assertFileExists($realPath); $response = new BinaryFileResponse($realPath, 200, array('Content-Type' => 'application/octet-stream')); - $response->deleteFileAfterSend(true); + $response->deleteFileAfterSend(TRUE); $response->prepare($request); $response->sendContent(); @@ -301,50 +283,44 @@ class BinaryFileResponseTest extends ResponseTestCase $this->assertFileNotExists($path); } - public function testAcceptRangeOnUnsafeMethods() - { + public function testAcceptRangeOnUnsafeMethods() { $request = Request::create('/', 'POST'); - $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream')); + $response = BinaryFileResponse::create(__DIR__ . '/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream')); $response->prepare($request); $this->assertEquals('none', $response->headers->get('Accept-Ranges')); } - public function testAcceptRangeNotOverriden() - { + public function testAcceptRangeNotOverriden() { $request = Request::create('/', 'POST'); - $response = BinaryFileResponse::create(__DIR__.'/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream')); + $response = BinaryFileResponse::create(__DIR__ . '/File/Fixtures/test.gif', 200, array('Content-Type' => 'application/octet-stream')); $response->headers->set('Accept-Ranges', 'foo'); $response->prepare($request); $this->assertEquals('foo', $response->headers->get('Accept-Ranges')); } - public function getSampleXAccelMappings() - { + public function getSampleXAccelMappings() { return array( array('/var/www/var/www/files/foo.txt', '/var/www/=/files/', '/files/var/www/files/foo.txt'), array('/home/foo/bar.txt', '/var/www/=/files/,/home/foo/=/baz/', '/baz/bar.txt'), ); } - public function testStream() - { + public function testStream() { $request = Request::create('/'); - $response = new BinaryFileResponse(new Stream(__DIR__.'/../README.md'), 200, array('Content-Type' => 'text/plain')); + $response = new BinaryFileResponse(new Stream(__DIR__ . '/../README.md'), 200, array('Content-Type' => 'text/plain')); $response->prepare($request); $this->assertNull($response->headers->get('Content-Length')); } - protected function provideResponse() - { - return new BinaryFileResponse(__DIR__.'/../README.md', 200, array('Content-Type' => 'application/octet-stream')); + protected function provideResponse() { + return new BinaryFileResponse(__DIR__ . '/../README.md', 200, array('Content-Type' => 'application/octet-stream')); } - public static function tearDownAfterClass() - { - $path = __DIR__.'/../Fixtures/to_delete'; + public static function tearDownAfterClass() { + $path = __DIR__ . '/../Fixtures/to_delete'; if (file_exists($path)) { @unlink($path); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/CookieTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/CookieTest.php index 070b7dd..ff3663b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/CookieTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/CookieTest.php @@ -24,8 +24,7 @@ use Symfony\Component\HttpFoundation\Cookie; */ class CookieTest extends TestCase { - public function invalidNames() - { + public function invalidNames() { return array( array(''), array(',MyName'), @@ -43,43 +42,37 @@ class CookieTest extends TestCase * @dataProvider invalidNames * @expectedException \InvalidArgumentException */ - public function testInstantiationThrowsExceptionIfCookieNameContainsInvalidCharacters($name) - { + public function testInstantiationThrowsExceptionIfCookieNameContainsInvalidCharacters($name) { new Cookie($name); } /** * @expectedException \InvalidArgumentException */ - public function testInvalidExpiration() - { + public function testInvalidExpiration() { new Cookie('MyCookie', 'foo', 'bar'); } - public function testNegativeExpirationIsNotPossible() - { + public function testNegativeExpirationIsNotPossible() { $cookie = new Cookie('foo', 'bar', -100); $this->assertSame(0, $cookie->getExpiresTime()); } - public function testGetValue() - { + public function testGetValue() { $value = 'MyValue'; $cookie = new Cookie('MyCookie', $value); $this->assertSame($value, $cookie->getValue(), '->getValue() returns the proper value'); } - public function testGetPath() - { + public function testGetPath() { $cookie = new Cookie('foo', 'bar'); $this->assertSame('/', $cookie->getPath(), '->getPath() returns / as the default path'); } - public function testGetExpiresTime() - { + public function testGetExpiresTime() { $cookie = new Cookie('foo', 'bar'); $this->assertEquals(0, $cookie->getExpiresTime(), '->getExpiresTime() returns the default expire date'); @@ -89,15 +82,13 @@ class CookieTest extends TestCase $this->assertEquals($expire, $cookie->getExpiresTime(), '->getExpiresTime() returns the expire date'); } - public function testGetExpiresTimeIsCastToInt() - { + public function testGetExpiresTimeIsCastToInt() { $cookie = new Cookie('foo', 'bar', 3600.9); $this->assertSame(3600, $cookie->getExpiresTime(), '->getExpiresTime() returns the expire date as an integer'); } - public function testConstructorWithDateTime() - { + public function testConstructorWithDateTime() { $expire = new \DateTime(); $cookie = new Cookie('foo', 'bar', $expire); @@ -107,16 +98,14 @@ class CookieTest extends TestCase /** * @requires PHP 5.5 */ - public function testConstructorWithDateTimeImmutable() - { + public function testConstructorWithDateTimeImmutable() { $expire = new \DateTimeImmutable(); $cookie = new Cookie('foo', 'bar', $expire); $this->assertEquals($expire->format('U'), $cookie->getExpiresTime(), '->getExpiresTime() returns the expire date'); } - public function testGetExpiresTimeWithStringValue() - { + public function testGetExpiresTimeWithStringValue() { $value = '+1 day'; $cookie = new Cookie('foo', 'bar', $value); $expire = strtotime($value); @@ -124,69 +113,61 @@ class CookieTest extends TestCase $this->assertEquals($expire, $cookie->getExpiresTime(), '->getExpiresTime() returns the expire date', 1); } - public function testGetDomain() - { + public function testGetDomain() { $cookie = new Cookie('foo', 'bar', 0, '/', '.myfoodomain.com'); $this->assertEquals('.myfoodomain.com', $cookie->getDomain(), '->getDomain() returns the domain name on which the cookie is valid'); } - public function testIsSecure() - { - $cookie = new Cookie('foo', 'bar', 0, '/', '.myfoodomain.com', true); + public function testIsSecure() { + $cookie = new Cookie('foo', 'bar', 0, '/', '.myfoodomain.com', TRUE); $this->assertTrue($cookie->isSecure(), '->isSecure() returns whether the cookie is transmitted over HTTPS'); } - public function testIsHttpOnly() - { - $cookie = new Cookie('foo', 'bar', 0, '/', '.myfoodomain.com', false, true); + public function testIsHttpOnly() { + $cookie = new Cookie('foo', 'bar', 0, '/', '.myfoodomain.com', FALSE, TRUE); $this->assertTrue($cookie->isHttpOnly(), '->isHttpOnly() returns whether the cookie is only transmitted over HTTP'); } - public function testCookieIsNotCleared() - { + public function testCookieIsNotCleared() { $cookie = new Cookie('foo', 'bar', time() + 3600 * 24); $this->assertFalse($cookie->isCleared(), '->isCleared() returns false if the cookie did not expire yet'); } - public function testCookieIsCleared() - { + public function testCookieIsCleared() { $cookie = new Cookie('foo', 'bar', time() - 20); $this->assertTrue($cookie->isCleared(), '->isCleared() returns true if the cookie has expired'); } - public function testToString() - { - $cookie = new Cookie('foo', 'bar', $expire = strtotime('Fri, 20-May-2011 15:25:52 GMT'), '/', '.myfoodomain.com', true); - $this->assertEquals('foo=bar; expires=Fri, 20-May-2011 15:25:52 GMT; max-age='.($expire - time()).'; path=/; domain=.myfoodomain.com; secure; httponly', (string) $cookie, '->__toString() returns string representation of the cookie'); + public function testToString() { + $cookie = new Cookie('foo', 'bar', $expire = strtotime('Fri, 20-May-2011 15:25:52 GMT'), '/', '.myfoodomain.com', TRUE); + $this->assertEquals('foo=bar; expires=Fri, 20-May-2011 15:25:52 GMT; max-age=' . ($expire - time()) . '; path=/; domain=.myfoodomain.com; secure; httponly', (string)$cookie, '->__toString() returns string representation of the cookie'); - $cookie = new Cookie('foo', 'bar with white spaces', strtotime('Fri, 20-May-2011 15:25:52 GMT'), '/', '.myfoodomain.com', true); - $this->assertEquals('foo=bar%20with%20white%20spaces; expires=Fri, 20-May-2011 15:25:52 GMT; max-age='.($expire - time()).'; path=/; domain=.myfoodomain.com; secure; httponly', (string) $cookie, '->__toString() encodes the value of the cookie according to RFC 3986 (white space = %20)'); + $cookie = new Cookie('foo', 'bar with white spaces', strtotime('Fri, 20-May-2011 15:25:52 GMT'), '/', '.myfoodomain.com', TRUE); + $this->assertEquals('foo=bar%20with%20white%20spaces; expires=Fri, 20-May-2011 15:25:52 GMT; max-age=' . ($expire - time()) . '; path=/; domain=.myfoodomain.com; secure; httponly', (string)$cookie, '->__toString() encodes the value of the cookie according to RFC 3986 (white space = %20)'); - $cookie = new Cookie('foo', null, 1, '/admin/', '.myfoodomain.com'); - $this->assertEquals('foo=deleted; expires='.gmdate('D, d-M-Y H:i:s T', $expire = time() - 31536001).'; max-age='.($expire - time()).'; path=/admin/; domain=.myfoodomain.com; httponly', (string) $cookie, '->__toString() returns string representation of a cleared cookie if value is NULL'); + $cookie = new Cookie('foo', NULL, 1, '/admin/', '.myfoodomain.com'); + $this->assertEquals('foo=deleted; expires=' . gmdate('D, d-M-Y H:i:s T', $expire = time() - 31536001) . '; max-age=' . ($expire - time()) . '; path=/admin/; domain=.myfoodomain.com; httponly', (string)$cookie, '->__toString() returns string representation of a cleared cookie if value is NULL'); $cookie = new Cookie('foo', 'bar', 0, '/', ''); - $this->assertEquals('foo=bar; path=/; httponly', (string) $cookie); + $this->assertEquals('foo=bar; path=/; httponly', (string)$cookie); } - public function testRawCookie() - { - $cookie = new Cookie('foo', 'b a r', 0, '/', null, false, false); + public function testRawCookie() { + $cookie = new Cookie('foo', 'b a r', 0, '/', NULL, FALSE, FALSE); $this->assertFalse($cookie->isRaw()); - $this->assertEquals('foo=b%20a%20r; path=/', (string) $cookie); + $this->assertEquals('foo=b%20a%20r; path=/', (string)$cookie); - $cookie = new Cookie('foo', 'b+a+r', 0, '/', null, false, false, true); + $cookie = new Cookie('foo', 'b+a+r', 0, '/', NULL, FALSE, FALSE, TRUE); $this->assertTrue($cookie->isRaw()); - $this->assertEquals('foo=b+a+r; path=/', (string) $cookie); + $this->assertEquals('foo=b+a+r; path=/', (string)$cookie); } - public function testGetMaxAge() - { + public function testGetMaxAge() { $cookie = new Cookie('foo', 'bar'); $this->assertEquals(0, $cookie->getMaxAge()); @@ -197,17 +178,15 @@ class CookieTest extends TestCase $this->assertEquals($expire - time(), $cookie->getMaxAge()); } - public function testFromString() - { + public function testFromString() { $cookie = Cookie::fromString('foo=bar; expires=Fri, 20-May-2011 15:25:52 GMT; path=/; domain=.myfoodomain.com; secure; httponly'); - $this->assertEquals(new Cookie('foo', 'bar', strtotime('Fri, 20-May-2011 15:25:52 GMT'), '/', '.myfoodomain.com', true, true, true), $cookie); + $this->assertEquals(new Cookie('foo', 'bar', strtotime('Fri, 20-May-2011 15:25:52 GMT'), '/', '.myfoodomain.com', TRUE, TRUE, TRUE), $cookie); - $cookie = Cookie::fromString('foo=bar', true); - $this->assertEquals(new Cookie('foo', 'bar', 0, '/', null, false, false), $cookie); + $cookie = Cookie::fromString('foo=bar', TRUE); + $this->assertEquals(new Cookie('foo', 'bar', 0, '/', NULL, FALSE, FALSE), $cookie); } - public function testFromStringWithHttpOnly() - { + public function testFromStringWithHttpOnly() { $cookie = Cookie::fromString('foo=bar; expires=Fri, 20-May-2011 15:25:52 GMT; path=/; domain=.myfoodomain.com; secure; httponly'); $this->assertTrue($cookie->isHttpOnly()); @@ -215,9 +194,8 @@ class CookieTest extends TestCase $this->assertFalse($cookie->isHttpOnly()); } - public function testSameSiteAttributeIsCaseInsensitive() - { - $cookie = new Cookie('foo', 'bar', 0, '/', null, false, true, false, 'Lax'); + public function testSameSiteAttributeIsCaseInsensitive() { + $cookie = new Cookie('foo', 'bar', 0, '/', NULL, FALSE, TRUE, FALSE, 'Lax'); $this->assertEquals('lax', $cookie->getSameSite()); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ExpressionRequestMatcherTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ExpressionRequestMatcherTest.php index 1152e46..41ac989 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ExpressionRequestMatcherTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ExpressionRequestMatcherTest.php @@ -21,8 +21,7 @@ class ExpressionRequestMatcherTest extends TestCase /** * @expectedException \LogicException */ - public function testWhenNoExpressionIsSet() - { + public function testWhenNoExpressionIsSet() { $expressionRequestMatcher = new ExpressionRequestMatcher(); $expressionRequestMatcher->matches(new Request()); } @@ -30,8 +29,7 @@ class ExpressionRequestMatcherTest extends TestCase /** * @dataProvider provideExpressions */ - public function testMatchesWhenParentMatchesIsTrue($expression, $expected) - { + public function testMatchesWhenParentMatchesIsTrue($expression, $expected) { $request = Request::create('/foo'); $expressionRequestMatcher = new ExpressionRequestMatcher(); @@ -42,8 +40,7 @@ class ExpressionRequestMatcherTest extends TestCase /** * @dataProvider provideExpressions */ - public function testMatchesWhenParentMatchesIsFalse($expression) - { + public function testMatchesWhenParentMatchesIsFalse($expression) { $request = Request::create('/foo'); $request->attributes->set('foo', 'foo'); $expressionRequestMatcher = new ExpressionRequestMatcher(); @@ -53,17 +50,16 @@ class ExpressionRequestMatcherTest extends TestCase $this->assertFalse($expressionRequestMatcher->matches($request)); } - public function provideExpressions() - { + public function provideExpressions() { return array( - array('request.getMethod() == method', true), - array('request.getPathInfo() == path', true), - array('request.getHost() == host', true), - array('request.getClientIp() == ip', true), - array('request.attributes.all() == attributes', true), - array('request.getMethod() == method && request.getPathInfo() == path && request.getHost() == host && request.getClientIp() == ip && request.attributes.all() == attributes', true), - array('request.getMethod() != method', false), - array('request.getMethod() != method && request.getPathInfo() == path && request.getHost() == host && request.getClientIp() == ip && request.attributes.all() == attributes', false), + array('request.getMethod() == method', TRUE), + array('request.getPathInfo() == path', TRUE), + array('request.getHost() == host', TRUE), + array('request.getClientIp() == ip', TRUE), + array('request.attributes.all() == attributes', TRUE), + array('request.getMethod() == method && request.getPathInfo() == path && request.getHost() == host && request.getClientIp() == ip && request.attributes.all() == attributes', TRUE), + array('request.getMethod() != method', FALSE), + array('request.getMethod() != method && request.getPathInfo() == path && request.getHost() == host && request.getClientIp() == ip && request.attributes.all() == attributes', FALSE), ); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/File/FakeFile.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/File/FakeFile.php index c415989..cf7c12d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/File/FakeFile.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/File/FakeFile.php @@ -17,29 +17,24 @@ class FakeFile extends OrigFile { private $realpath; - public function __construct($realpath, $path) - { + public function __construct($realpath, $path) { $this->realpath = $realpath; - parent::__construct($path, false); + parent::__construct($path, FALSE); } - public function isReadable() - { - return true; + public function isReadable() { + return TRUE; } - public function getRealpath() - { + public function getRealpath() { return $this->realpath; } - public function getSize() - { + public function getSize() { return 42; } - public function getMTime() - { + public function getMTime() { return time(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/File/FileTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/File/FileTest.php index dbd9c44..0938bd5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/File/FileTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/File/FileTest.php @@ -19,9 +19,8 @@ class FileTest extends TestCase { protected $file; - public function testGetMimeTypeUsesMimeTypeGuessers() - { - $file = new File(__DIR__.'/Fixtures/test.gif'); + public function testGetMimeTypeUsesMimeTypeGuessers() { + $file = new File(__DIR__ . '/Fixtures/test.gif'); $guesser = $this->createMockGuesser($file->getPathname(), 'image/gif'); MimeTypeGuesser::getInstance()->register($guesser); @@ -29,16 +28,14 @@ class FileTest extends TestCase $this->assertEquals('image/gif', $file->getMimeType()); } - public function testGuessExtensionWithoutGuesser() - { - $file = new File(__DIR__.'/Fixtures/directory/.empty'); + public function testGuessExtensionWithoutGuesser() { + $file = new File(__DIR__ . '/Fixtures/directory/.empty'); $this->assertNull($file->guessExtension()); } - public function testGuessExtensionIsBasedOnMimeType() - { - $file = new File(__DIR__.'/Fixtures/test'); + public function testGuessExtensionIsBasedOnMimeType() { + $file = new File(__DIR__ . '/Fixtures/test'); $guesser = $this->createMockGuesser($file->getPathname(), 'image/gif'); MimeTypeGuesser::getInstance()->register($guesser); @@ -49,9 +46,8 @@ class FileTest extends TestCase /** * @requires extension fileinfo */ - public function testGuessExtensionWithReset() - { - $file = new File(__DIR__.'/Fixtures/other-file.example'); + public function testGuessExtensionWithReset() { + $file = new File(__DIR__ . '/Fixtures/other-file.example'); $guesser = $this->createMockGuesser($file->getPathname(), 'image/gif'); MimeTypeGuesser::getInstance()->register($guesser); @@ -62,21 +58,19 @@ class FileTest extends TestCase $this->assertNull($file->guessExtension()); } - public function testConstructWhenFileNotExists() - { + public function testConstructWhenFileNotExists() { $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException'); - new File(__DIR__.'/Fixtures/not_here'); + new File(__DIR__ . '/Fixtures/not_here'); } - public function testMove() - { - $path = __DIR__.'/Fixtures/test.copy.gif'; - $targetDir = __DIR__.'/Fixtures/directory'; - $targetPath = $targetDir.'/test.copy.gif'; + public function testMove() { + $path = __DIR__ . '/Fixtures/test.copy.gif'; + $targetDir = __DIR__ . '/Fixtures/directory'; + $targetPath = $targetDir . '/test.copy.gif'; @unlink($path); @unlink($targetPath); - copy(__DIR__.'/Fixtures/test.gif', $path); + copy(__DIR__ . '/Fixtures/test.gif', $path); $file = new File($path); $movedFile = $file->move($targetDir); @@ -89,14 +83,13 @@ class FileTest extends TestCase @unlink($targetPath); } - public function testMoveWithNewName() - { - $path = __DIR__.'/Fixtures/test.copy.gif'; - $targetDir = __DIR__.'/Fixtures/directory'; - $targetPath = $targetDir.'/test.newname.gif'; + public function testMoveWithNewName() { + $path = __DIR__ . '/Fixtures/test.copy.gif'; + $targetDir = __DIR__ . '/Fixtures/directory'; + $targetPath = $targetDir . '/test.newname.gif'; @unlink($path); @unlink($targetPath); - copy(__DIR__.'/Fixtures/test.gif', $path); + copy(__DIR__ . '/Fixtures/test.gif', $path); $file = new File($path); $movedFile = $file->move($targetDir, 'test.newname.gif'); @@ -108,8 +101,7 @@ class FileTest extends TestCase @unlink($targetPath); } - public function getFilenameFixtures() - { + public function getFilenameFixtures() { return array( array('original.gif', 'original.gif'), array('..\\..\\original.gif', 'original.gif'), @@ -123,14 +115,13 @@ class FileTest extends TestCase /** * @dataProvider getFilenameFixtures */ - public function testMoveWithNonLatinName($filename, $sanitizedFilename) - { - $path = __DIR__.'/Fixtures/'.$sanitizedFilename; - $targetDir = __DIR__.'/Fixtures/directory/'; - $targetPath = $targetDir.$sanitizedFilename; + public function testMoveWithNonLatinName($filename, $sanitizedFilename) { + $path = __DIR__ . '/Fixtures/' . $sanitizedFilename; + $targetDir = __DIR__ . '/Fixtures/directory/'; + $targetPath = $targetDir . $sanitizedFilename; @unlink($path); @unlink($targetPath); - copy(__DIR__.'/Fixtures/test.gif', $path); + copy(__DIR__ . '/Fixtures/test.gif', $path); $file = new File($path); $movedFile = $file->move($targetDir, $filename); @@ -143,15 +134,14 @@ class FileTest extends TestCase @unlink($targetPath); } - public function testMoveToAnUnexistentDirectory() - { - $sourcePath = __DIR__.'/Fixtures/test.copy.gif'; - $targetDir = __DIR__.'/Fixtures/directory/sub'; - $targetPath = $targetDir.'/test.copy.gif'; + public function testMoveToAnUnexistentDirectory() { + $sourcePath = __DIR__ . '/Fixtures/test.copy.gif'; + $targetDir = __DIR__ . '/Fixtures/directory/sub'; + $targetPath = $targetDir . '/test.copy.gif'; @unlink($sourcePath); @unlink($targetPath); @rmdir($targetDir); - copy(__DIR__.'/Fixtures/test.gif', $sourcePath); + copy(__DIR__ . '/Fixtures/test.gif', $sourcePath); $file = new File($sourcePath); $movedFile = $file->move($targetDir); @@ -165,15 +155,13 @@ class FileTest extends TestCase @rmdir($targetDir); } - protected function createMockGuesser($path, $mimeType) - { + protected function createMockGuesser($path, $mimeType) { $guesser = $this->getMockBuilder('Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface')->getMock(); $guesser ->expects($this->once()) ->method('guess') ->with($this->equalTo($path)) - ->will($this->returnValue($mimeType)) - ; + ->will($this->returnValue($mimeType)); return $guesser; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/File/MimeType/MimeTypeTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/File/MimeType/MimeTypeTest.php index b3f1f02..6cdcf28 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/File/MimeType/MimeTypeTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/File/MimeType/MimeTypeTest.php @@ -22,43 +22,36 @@ class MimeTypeTest extends TestCase { protected $path; - public function testGuessImageWithoutExtension() - { - $this->assertEquals('image/gif', MimeTypeGuesser::getInstance()->guess(__DIR__.'/../Fixtures/test')); + public function testGuessImageWithoutExtension() { + $this->assertEquals('image/gif', MimeTypeGuesser::getInstance()->guess(__DIR__ . '/../Fixtures/test')); } - public function testGuessImageWithDirectory() - { + public function testGuessImageWithDirectory() { $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException'); - MimeTypeGuesser::getInstance()->guess(__DIR__.'/../Fixtures/directory'); + MimeTypeGuesser::getInstance()->guess(__DIR__ . '/../Fixtures/directory'); } - public function testGuessImageWithFileBinaryMimeTypeGuesser() - { + public function testGuessImageWithFileBinaryMimeTypeGuesser() { $guesser = MimeTypeGuesser::getInstance(); $guesser->register(new FileBinaryMimeTypeGuesser()); - $this->assertEquals('image/gif', MimeTypeGuesser::getInstance()->guess(__DIR__.'/../Fixtures/test')); + $this->assertEquals('image/gif', MimeTypeGuesser::getInstance()->guess(__DIR__ . '/../Fixtures/test')); } - public function testGuessImageWithKnownExtension() - { - $this->assertEquals('image/gif', MimeTypeGuesser::getInstance()->guess(__DIR__.'/../Fixtures/test.gif')); + public function testGuessImageWithKnownExtension() { + $this->assertEquals('image/gif', MimeTypeGuesser::getInstance()->guess(__DIR__ . '/../Fixtures/test.gif')); } - public function testGuessFileWithUnknownExtension() - { - $this->assertEquals('application/octet-stream', MimeTypeGuesser::getInstance()->guess(__DIR__.'/../Fixtures/.unknownextension')); + public function testGuessFileWithUnknownExtension() { + $this->assertEquals('application/octet-stream', MimeTypeGuesser::getInstance()->guess(__DIR__ . '/../Fixtures/.unknownextension')); } - public function testGuessWithIncorrectPath() - { + public function testGuessWithIncorrectPath() { $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException'); - MimeTypeGuesser::getInstance()->guess(__DIR__.'/../Fixtures/not_here'); + MimeTypeGuesser::getInstance()->guess(__DIR__ . '/../Fixtures/not_here'); } - public function testGuessWithNonReadablePath() - { + public function testGuessWithNonReadablePath() { if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Can not verify chmod operations on Windows'); } @@ -67,7 +60,7 @@ class MimeTypeTest extends TestCase $this->markTestSkipped('This test will fail if run under superuser'); } - $path = __DIR__.'/../Fixtures/to_delete'; + $path = __DIR__ . '/../Fixtures/to_delete'; touch($path); @chmod($path, 0333); @@ -79,9 +72,8 @@ class MimeTypeTest extends TestCase } } - public static function tearDownAfterClass() - { - $path = __DIR__.'/../Fixtures/to_delete'; + public static function tearDownAfterClass() { + $path = __DIR__ . '/../Fixtures/to_delete'; if (file_exists($path)) { @chmod($path, 0666); @unlink($path); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/File/UploadedFileTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/File/UploadedFileTest.php index 36f122f..a1ae3e5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/File/UploadedFileTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/File/UploadedFileTest.php @@ -16,31 +16,28 @@ use Symfony\Component\HttpFoundation\File\UploadedFile; class UploadedFileTest extends TestCase { - protected function setUp() - { + protected function setUp() { if (!ini_get('file_uploads')) { $this->markTestSkipped('file_uploads is disabled in php.ini'); } } - public function testConstructWhenFileNotExists() - { + public function testConstructWhenFileNotExists() { $this->{method_exists($this, $_ = 'expectException') ? $_ : 'setExpectedException'}('Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException'); new UploadedFile( - __DIR__.'/Fixtures/not_here', + __DIR__ . '/Fixtures/not_here', 'original.gif', - null + NULL ); } - public function testFileUploadsWithNoMimeType() - { + public function testFileUploadsWithNoMimeType() { $file = new UploadedFile( - __DIR__.'/Fixtures/test.gif', + __DIR__ . '/Fixtures/test.gif', 'original.gif', - null, - filesize(__DIR__.'/Fixtures/test.gif'), + NULL, + filesize(__DIR__ . '/Fixtures/test.gif'), UPLOAD_ERR_OK ); @@ -51,79 +48,73 @@ class UploadedFileTest extends TestCase } } - public function testFileUploadsWithUnknownMimeType() - { + public function testFileUploadsWithUnknownMimeType() { $file = new UploadedFile( - __DIR__.'/Fixtures/.unknownextension', + __DIR__ . '/Fixtures/.unknownextension', 'original.gif', - null, - filesize(__DIR__.'/Fixtures/.unknownextension'), + NULL, + filesize(__DIR__ . '/Fixtures/.unknownextension'), UPLOAD_ERR_OK ); $this->assertEquals('application/octet-stream', $file->getClientMimeType()); } - public function testGuessClientExtension() - { + public function testGuessClientExtension() { $file = new UploadedFile( - __DIR__.'/Fixtures/test.gif', + __DIR__ . '/Fixtures/test.gif', 'original.gif', 'image/gif', - filesize(__DIR__.'/Fixtures/test.gif'), - null + filesize(__DIR__ . '/Fixtures/test.gif'), + NULL ); $this->assertEquals('gif', $file->guessClientExtension()); } - public function testGuessClientExtensionWithIncorrectMimeType() - { + public function testGuessClientExtensionWithIncorrectMimeType() { $file = new UploadedFile( - __DIR__.'/Fixtures/test.gif', + __DIR__ . '/Fixtures/test.gif', 'original.gif', 'image/jpeg', - filesize(__DIR__.'/Fixtures/test.gif'), - null + filesize(__DIR__ . '/Fixtures/test.gif'), + NULL ); $this->assertEquals('jpeg', $file->guessClientExtension()); } - public function testErrorIsOkByDefault() - { + public function testErrorIsOkByDefault() { $file = new UploadedFile( - __DIR__.'/Fixtures/test.gif', + __DIR__ . '/Fixtures/test.gif', 'original.gif', 'image/gif', - filesize(__DIR__.'/Fixtures/test.gif'), - null + filesize(__DIR__ . '/Fixtures/test.gif'), + NULL ); $this->assertEquals(UPLOAD_ERR_OK, $file->getError()); } - public function testGetClientOriginalName() - { + public function testGetClientOriginalName() { $file = new UploadedFile( - __DIR__.'/Fixtures/test.gif', + __DIR__ . '/Fixtures/test.gif', 'original.gif', 'image/gif', - filesize(__DIR__.'/Fixtures/test.gif'), - null + filesize(__DIR__ . '/Fixtures/test.gif'), + NULL ); $this->assertEquals('original.gif', $file->getClientOriginalName()); } - public function testGetClientOriginalExtension() - { + public function testGetClientOriginalExtension() { $file = new UploadedFile( - __DIR__.'/Fixtures/test.gif', + __DIR__ . '/Fixtures/test.gif', 'original.gif', 'image/gif', - filesize(__DIR__.'/Fixtures/test.gif'), - null + filesize(__DIR__ . '/Fixtures/test.gif'), + NULL ); $this->assertEquals('gif', $file->getClientOriginalExtension()); @@ -132,27 +123,25 @@ class UploadedFileTest extends TestCase /** * @expectedException \Symfony\Component\HttpFoundation\File\Exception\FileException */ - public function testMoveLocalFileIsNotAllowed() - { + public function testMoveLocalFileIsNotAllowed() { $file = new UploadedFile( - __DIR__.'/Fixtures/test.gif', + __DIR__ . '/Fixtures/test.gif', 'original.gif', 'image/gif', - filesize(__DIR__.'/Fixtures/test.gif'), + filesize(__DIR__ . '/Fixtures/test.gif'), UPLOAD_ERR_OK ); - $movedFile = $file->move(__DIR__.'/Fixtures/directory'); + $movedFile = $file->move(__DIR__ . '/Fixtures/directory'); } - public function testMoveLocalFileIsAllowedInTestMode() - { - $path = __DIR__.'/Fixtures/test.copy.gif'; - $targetDir = __DIR__.'/Fixtures/directory'; - $targetPath = $targetDir.'/test.copy.gif'; + public function testMoveLocalFileIsAllowedInTestMode() { + $path = __DIR__ . '/Fixtures/test.copy.gif'; + $targetDir = __DIR__ . '/Fixtures/directory'; + $targetPath = $targetDir . '/test.copy.gif'; @unlink($path); @unlink($targetPath); - copy(__DIR__.'/Fixtures/test.gif', $path); + copy(__DIR__ . '/Fixtures/test.gif', $path); $file = new UploadedFile( $path, @@ -160,10 +149,10 @@ class UploadedFileTest extends TestCase 'image/gif', filesize($path), UPLOAD_ERR_OK, - true + TRUE ); - $movedFile = $file->move(__DIR__.'/Fixtures/directory'); + $movedFile = $file->move(__DIR__ . '/Fixtures/directory'); $this->assertFileExists($targetPath); $this->assertFileNotExists($path); @@ -172,60 +161,56 @@ class UploadedFileTest extends TestCase @unlink($targetPath); } - public function testGetClientOriginalNameSanitizeFilename() - { + public function testGetClientOriginalNameSanitizeFilename() { $file = new UploadedFile( - __DIR__.'/Fixtures/test.gif', + __DIR__ . '/Fixtures/test.gif', '../../original.gif', 'image/gif', - filesize(__DIR__.'/Fixtures/test.gif'), - null + filesize(__DIR__ . '/Fixtures/test.gif'), + NULL ); $this->assertEquals('original.gif', $file->getClientOriginalName()); } - public function testGetSize() - { + public function testGetSize() { $file = new UploadedFile( - __DIR__.'/Fixtures/test.gif', + __DIR__ . '/Fixtures/test.gif', 'original.gif', 'image/gif', - filesize(__DIR__.'/Fixtures/test.gif'), - null + filesize(__DIR__ . '/Fixtures/test.gif'), + NULL ); - $this->assertEquals(filesize(__DIR__.'/Fixtures/test.gif'), $file->getSize()); + $this->assertEquals(filesize(__DIR__ . '/Fixtures/test.gif'), $file->getSize()); $file = new UploadedFile( - __DIR__.'/Fixtures/test', + __DIR__ . '/Fixtures/test', 'original.gif', 'image/gif' ); - $this->assertEquals(filesize(__DIR__.'/Fixtures/test'), $file->getSize()); + $this->assertEquals(filesize(__DIR__ . '/Fixtures/test'), $file->getSize()); } - public function testGetExtension() - { + public function testGetExtension() { $file = new UploadedFile( - __DIR__.'/Fixtures/test.gif', + __DIR__ . '/Fixtures/test.gif', 'original.gif', - null + NULL ); $this->assertEquals('gif', $file->getExtension()); } - public function testIsValid() - { + public function testIsValid() { $file = new UploadedFile( - __DIR__.'/Fixtures/test.gif', + __DIR__ . '/Fixtures/test.gif', 'original.gif', - null, - filesize(__DIR__.'/Fixtures/test.gif'), + NULL, + filesize(__DIR__ . '/Fixtures/test.gif'), UPLOAD_ERR_OK, - true + TRUE ); $this->assertTrue($file->isValid()); @@ -234,21 +219,19 @@ class UploadedFileTest extends TestCase /** * @dataProvider uploadedFileErrorProvider */ - public function testIsInvalidOnUploadError($error) - { + public function testIsInvalidOnUploadError($error) { $file = new UploadedFile( - __DIR__.'/Fixtures/test.gif', + __DIR__ . '/Fixtures/test.gif', 'original.gif', - null, - filesize(__DIR__.'/Fixtures/test.gif'), + NULL, + filesize(__DIR__ . '/Fixtures/test.gif'), $error ); $this->assertFalse($file->isValid()); } - public function uploadedFileErrorProvider() - { + public function uploadedFileErrorProvider() { return array( array(UPLOAD_ERR_INI_SIZE), array(UPLOAD_ERR_FORM_SIZE), @@ -258,13 +241,12 @@ class UploadedFileTest extends TestCase ); } - public function testIsInvalidIfNotHttpUpload() - { + public function testIsInvalidIfNotHttpUpload() { $file = new UploadedFile( - __DIR__.'/Fixtures/test.gif', + __DIR__ . '/Fixtures/test.gif', 'original.gif', - null, - filesize(__DIR__.'/Fixtures/test.gif'), + NULL, + filesize(__DIR__ . '/Fixtures/test.gif'), UPLOAD_ERR_OK ); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/FileBagTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/FileBagTest.php index b1bbba0..fdb2c20 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/FileBagTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/FileBagTest.php @@ -26,13 +26,11 @@ class FileBagTest extends TestCase /** * @expectedException \InvalidArgumentException */ - public function testFileMustBeAnArrayOrUploadedFile() - { + public function testFileMustBeAnArrayOrUploadedFile() { new FileBag(array('file' => 'foo')); } - public function testShouldConvertsUploadedFiles() - { + public function testShouldConvertsUploadedFiles() { $tmpFile = $this->createTempFile(); $file = new UploadedFile($tmpFile, basename($tmpFile), 'text/plain', 100, 0); @@ -47,8 +45,7 @@ class FileBagTest extends TestCase $this->assertEquals($file, $bag->get('file')); } - public function testShouldSetEmptyUploadedFilesToNull() - { + public function testShouldSetEmptyUploadedFilesToNull() { $bag = new FileBag(array('file' => array( 'name' => '', 'type' => '', @@ -60,8 +57,7 @@ class FileBagTest extends TestCase $this->assertNull($bag->get('file')); } - public function testShouldRemoveEmptyUploadedFilesForMultiUpload() - { + public function testShouldRemoveEmptyUploadedFilesForMultiUpload() { $bag = new FileBag(array('files' => array( 'name' => array(''), 'type' => array(''), @@ -73,8 +69,7 @@ class FileBagTest extends TestCase $this->assertSame(array(), $bag->get('files')); } - public function testShouldNotRemoveEmptyUploadedFilesForAssociativeArray() - { + public function testShouldNotRemoveEmptyUploadedFilesForAssociativeArray() { $bag = new FileBag(array('files' => array( 'name' => array('file1' => ''), 'type' => array('file1' => ''), @@ -83,11 +78,10 @@ class FileBagTest extends TestCase 'size' => array('file1' => 0), ))); - $this->assertSame(array('file1' => null), $bag->get('files')); + $this->assertSame(array('file1' => NULL), $bag->get('files')); } - public function testShouldConvertUploadedFilesWithPhpBug() - { + public function testShouldConvertUploadedFilesWithPhpBug() { $tmpFile = $this->createTempFile(); $file = new UploadedFile($tmpFile, basename($tmpFile), 'text/plain', 100, 0); @@ -115,8 +109,7 @@ class FileBagTest extends TestCase $this->assertEquals($file, $files['child']['file']); } - public function testShouldConvertNestedUploadedFilesWithPhpBug() - { + public function testShouldConvertNestedUploadedFilesWithPhpBug() { $tmpFile = $this->createTempFile(); $file = new UploadedFile($tmpFile, basename($tmpFile), 'text/plain', 100, 0); @@ -144,8 +137,7 @@ class FileBagTest extends TestCase $this->assertEquals($file, $files['child']['sub']['file']); } - public function testShouldNotConvertNestedUploadedFiles() - { + public function testShouldNotConvertNestedUploadedFiles() { $tmpFile = $this->createTempFile(); $file = new UploadedFile($tmpFile, basename($tmpFile), 'text/plain', 100, 0); $bag = new FileBag(array('image' => array('file' => $file))); @@ -154,22 +146,19 @@ class FileBagTest extends TestCase $this->assertEquals($file, $files['image']['file']); } - protected function createTempFile() - { - return tempnam(sys_get_temp_dir().'/form_test', 'FormTest'); + protected function createTempFile() { + return tempnam(sys_get_temp_dir() . '/form_test', 'FormTest'); } - protected function setUp() - { - mkdir(sys_get_temp_dir().'/form_test', 0777, true); + protected function setUp() { + mkdir(sys_get_temp_dir() . '/form_test', 0777, TRUE); } - protected function tearDown() - { - foreach (glob(sys_get_temp_dir().'/form_test/*') as $file) { + protected function tearDown() { + foreach (glob(sys_get_temp_dir() . '/form_test/*') as $file) { unlink($file); } - rmdir(sys_get_temp_dir().'/form_test'); + rmdir(sys_get_temp_dir() . '/form_test'); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/HeaderBagTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/HeaderBagTest.php index 6d19ceb..a4b762b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/HeaderBagTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/HeaderBagTest.php @@ -16,33 +16,28 @@ use Symfony\Component\HttpFoundation\HeaderBag; class HeaderBagTest extends TestCase { - public function testConstructor() - { + public function testConstructor() { $bag = new HeaderBag(array('foo' => 'bar')); $this->assertTrue($bag->has('foo')); } - public function testToStringNull() - { + public function testToStringNull() { $bag = new HeaderBag(); $this->assertEquals('', $bag->__toString()); } - public function testToStringNotNull() - { + public function testToStringNotNull() { $bag = new HeaderBag(array('foo' => 'bar')); $this->assertEquals("Foo: bar\r\n", $bag->__toString()); } - public function testKeys() - { + public function testKeys() { $bag = new HeaderBag(array('foo' => 'bar')); $keys = $bag->keys(); $this->assertEquals('foo', $keys[0]); } - public function testGetDate() - { + public function testGetDate() { $bag = new HeaderBag(array('foo' => 'Tue, 4 Sep 2012 20:00:00 +0200')); $headerDate = $bag->getDate('foo'); $this->assertInstanceOf('DateTime', $headerDate); @@ -51,22 +46,19 @@ class HeaderBagTest extends TestCase /** * @expectedException \RuntimeException */ - public function testGetDateException() - { + public function testGetDateException() { $bag = new HeaderBag(array('foo' => 'Tue')); $headerDate = $bag->getDate('foo'); } - public function testGetCacheControlHeader() - { + public function testGetCacheControlHeader() { $bag = new HeaderBag(); $bag->addCacheControlDirective('public', '#a'); $this->assertTrue($bag->hasCacheControlDirective('public')); $this->assertEquals('#a', $bag->getCacheControlDirective('public')); } - public function testAll() - { + public function testAll() { $bag = new HeaderBag(array('foo' => 'bar')); $this->assertEquals(array('foo' => array('bar')), $bag->all(), '->all() gets all the input'); @@ -74,8 +66,7 @@ class HeaderBagTest extends TestCase $this->assertEquals(array('foo' => array('BAR')), $bag->all(), '->all() gets all the input key are lower case'); } - public function testReplace() - { + public function testReplace() { $bag = new HeaderBag(array('foo' => 'bar')); $bag->replace(array('NOPE' => 'BAR')); @@ -83,33 +74,30 @@ class HeaderBagTest extends TestCase $this->assertFalse($bag->has('foo'), '->replace() overrides previously set the input'); } - public function testGet() - { + public function testGet() { $bag = new HeaderBag(array('foo' => 'bar', 'fuzz' => 'bizz')); $this->assertEquals('bar', $bag->get('foo'), '->get return current value'); $this->assertEquals('bar', $bag->get('FoO'), '->get key in case insensitive'); - $this->assertEquals(array('bar'), $bag->get('foo', 'nope', false), '->get return the value as array'); + $this->assertEquals(array('bar'), $bag->get('foo', 'nope', FALSE), '->get return the value as array'); // defaults $this->assertNull($bag->get('none'), '->get unknown values returns null'); $this->assertEquals('default', $bag->get('none', 'default'), '->get unknown values returns default'); - $this->assertEquals(array('default'), $bag->get('none', 'default', false), '->get unknown values returns default as array'); + $this->assertEquals(array('default'), $bag->get('none', 'default', FALSE), '->get unknown values returns default as array'); - $bag->set('foo', 'bor', false); + $bag->set('foo', 'bor', FALSE); $this->assertEquals('bar', $bag->get('foo'), '->get return first value'); - $this->assertEquals(array('bar', 'bor'), $bag->get('foo', 'nope', false), '->get return all values as array'); + $this->assertEquals(array('bar', 'bor'), $bag->get('foo', 'nope', FALSE), '->get return all values as array'); } - public function testSetAssociativeArray() - { + public function testSetAssociativeArray() { $bag = new HeaderBag(); $bag->set('foo', array('bad-assoc-index' => 'value')); $this->assertSame('value', $bag->get('foo')); - $this->assertEquals(array('value'), $bag->get('foo', 'nope', false), 'assoc indices of multi-valued headers are ignored'); + $this->assertEquals(array('value'), $bag->get('foo', 'nope', FALSE), 'assoc indices of multi-valued headers are ignored'); } - public function testContains() - { + public function testContains() { $bag = new HeaderBag(array('foo' => 'bar', 'fuzz' => 'bizz')); $this->assertTrue($bag->contains('foo', 'bar'), '->contains first value'); $this->assertTrue($bag->contains('fuzz', 'bizz'), '->contains second value'); @@ -117,14 +105,13 @@ class HeaderBagTest extends TestCase $this->assertFalse($bag->contains('foo', 'nope'), '->contains unknown value'); // Multiple values - $bag->set('foo', 'bor', false); + $bag->set('foo', 'bor', FALSE); $this->assertTrue($bag->contains('foo', 'bar'), '->contains first value'); $this->assertTrue($bag->contains('foo', 'bor'), '->contains second value'); $this->assertFalse($bag->contains('foo', 'nope'), '->contains unknown value'); } - public function testCacheControlDirectiveAccessors() - { + public function testCacheControlDirectiveAccessors() { $bag = new HeaderBag(); $bag->addCacheControlDirective('public'); @@ -141,8 +128,7 @@ class HeaderBagTest extends TestCase $this->assertFalse($bag->hasCacheControlDirective('max-age')); } - public function testCacheControlDirectiveParsing() - { + public function testCacheControlDirectiveParsing() { $bag = new HeaderBag(array('cache-control' => 'public, max-age=10')); $this->assertTrue($bag->hasCacheControlDirective('public')); $this->assertTrue($bag->getCacheControlDirective('public')); @@ -154,15 +140,13 @@ class HeaderBagTest extends TestCase $this->assertEquals('max-age=10, public, s-maxage=100', $bag->get('cache-control')); } - public function testCacheControlDirectiveParsingQuotedZero() - { + public function testCacheControlDirectiveParsingQuotedZero() { $bag = new HeaderBag(array('cache-control' => 'max-age="0"')); $this->assertTrue($bag->hasCacheControlDirective('max-age')); $this->assertEquals(0, $bag->getCacheControlDirective('max-age')); } - public function testCacheControlDirectiveOverrideWithReplace() - { + public function testCacheControlDirectiveOverrideWithReplace() { $bag = new HeaderBag(array('cache-control' => 'private, max-age=100')); $bag->replace(array('cache-control' => 'public, max-age=10')); $this->assertTrue($bag->hasCacheControlDirective('public')); @@ -172,8 +156,7 @@ class HeaderBagTest extends TestCase $this->assertEquals(10, $bag->getCacheControlDirective('max-age')); } - public function testCacheControlClone() - { + public function testCacheControlClone() { $headers = array('foo' => 'bar'); $bag1 = new HeaderBag($headers); $bag2 = new HeaderBag($bag1->all()); @@ -181,8 +164,7 @@ class HeaderBagTest extends TestCase $this->assertEquals($bag1->all(), $bag2->all()); } - public function testGetIterator() - { + public function testGetIterator() { $headers = array('foo' => 'bar', 'hello' => 'world', 'third' => 'charm'); $headerBag = new HeaderBag($headers); @@ -195,8 +177,7 @@ class HeaderBagTest extends TestCase $this->assertEquals(count($headers), $i); } - public function testCount() - { + public function testCount() { $headers = array('foo' => 'bar', 'HELLO' => 'WORLD'); $headerBag = new HeaderBag($headers); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/IpUtilsTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/IpUtilsTest.php index 7a93f99..ce33b97 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/IpUtilsTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/IpUtilsTest.php @@ -19,34 +19,31 @@ class IpUtilsTest extends TestCase /** * @dataProvider getIpv4Data */ - public function testIpv4($matches, $remoteAddr, $cidr) - { + public function testIpv4($matches, $remoteAddr, $cidr) { $this->assertSame($matches, IpUtils::checkIp($remoteAddr, $cidr)); } - public function getIpv4Data() - { + public function getIpv4Data() { return array( - array(true, '192.168.1.1', '192.168.1.1'), - array(true, '192.168.1.1', '192.168.1.1/1'), - array(true, '192.168.1.1', '192.168.1.0/24'), - array(false, '192.168.1.1', '1.2.3.4/1'), - array(false, '192.168.1.1', '192.168.1.1/33'), // invalid subnet - array(true, '192.168.1.1', array('1.2.3.4/1', '192.168.1.0/24')), - array(true, '192.168.1.1', array('192.168.1.0/24', '1.2.3.4/1')), - array(false, '192.168.1.1', array('1.2.3.4/1', '4.3.2.1/1')), - array(true, '1.2.3.4', '0.0.0.0/0'), - array(true, '1.2.3.4', '192.168.1.0/0'), - array(false, '1.2.3.4', '256.256.256/0'), // invalid CIDR notation - array(false, 'an_invalid_ip', '192.168.1.0/24'), + array(TRUE, '192.168.1.1', '192.168.1.1'), + array(TRUE, '192.168.1.1', '192.168.1.1/1'), + array(TRUE, '192.168.1.1', '192.168.1.0/24'), + array(FALSE, '192.168.1.1', '1.2.3.4/1'), + array(FALSE, '192.168.1.1', '192.168.1.1/33'), // invalid subnet + array(TRUE, '192.168.1.1', array('1.2.3.4/1', '192.168.1.0/24')), + array(TRUE, '192.168.1.1', array('192.168.1.0/24', '1.2.3.4/1')), + array(FALSE, '192.168.1.1', array('1.2.3.4/1', '4.3.2.1/1')), + array(TRUE, '1.2.3.4', '0.0.0.0/0'), + array(TRUE, '1.2.3.4', '192.168.1.0/0'), + array(FALSE, '1.2.3.4', '256.256.256/0'), // invalid CIDR notation + array(FALSE, 'an_invalid_ip', '192.168.1.0/24'), ); } /** * @dataProvider getIpv6Data */ - public function testIpv6($matches, $remoteAddr, $cidr) - { + public function testIpv6($matches, $remoteAddr, $cidr) { if (!defined('AF_INET6')) { $this->markTestSkipped('Only works when PHP is compiled without the option "disable-ipv6".'); } @@ -54,21 +51,20 @@ class IpUtilsTest extends TestCase $this->assertSame($matches, IpUtils::checkIp($remoteAddr, $cidr)); } - public function getIpv6Data() - { + public function getIpv6Data() { return array( - array(true, '2a01:198:603:0:396e:4789:8e99:890f', '2a01:198:603:0::/65'), - array(false, '2a00:198:603:0:396e:4789:8e99:890f', '2a01:198:603:0::/65'), - array(false, '2a01:198:603:0:396e:4789:8e99:890f', '::1'), - array(true, '0:0:0:0:0:0:0:1', '::1'), - array(false, '0:0:603:0:396e:4789:8e99:0001', '::1'), - array(true, '0:0:603:0:396e:4789:8e99:0001', '::/0'), - array(true, '0:0:603:0:396e:4789:8e99:0001', '2a01:198:603:0::/0'), - array(true, '2a01:198:603:0:396e:4789:8e99:890f', array('::1', '2a01:198:603:0::/65')), - array(true, '2a01:198:603:0:396e:4789:8e99:890f', array('2a01:198:603:0::/65', '::1')), - array(false, '2a01:198:603:0:396e:4789:8e99:890f', array('::1', '1a01:198:603:0::/65')), - array(false, '}__test|O:21:"JDatabaseDriverMysqli":3:{s:2', '::1'), - array(false, '2a01:198:603:0:396e:4789:8e99:890f', 'unknown'), + array(TRUE, '2a01:198:603:0:396e:4789:8e99:890f', '2a01:198:603:0::/65'), + array(FALSE, '2a00:198:603:0:396e:4789:8e99:890f', '2a01:198:603:0::/65'), + array(FALSE, '2a01:198:603:0:396e:4789:8e99:890f', '::1'), + array(TRUE, '0:0:0:0:0:0:0:1', '::1'), + array(FALSE, '0:0:603:0:396e:4789:8e99:0001', '::1'), + array(TRUE, '0:0:603:0:396e:4789:8e99:0001', '::/0'), + array(TRUE, '0:0:603:0:396e:4789:8e99:0001', '2a01:198:603:0::/0'), + array(TRUE, '2a01:198:603:0:396e:4789:8e99:890f', array('::1', '2a01:198:603:0::/65')), + array(TRUE, '2a01:198:603:0:396e:4789:8e99:890f', array('2a01:198:603:0::/65', '::1')), + array(FALSE, '2a01:198:603:0:396e:4789:8e99:890f', array('::1', '1a01:198:603:0::/65')), + array(FALSE, '}__test|O:21:"JDatabaseDriverMysqli":3:{s:2', '::1'), + array(FALSE, '2a01:198:603:0:396e:4789:8e99:890f', 'unknown'), ); } @@ -76,8 +72,7 @@ class IpUtilsTest extends TestCase * @expectedException \RuntimeException * @requires extension sockets */ - public function testAnIpv6WithOptionDisabledIpv6() - { + public function testAnIpv6WithOptionDisabledIpv6() { if (defined('AF_INET6')) { $this->markTestSkipped('Only works when PHP is compiled with the option "disable-ipv6".'); } @@ -88,13 +83,11 @@ class IpUtilsTest extends TestCase /** * @dataProvider invalidIpAddressData */ - public function testInvalidIpAddressesDoNotMatch($requestIp, $proxyIp) - { + public function testInvalidIpAddressesDoNotMatch($requestIp, $proxyIp) { $this->assertFalse(IpUtils::checkIp4($requestIp, $proxyIp)); } - public function invalidIpAddressData() - { + public function invalidIpAddressData() { return array( 'invalid proxy wildcard' => array('192.168.20.13', '*'), 'invalid proxy missing netmask' => array('192.168.20.13', '0.0.0.0'), diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/JsonResponseTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/JsonResponseTest.php index 201839f..702535b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/JsonResponseTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/JsonResponseTest.php @@ -16,26 +16,22 @@ use Symfony\Component\HttpFoundation\JsonResponse; class JsonResponseTest extends TestCase { - public function testConstructorEmptyCreatesJsonObject() - { + public function testConstructorEmptyCreatesJsonObject() { $response = new JsonResponse(); $this->assertSame('{}', $response->getContent()); } - public function testConstructorWithArrayCreatesJsonArray() - { + public function testConstructorWithArrayCreatesJsonArray() { $response = new JsonResponse(array(0, 1, 2, 3)); $this->assertSame('[0,1,2,3]', $response->getContent()); } - public function testConstructorWithAssocArrayCreatesJsonObject() - { + public function testConstructorWithAssocArrayCreatesJsonObject() { $response = new JsonResponse(array('foo' => 'bar')); $this->assertSame('{"foo":"bar"}', $response->getContent()); } - public function testConstructorWithSimpleTypes() - { + public function testConstructorWithSimpleTypes() { $response = new JsonResponse('foo'); $this->assertSame('"foo"', $response->getContent()); @@ -45,52 +41,46 @@ class JsonResponseTest extends TestCase $response = new JsonResponse(0.1); $this->assertSame('0.1', $response->getContent()); - $response = new JsonResponse(true); + $response = new JsonResponse(TRUE); $this->assertSame('true', $response->getContent()); } - public function testConstructorWithCustomStatus() - { + public function testConstructorWithCustomStatus() { $response = new JsonResponse(array(), 202); $this->assertSame(202, $response->getStatusCode()); } - public function testConstructorAddsContentTypeHeader() - { + public function testConstructorAddsContentTypeHeader() { $response = new JsonResponse(); $this->assertSame('application/json', $response->headers->get('Content-Type')); } - public function testConstructorWithCustomHeaders() - { + public function testConstructorWithCustomHeaders() { $response = new JsonResponse(array(), 200, array('ETag' => 'foo')); $this->assertSame('application/json', $response->headers->get('Content-Type')); $this->assertSame('foo', $response->headers->get('ETag')); } - public function testConstructorWithCustomContentType() - { + public function testConstructorWithCustomContentType() { $headers = array('Content-Type' => 'application/vnd.acme.blog-v1+json'); $response = new JsonResponse(array(), 200, $headers); $this->assertSame('application/vnd.acme.blog-v1+json', $response->headers->get('Content-Type')); } - public function testSetJson() - { - $response = new JsonResponse('1', 200, array(), true); + public function testSetJson() { + $response = new JsonResponse('1', 200, array(), TRUE); $this->assertEquals('1', $response->getContent()); - $response = new JsonResponse('[1]', 200, array(), true); + $response = new JsonResponse('[1]', 200, array(), TRUE); $this->assertEquals('[1]', $response->getContent()); - $response = new JsonResponse(null, 200, array()); + $response = new JsonResponse(NULL, 200, array()); $response->setJson('true'); $this->assertEquals('true', $response->getContent()); } - public function testCreate() - { + public function testCreate() { $response = JsonResponse::create(array('foo' => 'bar'), 204); $this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response); @@ -98,29 +88,25 @@ class JsonResponseTest extends TestCase $this->assertEquals(204, $response->getStatusCode()); } - public function testStaticCreateEmptyJsonObject() - { + public function testStaticCreateEmptyJsonObject() { $response = JsonResponse::create(); $this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response); $this->assertSame('{}', $response->getContent()); } - public function testStaticCreateJsonArray() - { + public function testStaticCreateJsonArray() { $response = JsonResponse::create(array(0, 1, 2, 3)); $this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response); $this->assertSame('[0,1,2,3]', $response->getContent()); } - public function testStaticCreateJsonObject() - { + public function testStaticCreateJsonObject() { $response = JsonResponse::create(array('foo' => 'bar')); $this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response); $this->assertSame('{"foo":"bar"}', $response->getContent()); } - public function testStaticCreateWithSimpleTypes() - { + public function testStaticCreateWithSimpleTypes() { $response = JsonResponse::create('foo'); $this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response); $this->assertSame('"foo"', $response->getContent()); @@ -133,62 +119,54 @@ class JsonResponseTest extends TestCase $this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response); $this->assertSame('0.1', $response->getContent()); - $response = JsonResponse::create(true); + $response = JsonResponse::create(TRUE); $this->assertInstanceOf('Symfony\Component\HttpFoundation\JsonResponse', $response); $this->assertSame('true', $response->getContent()); } - public function testStaticCreateWithCustomStatus() - { + public function testStaticCreateWithCustomStatus() { $response = JsonResponse::create(array(), 202); $this->assertSame(202, $response->getStatusCode()); } - public function testStaticCreateAddsContentTypeHeader() - { + public function testStaticCreateAddsContentTypeHeader() { $response = JsonResponse::create(); $this->assertSame('application/json', $response->headers->get('Content-Type')); } - public function testStaticCreateWithCustomHeaders() - { + public function testStaticCreateWithCustomHeaders() { $response = JsonResponse::create(array(), 200, array('ETag' => 'foo')); $this->assertSame('application/json', $response->headers->get('Content-Type')); $this->assertSame('foo', $response->headers->get('ETag')); } - public function testStaticCreateWithCustomContentType() - { + public function testStaticCreateWithCustomContentType() { $headers = array('Content-Type' => 'application/vnd.acme.blog-v1+json'); $response = JsonResponse::create(array(), 200, $headers); $this->assertSame('application/vnd.acme.blog-v1+json', $response->headers->get('Content-Type')); } - public function testSetCallback() - { + public function testSetCallback() { $response = JsonResponse::create(array('foo' => 'bar'))->setCallback('callback'); $this->assertEquals('/**/callback({"foo":"bar"});', $response->getContent()); $this->assertEquals('text/javascript', $response->headers->get('Content-Type')); } - public function testJsonEncodeFlags() - { + public function testJsonEncodeFlags() { $response = new JsonResponse('<>\'&"'); $this->assertEquals('"\u003C\u003E\u0027\u0026\u0022"', $response->getContent()); } - public function testGetEncodingOptions() - { + public function testGetEncodingOptions() { $response = new JsonResponse(); $this->assertEquals(JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT, $response->getEncodingOptions()); } - public function testSetEncodingOptions() - { + public function testSetEncodingOptions() { $response = new JsonResponse(); $response->setData(array(array(1, 2, 3))); @@ -199,8 +177,7 @@ class JsonResponseTest extends TestCase $this->assertEquals('{"0":{"0":1,"1":2,"2":3}}', $response->getContent()); } - public function testItAcceptsJsonAsString() - { + public function testItAcceptsJsonAsString() { $response = JsonResponse::fromJsonString('{"foo":"bar"}'); $this->assertSame('{"foo":"bar"}', $response->getContent()); } @@ -208,8 +185,7 @@ class JsonResponseTest extends TestCase /** * @expectedException \InvalidArgumentException */ - public function testSetCallbackInvalidIdentifier() - { + public function testSetCallbackInvalidIdentifier() { $response = new JsonResponse('foo'); $response->setCallback('+invalid'); } @@ -217,8 +193,7 @@ class JsonResponseTest extends TestCase /** * @expectedException \InvalidArgumentException */ - public function testSetContent() - { + public function testSetContent() { JsonResponse::create("\xB1\x31"); } @@ -226,9 +201,8 @@ class JsonResponseTest extends TestCase * @expectedException \Exception * @expectedExceptionMessage This error is expected */ - public function testSetContentJsonSerializeError() - { - if (!interface_exists('JsonSerializable', false)) { + public function testSetContentJsonSerializeError() { + if (!interface_exists('JsonSerializable', FALSE)) { $this->markTestSkipped('JsonSerializable is required.'); } @@ -237,8 +211,7 @@ class JsonResponseTest extends TestCase JsonResponse::create($serializable); } - public function testSetComplexCallback() - { + public function testSetComplexCallback() { $response = JsonResponse::create(array('foo' => 'bar')); $response->setCallback('ಠ_ಠ["foo"].bar[0]'); @@ -246,11 +219,10 @@ class JsonResponseTest extends TestCase } } -if (interface_exists('JsonSerializable', false)) { +if (interface_exists('JsonSerializable', FALSE)) { class JsonSerializableObject implements \JsonSerializable { - public function jsonSerialize() - { + public function jsonSerialize() { throw new \Exception('This error is expected'); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ParameterBagTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ParameterBagTest.php index ab908d8..641ed8a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ParameterBagTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ParameterBagTest.php @@ -16,32 +16,27 @@ use Symfony\Component\HttpFoundation\ParameterBag; class ParameterBagTest extends TestCase { - public function testConstructor() - { + public function testConstructor() { $this->testAll(); } - public function testAll() - { + public function testAll() { $bag = new ParameterBag(array('foo' => 'bar')); $this->assertEquals(array('foo' => 'bar'), $bag->all(), '->all() gets all the input'); } - public function testKeys() - { + public function testKeys() { $bag = new ParameterBag(array('foo' => 'bar')); $this->assertEquals(array('foo'), $bag->keys()); } - public function testAdd() - { + public function testAdd() { $bag = new ParameterBag(array('foo' => 'bar')); $bag->add(array('bar' => 'bas')); $this->assertEquals(array('foo' => 'bar', 'bar' => 'bas'), $bag->all()); } - public function testRemove() - { + public function testRemove() { $bag = new ParameterBag(array('foo' => 'bar')); $bag->add(array('bar' => 'bas')); $this->assertEquals(array('foo' => 'bar', 'bar' => 'bas'), $bag->all()); @@ -49,8 +44,7 @@ class ParameterBagTest extends TestCase $this->assertEquals(array('foo' => 'bar'), $bag->all()); } - public function testReplace() - { + public function testReplace() { $bag = new ParameterBag(array('foo' => 'bar')); $bag->replace(array('FOO' => 'BAR')); @@ -58,24 +52,21 @@ class ParameterBagTest extends TestCase $this->assertFalse($bag->has('foo'), '->replace() overrides previously set the input'); } - public function testGet() - { - $bag = new ParameterBag(array('foo' => 'bar', 'null' => null)); + public function testGet() { + $bag = new ParameterBag(array('foo' => 'bar', 'null' => NULL)); $this->assertEquals('bar', $bag->get('foo'), '->get() gets the value of a parameter'); $this->assertEquals('default', $bag->get('unknown', 'default'), '->get() returns second argument as default if a parameter is not defined'); $this->assertNull($bag->get('null', 'default'), '->get() returns null if null is set'); } - public function testGetDoesNotUseDeepByDefault() - { + public function testGetDoesNotUseDeepByDefault() { $bag = new ParameterBag(array('foo' => array('bar' => 'moo'))); $this->assertNull($bag->get('foo[bar]')); } - public function testSet() - { + public function testSet() { $bag = new ParameterBag(array()); $bag->set('foo', 'bar'); @@ -85,48 +76,42 @@ class ParameterBagTest extends TestCase $this->assertEquals('baz', $bag->get('foo'), '->set() overrides previously set parameter'); } - public function testHas() - { + public function testHas() { $bag = new ParameterBag(array('foo' => 'bar')); $this->assertTrue($bag->has('foo'), '->has() returns true if a parameter is defined'); $this->assertFalse($bag->has('unknown'), '->has() return false if a parameter is not defined'); } - public function testGetAlpha() - { + public function testGetAlpha() { $bag = new ParameterBag(array('word' => 'foo_BAR_012')); $this->assertEquals('fooBAR', $bag->getAlpha('word'), '->getAlpha() gets only alphabetic characters'); $this->assertEquals('', $bag->getAlpha('unknown'), '->getAlpha() returns empty string if a parameter is not defined'); } - public function testGetAlnum() - { + public function testGetAlnum() { $bag = new ParameterBag(array('word' => 'foo_BAR_012')); $this->assertEquals('fooBAR012', $bag->getAlnum('word'), '->getAlnum() gets only alphanumeric characters'); $this->assertEquals('', $bag->getAlnum('unknown'), '->getAlnum() returns empty string if a parameter is not defined'); } - public function testGetDigits() - { + public function testGetDigits() { $bag = new ParameterBag(array('word' => 'foo_BAR_012')); $this->assertEquals('012', $bag->getDigits('word'), '->getDigits() gets only digits as string'); $this->assertEquals('', $bag->getDigits('unknown'), '->getDigits() returns empty string if a parameter is not defined'); } - public function testGetInt() - { + public function testGetInt() { $bag = new ParameterBag(array('digits' => '0123')); $this->assertEquals(123, $bag->getInt('digits'), '->getInt() gets a value of parameter as integer'); $this->assertEquals(0, $bag->getInt('unknown'), '->getInt() returns zero if a parameter is not defined'); } - public function testFilter() - { + public function testFilter() { $bag = new ParameterBag(array( 'digits' => '0123ab', 'email' => 'example@example.com', @@ -134,7 +119,7 @@ class ParameterBagTest extends TestCase 'dec' => '256', 'hex' => '0x100', 'array' => array('bang'), - )); + )); $this->assertEmpty($bag->filter('nokey'), '->filter() should return empty by default if no key is found'); @@ -160,8 +145,7 @@ class ParameterBagTest extends TestCase $this->assertEquals(array('bang'), $bag->filter('array', ''), '->filter() gets a value of parameter as an array'); } - public function testGetIterator() - { + public function testGetIterator() { $parameters = array('foo' => 'bar', 'hello' => 'world'); $bag = new ParameterBag($parameters); @@ -174,16 +158,14 @@ class ParameterBagTest extends TestCase $this->assertEquals(count($parameters), $i); } - public function testCount() - { + public function testCount() { $parameters = array('foo' => 'bar', 'hello' => 'world'); $bag = new ParameterBag($parameters); $this->assertCount(count($parameters), $bag); } - public function testGetBoolean() - { + public function testGetBoolean() { $parameters = array('string_true' => 'true', 'string_false' => 'false'); $bag = new ParameterBag($parameters); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/RedirectResponseTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/RedirectResponseTest.php index d389e83..acffef5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/RedirectResponseTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/RedirectResponseTest.php @@ -16,8 +16,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse; class RedirectResponseTest extends TestCase { - public function testGenerateMetaRedirect() - { + public function testGenerateMetaRedirect() { $response = new RedirectResponse('foo.bar'); $this->assertEquals(1, preg_match( @@ -29,36 +28,31 @@ class RedirectResponseTest extends TestCase /** * @expectedException \InvalidArgumentException */ - public function testRedirectResponseConstructorNullUrl() - { - $response = new RedirectResponse(null); + public function testRedirectResponseConstructorNullUrl() { + $response = new RedirectResponse(NULL); } /** * @expectedException \InvalidArgumentException */ - public function testRedirectResponseConstructorWrongStatusCode() - { + public function testRedirectResponseConstructorWrongStatusCode() { $response = new RedirectResponse('foo.bar', 404); } - public function testGenerateLocationHeader() - { + public function testGenerateLocationHeader() { $response = new RedirectResponse('foo.bar'); $this->assertTrue($response->headers->has('Location')); $this->assertEquals('foo.bar', $response->headers->get('Location')); } - public function testGetTargetUrl() - { + public function testGetTargetUrl() { $response = new RedirectResponse('foo.bar'); $this->assertEquals('foo.bar', $response->getTargetUrl()); } - public function testSetTargetUrl() - { + public function testSetTargetUrl() { $response = new RedirectResponse('foo.bar'); $response->setTargetUrl('baz.beep'); @@ -68,22 +62,19 @@ class RedirectResponseTest extends TestCase /** * @expectedException \InvalidArgumentException */ - public function testSetTargetUrlNull() - { + public function testSetTargetUrlNull() { $response = new RedirectResponse('foo.bar'); - $response->setTargetUrl(null); + $response->setTargetUrl(NULL); } - public function testCreate() - { + public function testCreate() { $response = RedirectResponse::create('foo', 301); $this->assertInstanceOf('Symfony\Component\HttpFoundation\RedirectResponse', $response); $this->assertEquals(301, $response->getStatusCode()); } - public function testCacheHeaders() - { + public function testCacheHeaders() { $response = new RedirectResponse('foo.bar', 301); $this->assertFalse($response->headers->hasCacheControlDirective('no-cache')); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/RequestMatcherTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/RequestMatcherTest.php index b5d8004..c2c4d3f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/RequestMatcherTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/RequestMatcherTest.php @@ -20,32 +20,29 @@ class RequestMatcherTest extends TestCase /** * @dataProvider getMethodData */ - public function testMethod($requestMethod, $matcherMethod, $isMatch) - { + public function testMethod($requestMethod, $matcherMethod, $isMatch) { $matcher = new RequestMatcher(); $matcher->matchMethod($matcherMethod); $request = Request::create('', $requestMethod); $this->assertSame($isMatch, $matcher->matches($request)); - $matcher = new RequestMatcher(null, null, $matcherMethod); + $matcher = new RequestMatcher(NULL, NULL, $matcherMethod); $request = Request::create('', $requestMethod); $this->assertSame($isMatch, $matcher->matches($request)); } - public function getMethodData() - { + public function getMethodData() { return array( - array('get', 'get', true), - array('get', array('get', 'post'), true), - array('get', 'post', false), - array('get', 'GET', true), - array('get', array('GET', 'POST'), true), - array('get', 'POST', false), + array('get', 'get', TRUE), + array('get', array('get', 'post'), TRUE), + array('get', 'post', FALSE), + array('get', 'GET', TRUE), + array('get', array('GET', 'POST'), TRUE), + array('get', 'POST', FALSE), ); } - public function testScheme() - { + public function testScheme() { $httpRequest = $request = $request = Request::create(''); $httpsRequest = $request = $request = Request::create('', 'get', array(), array(), array(), array('HTTPS' => 'on')); @@ -66,34 +63,31 @@ class RequestMatcherTest extends TestCase /** * @dataProvider getHostData */ - public function testHost($pattern, $isMatch) - { + public function testHost($pattern, $isMatch) { $matcher = new RequestMatcher(); $request = Request::create('', 'get', array(), array(), array(), array('HTTP_HOST' => 'foo.example.com')); $matcher->matchHost($pattern); $this->assertSame($isMatch, $matcher->matches($request)); - $matcher = new RequestMatcher(null, $pattern); + $matcher = new RequestMatcher(NULL, $pattern); $this->assertSame($isMatch, $matcher->matches($request)); } - public function getHostData() - { + public function getHostData() { return array( - array('.*\.example\.com', true), - array('\.example\.com$', true), - array('^.*\.example\.com$', true), - array('.*\.sensio\.com', false), - array('.*\.example\.COM', true), - array('\.example\.COM$', true), - array('^.*\.example\.COM$', true), - array('.*\.sensio\.COM', false), + array('.*\.example\.com', TRUE), + array('\.example\.com$', TRUE), + array('^.*\.example\.com$', TRUE), + array('.*\.sensio\.com', FALSE), + array('.*\.example\.COM', TRUE), + array('\.example\.COM$', TRUE), + array('^.*\.example\.COM$', TRUE), + array('.*\.sensio\.COM', FALSE), ); } - public function testPath() - { + public function testPath() { $matcher = new RequestMatcher(); $request = Request::create('/admin/foo'); @@ -111,8 +105,7 @@ class RequestMatcherTest extends TestCase $this->assertFalse($matcher->matches($request)); } - public function testPathWithLocaleIsNotSupported() - { + public function testPathWithLocaleIsNotSupported() { $matcher = new RequestMatcher(); $request = Request::create('/en/login'); $request->setLocale('en'); @@ -121,16 +114,14 @@ class RequestMatcherTest extends TestCase $this->assertFalse($matcher->matches($request)); } - public function testPathWithEncodedCharacters() - { + public function testPathWithEncodedCharacters() { $matcher = new RequestMatcher(); $request = Request::create('/admin/fo%20o'); $matcher->matchPath('^/admin/fo o*$'); $this->assertTrue($matcher->matches($request)); } - public function testAttributes() - { + public function testAttributes() { $matcher = new RequestMatcher(); $request = Request::create('/admin/foo'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/RequestStackTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/RequestStackTest.php index a84fb26..4a0204e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/RequestStackTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/RequestStackTest.php @@ -17,8 +17,7 @@ use Symfony\Component\HttpFoundation\RequestStack; class RequestStackTest extends TestCase { - public function testGetCurrentRequest() - { + public function testGetCurrentRequest() { $requestStack = new RequestStack(); $this->assertNull($requestStack->getCurrentRequest()); @@ -33,8 +32,7 @@ class RequestStackTest extends TestCase $this->assertNull($requestStack->pop()); } - public function testGetMasterRequest() - { + public function testGetMasterRequest() { $requestStack = new RequestStack(); $this->assertNull($requestStack->getMasterRequest()); @@ -47,8 +45,7 @@ class RequestStackTest extends TestCase $this->assertSame($masterRequest, $requestStack->getMasterRequest()); } - public function testGetParentRequest() - { + public function testGetParentRequest() { $requestStack = new RequestStack(); $this->assertNull($requestStack->getParentRequest()); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/RequestTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/RequestTest.php index 230ad15..3bae015 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/RequestTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/RequestTest.php @@ -19,14 +19,12 @@ use Symfony\Component\HttpFoundation\Request; class RequestTest extends TestCase { - protected function tearDown() - { + protected function tearDown() { // reset Request::setTrustedProxies(array(), -1); } - public function testInitialize() - { + public function testInitialize() { $request = new Request(); $request->initialize(array('foo' => 'bar')); @@ -42,48 +40,42 @@ class RequestTest extends TestCase $this->assertEquals('bar', $request->headers->get('FOO'), '->initialize() takes an array of HTTP headers as its sixth argument'); } - public function testGetLocale() - { + public function testGetLocale() { $request = new Request(); $request->setLocale('pl'); $locale = $request->getLocale(); $this->assertEquals('pl', $locale); } - public function testGetUser() - { + public function testGetUser() { $request = Request::create('http://user:password@test.com'); $user = $request->getUser(); $this->assertEquals('user', $user); } - public function testGetPassword() - { + public function testGetPassword() { $request = Request::create('http://user:password@test.com'); $password = $request->getPassword(); $this->assertEquals('password', $password); } - public function testIsNoCache() - { + public function testIsNoCache() { $request = new Request(); $isNoCache = $request->isNoCache(); $this->assertFalse($isNoCache); } - public function testGetContentType() - { + public function testGetContentType() { $request = new Request(); $contentType = $request->getContentType(); $this->assertNull($contentType); } - public function testSetDefaultLocale() - { + public function testSetDefaultLocale() { $request = new Request(); $request->setDefaultLocale('pl'); $locale = $request->getLocale(); @@ -91,8 +83,7 @@ class RequestTest extends TestCase $this->assertEquals('pl', $locale); } - public function testCreate() - { + public function testCreate() { $request = Request::create('http://test.com/foo?bar=baz'); $this->assertEquals('http://test.com/foo?bar=baz', $request->getUri()); $this->assertEquals('/foo', $request->getPathInfo()); @@ -234,8 +225,7 @@ class RequestTest extends TestCase $this->assertFalse($request->isSecure()); } - public function testCreateCheckPrecedence() - { + public function testCreateCheckPrecedence() { // server is used by default $request = Request::create('/', 'DELETE', array(), array(), array(), array( 'HTTP_HOST' => 'example.com', @@ -268,8 +258,7 @@ class RequestTest extends TestCase $this->assertEquals('foo=bar', $request->getQueryString()); } - public function testDuplicate() - { + public function testDuplicate() { $request = new Request(array('foo' => 'bar'), array('foo' => 'bar'), array('foo' => 'bar'), array(), array(), array('HTTP_FOO' => 'bar')); $dup = $request->duplicate(); @@ -286,8 +275,7 @@ class RequestTest extends TestCase $this->assertEquals(array('foo' => array('foobar')), $dup->headers->all(), '->duplicate() overrides the HTTP header if provided'); } - public function testDuplicateWithFormat() - { + public function testDuplicateWithFormat() { $request = new Request(array(), array(), array('_format' => 'json')); $dup = $request->duplicate(); @@ -304,8 +292,7 @@ class RequestTest extends TestCase /** * @dataProvider getFormatToMimeTypeMapProviderWithAdditionalNullFormat */ - public function testGetFormatFromMimeType($format, $mimeTypes) - { + public function testGetFormatFromMimeType($format, $mimeTypes) { $request = new Request(); foreach ($mimeTypes as $mime) { $this->assertEquals($format, $request->getFormat($mime)); @@ -314,22 +301,20 @@ class RequestTest extends TestCase foreach ($mimeTypes as $mime) { $this->assertEquals($format, $request->getFormat($mime)); - if (null !== $format) { + if (NULL !== $format) { $this->assertEquals($mimeTypes[0], $request->getMimeType($format)); } } } - public function getFormatToMimeTypeMapProviderWithAdditionalNullFormat() - { + public function getFormatToMimeTypeMapProviderWithAdditionalNullFormat() { return array_merge( - array(array(null, array(null, 'unexistent-mime-type'))), + array(array(NULL, array(NULL, 'unexistent-mime-type'))), $this->getFormatToMimeTypeMapProvider() ); } - public function testGetFormatFromMimeTypeWithParameters() - { + public function testGetFormatFromMimeTypeWithParameters() { $request = new Request(); $this->assertEquals('json', $request->getFormat('application/json; charset=utf-8')); } @@ -337,8 +322,7 @@ class RequestTest extends TestCase /** * @dataProvider getFormatToMimeTypeMapProvider */ - public function testGetMimeTypeFromFormat($format, $mimeTypes) - { + public function testGetMimeTypeFromFormat($format, $mimeTypes) { $request = new Request(); $this->assertEquals($mimeTypes[0], $request->getMimeType($format)); } @@ -346,27 +330,23 @@ class RequestTest extends TestCase /** * @dataProvider getFormatToMimeTypeMapProvider */ - public function testGetMimeTypesFromFormat($format, $mimeTypes) - { + public function testGetMimeTypesFromFormat($format, $mimeTypes) { $this->assertEquals($mimeTypes, Request::getMimeTypes($format)); } - public function testGetMimeTypesFromInexistentFormat() - { + public function testGetMimeTypesFromInexistentFormat() { $request = new Request(); $this->assertNull($request->getMimeType('foo')); $this->assertEquals(array(), Request::getMimeTypes('foo')); } - public function testGetFormatWithCustomMimeType() - { + public function testGetFormatWithCustomMimeType() { $request = new Request(); $request->setFormat('custom', 'application/vnd.foo.api;myversion=2.3'); $this->assertEquals('custom', $request->getFormat('application/vnd.foo.api;myversion=2.3')); } - public function getFormatToMimeTypeMapProvider() - { + public function getFormatToMimeTypeMapProvider() { return array( array('txt', array('text/plain')), array('js', array('application/javascript', 'application/x-javascript', 'text/javascript')), @@ -379,8 +359,7 @@ class RequestTest extends TestCase ); } - public function testGetUri() - { + public function testGetUri() { $server = array(); // Standard Request on non default PORT @@ -494,8 +473,7 @@ class RequestTest extends TestCase $this->assertEquals('http://host:8080/ba%20se/index_dev.php/foo%20bar/in+fo?query=string', $request->getUri()); } - public function testGetUriForPath() - { + public function testGetUriForPath() { $request = Request::create('http://test.com/foo?bar=baz'); $this->assertEquals('http://test.com/some/path', $request->getUriForPath('/some/path')); @@ -604,13 +582,11 @@ class RequestTest extends TestCase /** * @dataProvider getRelativeUriForPathData() */ - public function testGetRelativeUriForPath($expected, $pathinfo, $path) - { + public function testGetRelativeUriForPath($expected, $pathinfo, $path) { $this->assertEquals($expected, Request::create($pathinfo)->getRelativeUriForPath($path)); } - public function getRelativeUriForPathData() - { + public function getRelativeUriForPathData() { return array( array('me.png', '/foo', '/me.png'), array('../me.png', '/foo/bar', '/me.png'), @@ -621,8 +597,7 @@ class RequestTest extends TestCase ); } - public function testGetUserInfo() - { + public function testGetUserInfo() { $request = new Request(); $server = array('PHP_AUTH_USER' => 'fabien'); @@ -638,8 +613,7 @@ class RequestTest extends TestCase $this->assertEquals('0:0', $request->getUserInfo()); } - public function testGetSchemeAndHttpHost() - { + public function testGetSchemeAndHttpHost() { $request = new Request(); $server = array(); @@ -664,16 +638,14 @@ class RequestTest extends TestCase /** * @dataProvider getQueryStringNormalizationData */ - public function testGetQueryString($query, $expectedQuery, $msg) - { + public function testGetQueryString($query, $expectedQuery, $msg) { $request = new Request(); $request->server->set('QUERY_STRING', $query); $this->assertSame($expectedQuery, $request->getQueryString(), $msg); } - public function getQueryStringNormalizationData() - { + public function getQueryStringNormalizationData() { return array( array('foo', 'foo', 'works with valueless parameters'), array('foo=', 'foo=', 'includes a dangling equal sign'), @@ -699,8 +671,7 @@ class RequestTest extends TestCase ); } - public function testGetQueryStringReturnsNull() - { + public function testGetQueryStringReturnsNull() { $request = new Request(); $this->assertNull($request->getQueryString(), '->getQueryString() returns null for non-existent query string'); @@ -709,8 +680,7 @@ class RequestTest extends TestCase $this->assertNull($request->getQueryString(), '->getQueryString() returns null for empty query string'); } - public function testGetHost() - { + public function testGetHost() { $request = new Request(); $request->initialize(array('foo' => 'bar')); @@ -731,8 +701,7 @@ class RequestTest extends TestCase $this->assertEquals('www.host.com', $request->getHost(), '->getHost() value from Host header has priority over SERVER_NAME '); } - public function testGetPort() - { + public function testGetPort() { $request = Request::create('http://example.com', 'GET', array(), array(), array(), array( 'HTTP_X_FORWARDED_PROTO' => 'https', 'HTTP_X_FORWARDED_PORT' => '443', @@ -788,15 +757,13 @@ class RequestTest extends TestCase /** * @expectedException \RuntimeException */ - public function testGetHostWithFakeHttpHostValue() - { + public function testGetHostWithFakeHttpHostValue() { $request = new Request(); $request->initialize(array(), array(), array(), array(), array(), array('HTTP_HOST' => 'www.host.com?query=string')); $request->getHost(); } - public function testGetSetMethod() - { + public function testGetSetMethod() { $request = new Request(); $this->assertEquals('GET', $request->getMethod(), '->getMethod() returns GET if no method is defined'); @@ -853,8 +820,7 @@ class RequestTest extends TestCase /** * @dataProvider getClientIpsProvider */ - public function testGetClientIp($expected, $remoteAddr, $httpForwardedFor, $trustedProxies) - { + public function testGetClientIp($expected, $remoteAddr, $httpForwardedFor, $trustedProxies) { $request = $this->getRequestInstanceForClientIpTests($remoteAddr, $httpForwardedFor, $trustedProxies); $this->assertEquals($expected[0], $request->getClientIp()); @@ -863,8 +829,7 @@ class RequestTest extends TestCase /** * @dataProvider getClientIpsProvider */ - public function testGetClientIps($expected, $remoteAddr, $httpForwardedFor, $trustedProxies) - { + public function testGetClientIps($expected, $remoteAddr, $httpForwardedFor, $trustedProxies) { $request = $this->getRequestInstanceForClientIpTests($remoteAddr, $httpForwardedFor, $trustedProxies); $this->assertEquals($expected, $request->getClientIps()); @@ -873,64 +838,61 @@ class RequestTest extends TestCase /** * @dataProvider getClientIpsForwardedProvider */ - public function testGetClientIpsForwarded($expected, $remoteAddr, $httpForwarded, $trustedProxies) - { + public function testGetClientIpsForwarded($expected, $remoteAddr, $httpForwarded, $trustedProxies) { $request = $this->getRequestInstanceForClientIpsForwardedTests($remoteAddr, $httpForwarded, $trustedProxies); $this->assertEquals($expected, $request->getClientIps()); } - public function getClientIpsForwardedProvider() - { + public function getClientIpsForwardedProvider() { // $expected $remoteAddr $httpForwarded $trustedProxies return array( - array(array('127.0.0.1'), '127.0.0.1', 'for="_gazonk"', null), - array(array('127.0.0.1'), '127.0.0.1', 'for="_gazonk"', array('127.0.0.1')), - array(array('88.88.88.88'), '127.0.0.1', 'for="88.88.88.88:80"', array('127.0.0.1')), - array(array('192.0.2.60'), '::1', 'for=192.0.2.60;proto=http;by=203.0.113.43', array('::1')), - array(array('2620:0:1cfe:face:b00c::3', '192.0.2.43'), '::1', 'for=192.0.2.43, for=2620:0:1cfe:face:b00c::3', array('::1')), - array(array('2001:db8:cafe::17'), '::1', 'for="[2001:db8:cafe::17]:4711', array('::1')), + array(array('127.0.0.1'), '127.0.0.1', 'for="_gazonk"', NULL), + array(array('127.0.0.1'), '127.0.0.1', 'for="_gazonk"', array('127.0.0.1')), + array(array('88.88.88.88'), '127.0.0.1', 'for="88.88.88.88:80"', array('127.0.0.1')), + array(array('192.0.2.60'), '::1', 'for=192.0.2.60;proto=http;by=203.0.113.43', array('::1')), + array(array('2620:0:1cfe:face:b00c::3', '192.0.2.43'), '::1', 'for=192.0.2.43, for=2620:0:1cfe:face:b00c::3', array('::1')), + array(array('2001:db8:cafe::17'), '::1', 'for="[2001:db8:cafe::17]:4711', array('::1')), ); } - public function getClientIpsProvider() - { + public function getClientIpsProvider() { // $expected $remoteAddr $httpForwardedFor $trustedProxies return array( // simple IPv4 - array(array('88.88.88.88'), '88.88.88.88', null, null), + array(array('88.88.88.88'), '88.88.88.88', NULL, NULL), // trust the IPv4 remote addr - array(array('88.88.88.88'), '88.88.88.88', null, array('88.88.88.88')), + array(array('88.88.88.88'), '88.88.88.88', NULL, array('88.88.88.88')), // simple IPv6 - array(array('::1'), '::1', null, null), + array(array('::1'), '::1', NULL, NULL), // trust the IPv6 remote addr - array(array('::1'), '::1', null, array('::1')), + array(array('::1'), '::1', NULL, array('::1')), // forwarded for with remote IPv4 addr not trusted - array(array('127.0.0.1'), '127.0.0.1', '88.88.88.88', null), + array(array('127.0.0.1'), '127.0.0.1', '88.88.88.88', NULL), // forwarded for with remote IPv4 addr trusted - array(array('88.88.88.88'), '127.0.0.1', '88.88.88.88', array('127.0.0.1')), + array(array('88.88.88.88'), '127.0.0.1', '88.88.88.88', array('127.0.0.1')), // forwarded for with remote IPv4 and all FF addrs trusted - array(array('88.88.88.88'), '127.0.0.1', '88.88.88.88', array('127.0.0.1', '88.88.88.88')), + array(array('88.88.88.88'), '127.0.0.1', '88.88.88.88', array('127.0.0.1', '88.88.88.88')), // forwarded for with remote IPv4 range trusted - array(array('88.88.88.88'), '123.45.67.89', '88.88.88.88', array('123.45.67.0/24')), + array(array('88.88.88.88'), '123.45.67.89', '88.88.88.88', array('123.45.67.0/24')), // forwarded for with remote IPv6 addr not trusted - array(array('1620:0:1cfe:face:b00c::3'), '1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3', null), + array(array('1620:0:1cfe:face:b00c::3'), '1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3', NULL), // forwarded for with remote IPv6 addr trusted - array(array('2620:0:1cfe:face:b00c::3'), '1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3', array('1620:0:1cfe:face:b00c::3')), + array(array('2620:0:1cfe:face:b00c::3'), '1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3', array('1620:0:1cfe:face:b00c::3')), // forwarded for with remote IPv6 range trusted - array(array('88.88.88.88'), '2a01:198:603:0:396e:4789:8e99:890f', '88.88.88.88', array('2a01:198:603:0::/65')), + array(array('88.88.88.88'), '2a01:198:603:0:396e:4789:8e99:890f', '88.88.88.88', array('2a01:198:603:0::/65')), // multiple forwarded for with remote IPv4 addr trusted array(array('88.88.88.88', '87.65.43.21', '127.0.0.1'), '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', array('123.45.67.89')), // multiple forwarded for with remote IPv4 addr and some reverse proxies trusted - array(array('87.65.43.21', '127.0.0.1'), '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', array('123.45.67.89', '88.88.88.88')), + array(array('87.65.43.21', '127.0.0.1'), '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', array('123.45.67.89', '88.88.88.88')), // multiple forwarded for with remote IPv4 addr and some reverse proxies trusted but in the middle - array(array('88.88.88.88', '127.0.0.1'), '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', array('123.45.67.89', '87.65.43.21')), + array(array('88.88.88.88', '127.0.0.1'), '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', array('123.45.67.89', '87.65.43.21')), // multiple forwarded for with remote IPv4 addr and all reverse proxies trusted - array(array('127.0.0.1'), '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', array('123.45.67.89', '87.65.43.21', '88.88.88.88', '127.0.0.1')), + array(array('127.0.0.1'), '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', array('123.45.67.89', '87.65.43.21', '88.88.88.88', '127.0.0.1')), // multiple forwarded for with remote IPv6 addr trusted array(array('2620:0:1cfe:face:b00c::3', '3620:0:1cfe:face:b00c::3'), '1620:0:1cfe:face:b00c::3', '3620:0:1cfe:face:b00c::3,2620:0:1cfe:face:b00c::3', array('1620:0:1cfe:face:b00c::3')), @@ -952,8 +914,7 @@ class RequestTest extends TestCase * @expectedException \Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException * @dataProvider getClientIpsWithConflictingHeadersProvider */ - public function testGetClientIpsWithConflictingHeaders($httpForwarded, $httpXForwardedFor) - { + public function testGetClientIpsWithConflictingHeaders($httpForwarded, $httpXForwardedFor) { $request = new Request(); $server = array( @@ -972,8 +933,7 @@ class RequestTest extends TestCase /** * @dataProvider getClientIpsWithConflictingHeadersProvider */ - public function testGetClientIpsOnlyXHttpForwardedForTrusted($httpForwarded, $httpXForwardedFor) - { + public function testGetClientIpsOnlyXHttpForwardedForTrusted($httpForwarded, $httpXForwardedFor) { $request = new Request(); $server = array( @@ -989,14 +949,13 @@ class RequestTest extends TestCase $this->assertSame(array_reverse(explode(',', $httpXForwardedFor)), $request->getClientIps()); } - public function getClientIpsWithConflictingHeadersProvider() - { + public function getClientIpsWithConflictingHeadersProvider() { // $httpForwarded $httpXForwardedFor return array( - array('for=87.65.43.21', '192.0.2.60'), + array('for=87.65.43.21', '192.0.2.60'), array('for=87.65.43.21, for=192.0.2.60', '192.0.2.60'), - array('for=192.0.2.60', '192.0.2.60,87.65.43.21'), - array('for="::face", for=192.0.2.60', '192.0.2.60,192.0.2.43'), + array('for=192.0.2.60', '192.0.2.60,87.65.43.21'), + array('for="::face", for=192.0.2.60', '192.0.2.60,192.0.2.43'), array('for=87.65.43.21, for=192.0.2.60', '192.0.2.60,87.65.43.21'), ); } @@ -1004,8 +963,7 @@ class RequestTest extends TestCase /** * @dataProvider getClientIpsWithAgreeingHeadersProvider */ - public function testGetClientIpsWithAgreeingHeaders($httpForwarded, $httpXForwardedFor, $expectedIps) - { + public function testGetClientIpsWithAgreeingHeaders($httpForwarded, $httpXForwardedFor, $expectedIps) { $request = new Request(); $server = array( @@ -1023,52 +981,47 @@ class RequestTest extends TestCase $this->assertSame($expectedIps, $clientIps); } - public function getClientIpsWithAgreeingHeadersProvider() - { + public function getClientIpsWithAgreeingHeadersProvider() { // $httpForwarded $httpXForwardedFor return array( - array('for="192.0.2.60"', '192.0.2.60', array('192.0.2.60')), - array('for=192.0.2.60, for=87.65.43.21', '192.0.2.60,87.65.43.21', array('87.65.43.21', '192.0.2.60')), - array('for="[::face]", for=192.0.2.60', '::face,192.0.2.60', array('192.0.2.60', '::face')), - array('for="192.0.2.60:80"', '192.0.2.60', array('192.0.2.60')), - array('for=192.0.2.60;proto=http;by=203.0.113.43', '192.0.2.60', array('192.0.2.60')), - array('for="[2001:db8:cafe::17]:4711"', '2001:db8:cafe::17', array('2001:db8:cafe::17')), + array('for="192.0.2.60"', '192.0.2.60', array('192.0.2.60')), + array('for=192.0.2.60, for=87.65.43.21', '192.0.2.60,87.65.43.21', array('87.65.43.21', '192.0.2.60')), + array('for="[::face]", for=192.0.2.60', '::face,192.0.2.60', array('192.0.2.60', '::face')), + array('for="192.0.2.60:80"', '192.0.2.60', array('192.0.2.60')), + array('for=192.0.2.60;proto=http;by=203.0.113.43', '192.0.2.60', array('192.0.2.60')), + array('for="[2001:db8:cafe::17]:4711"', '2001:db8:cafe::17', array('2001:db8:cafe::17')), ); } - public function testGetContentWorksTwiceInDefaultMode() - { + public function testGetContentWorksTwiceInDefaultMode() { $req = new Request(); $this->assertEquals('', $req->getContent()); $this->assertEquals('', $req->getContent()); } - public function testGetContentReturnsResource() - { + public function testGetContentReturnsResource() { $req = new Request(); - $retval = $req->getContent(true); + $retval = $req->getContent(TRUE); $this->assertInternalType('resource', $retval); $this->assertEquals('', fread($retval, 1)); $this->assertTrue(feof($retval)); } - public function testGetContentReturnsResourceWhenContentSetInConstructor() - { + public function testGetContentReturnsResourceWhenContentSetInConstructor() { $req = new Request(array(), array(), array(), array(), array(), array(), 'MyContent'); - $resource = $req->getContent(true); + $resource = $req->getContent(TRUE); $this->assertInternalType('resource', $resource); $this->assertEquals('MyContent', stream_get_contents($resource)); } - public function testContentAsResource() - { + public function testContentAsResource() { $resource = fopen('php://memory', 'r+'); fwrite($resource, 'My other content'); rewind($resource); $req = new Request(array(), array(), array(), array(), array(), array(), $resource); - $this->assertEquals('My other content', stream_get_contents($req->getContent(true))); + $this->assertEquals('My other content', stream_get_contents($req->getContent(TRUE))); $this->assertEquals('My other content', $req->getContent()); } @@ -1076,8 +1029,7 @@ class RequestTest extends TestCase * @expectedException \LogicException * @dataProvider getContentCantBeCalledTwiceWithResourcesProvider */ - public function testGetContentCantBeCalledTwiceWithResources($first, $second) - { + public function testGetContentCantBeCalledTwiceWithResources($first, $second) { if (\PHP_VERSION_ID >= 50600) { $this->markTestSkipped('PHP >= 5.6 allows to open php://input several times.'); } @@ -1087,11 +1039,10 @@ class RequestTest extends TestCase $req->getContent($second); } - public function getContentCantBeCalledTwiceWithResourcesProvider() - { + public function getContentCantBeCalledTwiceWithResourcesProvider() { return array( - 'Resource then fetch' => array(true, false), - 'Resource then resource' => array(true, true), + 'Resource then fetch' => array(TRUE, FALSE), + 'Resource then resource' => array(TRUE, TRUE), ); } @@ -1099,8 +1050,7 @@ class RequestTest extends TestCase * @dataProvider getContentCanBeCalledTwiceWithResourcesProvider * @requires PHP 5.6 */ - public function testGetContentCanBeCalledTwiceWithResources($first, $second) - { + public function testGetContentCanBeCalledTwiceWithResources($first, $second) { $req = new Request(); $a = $req->getContent($first); $b = $req->getContent($second); @@ -1116,18 +1066,16 @@ class RequestTest extends TestCase $this->assertSame($a, $b); } - public function getContentCanBeCalledTwiceWithResourcesProvider() - { + public function getContentCanBeCalledTwiceWithResourcesProvider() { return array( - 'Fetch then fetch' => array(false, false), - 'Fetch then resource' => array(false, true), - 'Resource then fetch' => array(true, false), - 'Resource then resource' => array(true, true), + 'Fetch then fetch' => array(FALSE, FALSE), + 'Fetch then resource' => array(FALSE, TRUE), + 'Resource then fetch' => array(TRUE, FALSE), + 'Resource then resource' => array(TRUE, TRUE), ); } - public function provideOverloadedMethods() - { + public function provideOverloadedMethods() { return array( array('PUT'), array('DELETE'), @@ -1141,8 +1089,7 @@ class RequestTest extends TestCase /** * @dataProvider provideOverloadedMethods */ - public function testCreateFromGlobals($method) - { + public function testCreateFromGlobals($method) { $normalizedMethod = strtoupper($method); $_GET['foo1'] = 'bar1'; @@ -1182,8 +1129,7 @@ class RequestTest extends TestCase $this->disableHttpMethodParameterOverride(); } - public function testOverrideGlobals() - { + public function testOverrideGlobals() { $request = new Request(); $request->initialize(array('foo' => 'bar')); @@ -1233,8 +1179,7 @@ class RequestTest extends TestCase $_SERVER = $server; } - public function testGetScriptName() - { + public function testGetScriptName() { $request = new Request(); $this->assertEquals('', $request->getScriptName()); @@ -1259,8 +1204,7 @@ class RequestTest extends TestCase $this->assertEquals('/index.php', $request->getScriptName()); } - public function testGetBasePath() - { + public function testGetBasePath() { $request = new Request(); $this->assertEquals('', $request->getBasePath()); @@ -1291,8 +1235,7 @@ class RequestTest extends TestCase $this->assertEquals('', $request->getBasePath()); } - public function testGetPathInfo() - { + public function testGetPathInfo() { $request = new Request(); $this->assertEquals('/', $request->getPathInfo()); @@ -1315,8 +1258,7 @@ class RequestTest extends TestCase $this->assertEquals('/', $request->getPathInfo()); } - public function testGetParameterPrecedence() - { + public function testGetParameterPrecedence() { $request = new Request(); $request->attributes->set('foo', 'attr'); $request->query->set('foo', 'query'); @@ -1334,8 +1276,7 @@ class RequestTest extends TestCase $this->assertNull($request->get('foo')); } - public function testGetPreferredLanguage() - { + public function testGetPreferredLanguage() { $request = new Request(); $this->assertNull($request->getPreferredLanguage()); $this->assertNull($request->getPreferredLanguage(array())); @@ -1361,8 +1302,7 @@ class RequestTest extends TestCase $this->assertEquals('en', $request->getPreferredLanguage(array('fr', 'en'))); } - public function testIsXmlHttpRequest() - { + public function testIsXmlHttpRequest() { $request = new Request(); $this->assertFalse($request->isXmlHttpRequest()); @@ -1376,8 +1316,7 @@ class RequestTest extends TestCase /** * @requires extension intl */ - public function testIntlLocale() - { + public function testIntlLocale() { $request = new Request(); $request->setDefaultLocale('fr'); @@ -1393,8 +1332,7 @@ class RequestTest extends TestCase $this->assertEquals('en', \Locale::getDefault()); } - public function testGetCharsets() - { + public function testGetCharsets() { $request = new Request(); $this->assertEquals(array(), $request->getCharsets()); $request->headers->set('Accept-Charset', 'ISO-8859-1, US-ASCII, UTF-8; q=0.8, ISO-10646-UCS-2; q=0.6'); @@ -1409,8 +1347,7 @@ class RequestTest extends TestCase $this->assertEquals(array('ISO-8859-1', 'utf-8', '*'), $request->getCharsets()); } - public function testGetEncodings() - { + public function testGetEncodings() { $request = new Request(); $this->assertEquals(array(), $request->getEncodings()); $request->headers->set('Accept-Encoding', 'gzip,deflate,sdch'); @@ -1425,8 +1362,7 @@ class RequestTest extends TestCase $this->assertEquals(array('deflate', 'compress', 'gzip'), $request->getEncodings()); } - public function testGetAcceptableContentTypes() - { + public function testGetAcceptableContentTypes() { $request = new Request(); $this->assertEquals(array(), $request->getAcceptableContentTypes()); $request->headers->set('Accept', 'application/vnd.wap.wmlscriptc, text/vnd.wap.wml, application/vnd.wap.xhtml+xml, application/xhtml+xml, text/html, multipart/mixed, */*'); @@ -1437,8 +1373,7 @@ class RequestTest extends TestCase $this->assertEquals(array('application/vnd.wap.wmlscriptc', 'text/vnd.wap.wml', 'application/vnd.wap.xhtml+xml', 'application/xhtml+xml', 'text/html', 'multipart/mixed', '*/*'), $request->getAcceptableContentTypes()); } - public function testGetLanguages() - { + public function testGetLanguages() { $request = new Request(); $this->assertEquals(array(), $request->getLanguages()); @@ -1464,8 +1399,7 @@ class RequestTest extends TestCase $this->assertEquals(array('zh', 'cherokee'), $request->getLanguages()); } - public function testGetRequestFormat() - { + public function testGetRequestFormat() { $request = new Request(); $this->assertEquals('html', $request->getRequestFormat()); @@ -1475,18 +1409,17 @@ class RequestTest extends TestCase $this->assertEquals('html', $request->getRequestFormat('html')); $request = new Request(); - $this->assertNull($request->getRequestFormat(null)); + $this->assertNull($request->getRequestFormat(NULL)); $request = new Request(); $this->assertNull($request->setRequestFormat('foo')); - $this->assertEquals('foo', $request->getRequestFormat(null)); + $this->assertEquals('foo', $request->getRequestFormat(NULL)); $request = new Request(array('_format' => 'foo')); $this->assertEquals('html', $request->getRequestFormat()); } - public function testHasSession() - { + public function testHasSession() { $request = new Request(); $this->assertFalse($request->hasSession()); @@ -1494,8 +1427,7 @@ class RequestTest extends TestCase $this->assertTrue($request->hasSession()); } - public function testGetSession() - { + public function testGetSession() { $request = new Request(); $request->setSession(new Session(new MockArraySessionStorage())); @@ -1507,8 +1439,7 @@ class RequestTest extends TestCase $this->assertObjectHasAttribute('attributeName', $session); } - public function testHasPreviousSession() - { + public function testHasPreviousSession() { $request = new Request(); $this->assertFalse($request->hasPreviousSession()); @@ -1518,27 +1449,25 @@ class RequestTest extends TestCase $this->assertTrue($request->hasPreviousSession()); } - public function testToString() - { + public function testToString() { $request = new Request(); $request->headers->set('Accept-language', 'zh, en-us; q=0.8, en; q=0.6'); $request->cookies->set('Foo', 'Bar'); - $asString = (string) $request; + $asString = (string)$request; $this->assertContains('Accept-Language: zh, en-us; q=0.8, en; q=0.6', $asString); $this->assertContains('Cookie: Foo=Bar', $asString); $request->cookies->set('Another', 'Cookie'); - $asString = (string) $request; + $asString = (string)$request; $this->assertContains('Cookie: Foo=Bar; Another=Cookie', $asString); } - public function testIsMethod() - { + public function testIsMethod() { $request = new Request(); $request->setMethod('POST'); $this->assertTrue($request->isMethod('POST')); @@ -1556,16 +1485,14 @@ class RequestTest extends TestCase /** * @dataProvider getBaseUrlData */ - public function testGetBaseUrl($uri, $server, $expectedBaseUrl, $expectedPathInfo) - { + public function testGetBaseUrl($uri, $server, $expectedBaseUrl, $expectedPathInfo) { $request = Request::create($uri, 'GET', array(), array(), array(), $server); $this->assertSame($expectedBaseUrl, $request->getBaseUrl(), 'baseUrl'); $this->assertSame($expectedPathInfo, $request->getPathInfo(), 'pathInfo'); } - public function getBaseUrlData() - { + public function getBaseUrlData() { return array( array( '/fruit/strawberry/1234index.php/blah', @@ -1643,18 +1570,16 @@ class RequestTest extends TestCase /** * @dataProvider urlencodedStringPrefixData */ - public function testUrlencodedStringPrefix($string, $prefix, $expect) - { + public function testUrlencodedStringPrefix($string, $prefix, $expect) { $request = new Request(); $me = new \ReflectionMethod($request, 'getUrlencodedPrefix'); - $me->setAccessible(true); + $me->setAccessible(TRUE); $this->assertSame($expect, $me->invoke($request, $string, $prefix)); } - public function urlencodedStringPrefixData() - { + public function urlencodedStringPrefixData() { return array( array('foo', 'foo', 'foo'), array('fo%6f', 'foo', 'fo%6f'), @@ -1667,20 +1592,18 @@ class RequestTest extends TestCase ); } - private function disableHttpMethodParameterOverride() - { + private function disableHttpMethodParameterOverride() { $class = new \ReflectionClass('Symfony\\Component\\HttpFoundation\\Request'); $property = $class->getProperty('httpMethodParameterOverride'); - $property->setAccessible(true); - $property->setValue(false); + $property->setAccessible(TRUE); + $property->setValue(FALSE); } - private function getRequestInstanceForClientIpTests($remoteAddr, $httpForwardedFor, $trustedProxies) - { + private function getRequestInstanceForClientIpTests($remoteAddr, $httpForwardedFor, $trustedProxies) { $request = new Request(); $server = array('REMOTE_ADDR' => $remoteAddr); - if (null !== $httpForwardedFor) { + if (NULL !== $httpForwardedFor) { $server['HTTP_X_FORWARDED_FOR'] = $httpForwardedFor; } @@ -1693,13 +1616,12 @@ class RequestTest extends TestCase return $request; } - private function getRequestInstanceForClientIpsForwardedTests($remoteAddr, $httpForwarded, $trustedProxies) - { + private function getRequestInstanceForClientIpsForwardedTests($remoteAddr, $httpForwarded, $trustedProxies) { $request = new Request(); $server = array('REMOTE_ADDR' => $remoteAddr); - if (null !== $httpForwarded) { + if (NULL !== $httpForwarded) { $server['HTTP_FORWARDED'] = $httpForwarded; } @@ -1712,8 +1634,7 @@ class RequestTest extends TestCase return $request; } - public function testTrustedProxiesXForwardedFor() - { + public function testTrustedProxiesXForwardedFor() { $request = Request::create('http://example.com/'); $request->server->set('REMOTE_ADDR', '3.3.3.3'); $request->headers->set('X_FORWARDED_FOR', '1.1.1.1, 2.2.2.2'); @@ -1768,8 +1689,7 @@ class RequestTest extends TestCase * @group legacy * @expectedDeprecation The "Symfony\Component\HttpFoundation\Request::setTrustedHeaderName()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the $trustedHeaderSet argument of the Request::setTrustedProxies() method instead. */ - public function testLegacyTrustedProxies() - { + public function testLegacyTrustedProxies() { $request = Request::create('http://example.com/'); $request->server->set('REMOTE_ADDR', '3.3.3.3'); $request->headers->set('X_FORWARDED_FOR', '1.1.1.1, 2.2.2.2'); @@ -1794,10 +1714,10 @@ class RequestTest extends TestCase $this->assertFalse($request->isSecure()); // disabling via empty header names - Request::setTrustedHeaderName(Request::HEADER_CLIENT_IP, null); - Request::setTrustedHeaderName(Request::HEADER_CLIENT_HOST, null); - Request::setTrustedHeaderName(Request::HEADER_CLIENT_PORT, null); - Request::setTrustedHeaderName(Request::HEADER_CLIENT_PROTO, null); + Request::setTrustedHeaderName(Request::HEADER_CLIENT_IP, NULL); + Request::setTrustedHeaderName(Request::HEADER_CLIENT_HOST, NULL); + Request::setTrustedHeaderName(Request::HEADER_CLIENT_PORT, NULL); + Request::setTrustedHeaderName(Request::HEADER_CLIENT_PROTO, NULL); $this->assertEquals('3.3.3.3', $request->getClientIp()); $this->assertEquals('example.com', $request->getHost()); $this->assertEquals(80, $request->getPort()); @@ -1811,8 +1731,7 @@ class RequestTest extends TestCase Request::setTrustedHeaderName(Request::HEADER_CLIENT_PROTO, 'X_FORWARDED_PROTO'); } - public function testTrustedProxiesForwarded() - { + public function testTrustedProxiesForwarded() { $request = Request::create('http://example.com/'); $request->server->set('REMOTE_ADDR', '3.3.3.3'); $request->headers->set('FORWARDED', 'for=1.1.1.1, host=foo.example.com:8080, proto=https, for=2.2.2.2, host=real.example.com:8080'); @@ -1864,8 +1783,7 @@ class RequestTest extends TestCase * @group legacy * @expectedException \InvalidArgumentException */ - public function testSetTrustedProxiesInvalidHeaderName() - { + public function testSetTrustedProxiesInvalidHeaderName() { Request::create('http://example.com/'); Request::setTrustedHeaderName('bogus name', 'X_MY_FOR'); } @@ -1874,8 +1792,7 @@ class RequestTest extends TestCase * @group legacy * @expectedException \InvalidArgumentException */ - public function testGetTrustedProxiesInvalidHeaderName() - { + public function testGetTrustedProxiesInvalidHeaderName() { Request::create('http://example.com/'); Request::getTrustedHeaderName('bogus name'); } @@ -1883,8 +1800,7 @@ class RequestTest extends TestCase /** * @dataProvider iisRequestUriProvider */ - public function testIISRequestUri($headers, $server, $expectedRequestUri) - { + public function testIISRequestUri($headers, $server, $expectedRequestUri) { $request = new Request(); $request->headers->replace($headers); $request->server->replace($server); @@ -1896,8 +1812,7 @@ class RequestTest extends TestCase $this->assertEquals($subRequestUri, $subRequest->getRequestUri(), '->getRequestUri() is correct in sub request'); } - public function iisRequestUriProvider() - { + public function iisRequestUriProvider() { return array( array( array( @@ -1969,8 +1884,7 @@ class RequestTest extends TestCase ); } - public function testTrustedHosts() - { + public function testTrustedHosts() { // create a request $request = Request::create('/'); @@ -1995,11 +1909,11 @@ class RequestTest extends TestCase $this->assertEquals('trusted.com', $request->getHost()); $this->assertEquals(80, $request->getPort()); - $request->server->set('HTTPS', true); + $request->server->set('HTTPS', TRUE); $request->headers->set('host', 'trusted.com'); $this->assertEquals('trusted.com', $request->getHost()); $this->assertEquals(443, $request->getPort()); - $request->server->set('HTTPS', false); + $request->server->set('HTTPS', FALSE); $request->headers->set('host', 'trusted.com:8000'); $this->assertEquals('trusted.com', $request->getHost()); @@ -2012,35 +1926,32 @@ class RequestTest extends TestCase Request::setTrustedHosts(array()); } - public function testFactory() - { - Request::setFactory(function (array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) { + public function testFactory() { + Request::setFactory(function (array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = NULL) { return new NewRequest(); }); $this->assertEquals('foo', Request::create('/')->getFoo()); - Request::setFactory(null); + Request::setFactory(NULL); } /** * @dataProvider getLongHostNames */ - public function testVeryLongHosts($host) - { - $start = microtime(true); + public function testVeryLongHosts($host) { + $start = microtime(TRUE); $request = Request::create('/'); $request->headers->set('host', $host); $this->assertEquals($host, $request->getHost()); - $this->assertLessThan(5, microtime(true) - $start); + $this->assertLessThan(5, microtime(TRUE) - $start); } /** * @dataProvider getHostValidities */ - public function testHostValidity($host, $isValid, $expectedHost = null, $expectedPort = null) - { + public function testHostValidity($host, $isValid, $expectedHost = NULL, $expectedPort = NULL) { $request = Request::create('/'); $request->headers->set('host', $host); @@ -2061,23 +1972,21 @@ class RequestTest extends TestCase } } - public function getHostValidities() - { + public function getHostValidities() { return array( - array('.a', false), - array('a..', false), - array('a.', true), - array("\xE9", false), - array('[::1]', true), - array('[::1]:80', true, '[::1]', 80), - array(str_repeat('.', 101), false), + array('.a', FALSE), + array('a..', FALSE), + array('a.', TRUE), + array("\xE9", FALSE), + array('[::1]', TRUE), + array('[::1]:80', TRUE, '[::1]', 80), + array(str_repeat('.', 101), FALSE), ); } - public function getLongHostNames() - { + public function getLongHostNames() { return array( - array('a'.str_repeat('.a', 40000)), + array('a' . str_repeat('.a', 40000)), array(str_repeat(':', 101)), ); } @@ -2085,52 +1994,48 @@ class RequestTest extends TestCase /** * @dataProvider methodIdempotentProvider */ - public function testMethodIdempotent($method, $idempotent) - { + public function testMethodIdempotent($method, $idempotent) { $request = new Request(); $request->setMethod($method); $this->assertEquals($idempotent, $request->isMethodIdempotent()); } - public function methodIdempotentProvider() - { + public function methodIdempotentProvider() { return array( - array('HEAD', true), - array('GET', true), - array('POST', false), - array('PUT', true), - array('PATCH', false), - array('DELETE', true), - array('PURGE', true), - array('OPTIONS', true), - array('TRACE', true), - array('CONNECT', false), + array('HEAD', TRUE), + array('GET', TRUE), + array('POST', FALSE), + array('PUT', TRUE), + array('PATCH', FALSE), + array('DELETE', TRUE), + array('PURGE', TRUE), + array('OPTIONS', TRUE), + array('TRACE', TRUE), + array('CONNECT', FALSE), ); } /** * @dataProvider methodSafeProvider */ - public function testMethodSafe($method, $safe) - { + public function testMethodSafe($method, $safe) { $request = new Request(); $request->setMethod($method); - $this->assertEquals($safe, $request->isMethodSafe(false)); + $this->assertEquals($safe, $request->isMethodSafe(FALSE)); } - public function methodSafeProvider() - { + public function methodSafeProvider() { return array( - array('HEAD', true), - array('GET', true), - array('POST', false), - array('PUT', false), - array('PATCH', false), - array('DELETE', false), - array('PURGE', false), - array('OPTIONS', true), - array('TRACE', true), - array('CONNECT', false), + array('HEAD', TRUE), + array('GET', TRUE), + array('POST', FALSE), + array('PUT', FALSE), + array('PATCH', FALSE), + array('DELETE', FALSE), + array('PURGE', FALSE), + array('OPTIONS', TRUE), + array('TRACE', TRUE), + array('CONNECT', FALSE), ); } @@ -2138,8 +2043,7 @@ class RequestTest extends TestCase * @group legacy * @expectedDeprecation Checking only for cacheable HTTP methods with Symfony\Component\HttpFoundation\Request::isMethodSafe() is deprecated since Symfony 3.2 and will throw an exception in 4.0. Disable checking only for cacheable methods by calling the method with `false` as first argument or use the Request::isMethodCacheable() instead. */ - public function testMethodSafeChecksCacheable() - { + public function testMethodSafeChecksCacheable() { $request = new Request(); $request->setMethod('OPTIONS'); $this->assertFalse($request->isMethodSafe()); @@ -2148,34 +2052,31 @@ class RequestTest extends TestCase /** * @dataProvider methodCacheableProvider */ - public function testMethodCacheable($method, $cacheable) - { + public function testMethodCacheable($method, $cacheable) { $request = new Request(); $request->setMethod($method); $this->assertEquals($cacheable, $request->isMethodCacheable()); } - public function methodCacheableProvider() - { + public function methodCacheableProvider() { return array( - array('HEAD', true), - array('GET', true), - array('POST', false), - array('PUT', false), - array('PATCH', false), - array('DELETE', false), - array('PURGE', false), - array('OPTIONS', false), - array('TRACE', false), - array('CONNECT', false), + array('HEAD', TRUE), + array('GET', TRUE), + array('POST', FALSE), + array('PUT', FALSE), + array('PATCH', FALSE), + array('DELETE', FALSE), + array('PURGE', FALSE), + array('OPTIONS', FALSE), + array('TRACE', FALSE), + array('CONNECT', FALSE), ); } /** * @group legacy */ - public function testGetTrustedHeaderName() - { + public function testGetTrustedHeaderName() { Request::setTrustedProxies(array('8.8.8.8'), Request::HEADER_X_FORWARDED_ALL); $this->assertNull(Request::getTrustedHeaderName(Request::HEADER_FORWARDED)); @@ -2229,8 +2130,7 @@ class RequestTest extends TestCase /** * @dataProvider protocolVersionProvider */ - public function testProtocolVersion($serverProtocol, $trustedProxy, $via, $expected) - { + public function testProtocolVersion($serverProtocol, $trustedProxy, $via, $expected) { if ($trustedProxy) { Request::setTrustedProxies(array('1.1.1.1'), -1); } @@ -2243,41 +2143,39 @@ class RequestTest extends TestCase $this->assertSame($expected, $request->getProtocolVersion()); } - public function protocolVersionProvider() - { + public function protocolVersionProvider() { return array( - 'untrusted without via' => array('HTTP/2.0', false, '', 'HTTP/2.0'), - 'untrusted with via' => array('HTTP/2.0', false, '1.0 fred, 1.1 nowhere.com (Apache/1.1)', 'HTTP/2.0'), - 'trusted without via' => array('HTTP/2.0', true, '', 'HTTP/2.0'), - 'trusted with via' => array('HTTP/2.0', true, '1.0 fred, 1.1 nowhere.com (Apache/1.1)', 'HTTP/1.0'), - 'trusted with via and protocol name' => array('HTTP/2.0', true, 'HTTP/1.0 fred, HTTP/1.1 nowhere.com (Apache/1.1)', 'HTTP/1.0'), - 'trusted with broken via' => array('HTTP/2.0', true, 'HTTP/1^0 foo', 'HTTP/2.0'), - 'trusted with partially-broken via' => array('HTTP/2.0', true, '1.0 fred, foo', 'HTTP/1.0'), + 'untrusted without via' => array('HTTP/2.0', FALSE, '', 'HTTP/2.0'), + 'untrusted with via' => array('HTTP/2.0', FALSE, '1.0 fred, 1.1 nowhere.com (Apache/1.1)', 'HTTP/2.0'), + 'trusted without via' => array('HTTP/2.0', TRUE, '', 'HTTP/2.0'), + 'trusted with via' => array('HTTP/2.0', TRUE, '1.0 fred, 1.1 nowhere.com (Apache/1.1)', 'HTTP/1.0'), + 'trusted with via and protocol name' => array('HTTP/2.0', TRUE, 'HTTP/1.0 fred, HTTP/1.1 nowhere.com (Apache/1.1)', 'HTTP/1.0'), + 'trusted with broken via' => array('HTTP/2.0', TRUE, 'HTTP/1^0 foo', 'HTTP/2.0'), + 'trusted with partially-broken via' => array('HTTP/2.0', TRUE, '1.0 fred, foo', 'HTTP/1.0'), ); } - public function nonstandardRequestsData() - { + public function nonstandardRequestsData() { return array( - array('', '', '/', 'http://host:8080/', ''), + array('', '', '/', 'http://host:8080/', ''), array('/', '', '/', 'http://host:8080/', ''), - array('hello/app.php/x', '', '/x', 'http://host:8080/hello/app.php/x', '/hello', '/hello/app.php'), + array('hello/app.php/x', '', '/x', 'http://host:8080/hello/app.php/x', '/hello', '/hello/app.php'), array('/hello/app.php/x', '', '/x', 'http://host:8080/hello/app.php/x', '/hello', '/hello/app.php'), - array('', 'a=b', '/', 'http://host:8080/?a=b'), - array('?a=b', 'a=b', '/', 'http://host:8080/?a=b'), + array('', 'a=b', '/', 'http://host:8080/?a=b'), + array('?a=b', 'a=b', '/', 'http://host:8080/?a=b'), array('/?a=b', 'a=b', '/', 'http://host:8080/?a=b'), - array('x', 'a=b', '/x', 'http://host:8080/x?a=b'), - array('x?a=b', 'a=b', '/x', 'http://host:8080/x?a=b'), + array('x', 'a=b', '/x', 'http://host:8080/x?a=b'), + array('x?a=b', 'a=b', '/x', 'http://host:8080/x?a=b'), array('/x?a=b', 'a=b', '/x', 'http://host:8080/x?a=b'), - array('hello/x', '', '/x', 'http://host:8080/hello/x', '/hello'), + array('hello/x', '', '/x', 'http://host:8080/hello/x', '/hello'), array('/hello/x', '', '/x', 'http://host:8080/hello/x', '/hello'), - array('hello/app.php/x', 'a=b', '/x', 'http://host:8080/hello/app.php/x?a=b', '/hello', '/hello/app.php'), - array('hello/app.php/x?a=b', 'a=b', '/x', 'http://host:8080/hello/app.php/x?a=b', '/hello', '/hello/app.php'), + array('hello/app.php/x', 'a=b', '/x', 'http://host:8080/hello/app.php/x?a=b', '/hello', '/hello/app.php'), + array('hello/app.php/x?a=b', 'a=b', '/x', 'http://host:8080/hello/app.php/x?a=b', '/hello', '/hello/app.php'), array('/hello/app.php/x?a=b', 'a=b', '/x', 'http://host:8080/hello/app.php/x?a=b', '/hello', '/hello/app.php'), ); } @@ -2285,9 +2183,8 @@ class RequestTest extends TestCase /** * @dataProvider nonstandardRequestsData */ - public function testNonstandardRequests($requestUri, $queryString, $expectedPathInfo, $expectedUri, $expectedBasePath = '', $expectedBaseUrl = null) - { - if (null === $expectedBaseUrl) { + public function testNonstandardRequests($requestUri, $queryString, $expectedPathInfo, $expectedUri, $expectedBasePath = '', $expectedBaseUrl = NULL) { + if (NULL === $expectedBaseUrl) { $expectedBaseUrl = $expectedBasePath; } @@ -2314,16 +2211,14 @@ class RequestTest extends TestCase class RequestContentProxy extends Request { - public function getContent($asResource = false) - { + public function getContent($asResource = FALSE) { return http_build_query(array('_method' => 'PUT', 'content' => 'mycontent'), '', '&'); } } class NewRequest extends Request { - public function getFoo() - { + public function getFoo() { return 'foo'; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php index ce85535..dfd0b2b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ResponseHeaderBagTest.php @@ -20,8 +20,7 @@ use Symfony\Component\HttpFoundation\Cookie; */ class ResponseHeaderBagTest extends TestCase { - public function testAllPreserveCase() - { + public function testAllPreserveCase() { $headers = array( 'fOo' => 'BAR', 'ETag' => 'xyzzy', @@ -40,8 +39,7 @@ class ResponseHeaderBagTest extends TestCase } } - public function testCacheControlHeader() - { + public function testCacheControlHeader() { $bag = new ResponseHeaderBag(array()); $this->assertEquals('no-cache, private', $bag->get('Cache-Control')); $this->assertTrue($bag->hasCacheControlDirective('no-cache')); @@ -89,26 +87,24 @@ class ResponseHeaderBagTest extends TestCase $bag = new ResponseHeaderBag(); $bag->set('Cache-Control', array('public', 'must-revalidate')); - $this->assertCount(1, $bag->get('Cache-Control', null, false)); + $this->assertCount(1, $bag->get('Cache-Control', NULL, FALSE)); $this->assertEquals('must-revalidate, public', $bag->get('Cache-Control')); $bag = new ResponseHeaderBag(); $bag->set('Cache-Control', 'public'); - $bag->set('Cache-Control', 'must-revalidate', false); - $this->assertCount(1, $bag->get('Cache-Control', null, false)); + $bag->set('Cache-Control', 'must-revalidate', FALSE); + $this->assertCount(1, $bag->get('Cache-Control', NULL, FALSE)); $this->assertEquals('must-revalidate, public', $bag->get('Cache-Control')); } - public function testCacheControlClone() - { + public function testCacheControlClone() { $headers = array('foo' => 'bar'); $bag1 = new ResponseHeaderBag($headers); $bag2 = new ResponseHeaderBag($bag1->allPreserveCase()); $this->assertEquals($bag1->allPreserveCase(), $bag2->allPreserveCase()); } - public function testToStringIncludesCookieHeaders() - { + public function testToStringIncludesCookieHeaders() { $bag = new ResponseHeaderBag(array()); $bag->setCookie(new Cookie('foo', 'bar')); @@ -116,20 +112,18 @@ class ResponseHeaderBagTest extends TestCase $bag->clearCookie('foo'); - $this->assertSetCookieHeader('foo=deleted; expires='.gmdate('D, d-M-Y H:i:s T', time() - 31536001).'; max-age=-31536001; path=/; httponly', $bag); + $this->assertSetCookieHeader('foo=deleted; expires=' . gmdate('D, d-M-Y H:i:s T', time() - 31536001) . '; max-age=-31536001; path=/; httponly', $bag); } - public function testClearCookieSecureNotHttpOnly() - { + public function testClearCookieSecureNotHttpOnly() { $bag = new ResponseHeaderBag(array()); - $bag->clearCookie('foo', '/', null, true, false); + $bag->clearCookie('foo', '/', NULL, TRUE, FALSE); - $this->assertSetCookieHeader('foo=deleted; expires='.gmdate('D, d-M-Y H:i:s T', time() - 31536001).'; max-age=-31536001; path=/; secure', $bag); + $this->assertSetCookieHeader('foo=deleted; expires=' . gmdate('D, d-M-Y H:i:s T', time() - 31536001) . '; max-age=-31536001; path=/; secure', $bag); } - public function testReplace() - { + public function testReplace() { $bag = new ResponseHeaderBag(array()); $this->assertEquals('no-cache, private', $bag->get('Cache-Control')); $this->assertTrue($bag->hasCacheControlDirective('no-cache')); @@ -139,8 +133,7 @@ class ResponseHeaderBagTest extends TestCase $this->assertTrue($bag->hasCacheControlDirective('public')); } - public function testReplaceWithRemove() - { + public function testReplaceWithRemove() { $bag = new ResponseHeaderBag(array()); $this->assertEquals('no-cache, private', $bag->get('Cache-Control')); $this->assertTrue($bag->hasCacheControlDirective('no-cache')); @@ -151,8 +144,7 @@ class ResponseHeaderBagTest extends TestCase $this->assertTrue($bag->hasCacheControlDirective('no-cache')); } - public function testCookiesWithSameNames() - { + public function testCookiesWithSameNames() { $bag = new ResponseHeaderBag(); $bag->setCookie(new Cookie('foo', 'bar', 0, '/path/foo', 'foo.bar')); $bag->setCookie(new Cookie('foo', 'bar', 0, '/path/bar', 'foo.bar')); @@ -166,7 +158,7 @@ class ResponseHeaderBagTest extends TestCase 'foo=bar; path=/path/bar; domain=foo.bar; httponly', 'foo=bar; path=/path/bar; domain=bar.foo; httponly', 'foo=bar; path=/; httponly', - ), $bag->get('set-cookie', null, false)); + ), $bag->get('set-cookie', NULL, FALSE)); $this->assertSetCookieHeader('foo=bar; path=/path/foo; domain=foo.bar; httponly', $bag); $this->assertSetCookieHeader('foo=bar; path=/path/bar; domain=foo.bar; httponly', $bag); @@ -181,8 +173,7 @@ class ResponseHeaderBagTest extends TestCase $this->assertArrayHasKey('foo', $cookies['']['/']); } - public function testRemoveCookie() - { + public function testRemoveCookie() { $bag = new ResponseHeaderBag(); $this->assertFalse($bag->has('set-cookie')); @@ -206,8 +197,7 @@ class ResponseHeaderBagTest extends TestCase $this->assertArrayNotHasKey('foo.bar', $cookies); } - public function testRemoveCookieWithNullRemove() - { + public function testRemoveCookieWithNullRemove() { $bag = new ResponseHeaderBag(); $bag->setCookie(new Cookie('foo', 'bar', 0)); $bag->setCookie(new Cookie('bar', 'foo', 0)); @@ -215,25 +205,24 @@ class ResponseHeaderBagTest extends TestCase $cookies = $bag->getCookies(ResponseHeaderBag::COOKIES_ARRAY); $this->assertArrayHasKey('/', $cookies['']); - $bag->removeCookie('foo', null); + $bag->removeCookie('foo', NULL); $cookies = $bag->getCookies(ResponseHeaderBag::COOKIES_ARRAY); $this->assertArrayNotHasKey('foo', $cookies['']['/']); - $bag->removeCookie('bar', null); + $bag->removeCookie('bar', NULL); $cookies = $bag->getCookies(ResponseHeaderBag::COOKIES_ARRAY); $this->assertFalse(isset($cookies['']['/']['bar'])); } - public function testSetCookieHeader() - { + public function testSetCookieHeader() { $bag = new ResponseHeaderBag(); $bag->set('set-cookie', 'foo=bar'); - $this->assertEquals(array(new Cookie('foo', 'bar', 0, '/', null, false, false, true)), $bag->getCookies()); + $this->assertEquals(array(new Cookie('foo', 'bar', 0, '/', NULL, FALSE, FALSE, TRUE)), $bag->getCookies()); - $bag->set('set-cookie', 'foo2=bar2', false); + $bag->set('set-cookie', 'foo2=bar2', FALSE); $this->assertEquals(array( - new Cookie('foo', 'bar', 0, '/', null, false, false, true), - new Cookie('foo2', 'bar2', 0, '/', null, false, false, true), + new Cookie('foo', 'bar', 0, '/', NULL, FALSE, FALSE, TRUE), + new Cookie('foo2', 'bar2', 0, '/', NULL, FALSE, FALSE, TRUE), ), $bag->getCookies()); $bag->remove('set-cookie'); @@ -243,8 +232,7 @@ class ResponseHeaderBagTest extends TestCase /** * @expectedException \InvalidArgumentException */ - public function testGetCookiesWithInvalidArgument() - { + public function testGetCookiesWithInvalidArgument() { $bag = new ResponseHeaderBag(); $bag->getCookies('invalid_argument'); @@ -253,8 +241,7 @@ class ResponseHeaderBagTest extends TestCase /** * @expectedException \InvalidArgumentException */ - public function testMakeDispositionInvalidDisposition() - { + public function testMakeDispositionInvalidDisposition() { $headers = new ResponseHeaderBag(); $headers->makeDisposition('invalid', 'foo.html'); @@ -263,29 +250,26 @@ class ResponseHeaderBagTest extends TestCase /** * @dataProvider provideMakeDisposition */ - public function testMakeDisposition($disposition, $filename, $filenameFallback, $expected) - { + public function testMakeDisposition($disposition, $filename, $filenameFallback, $expected) { $headers = new ResponseHeaderBag(); $this->assertEquals($expected, $headers->makeDisposition($disposition, $filename, $filenameFallback)); } - public function testToStringDoesntMessUpHeaders() - { + public function testToStringDoesntMessUpHeaders() { $headers = new ResponseHeaderBag(); $headers->set('Location', 'http://www.symfony.com'); $headers->set('Content-type', 'text/html'); - (string) $headers; + (string)$headers; $allHeaders = $headers->allPreserveCase(); $this->assertEquals(array('http://www.symfony.com'), $allHeaders['Location']); $this->assertEquals(array('text/html'), $allHeaders['Content-type']); } - public function provideMakeDisposition() - { + public function provideMakeDisposition() { return array( array('attachment', 'foo.html', 'foo.html', 'attachment; filename="foo.html"'), array('attachment', 'foo.html', '', 'attachment; filename="foo.html"'), @@ -300,15 +284,13 @@ class ResponseHeaderBagTest extends TestCase * @dataProvider provideMakeDispositionFail * @expectedException \InvalidArgumentException */ - public function testMakeDispositionFail($disposition, $filename) - { + public function testMakeDispositionFail($disposition, $filename) { $headers = new ResponseHeaderBag(); $headers->makeDisposition($disposition, $filename); } - public function provideMakeDispositionFail() - { + public function provideMakeDispositionFail() { return array( array('attachment', 'foo%20bar.html'), array('attachment', 'foo/bar.html'), @@ -319,8 +301,7 @@ class ResponseHeaderBagTest extends TestCase ); } - public function testDateHeaderAddedOnCreation() - { + public function testDateHeaderAddedOnCreation() { $now = time(); $bag = new ResponseHeaderBag(); @@ -329,16 +310,14 @@ class ResponseHeaderBagTest extends TestCase $this->assertEquals($now, $bag->getDate('Date')->getTimestamp()); } - public function testDateHeaderCanBeSetOnCreation() - { + public function testDateHeaderCanBeSetOnCreation() { $someDate = 'Thu, 23 Mar 2017 09:15:12 GMT'; $bag = new ResponseHeaderBag(array('Date' => $someDate)); $this->assertEquals($someDate, $bag->get('Date')); } - public function testDateHeaderWillBeRecreatedWhenRemoved() - { + public function testDateHeaderWillBeRecreatedWhenRemoved() { $someDate = 'Thu, 23 Mar 2017 09:15:12 GMT'; $bag = new ResponseHeaderBag(array('Date' => $someDate)); $bag->remove('Date'); @@ -348,16 +327,14 @@ class ResponseHeaderBagTest extends TestCase $this->assertNotEquals($someDate, $bag->get('Date')); } - public function testDateHeaderWillBeRecreatedWhenHeadersAreReplaced() - { + public function testDateHeaderWillBeRecreatedWhenHeadersAreReplaced() { $bag = new ResponseHeaderBag(); $bag->replace(array()); $this->assertTrue($bag->has('Date')); } - private function assertSetCookieHeader($expected, ResponseHeaderBag $actual) - { - $this->assertRegExp('#^Set-Cookie:\s+'.preg_quote($expected, '#').'$#m', str_replace("\r\n", "\n", (string) $actual)); + private function assertSetCookieHeader($expected, ResponseHeaderBag $actual) { + $this->assertRegExp('#^Set-Cookie:\s+' . preg_quote($expected, '#') . '$#m', str_replace("\r\n", "\n", (string)$actual)); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ResponseTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ResponseTest.php index 350d972..da575d3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ResponseTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ResponseTest.php @@ -19,8 +19,7 @@ use Symfony\Component\HttpFoundation\Response; */ class ResponseTest extends ResponseTestCase { - public function testCreate() - { + public function testCreate() { $response = Response::create('foo', 301, array('Foo' => 'bar')); $this->assertInstanceOf('Symfony\Component\HttpFoundation\Response', $response); @@ -28,23 +27,20 @@ class ResponseTest extends ResponseTestCase $this->assertEquals('bar', $response->headers->get('foo')); } - public function testToString() - { + public function testToString() { $response = new Response(); $response = explode("\r\n", $response); $this->assertEquals('HTTP/1.0 200 OK', $response[0]); $this->assertEquals('Cache-Control: no-cache, private', $response[1]); } - public function testClone() - { + public function testClone() { $response = new Response(); $responseClone = clone $response; $this->assertEquals($response, $responseClone); } - public function testSendHeaders() - { + public function testSendHeaders() { $response = new Response(); $headers = $response->sendHeaders(); $this->assertObjectHasAttribute('headers', $headers); @@ -55,8 +51,7 @@ class ResponseTest extends ResponseTestCase $this->assertObjectHasAttribute('charset', $headers); } - public function testSend() - { + public function testSend() { $response = new Response(); $responseSend = $response->send(); $this->assertObjectHasAttribute('headers', $responseSend); @@ -67,8 +62,7 @@ class ResponseTest extends ResponseTestCase $this->assertObjectHasAttribute('charset', $responseSend); } - public function testGetCharset() - { + public function testGetCharset() { $response = new Response(); $charsetOrigin = 'UTF-8'; $response->setCharset($charsetOrigin); @@ -76,56 +70,48 @@ class ResponseTest extends ResponseTestCase $this->assertEquals($charsetOrigin, $charset); } - public function testIsCacheable() - { + public function testIsCacheable() { $response = new Response(); $this->assertFalse($response->isCacheable()); } - public function testIsCacheableWithErrorCode() - { + public function testIsCacheableWithErrorCode() { $response = new Response('', 500); $this->assertFalse($response->isCacheable()); } - public function testIsCacheableWithNoStoreDirective() - { + public function testIsCacheableWithNoStoreDirective() { $response = new Response(); $response->headers->set('cache-control', 'private'); $this->assertFalse($response->isCacheable()); } - public function testIsCacheableWithSetTtl() - { + public function testIsCacheableWithSetTtl() { $response = new Response(); $response->setTtl(10); $this->assertTrue($response->isCacheable()); } - public function testMustRevalidate() - { + public function testMustRevalidate() { $response = new Response(); $this->assertFalse($response->mustRevalidate()); } - public function testMustRevalidateWithMustRevalidateCacheControlHeader() - { + public function testMustRevalidateWithMustRevalidateCacheControlHeader() { $response = new Response(); $response->headers->set('cache-control', 'must-revalidate'); $this->assertTrue($response->mustRevalidate()); } - public function testMustRevalidateWithProxyRevalidateCacheControlHeader() - { + public function testMustRevalidateWithProxyRevalidateCacheControlHeader() { $response = new Response(); $response->headers->set('cache-control', 'proxy-revalidate'); $this->assertTrue($response->mustRevalidate()); } - public function testSetNotModified() - { + public function testSetNotModified() { $response = new Response(); $modified = $response->setNotModified(); $this->assertObjectHasAttribute('headers', $modified); @@ -137,29 +123,25 @@ class ResponseTest extends ResponseTestCase $this->assertEquals(304, $modified->getStatusCode()); } - public function testIsSuccessful() - { + public function testIsSuccessful() { $response = new Response(); $this->assertTrue($response->isSuccessful()); } - public function testIsNotModified() - { + public function testIsNotModified() { $response = new Response(); $modified = $response->isNotModified(new Request()); $this->assertFalse($modified); } - public function testIsNotModifiedNotSafe() - { + public function testIsNotModifiedNotSafe() { $request = Request::create('/homepage', 'POST'); $response = new Response(); $this->assertFalse($response->isNotModified($request)); } - public function testIsNotModifiedLastModified() - { + public function testIsNotModifiedLastModified() { $before = 'Sun, 25 Aug 2013 18:32:31 GMT'; $modified = 'Sun, 25 Aug 2013 18:33:31 GMT'; $after = 'Sun, 25 Aug 2013 19:33:31 GMT'; @@ -182,8 +164,7 @@ class ResponseTest extends ResponseTestCase $this->assertFalse($response->isNotModified($request)); } - public function testIsNotModifiedEtag() - { + public function testIsNotModifiedEtag() { $etagOne = 'randomly_generated_etag'; $etagTwo = 'randomly_generated_etag_2'; @@ -202,8 +183,7 @@ class ResponseTest extends ResponseTestCase $this->assertFalse($response->isNotModified($request)); } - public function testIsNotModifiedLastModifiedAndEtag() - { + public function testIsNotModifiedLastModifiedAndEtag() { $before = 'Sun, 25 Aug 2013 18:32:31 GMT'; $modified = 'Sun, 25 Aug 2013 18:33:31 GMT'; $after = 'Sun, 25 Aug 2013 19:33:31 GMT'; @@ -228,8 +208,7 @@ class ResponseTest extends ResponseTestCase $this->assertTrue($response->isNotModified($request)); } - public function testIsNotModifiedIfModifiedSinceAndEtagWithoutLastModified() - { + public function testIsNotModifiedIfModifiedSinceAndEtagWithoutLastModified() { $modified = 'Sun, 25 Aug 2013 18:33:31 GMT'; $etag = 'randomly_generated_etag'; @@ -246,8 +225,7 @@ class ResponseTest extends ResponseTestCase $this->assertFalse($response->isNotModified($request)); } - public function testIsValidateable() - { + public function testIsValidateable() { $response = new Response('', 200, array('Last-Modified' => $this->createDateTimeOneHourAgo()->format(DATE_RFC2822))); $this->assertTrue($response->isValidateable(), '->isValidateable() returns true if Last-Modified is present'); @@ -258,8 +236,7 @@ class ResponseTest extends ResponseTestCase $this->assertFalse($response->isValidateable(), '->isValidateable() returns false when no validator is present'); } - public function testGetDate() - { + public function testGetDate() { $oneHourAgo = $this->createDateTimeOneHourAgo(); $response = new Response('', 200, array('Date' => $oneHourAgo->format(DATE_RFC2822))); $date = $response->getDate(); @@ -282,8 +259,7 @@ class ResponseTest extends ResponseTestCase $this->assertEquals($now->getTimestamp(), $date->getTimestamp(), '->getDate() returns the current Date when the header has previously been removed'); } - public function testGetMaxAge() - { + public function testGetMaxAge() { $response = new Response(); $response->headers->set('Cache-Control', 's-maxage=600, max-age=0'); $this->assertEquals(600, $response->getMaxAge(), '->getMaxAge() uses s-maxage cache control directive when present'); @@ -306,8 +282,7 @@ class ResponseTest extends ResponseTestCase $this->assertNull($response->getMaxAge(), '->getMaxAge() returns null if no freshness information available'); } - public function testSetSharedMaxAge() - { + public function testSetSharedMaxAge() { $response = new Response(); $response->setSharedMaxAge(20); @@ -315,8 +290,7 @@ class ResponseTest extends ResponseTestCase $this->assertEquals('public, s-maxage=20', $cacheControl); } - public function testIsPrivate() - { + public function testIsPrivate() { $response = new Response(); $response->headers->set('Cache-Control', 'max-age=100'); $response->setPrivate(); @@ -331,8 +305,7 @@ class ResponseTest extends ResponseTestCase $this->assertFalse($response->headers->hasCacheControlDirective('public'), '->isPrivate() removes the public Cache-Control directive'); } - public function testExpire() - { + public function testExpire() { $response = new Response(); $response->headers->set('Cache-Control', 'max-age=100'); $response->expire(); @@ -359,8 +332,7 @@ class ResponseTest extends ResponseTestCase $this->assertNull($response->headers->get('Age'), '->expire() does not set the Age when the response is expired'); } - public function testGetTtl() - { + public function testGetTtl() { $response = new Response(); $this->assertNull($response->getTtl(), '->getTtl() returns null when no Expires or Cache-Control headers are present'); @@ -382,16 +354,14 @@ class ResponseTest extends ResponseTestCase $this->assertEquals(60, $response->getTtl(), '->getTtl() uses Cache-Control max-age when present'); } - public function testSetClientTtl() - { + public function testSetClientTtl() { $response = new Response(); $response->setClientTtl(10); $this->assertEquals($response->getMaxAge(), $response->getAge() + 10); } - public function testGetSetProtocolVersion() - { + public function testGetSetProtocolVersion() { $response = new Response(); $this->assertEquals('1.0', $response->getProtocolVersion()); @@ -401,8 +371,7 @@ class ResponseTest extends ResponseTestCase $this->assertEquals('1.1', $response->getProtocolVersion()); } - public function testGetVary() - { + public function testGetVary() { $response = new Response(); $this->assertEquals(array(), $response->getVary(), '->getVary() returns an empty array if no Vary header is present'); @@ -429,8 +398,7 @@ class ResponseTest extends ResponseTestCase $this->assertEquals($vary, $response->getVary(), '->getVary() parses multiple header name values in arrays'); } - public function testSetVary() - { + public function testSetVary() { $response = new Response(); $response->setVary('Accept-Language'); $this->assertEquals(array('Accept-Language'), $response->getVary()); @@ -438,12 +406,11 @@ class ResponseTest extends ResponseTestCase $response->setVary('Accept-Language, User-Agent'); $this->assertEquals(array('Accept-Language', 'User-Agent'), $response->getVary(), '->setVary() replace the vary header by default'); - $response->setVary('X-Foo', false); + $response->setVary('X-Foo', FALSE); $this->assertEquals(array('Accept-Language', 'User-Agent', 'X-Foo'), $response->getVary(), '->setVary() doesn\'t wipe out earlier Vary headers if replace is set to false'); } - public function testDefaultContentType() - { + public function testDefaultContentType() { $headerMock = $this->getMockBuilder('Symfony\Component\HttpFoundation\ResponseHeaderBag')->setMethods(array('set'))->getMock(); $headerMock->expects($this->at(0)) ->method('set') @@ -458,8 +425,7 @@ class ResponseTest extends ResponseTestCase $response->prepare(new Request()); } - public function testContentTypeCharset() - { + public function testContentTypeCharset() { $response = new Response(); $response->headers->set('Content-Type', 'text/css'); @@ -469,8 +435,7 @@ class ResponseTest extends ResponseTestCase $this->assertEquals('text/css; charset=UTF-8', $response->headers->get('Content-Type')); } - public function testPrepareDoesNothingIfContentTypeIsSet() - { + public function testPrepareDoesNothingIfContentTypeIsSet() { $response = new Response('foo'); $response->headers->set('Content-Type', 'text/plain'); @@ -479,8 +444,7 @@ class ResponseTest extends ResponseTestCase $this->assertEquals('text/plain; charset=UTF-8', $response->headers->get('content-type')); } - public function testPrepareDoesNothingIfRequestFormatIsNotDefined() - { + public function testPrepareDoesNothingIfRequestFormatIsNotDefined() { $response = new Response('foo'); $response->prepare(new Request()); @@ -488,8 +452,7 @@ class ResponseTest extends ResponseTestCase $this->assertEquals('text/html; charset=UTF-8', $response->headers->get('content-type')); } - public function testPrepareSetContentType() - { + public function testPrepareSetContentType() { $response = new Response('foo'); $request = Request::create('/'); $request->setRequestFormat('json'); @@ -499,8 +462,7 @@ class ResponseTest extends ResponseTestCase $this->assertEquals('application/json', $response->headers->get('content-type')); } - public function testPrepareRemovesContentForHeadRequests() - { + public function testPrepareRemovesContentForHeadRequests() { $response = new Response('foo'); $request = Request::create('/', 'HEAD'); @@ -512,8 +474,7 @@ class ResponseTest extends ResponseTestCase $this->assertEquals($length, $response->headers->get('Content-Length'), 'Content-Length should be as if it was GET; see RFC2616 14.13'); } - public function testPrepareRemovesContentForInformationalResponse() - { + public function testPrepareRemovesContentForInformationalResponse() { $response = new Response('foo'); $request = Request::create('/'); @@ -532,8 +493,7 @@ class ResponseTest extends ResponseTestCase $this->assertFalse($response->headers->has('Content-Length')); } - public function testPrepareRemovesContentLength() - { + public function testPrepareRemovesContentLength() { $response = new Response('foo'); $request = Request::create('/'); @@ -546,8 +506,7 @@ class ResponseTest extends ResponseTestCase $this->assertFalse($response->headers->has('Content-Length')); } - public function testPrepareSetsPragmaOnHttp10Only() - { + public function testPrepareSetsPragmaOnHttp10Only() { $request = Request::create('/', 'GET'); $request->server->set('SERVER_PROTOCOL', 'HTTP/1.0'); @@ -563,8 +522,7 @@ class ResponseTest extends ResponseTestCase $this->assertFalse($response->headers->has('expires')); } - public function testSetCache() - { + public function testSetCache() { $response = new Response(); //array('etag', 'last_modified', 'max_age', 's_maxage', 'private', 'public') try { @@ -595,31 +553,30 @@ class ResponseTest extends ResponseTestCase $this->assertTrue($response->headers->hasCacheControlDirective('public')); $this->assertFalse($response->headers->hasCacheControlDirective('private')); - $response->setCache(array('public' => true)); + $response->setCache(array('public' => TRUE)); $this->assertTrue($response->headers->hasCacheControlDirective('public')); $this->assertFalse($response->headers->hasCacheControlDirective('private')); - $response->setCache(array('public' => false)); + $response->setCache(array('public' => FALSE)); $this->assertFalse($response->headers->hasCacheControlDirective('public')); $this->assertTrue($response->headers->hasCacheControlDirective('private')); - $response->setCache(array('private' => true)); + $response->setCache(array('private' => TRUE)); $this->assertFalse($response->headers->hasCacheControlDirective('public')); $this->assertTrue($response->headers->hasCacheControlDirective('private')); - $response->setCache(array('private' => false)); + $response->setCache(array('private' => FALSE)); $this->assertTrue($response->headers->hasCacheControlDirective('public')); $this->assertFalse($response->headers->hasCacheControlDirective('private')); - $response->setCache(array('immutable' => true)); + $response->setCache(array('immutable' => TRUE)); $this->assertTrue($response->headers->hasCacheControlDirective('immutable')); - $response->setCache(array('immutable' => false)); + $response->setCache(array('immutable' => FALSE)); $this->assertFalse($response->headers->hasCacheControlDirective('immutable')); } - public function testSendContent() - { + public function testSendContent() { $response = new Response('test response rendering', 200); ob_start(); @@ -628,8 +585,7 @@ class ResponseTest extends ResponseTestCase $this->assertContains('test response rendering', $string); } - public function testSetPublic() - { + public function testSetPublic() { $response = new Response(); $response->setPublic(); @@ -637,26 +593,23 @@ class ResponseTest extends ResponseTestCase $this->assertFalse($response->headers->hasCacheControlDirective('private')); } - public function testSetImmutable() - { + public function testSetImmutable() { $response = new Response(); $response->setImmutable(); $this->assertTrue($response->headers->hasCacheControlDirective('immutable')); } - public function testIsImmutable() - { + public function testIsImmutable() { $response = new Response(); $response->setImmutable(); $this->assertTrue($response->isImmutable()); } - public function testSetExpires() - { + public function testSetExpires() { $response = new Response(); - $response->setExpires(null); + $response->setExpires(NULL); $this->assertNull($response->getExpires(), '->setExpires() remove the header when passed null'); @@ -666,18 +619,16 @@ class ResponseTest extends ResponseTestCase $this->assertEquals($response->getExpires()->getTimestamp(), $now->getTimestamp()); } - public function testSetLastModified() - { + public function testSetLastModified() { $response = new Response(); $response->setLastModified($this->createDateTimeNow()); $this->assertNotNull($response->getLastModified()); - $response->setLastModified(null); + $response->setLastModified(NULL); $this->assertNull($response->getLastModified()); } - public function testIsInvalid() - { + public function testIsInvalid() { $response = new Response(); try { @@ -701,32 +652,29 @@ class ResponseTest extends ResponseTestCase /** * @dataProvider getStatusCodeFixtures */ - public function testSetStatusCode($code, $text, $expectedText) - { + public function testSetStatusCode($code, $text, $expectedText) { $response = new Response(); $response->setStatusCode($code, $text); $statusText = new \ReflectionProperty($response, 'statusText'); - $statusText->setAccessible(true); + $statusText->setAccessible(TRUE); $this->assertEquals($expectedText, $statusText->getValue($response)); } - public function getStatusCodeFixtures() - { + public function getStatusCodeFixtures() { return array( - array('200', null, 'OK'), - array('200', false, ''), + array('200', NULL, 'OK'), + array('200', FALSE, ''), array('200', 'foo', 'foo'), - array('199', null, 'unknown status'), - array('199', false, ''), + array('199', NULL, 'unknown status'), + array('199', FALSE, ''), array('199', 'foo', 'foo'), ); } - public function testIsInformational() - { + public function testIsInformational() { $response = new Response('', 100); $this->assertTrue($response->isInformational()); @@ -734,8 +682,7 @@ class ResponseTest extends ResponseTestCase $this->assertFalse($response->isInformational()); } - public function testIsRedirectRedirection() - { + public function testIsRedirectRedirection() { foreach (array(301, 302, 303, 307) as $code) { $response = new Response('', $code); $this->assertTrue($response->isRedirection()); @@ -759,8 +706,7 @@ class ResponseTest extends ResponseTestCase $this->assertTrue($response->isRedirect('/good-uri')); } - public function testIsNotFound() - { + public function testIsNotFound() { $response = new Response('', 404); $this->assertTrue($response->isNotFound()); @@ -768,8 +714,7 @@ class ResponseTest extends ResponseTestCase $this->assertFalse($response->isNotFound()); } - public function testIsEmpty() - { + public function testIsEmpty() { foreach (array(204, 304) as $code) { $response = new Response('', $code); $this->assertTrue($response->isEmpty()); @@ -779,8 +724,7 @@ class ResponseTest extends ResponseTestCase $this->assertFalse($response->isEmpty()); } - public function testIsForbidden() - { + public function testIsForbidden() { $response = new Response('', 403); $this->assertTrue($response->isForbidden()); @@ -788,8 +732,7 @@ class ResponseTest extends ResponseTestCase $this->assertFalse($response->isForbidden()); } - public function testIsOk() - { + public function testIsOk() { $response = new Response('', 200); $this->assertTrue($response->isOk()); @@ -797,8 +740,7 @@ class ResponseTest extends ResponseTestCase $this->assertFalse($response->isOk()); } - public function testIsServerOrClientError() - { + public function testIsServerOrClientError() { $response = new Response('', 404); $this->assertTrue($response->isClientError()); $this->assertFalse($response->isServerError()); @@ -808,8 +750,7 @@ class ResponseTest extends ResponseTestCase $this->assertTrue($response->isServerError()); } - public function testHasVary() - { + public function testHasVary() { $response = new Response(); $this->assertFalse($response->hasVary()); @@ -817,8 +758,7 @@ class ResponseTest extends ResponseTestCase $this->assertTrue($response->hasVary()); } - public function testSetEtag() - { + public function testSetEtag() { $response = new Response('', 200, array('ETag' => '"12345"')); $response->setEtag(); @@ -828,34 +768,31 @@ class ResponseTest extends ResponseTestCase /** * @dataProvider validContentProvider */ - public function testSetContent($content) - { + public function testSetContent($content) { $response = new Response(); $response->setContent($content); - $this->assertEquals((string) $content, $response->getContent()); + $this->assertEquals((string)$content, $response->getContent()); } /** * @expectedException \UnexpectedValueException * @dataProvider invalidContentProvider */ - public function testSetContentInvalid($content) - { + public function testSetContentInvalid($content) { $response = new Response(); $response->setContent($content); } - public function testSettersAreChainable() - { + public function testSettersAreChainable() { $response = new Response(); $setters = array( 'setProtocolVersion' => '1.0', 'setCharset' => 'UTF-8', - 'setPublic' => null, - 'setPrivate' => null, + 'setPublic' => NULL, + 'setPrivate' => NULL, 'setDate' => $this->createDateTimeNow(), - 'expire' => null, + 'expire' => NULL, 'setMaxAge' => 1, 'setSharedMaxAge' => 1, 'setTtl' => 1, @@ -867,8 +804,7 @@ class ResponseTest extends ResponseTestCase } } - public function testNoDeprecationsAreTriggered() - { + public function testNoDeprecationsAreTriggered() { new DefaultResponse(); $this->getMockBuilder(Response::class)->getMock(); @@ -877,8 +813,7 @@ class ResponseTest extends ResponseTestCase $this->addToAssertionCount(1); } - public function validContentProvider() - { + public function validContentProvider() { return array( 'obj' => array(new StringableObject()), 'string' => array('Foo'), @@ -886,34 +821,29 @@ class ResponseTest extends ResponseTestCase ); } - public function invalidContentProvider() - { + public function invalidContentProvider() { return array( 'obj' => array(new \stdClass()), 'array' => array(array()), - 'bool' => array(true, '1'), + 'bool' => array(TRUE, '1'), ); } - protected function createDateTimeOneHourAgo() - { + protected function createDateTimeOneHourAgo() { return $this->createDateTimeNow()->sub(new \DateInterval('PT1H')); } - protected function createDateTimeOneHourLater() - { + protected function createDateTimeOneHourLater() { return $this->createDateTimeNow()->add(new \DateInterval('PT1H')); } - protected function createDateTimeNow() - { + protected function createDateTimeNow() { $date = new \DateTime(); return $date->setTimestamp(time()); } - protected function provideResponse() - { + protected function provideResponse() { return new Response(); } @@ -924,9 +854,8 @@ class ResponseTest extends ResponseTestCase * @copyright Copyright (c) 2015-2016 Zend Technologies USA Inc. (http://www.zend.com) * @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License */ - public function ianaCodesReasonPhrasesProvider() - { - if (!in_array('https', stream_get_wrappers(), true)) { + public function ianaCodesReasonPhrasesProvider() { + if (!in_array('https', stream_get_wrappers(), TRUE)) { $this->markTestSkipped('The "https" wrapper is not available'); } @@ -940,7 +869,7 @@ class ResponseTest extends ResponseTestCase ))); $ianaHttpStatusCodes->load('https://www.iana.org/assignments/http-status-codes/http-status-codes.xml'); - if (!$ianaHttpStatusCodes->relaxNGValidate(__DIR__.'/schema/http-status-codes.rng')) { + if (!$ianaHttpStatusCodes->relaxNGValidate(__DIR__ . '/schema/http-status-codes.rng')) { self::fail('Invalid IANA\'s HTTP status code list.'); } @@ -954,7 +883,7 @@ class ResponseTest extends ResponseTestCase $value = $xpath->query('.//ns:value', $record)->item(0)->nodeValue; $description = $xpath->query('.//ns:description', $record)->item(0)->nodeValue; - if (in_array($description, array('Unassigned', '(Unused)'), true)) { + if (in_array($description, array('Unassigned', '(Unused)'), TRUE)) { continue; } @@ -973,16 +902,14 @@ class ResponseTest extends ResponseTestCase /** * @dataProvider ianaCodesReasonPhrasesProvider */ - public function testReasonPhraseDefaultsAgainstIana($code, $reasonPhrase) - { + public function testReasonPhraseDefaultsAgainstIana($code, $reasonPhrase) { $this->assertEquals($reasonPhrase, Response::$statusTexts[$code]); } } class StringableObject { - public function __toString() - { + public function __toString() { return 'Foo'; } } @@ -993,11 +920,9 @@ class DefaultResponse extends Response class ExtendedResponse extends Response { - public function setLastModified(\DateTime $date = null) - { + public function setLastModified(\DateTime $date = NULL) { } - public function getDate() - { + public function getDate() { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ResponseTestCase.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ResponseTestCase.php index 4ead34c..fb24d1e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ResponseTestCase.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ResponseTestCase.php @@ -16,11 +16,10 @@ use Symfony\Component\HttpFoundation\Request; abstract class ResponseTestCase extends TestCase { - public function testNoCacheControlHeaderOnAttachmentUsingHTTPSAndMSIE() - { + public function testNoCacheControlHeaderOnAttachmentUsingHTTPSAndMSIE() { // Check for HTTPS and IE 8 $request = new Request(); - $request->server->set('HTTPS', true); + $request->server->set('HTTPS', TRUE); $request->server->set('HTTP_USER_AGENT', 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)'); $response = $this->provideResponse(); @@ -48,7 +47,7 @@ abstract class ResponseTestCase extends TestCase $this->assertTrue($response->headers->has('Cache-Control')); // Check for IE 9 and HTTP - $request->server->set('HTTPS', false); + $request->server->set('HTTPS', FALSE); $response = $this->provideResponse(); $response->headers->set('Content-Disposition', 'attachment; filename="fname.ext"'); @@ -66,7 +65,7 @@ abstract class ResponseTestCase extends TestCase $this->assertTrue($response->headers->has('Cache-Control')); // Check for non-IE and HTTPS - $request->server->set('HTTPS', true); + $request->server->set('HTTPS', TRUE); $request->server->set('HTTP_USER_AGENT', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.60 Safari/537.17'); $response = $this->provideResponse(); @@ -76,7 +75,7 @@ abstract class ResponseTestCase extends TestCase $this->assertTrue($response->headers->has('Cache-Control')); // Check for non-IE and HTTP - $request->server->set('HTTPS', false); + $request->server->set('HTTPS', FALSE); $response = $this->provideResponse(); $response->headers->set('Content-Disposition', 'attachment; filename="fname.ext"'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ServerBagTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ServerBagTest.php index f8becec..66cf126 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ServerBagTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/ServerBagTest.php @@ -21,8 +21,7 @@ use Symfony\Component\HttpFoundation\ServerBag; */ class ServerBagTest extends TestCase { - public function testShouldExtractHeadersFromServerArray() - { + public function testShouldExtractHeadersFromServerArray() { $server = array( 'SOME_SERVER_VARIABLE' => 'value', 'SOME_SERVER_VARIABLE2' => 'value', @@ -40,37 +39,34 @@ class ServerBagTest extends TestCase 'CONTENT_TYPE' => 'text/html', 'CONTENT_LENGTH' => '0', 'ETAG' => 'asdf', - 'AUTHORIZATION' => 'Basic '.base64_encode('foo:bar'), + 'AUTHORIZATION' => 'Basic ' . base64_encode('foo:bar'), 'PHP_AUTH_USER' => 'foo', 'PHP_AUTH_PW' => 'bar', ), $bag->getHeaders()); } - public function testHttpPasswordIsOptional() - { + public function testHttpPasswordIsOptional() { $bag = new ServerBag(array('PHP_AUTH_USER' => 'foo')); $this->assertEquals(array( - 'AUTHORIZATION' => 'Basic '.base64_encode('foo:'), + 'AUTHORIZATION' => 'Basic ' . base64_encode('foo:'), 'PHP_AUTH_USER' => 'foo', 'PHP_AUTH_PW' => '', ), $bag->getHeaders()); } - public function testHttpBasicAuthWithPhpCgi() - { - $bag = new ServerBag(array('HTTP_AUTHORIZATION' => 'Basic '.base64_encode('foo:bar'))); + public function testHttpBasicAuthWithPhpCgi() { + $bag = new ServerBag(array('HTTP_AUTHORIZATION' => 'Basic ' . base64_encode('foo:bar'))); $this->assertEquals(array( - 'AUTHORIZATION' => 'Basic '.base64_encode('foo:bar'), + 'AUTHORIZATION' => 'Basic ' . base64_encode('foo:bar'), 'PHP_AUTH_USER' => 'foo', 'PHP_AUTH_PW' => 'bar', ), $bag->getHeaders()); } - public function testHttpBasicAuthWithPhpCgiBogus() - { - $bag = new ServerBag(array('HTTP_AUTHORIZATION' => 'Basic_'.base64_encode('foo:bar'))); + public function testHttpBasicAuthWithPhpCgiBogus() { + $bag = new ServerBag(array('HTTP_AUTHORIZATION' => 'Basic_' . base64_encode('foo:bar'))); // Username and passwords should not be set as the header is bogus $headers = $bag->getHeaders(); @@ -78,31 +74,28 @@ class ServerBagTest extends TestCase $this->assertArrayNotHasKey('PHP_AUTH_PW', $headers); } - public function testHttpBasicAuthWithPhpCgiRedirect() - { - $bag = new ServerBag(array('REDIRECT_HTTP_AUTHORIZATION' => 'Basic '.base64_encode('username:pass:word'))); + public function testHttpBasicAuthWithPhpCgiRedirect() { + $bag = new ServerBag(array('REDIRECT_HTTP_AUTHORIZATION' => 'Basic ' . base64_encode('username:pass:word'))); $this->assertEquals(array( - 'AUTHORIZATION' => 'Basic '.base64_encode('username:pass:word'), + 'AUTHORIZATION' => 'Basic ' . base64_encode('username:pass:word'), 'PHP_AUTH_USER' => 'username', 'PHP_AUTH_PW' => 'pass:word', ), $bag->getHeaders()); } - public function testHttpBasicAuthWithPhpCgiEmptyPassword() - { - $bag = new ServerBag(array('HTTP_AUTHORIZATION' => 'Basic '.base64_encode('foo:'))); + public function testHttpBasicAuthWithPhpCgiEmptyPassword() { + $bag = new ServerBag(array('HTTP_AUTHORIZATION' => 'Basic ' . base64_encode('foo:'))); $this->assertEquals(array( - 'AUTHORIZATION' => 'Basic '.base64_encode('foo:'), + 'AUTHORIZATION' => 'Basic ' . base64_encode('foo:'), 'PHP_AUTH_USER' => 'foo', 'PHP_AUTH_PW' => '', ), $bag->getHeaders()); } - public function testHttpDigestAuthWithPhpCgi() - { - $digest = 'Digest username="foo", realm="acme", nonce="'.md5('secret').'", uri="/protected, qop="auth"'; + public function testHttpDigestAuthWithPhpCgi() { + $digest = 'Digest username="foo", realm="acme", nonce="' . md5('secret') . '", uri="/protected, qop="auth"'; $bag = new ServerBag(array('HTTP_AUTHORIZATION' => $digest)); $this->assertEquals(array( @@ -111,9 +104,8 @@ class ServerBagTest extends TestCase ), $bag->getHeaders()); } - public function testHttpDigestAuthWithPhpCgiBogus() - { - $digest = 'Digest_username="foo", realm="acme", nonce="'.md5('secret').'", uri="/protected, qop="auth"'; + public function testHttpDigestAuthWithPhpCgiBogus() { + $digest = 'Digest_username="foo", realm="acme", nonce="' . md5('secret') . '", uri="/protected, qop="auth"'; $bag = new ServerBag(array('HTTP_AUTHORIZATION' => $digest)); // Username and passwords should not be set as the header is bogus @@ -122,9 +114,8 @@ class ServerBagTest extends TestCase $this->assertArrayNotHasKey('PHP_AUTH_PW', $headers); } - public function testHttpDigestAuthWithPhpCgiRedirect() - { - $digest = 'Digest username="foo", realm="acme", nonce="'.md5('secret').'", uri="/protected, qop="auth"'; + public function testHttpDigestAuthWithPhpCgiRedirect() { + $digest = 'Digest username="foo", realm="acme", nonce="' . md5('secret') . '", uri="/protected, qop="auth"'; $bag = new ServerBag(array('REDIRECT_HTTP_AUTHORIZATION' => $digest)); $this->assertEquals(array( @@ -133,8 +124,7 @@ class ServerBagTest extends TestCase ), $bag->getHeaders()); } - public function testOAuthBearerAuth() - { + public function testOAuthBearerAuth() { $headerContent = 'Bearer L-yLEOr9zhmUYRkzN1jwwxwQ-PBNiKDc8dgfB4hTfvo'; $bag = new ServerBag(array('HTTP_AUTHORIZATION' => $headerContent)); @@ -143,8 +133,7 @@ class ServerBagTest extends TestCase ), $bag->getHeaders()); } - public function testOAuthBearerAuthWithRedirect() - { + public function testOAuthBearerAuthWithRedirect() { $headerContent = 'Bearer L-yLEOr9zhmUYRkzN1jwwxwQ-PBNiKDc8dgfB4hTfvo'; $bag = new ServerBag(array('REDIRECT_HTTP_AUTHORIZATION' => $headerContent)); @@ -156,8 +145,7 @@ class ServerBagTest extends TestCase /** * @see https://github.com/symfony/symfony/issues/17345 */ - public function testItDoesNotOverwriteTheAuthorizationHeaderIfItIsAlreadySet() - { + public function testItDoesNotOverwriteTheAuthorizationHeaderIfItIsAlreadySet() { $headerContent = 'Bearer L-yLEOr9zhmUYRkzN1jwwxwQ-PBNiKDc8dgfB4hTfvo'; $bag = new ServerBag(array('PHP_AUTH_USER' => 'foo', 'HTTP_AUTHORIZATION' => $headerContent)); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Attribute/AttributeBagTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Attribute/AttributeBagTest.php index 724a0b9..cd3402b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Attribute/AttributeBagTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Attribute/AttributeBagTest.php @@ -28,8 +28,7 @@ class AttributeBagTest extends TestCase */ private $bag; - protected function setUp() - { + protected function setUp() { $this->array = array( 'hello' => 'world', 'always' => 'be happy', @@ -49,14 +48,12 @@ class AttributeBagTest extends TestCase $this->bag->initialize($this->array); } - protected function tearDown() - { - $this->bag = null; + protected function tearDown() { + $this->bag = NULL; $this->array = array(); } - public function testInitialize() - { + public function testInitialize() { $bag = new AttributeBag(); $bag->initialize($this->array); $this->assertEquals($this->array, $bag->all()); @@ -65,15 +62,13 @@ class AttributeBagTest extends TestCase $this->assertEquals($array, $bag->all()); } - public function testGetStorageKey() - { + public function testGetStorageKey() { $this->assertEquals('_sf2', $this->bag->getStorageKey()); $attributeBag = new AttributeBag('test'); $this->assertEquals('test', $attributeBag->getStorageKey()); } - public function testGetSetName() - { + public function testGetSetName() { $this->assertEquals('attributes', $this->bag->getName()); $this->bag->setName('foo'); $this->assertEquals('foo', $this->bag->getName()); @@ -82,21 +77,18 @@ class AttributeBagTest extends TestCase /** * @dataProvider attributesProvider */ - public function testHas($key, $value, $exists) - { + public function testHas($key, $value, $exists) { $this->assertEquals($exists, $this->bag->has($key)); } /** * @dataProvider attributesProvider */ - public function testGet($key, $value, $expected) - { + public function testGet($key, $value, $expected) { $this->assertEquals($value, $this->bag->get($key)); } - public function testGetDefaults() - { + public function testGetDefaults() { $this->assertNull($this->bag->get('user2.login')); $this->assertEquals('default', $this->bag->get('user2.login', 'default')); } @@ -104,14 +96,12 @@ class AttributeBagTest extends TestCase /** * @dataProvider attributesProvider */ - public function testSet($key, $value, $expected) - { + public function testSet($key, $value, $expected) { $this->bag->set($key, $value); $this->assertEquals($value, $this->bag->get($key)); } - public function testAll() - { + public function testAll() { $this->assertEquals($this->array, $this->bag->all()); $this->bag->set('hello', 'fabien'); @@ -120,8 +110,7 @@ class AttributeBagTest extends TestCase $this->assertEquals($array, $this->bag->all()); } - public function testReplace() - { + public function testReplace() { $array = array(); $array['name'] = 'jack'; $array['foo.bar'] = 'beep'; @@ -132,8 +121,7 @@ class AttributeBagTest extends TestCase $this->assertNull($this->bag->get('user.login')); } - public function testRemove() - { + public function testRemove() { $this->assertEquals('world', $this->bag->get('hello')); $this->bag->remove('hello'); $this->assertNull($this->bag->get('hello')); @@ -147,29 +135,26 @@ class AttributeBagTest extends TestCase $this->assertNull($this->bag->get('user.login')); } - public function testClear() - { + public function testClear() { $this->bag->clear(); $this->assertEquals(array(), $this->bag->all()); } - public function attributesProvider() - { + public function attributesProvider() { return array( - array('hello', 'world', true), - array('always', 'be happy', true), - array('user.login', 'drak', true), - array('csrf.token', array('a' => '1234', 'b' => '4321'), true), - array('category', array('fishing' => array('first' => 'cod', 'second' => 'sole')), true), - array('user2.login', null, false), - array('never', null, false), - array('bye', null, false), - array('bye/for/now', null, false), + array('hello', 'world', TRUE), + array('always', 'be happy', TRUE), + array('user.login', 'drak', TRUE), + array('csrf.token', array('a' => '1234', 'b' => '4321'), TRUE), + array('category', array('fishing' => array('first' => 'cod', 'second' => 'sole')), TRUE), + array('user2.login', NULL, FALSE), + array('never', NULL, FALSE), + array('bye', NULL, FALSE), + array('bye/for/now', NULL, FALSE), ); } - public function testGetIterator() - { + public function testGetIterator() { $i = 0; foreach ($this->bag as $key => $val) { $this->assertEquals($this->array[$key], $val); @@ -179,8 +164,7 @@ class AttributeBagTest extends TestCase $this->assertEquals(count($this->array), $i); } - public function testCount() - { + public function testCount() { $this->assertCount(count($this->array), $this->bag); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php index f074ce1..277b241 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php @@ -28,8 +28,7 @@ class NamespacedAttributeBagTest extends TestCase */ private $bag; - protected function setUp() - { + protected function setUp() { $this->array = array( 'hello' => 'world', 'always' => 'be happy', @@ -49,14 +48,12 @@ class NamespacedAttributeBagTest extends TestCase $this->bag->initialize($this->array); } - protected function tearDown() - { - $this->bag = null; + protected function tearDown() { + $this->bag = NULL; $this->array = array(); } - public function testInitialize() - { + public function testInitialize() { $bag = new NamespacedAttributeBag(); $bag->initialize($this->array); $this->assertEquals($this->array, $this->bag->all()); @@ -67,8 +64,7 @@ class NamespacedAttributeBagTest extends TestCase $this->assertEquals($this->array, $this->bag->all()); } - public function testGetStorageKey() - { + public function testGetStorageKey() { $this->assertEquals('_sf2', $this->bag->getStorageKey()); $attributeBag = new NamespacedAttributeBag('test'); $this->assertEquals('test', $attributeBag->getStorageKey()); @@ -77,21 +73,18 @@ class NamespacedAttributeBagTest extends TestCase /** * @dataProvider attributesProvider */ - public function testHas($key, $value, $exists) - { + public function testHas($key, $value, $exists) { $this->assertEquals($exists, $this->bag->has($key)); } /** * @dataProvider attributesProvider */ - public function testGet($key, $value, $expected) - { + public function testGet($key, $value, $expected) { $this->assertEquals($value, $this->bag->get($key)); } - public function testGetDefaults() - { + public function testGetDefaults() { $this->assertNull($this->bag->get('user2.login')); $this->assertEquals('default', $this->bag->get('user2.login', 'default')); } @@ -99,14 +92,12 @@ class NamespacedAttributeBagTest extends TestCase /** * @dataProvider attributesProvider */ - public function testSet($key, $value, $expected) - { + public function testSet($key, $value, $expected) { $this->bag->set($key, $value); $this->assertEquals($value, $this->bag->get($key)); } - public function testAll() - { + public function testAll() { $this->assertEquals($this->array, $this->bag->all()); $this->bag->set('hello', 'fabien'); @@ -115,8 +106,7 @@ class NamespacedAttributeBagTest extends TestCase $this->assertEquals($array, $this->bag->all()); } - public function testReplace() - { + public function testReplace() { $array = array(); $array['name'] = 'jack'; $array['foo.bar'] = 'beep'; @@ -127,8 +117,7 @@ class NamespacedAttributeBagTest extends TestCase $this->assertNull($this->bag->get('user.login')); } - public function testRemove() - { + public function testRemove() { $this->assertEquals('world', $this->bag->get('hello')); $this->bag->remove('hello'); $this->assertNull($this->bag->get('hello')); @@ -142,41 +131,37 @@ class NamespacedAttributeBagTest extends TestCase $this->assertNull($this->bag->get('user.login')); } - public function testRemoveExistingNamespacedAttribute() - { + public function testRemoveExistingNamespacedAttribute() { $this->assertSame('cod', $this->bag->remove('category/fishing/first')); } - public function testRemoveNonexistingNamespacedAttribute() - { + public function testRemoveNonexistingNamespacedAttribute() { $this->assertNull($this->bag->remove('foo/bar/baz')); } - public function testClear() - { + public function testClear() { $this->bag->clear(); $this->assertEquals(array(), $this->bag->all()); } - public function attributesProvider() - { + public function attributesProvider() { return array( - array('hello', 'world', true), - array('always', 'be happy', true), - array('user.login', 'drak', true), - array('csrf.token', array('a' => '1234', 'b' => '4321'), true), - array('csrf.token/a', '1234', true), - array('csrf.token/b', '4321', true), - array('category', array('fishing' => array('first' => 'cod', 'second' => 'sole')), true), - array('category/fishing', array('first' => 'cod', 'second' => 'sole'), true), - array('category/fishing/missing/first', null, false), - array('category/fishing/first', 'cod', true), - array('category/fishing/second', 'sole', true), - array('category/fishing/missing/second', null, false), - array('user2.login', null, false), - array('never', null, false), - array('bye', null, false), - array('bye/for/now', null, false), + array('hello', 'world', TRUE), + array('always', 'be happy', TRUE), + array('user.login', 'drak', TRUE), + array('csrf.token', array('a' => '1234', 'b' => '4321'), TRUE), + array('csrf.token/a', '1234', TRUE), + array('csrf.token/b', '4321', TRUE), + array('category', array('fishing' => array('first' => 'cod', 'second' => 'sole')), TRUE), + array('category/fishing', array('first' => 'cod', 'second' => 'sole'), TRUE), + array('category/fishing/missing/first', NULL, FALSE), + array('category/fishing/first', 'cod', TRUE), + array('category/fishing/second', 'sole', TRUE), + array('category/fishing/missing/second', NULL, FALSE), + array('user2.login', NULL, FALSE), + array('never', NULL, FALSE), + array('bye', NULL, FALSE), + array('bye/for/now', NULL, FALSE), ); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Flash/AutoExpireFlashBagTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Flash/AutoExpireFlashBagTest.php index fa8626a..37cd95b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Flash/AutoExpireFlashBagTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Flash/AutoExpireFlashBagTest.php @@ -28,76 +28,66 @@ class AutoExpireFlashBagTest extends TestCase protected $array = array(); - protected function setUp() - { + protected function setUp() { parent::setUp(); $this->bag = new FlashBag(); $this->array = array('new' => array('notice' => array('A previous flash message'))); $this->bag->initialize($this->array); } - protected function tearDown() - { - $this->bag = null; + protected function tearDown() { + $this->bag = NULL; parent::tearDown(); } - public function testInitialize() - { + public function testInitialize() { $bag = new FlashBag(); $array = array('new' => array('notice' => array('A previous flash message'))); $bag->initialize($array); $this->assertEquals(array('A previous flash message'), $bag->peek('notice')); $array = array('new' => array( - 'notice' => array('Something else'), - 'error' => array('a'), - )); + 'notice' => array('Something else'), + 'error' => array('a'), + )); $bag->initialize($array); $this->assertEquals(array('Something else'), $bag->peek('notice')); $this->assertEquals(array('a'), $bag->peek('error')); } - public function testGetStorageKey() - { + public function testGetStorageKey() { $this->assertEquals('_symfony_flashes', $this->bag->getStorageKey()); $attributeBag = new FlashBag('test'); $this->assertEquals('test', $attributeBag->getStorageKey()); } - public function testGetSetName() - { + public function testGetSetName() { $this->assertEquals('flashes', $this->bag->getName()); $this->bag->setName('foo'); $this->assertEquals('foo', $this->bag->getName()); } - public function testPeek() - { + public function testPeek() { $this->assertEquals(array(), $this->bag->peek('non_existing')); $this->assertEquals(array('default'), $this->bag->peek('non_existing', array('default'))); $this->assertEquals(array('A previous flash message'), $this->bag->peek('notice')); $this->assertEquals(array('A previous flash message'), $this->bag->peek('notice')); } - public function testSet() - { + public function testSet() { $this->bag->set('notice', 'Foo'); $this->assertEquals(array('A previous flash message'), $this->bag->peek('notice')); } - public function testHas() - { + public function testHas() { $this->assertFalse($this->bag->has('nothing')); $this->assertTrue($this->bag->has('notice')); } - public function testKeys() - { + public function testKeys() { $this->assertEquals(array('notice'), $this->bag->keys()); } - public function testPeekAll() - { + public function testPeekAll() { $array = array( 'new' => array( 'notice' => 'Foo', @@ -109,50 +99,45 @@ class AutoExpireFlashBagTest extends TestCase $this->assertEquals(array( 'notice' => 'Foo', 'error' => 'Bar', - ), $this->bag->peekAll() + ), $this->bag->peekAll() ); $this->assertEquals(array( 'notice' => 'Foo', 'error' => 'Bar', - ), $this->bag->peekAll() + ), $this->bag->peekAll() ); } - public function testGet() - { + public function testGet() { $this->assertEquals(array(), $this->bag->get('non_existing')); $this->assertEquals(array('default'), $this->bag->get('non_existing', array('default'))); $this->assertEquals(array('A previous flash message'), $this->bag->get('notice')); $this->assertEquals(array(), $this->bag->get('notice')); } - public function testSetAll() - { + public function testSetAll() { $this->bag->setAll(array('a' => 'first', 'b' => 'second')); $this->assertFalse($this->bag->has('a')); $this->assertFalse($this->bag->has('b')); } - public function testAll() - { + public function testAll() { $this->bag->set('notice', 'Foo'); $this->bag->set('error', 'Bar'); $this->assertEquals(array( 'notice' => array('A previous flash message'), - ), $this->bag->all() + ), $this->bag->all() ); $this->assertEquals(array(), $this->bag->all()); } - public function testClear() - { + public function testClear() { $this->assertEquals(array('notice' => array('A previous flash message')), $this->bag->clear()); } - public function testDoNotRemoveTheNewFlashesWhenDisplayingTheExistingOnes() - { + public function testDoNotRemoveTheNewFlashesWhenDisplayingTheExistingOnes() { $this->bag->add('success', 'Something'); $this->bag->all(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Flash/FlashBagTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Flash/FlashBagTest.php index c4e75b1..bacb1b9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Flash/FlashBagTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Flash/FlashBagTest.php @@ -28,22 +28,19 @@ class FlashBagTest extends TestCase protected $array = array(); - protected function setUp() - { + protected function setUp() { parent::setUp(); $this->bag = new FlashBag(); $this->array = array('notice' => array('A previous flash message')); $this->bag->initialize($this->array); } - protected function tearDown() - { - $this->bag = null; + protected function tearDown() { + $this->bag = NULL; parent::tearDown(); } - public function testInitialize() - { + public function testInitialize() { $bag = new FlashBag(); $bag->initialize($this->array); $this->assertEquals($this->array, $bag->peekAll()); @@ -52,81 +49,72 @@ class FlashBagTest extends TestCase $this->assertEquals($array, $bag->peekAll()); } - public function testGetStorageKey() - { + public function testGetStorageKey() { $this->assertEquals('_symfony_flashes', $this->bag->getStorageKey()); $attributeBag = new FlashBag('test'); $this->assertEquals('test', $attributeBag->getStorageKey()); } - public function testGetSetName() - { + public function testGetSetName() { $this->assertEquals('flashes', $this->bag->getName()); $this->bag->setName('foo'); $this->assertEquals('foo', $this->bag->getName()); } - public function testPeek() - { + public function testPeek() { $this->assertEquals(array(), $this->bag->peek('non_existing')); $this->assertEquals(array('default'), $this->bag->peek('not_existing', array('default'))); $this->assertEquals(array('A previous flash message'), $this->bag->peek('notice')); $this->assertEquals(array('A previous flash message'), $this->bag->peek('notice')); } - public function testGet() - { + public function testGet() { $this->assertEquals(array(), $this->bag->get('non_existing')); $this->assertEquals(array('default'), $this->bag->get('not_existing', array('default'))); $this->assertEquals(array('A previous flash message'), $this->bag->get('notice')); $this->assertEquals(array(), $this->bag->get('notice')); } - public function testAll() - { + public function testAll() { $this->bag->set('notice', 'Foo'); $this->bag->set('error', 'Bar'); $this->assertEquals(array( 'notice' => array('Foo'), - 'error' => array('Bar'), ), $this->bag->all() + 'error' => array('Bar'),), $this->bag->all() ); $this->assertEquals(array(), $this->bag->all()); } - public function testSet() - { + public function testSet() { $this->bag->set('notice', 'Foo'); $this->bag->set('notice', 'Bar'); $this->assertEquals(array('Bar'), $this->bag->peek('notice')); } - public function testHas() - { + public function testHas() { $this->assertFalse($this->bag->has('nothing')); $this->assertTrue($this->bag->has('notice')); } - public function testKeys() - { + public function testKeys() { $this->assertEquals(array('notice'), $this->bag->keys()); } - public function testPeekAll() - { + public function testPeekAll() { $this->bag->set('notice', 'Foo'); $this->bag->set('error', 'Bar'); $this->assertEquals(array( 'notice' => array('Foo'), 'error' => array('Bar'), - ), $this->bag->peekAll() + ), $this->bag->peekAll() ); $this->assertTrue($this->bag->has('notice')); $this->assertTrue($this->bag->has('error')); $this->assertEquals(array( 'notice' => array('Foo'), 'error' => array('Bar'), - ), $this->bag->peekAll() + ), $this->bag->peekAll() ); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/SessionTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/SessionTest.php index 41720e4..ea1b5ea 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/SessionTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/SessionTest.php @@ -36,50 +36,43 @@ class SessionTest extends TestCase */ protected $session; - protected function setUp() - { + protected function setUp() { $this->storage = new MockArraySessionStorage(); $this->session = new Session($this->storage, new AttributeBag(), new FlashBag()); } - protected function tearDown() - { - $this->storage = null; - $this->session = null; + protected function tearDown() { + $this->storage = NULL; + $this->session = NULL; } - public function testStart() - { + public function testStart() { $this->assertEquals('', $this->session->getId()); $this->assertTrue($this->session->start()); $this->assertNotEquals('', $this->session->getId()); } - public function testIsStarted() - { + public function testIsStarted() { $this->assertFalse($this->session->isStarted()); $this->session->start(); $this->assertTrue($this->session->isStarted()); } - public function testSetId() - { + public function testSetId() { $this->assertEquals('', $this->session->getId()); $this->session->setId('0123456789abcdef'); $this->session->start(); $this->assertEquals('0123456789abcdef', $this->session->getId()); } - public function testSetName() - { + public function testSetName() { $this->assertEquals('MOCKSESSID', $this->session->getName()); $this->session->setName('session.test.com'); $this->session->start(); $this->assertEquals('session.test.com', $this->session->getName()); } - public function testGet() - { + public function testGet() { // tests defaults $this->assertNull($this->session->get('foo')); $this->assertEquals(1, $this->session->get('foo', 1)); @@ -88,8 +81,7 @@ class SessionTest extends TestCase /** * @dataProvider setProvider */ - public function testSet($key, $value) - { + public function testSet($key, $value) { $this->session->set($key, $value); $this->assertEquals($value, $this->session->get($key)); } @@ -97,15 +89,13 @@ class SessionTest extends TestCase /** * @dataProvider setProvider */ - public function testHas($key, $value) - { + public function testHas($key, $value) { $this->session->set($key, $value); $this->assertTrue($this->session->has($key)); - $this->assertFalse($this->session->has($key.'non_value')); + $this->assertFalse($this->session->has($key . 'non_value')); } - public function testReplace() - { + public function testReplace() { $this->session->replace(array('happiness' => 'be good', 'symfony' => 'awesome')); $this->assertEquals(array('happiness' => 'be good', 'symfony' => 'awesome'), $this->session->all()); $this->session->replace(array()); @@ -115,8 +105,7 @@ class SessionTest extends TestCase /** * @dataProvider setProvider */ - public function testAll($key, $value, $result) - { + public function testAll($key, $value, $result) { $this->session->set($key, $value); $this->assertEquals($result, $this->session->all()); } @@ -124,16 +113,14 @@ class SessionTest extends TestCase /** * @dataProvider setProvider */ - public function testClear($key, $value) - { + public function testClear($key, $value) { $this->session->set('hi', 'fabien'); $this->session->set($key, $value); $this->session->clear(); $this->assertEquals(array(), $this->session->all()); } - public function setProvider() - { + public function setProvider() { return array( array('foo', 'bar', array('foo' => 'bar')), array('foo.bar', 'too much beer', array('foo.bar' => 'too much beer')), @@ -144,57 +131,49 @@ class SessionTest extends TestCase /** * @dataProvider setProvider */ - public function testRemove($key, $value) - { + public function testRemove($key, $value) { $this->session->set('hi.world', 'have a nice day'); $this->session->set($key, $value); $this->session->remove($key); $this->assertEquals(array('hi.world' => 'have a nice day'), $this->session->all()); } - public function testInvalidate() - { + public function testInvalidate() { $this->session->set('invalidate', 123); $this->session->invalidate(); $this->assertEquals(array(), $this->session->all()); } - public function testMigrate() - { + public function testMigrate() { $this->session->set('migrate', 321); $this->session->migrate(); $this->assertEquals(321, $this->session->get('migrate')); } - public function testMigrateDestroy() - { + public function testMigrateDestroy() { $this->session->set('migrate', 333); - $this->session->migrate(true); + $this->session->migrate(TRUE); $this->assertEquals(333, $this->session->get('migrate')); } - public function testSave() - { + public function testSave() { $this->session->start(); $this->session->save(); $this->assertFalse($this->session->isStarted()); } - public function testGetId() - { + public function testGetId() { $this->assertEquals('', $this->session->getId()); $this->session->start(); $this->assertNotEquals('', $this->session->getId()); } - public function testGetFlashBag() - { + public function testGetFlashBag() { $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface', $this->session->getFlashBag()); } - public function testGetIterator() - { + public function testGetIterator() { $attributes = array('hello' => 'world', 'symfony' => 'rocks'); foreach ($attributes as $key => $val) { $this->session->set($key, $val); @@ -209,21 +188,18 @@ class SessionTest extends TestCase $this->assertEquals(count($attributes), $i); } - public function testGetCount() - { + public function testGetCount() { $this->session->set('hello', 'world'); $this->session->set('symfony', 'rocks'); $this->assertCount(2, $this->session); } - public function testGetMeta() - { + public function testGetMeta() { $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\MetadataBag', $this->session->getMetadataBag()); } - public function testIsEmpty() - { + public function testIsEmpty() { $this->assertTrue($this->session->isEmpty()); $this->session->set('hello', 'world'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/AbstractSessionHandlerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/AbstractSessionHandlerTest.php index 3ac081e..7b0190c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/AbstractSessionHandlerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/AbstractSessionHandlerTest.php @@ -20,20 +20,18 @@ class AbstractSessionHandlerTest extends TestCase { private static $server; - public static function setUpBeforeClass() - { + public static function setUpBeforeClass() { $spec = array( 1 => array('file', '/dev/null', 'w'), 2 => array('file', '/dev/null', 'w'), ); - if (!self::$server = @proc_open('exec php -S localhost:8053', $spec, $pipes, __DIR__.'/Fixtures')) { + if (!self::$server = @proc_open('exec php -S localhost:8053', $spec, $pipes, __DIR__ . '/Fixtures')) { self::markTestSkipped('PHP server unable to start.'); } sleep(1); } - public static function tearDownAfterClass() - { + public static function tearDownAfterClass() { if (self::$server) { proc_terminate(self::$server); proc_close(self::$server); @@ -43,18 +41,16 @@ class AbstractSessionHandlerTest extends TestCase /** * @dataProvider provideSession */ - public function testSession($fixture) - { + public function testSession($fixture) { $context = array('http' => array('header' => "Cookie: sid=123abc\r\n")); $context = stream_context_create($context); - $result = file_get_contents(sprintf('http://localhost:8053/%s.php', $fixture), false, $context); + $result = file_get_contents(sprintf('http://localhost:8053/%s.php', $fixture), FALSE, $context); - $this->assertStringEqualsFile(__DIR__.sprintf('/Fixtures/%s.expected', $fixture), $result); + $this->assertStringEqualsFile(__DIR__ . sprintf('/Fixtures/%s.expected', $fixture), $result); } - public function provideSession() - { - foreach (glob(__DIR__.'/Fixtures/*.php') as $file) { + public function provideSession() { + foreach (glob(__DIR__ . '/Fixtures/*.php') as $file) { yield array(pathinfo($file, PATHINFO_FILENAME)); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/common.inc b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/common.inc index 7a064c7..4ad3f41 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/common.inc +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/common.inc @@ -3,7 +3,7 @@ use Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler; $parent = __DIR__; -while (!@file_exists($parent.'/vendor/autoload.php')) { +while (!@file_exists($parent . '/vendor/autoload.php')) { if (!@file_exists($parent)) { // open_basedir restriction in effect break; @@ -16,7 +16,7 @@ while (!@file_exists($parent.'/vendor/autoload.php')) { $parent = dirname($parent); } -require $parent.'/vendor/autoload.php'; +require $parent . '/vendor/autoload.php'; error_reporting(-1); ini_set('html_errors', 0); @@ -55,20 +55,17 @@ class TestSessionHandler extends AbstractSessionHandler { private $data; - public function __construct($data = '') - { + public function __construct($data = '') { $this->data = $data; } - public function open($path, $name) - { + public function open($path, $name) { echo __FUNCTION__, "\n"; return parent::open($path, $name); } - public function validateId($sessionId) - { + public function validateId($sessionId) { echo __FUNCTION__, "\n"; return parent::validateId($sessionId); @@ -77,8 +74,7 @@ class TestSessionHandler extends AbstractSessionHandler /** * {@inheritdoc} */ - public function read($sessionId) - { + public function read($sessionId) { echo __FUNCTION__, "\n"; return parent::read($sessionId); @@ -87,18 +83,16 @@ class TestSessionHandler extends AbstractSessionHandler /** * {@inheritdoc} */ - public function updateTimestamp($sessionId, $data) - { + public function updateTimestamp($sessionId, $data) { echo __FUNCTION__, "\n"; - return true; + return TRUE; } /** * {@inheritdoc} */ - public function write($sessionId, $data) - { + public function write($sessionId, $data) { echo __FUNCTION__, "\n"; return parent::write($sessionId, $data); @@ -107,45 +101,39 @@ class TestSessionHandler extends AbstractSessionHandler /** * {@inheritdoc} */ - public function destroy($sessionId) - { + public function destroy($sessionId) { echo __FUNCTION__, "\n"; return parent::destroy($sessionId); } - public function close() - { + public function close() { echo __FUNCTION__, "\n"; - return true; + return TRUE; } - public function gc($maxLifetime) - { + public function gc($maxLifetime) { echo __FUNCTION__, "\n"; - return true; + return TRUE; } - protected function doRead($sessionId) - { - echo __FUNCTION__.': ', $this->data, "\n"; + protected function doRead($sessionId) { + echo __FUNCTION__ . ': ', $this->data, "\n"; return $this->data; } - protected function doWrite($sessionId, $data) - { - echo __FUNCTION__.': ', $data, "\n"; + protected function doWrite($sessionId, $data) { + echo __FUNCTION__ . ': ', $data, "\n"; - return true; + return TRUE; } - protected function doDestroy($sessionId) - { + protected function doDestroy($sessionId) { echo __FUNCTION__, "\n"; - return true; + return TRUE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/empty_destroys.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/empty_destroys.php index 3cfc125..d2353c1 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/empty_destroys.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/empty_destroys.php @@ -1,8 +1,8 @@ save(); echo empty($_SESSION) ? '$_SESSION is empty' : '$_SESSION is not empty'; -ob_start(function ($buffer) { return str_replace(session_id(), 'random_session_id', $buffer); }); +ob_start(function ($buffer) { + return str_replace(session_id(), 'random_session_id', $buffer); +}); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_cookie.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_cookie.php index ffb5b20..f82f113 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_cookie.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/Fixtures/with_cookie.php @@ -1,8 +1,8 @@ markTestSkipped('PHPUnit_MockObject cannot mock the Memcache class on HHVM. See https://github.com/sebastianbergmann/phpunit-mock-objects/pull/289'); } @@ -45,68 +44,57 @@ class MemcacheSessionHandlerTest extends TestCase ); } - protected function tearDown() - { - $this->memcache = null; - $this->storage = null; + protected function tearDown() { + $this->memcache = NULL; + $this->storage = NULL; parent::tearDown(); } - public function testOpenSession() - { + public function testOpenSession() { $this->assertTrue($this->storage->open('', '')); } - public function testCloseSession() - { + public function testCloseSession() { $this->assertTrue($this->storage->close()); } - public function testReadSession() - { + public function testReadSession() { $this->memcache ->expects($this->once()) ->method('get') - ->with(self::PREFIX.'id') - ; + ->with(self::PREFIX . 'id'); $this->assertEquals('', $this->storage->read('id')); } - public function testWriteSession() - { + public function testWriteSession() { $this->memcache ->expects($this->once()) ->method('set') - ->with(self::PREFIX.'id', 'data', 0, $this->equalTo(time() + self::TTL, 2)) - ->will($this->returnValue(true)) - ; + ->with(self::PREFIX . 'id', 'data', 0, $this->equalTo(time() + self::TTL, 2)) + ->will($this->returnValue(TRUE)); $this->assertTrue($this->storage->write('id', 'data')); } - public function testDestroySession() - { + public function testDestroySession() { $this->memcache ->expects($this->once()) ->method('delete') - ->with(self::PREFIX.'id') - ->will($this->returnValue(true)) - ; + ->with(self::PREFIX . 'id') + ->will($this->returnValue(TRUE)); $this->assertTrue($this->storage->destroy('id')); } - public function testGcSession() - { + public function testGcSession() { $this->assertTrue($this->storage->gc(123)); } /** * @dataProvider getOptionFixtures */ - public function testSupportedOptions($options, $supported) - { + public function testSupportedOptions($options, $supported) { try { new MemcacheSessionHandler($this->memcache, $options); $this->assertTrue($supported); @@ -115,20 +103,18 @@ class MemcacheSessionHandlerTest extends TestCase } } - public function getOptionFixtures() - { + public function getOptionFixtures() { return array( - array(array('prefix' => 'session'), true), - array(array('expiretime' => 100), true), - array(array('prefix' => 'session', 'expiretime' => 200), true), - array(array('expiretime' => 100, 'foo' => 'bar'), false), + array(array('prefix' => 'session'), TRUE), + array(array('expiretime' => 100), TRUE), + array(array('prefix' => 'session', 'expiretime' => 200), TRUE), + array(array('expiretime' => 100, 'foo' => 'bar'), FALSE), ); } - public function testGetConnection() - { + public function testGetConnection() { $method = new \ReflectionMethod($this->storage, 'getMemcache'); - $method->setAccessible(true); + $method->setAccessible(TRUE); $this->assertInstanceOf('\Memcache', $method->invoke($this->storage)); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php index 2e7be35..70358fd 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php @@ -30,8 +30,7 @@ class MemcachedSessionHandlerTest extends TestCase protected $memcached; - protected function setUp() - { + protected function setUp() { if (defined('HHVM_VERSION')) { $this->markTestSkipped('PHPUnit_MockObject cannot mock the Memcached class on HHVM. See https://github.com/sebastianbergmann/phpunit-mock-objects/pull/289'); } @@ -49,68 +48,57 @@ class MemcachedSessionHandlerTest extends TestCase ); } - protected function tearDown() - { - $this->memcached = null; - $this->storage = null; + protected function tearDown() { + $this->memcached = NULL; + $this->storage = NULL; parent::tearDown(); } - public function testOpenSession() - { + public function testOpenSession() { $this->assertTrue($this->storage->open('', '')); } - public function testCloseSession() - { + public function testCloseSession() { $this->assertTrue($this->storage->close()); } - public function testReadSession() - { + public function testReadSession() { $this->memcached ->expects($this->once()) ->method('get') - ->with(self::PREFIX.'id') - ; + ->with(self::PREFIX . 'id'); $this->assertEquals('', $this->storage->read('id')); } - public function testWriteSession() - { + public function testWriteSession() { $this->memcached ->expects($this->once()) ->method('set') - ->with(self::PREFIX.'id', 'data', $this->equalTo(time() + self::TTL, 2)) - ->will($this->returnValue(true)) - ; + ->with(self::PREFIX . 'id', 'data', $this->equalTo(time() + self::TTL, 2)) + ->will($this->returnValue(TRUE)); $this->assertTrue($this->storage->write('id', 'data')); } - public function testDestroySession() - { + public function testDestroySession() { $this->memcached ->expects($this->once()) ->method('delete') - ->with(self::PREFIX.'id') - ->will($this->returnValue(true)) - ; + ->with(self::PREFIX . 'id') + ->will($this->returnValue(TRUE)); $this->assertTrue($this->storage->destroy('id')); } - public function testGcSession() - { + public function testGcSession() { $this->assertTrue($this->storage->gc(123)); } /** * @dataProvider getOptionFixtures */ - public function testSupportedOptions($options, $supported) - { + public function testSupportedOptions($options, $supported) { try { new MemcachedSessionHandler($this->memcached, $options); $this->assertTrue($supported); @@ -119,20 +107,18 @@ class MemcachedSessionHandlerTest extends TestCase } } - public function getOptionFixtures() - { + public function getOptionFixtures() { return array( - array(array('prefix' => 'session'), true), - array(array('expiretime' => 100), true), - array(array('prefix' => 'session', 'expiretime' => 200), true), - array(array('expiretime' => 100, 'foo' => 'bar'), false), + array(array('prefix' => 'session'), TRUE), + array(array('expiretime' => 100), TRUE), + array(array('prefix' => 'session', 'expiretime' => 200), TRUE), + array(array('expiretime' => 100, 'foo' => 'bar'), FALSE), ); } - public function testGetConnection() - { + public function testGetConnection() { $method = new \ReflectionMethod($this->storage, 'getMemcached'); - $method->setAccessible(true); + $method->setAccessible(TRUE); $this->assertInstanceOf('\Memcached', $method->invoke($this->storage)); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php index da05109..c09d47c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php @@ -28,15 +28,14 @@ class MongoDbSessionHandlerTest extends TestCase private $storage; public $options; - protected function setUp() - { + protected function setUp() { parent::setUp(); if (extension_loaded('mongodb')) { if (!class_exists('MongoDB\Client')) { $this->markTestSkipped('The mongodb/mongodb package is required.'); } - } elseif (!extension_loaded('mongo')) { + } else if (!extension_loaded('mongo')) { $this->markTestSkipped('The Mongo or MongoDB extension is required.'); } @@ -65,31 +64,26 @@ class MongoDbSessionHandlerTest extends TestCase /** * @expectedException \InvalidArgumentException */ - public function testConstructorShouldThrowExceptionForInvalidMongo() - { + public function testConstructorShouldThrowExceptionForInvalidMongo() { new MongoDbSessionHandler(new \stdClass(), $this->options); } /** * @expectedException \InvalidArgumentException */ - public function testConstructorShouldThrowExceptionForMissingOptions() - { + public function testConstructorShouldThrowExceptionForMissingOptions() { new MongoDbSessionHandler($this->mongo, array()); } - public function testOpenMethodAlwaysReturnTrue() - { + public function testOpenMethodAlwaysReturnTrue() { $this->assertTrue($this->storage->open('test', 'test'), 'The "open" method should always return true'); } - public function testCloseMethodAlwaysReturnTrue() - { + public function testCloseMethodAlwaysReturnTrue() { $this->assertTrue($this->storage->close(), 'The "close" method should always return true'); } - public function testRead() - { + public function testRead() { $collection = $this->createMongoCollectionMock(); $this->mongo->expects($this->once()) @@ -112,7 +106,7 @@ class MongoDbSessionHandlerTest extends TestCase if (phpversion('mongodb')) { $this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $criteria[$this->options['expiry_field']]['$gte']); - $this->assertGreaterThanOrEqual(round((string) $criteria[$this->options['expiry_field']]['$gte'] / 1000), $testTimeout); + $this->assertGreaterThanOrEqual(round((string)$criteria[$this->options['expiry_field']]['$gte'] / 1000), $testTimeout); } else { $this->assertInstanceOf('MongoDate', $criteria[$this->options['expiry_field']]['$gte']); $this->assertGreaterThanOrEqual($criteria[$this->options['expiry_field']]['$gte']->sec, $testTimeout); @@ -136,8 +130,7 @@ class MongoDbSessionHandlerTest extends TestCase $this->assertEquals('bar', $this->storage->read('foo')); } - public function testWrite() - { + public function testWrite() { $collection = $this->createMongoCollectionMock(); $this->mongo->expects($this->once()) @@ -155,22 +148,22 @@ class MongoDbSessionHandlerTest extends TestCase $this->assertEquals(array($this->options['id_field'] => 'foo'), $criteria); if (phpversion('mongodb')) { - $this->assertEquals(array('upsert' => true), $options); + $this->assertEquals(array('upsert' => TRUE), $options); } else { - $this->assertEquals(array('upsert' => true, 'multiple' => false), $options); + $this->assertEquals(array('upsert' => TRUE, 'multiple' => FALSE), $options); } $data = $updateData['$set']; })); - $expectedExpiry = time() + (int) ini_get('session.gc_maxlifetime'); + $expectedExpiry = time() + (int)ini_get('session.gc_maxlifetime'); $this->assertTrue($this->storage->write('foo', 'bar')); if (phpversion('mongodb')) { $this->assertEquals('bar', $data[$this->options['data_field']]->getData()); $this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$this->options['time_field']]); $this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$this->options['expiry_field']]); - $this->assertGreaterThanOrEqual($expectedExpiry, round((string) $data[$this->options['expiry_field']] / 1000)); + $this->assertGreaterThanOrEqual($expectedExpiry, round((string)$data[$this->options['expiry_field']] / 1000)); } else { $this->assertEquals('bar', $data[$this->options['data_field']]->bin); $this->assertInstanceOf('MongoDate', $data[$this->options['time_field']]); @@ -179,8 +172,7 @@ class MongoDbSessionHandlerTest extends TestCase } } - public function testWriteWhenUsingExpiresField() - { + public function testWriteWhenUsingExpiresField() { $this->options = array( 'id_field' => '_id', 'data_field' => 'data', @@ -209,9 +201,9 @@ class MongoDbSessionHandlerTest extends TestCase $this->assertEquals(array($this->options['id_field'] => 'foo'), $criteria); if (phpversion('mongodb')) { - $this->assertEquals(array('upsert' => true), $options); + $this->assertEquals(array('upsert' => TRUE), $options); } else { - $this->assertEquals(array('upsert' => true, 'multiple' => false), $options); + $this->assertEquals(array('upsert' => TRUE, 'multiple' => FALSE), $options); } $data = $updateData['$set']; @@ -230,8 +222,7 @@ class MongoDbSessionHandlerTest extends TestCase } } - public function testReplaceSessionData() - { + public function testReplaceSessionData() { $collection = $this->createMongoCollectionMock(); $this->mongo->expects($this->once()) @@ -259,8 +250,7 @@ class MongoDbSessionHandlerTest extends TestCase } } - public function testDestroy() - { + public function testDestroy() { $collection = $this->createMongoCollectionMock(); $this->mongo->expects($this->once()) @@ -277,8 +267,7 @@ class MongoDbSessionHandlerTest extends TestCase $this->assertTrue($this->storage->destroy('foo')); } - public function testGc() - { + public function testGc() { $collection = $this->createMongoCollectionMock(); $this->mongo->expects($this->once()) @@ -293,7 +282,7 @@ class MongoDbSessionHandlerTest extends TestCase ->will($this->returnCallback(function ($criteria) { if (phpversion('mongodb')) { $this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $criteria[$this->options['expiry_field']]['$lt']); - $this->assertGreaterThanOrEqual(time() - 1, round((string) $criteria[$this->options['expiry_field']]['$lt'] / 1000)); + $this->assertGreaterThanOrEqual(time() - 1, round((string)$criteria[$this->options['expiry_field']]['$lt'] / 1000)); } else { $this->assertInstanceOf('MongoDate', $criteria[$this->options['expiry_field']]['$lt']); $this->assertGreaterThanOrEqual(time() - 1, $criteria[$this->options['expiry_field']]['$lt']->sec); @@ -303,10 +292,9 @@ class MongoDbSessionHandlerTest extends TestCase $this->assertTrue($this->storage->gc(1)); } - public function testGetConnection() - { + public function testGetConnection() { $method = new \ReflectionMethod($this->storage, 'getMongo'); - $method->setAccessible(true); + $method->setAccessible(TRUE); if (phpversion('mongodb')) { $mongoClass = 'MongoDB\Client'; @@ -317,8 +305,7 @@ class MongoDbSessionHandlerTest extends TestCase $this->assertInstanceOf($mongoClass, $method->invoke($this->storage)); } - private function createMongoCollectionMock() - { + private function createMongoCollectionMock() { $collectionClass = 'MongoCollection'; if (phpversion('mongodb')) { $collectionClass = 'MongoDB\Collection'; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php index a6264e5..e911339 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php @@ -25,8 +25,7 @@ use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; */ class NativeFileSessionHandlerTest extends TestCase { - public function testConstruct() - { + public function testConstruct() { $storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeFileSessionHandler(sys_get_temp_dir())); $this->assertEquals('files', $storage->getSaveHandler()->getSaveHandlerName()); @@ -39,8 +38,7 @@ class NativeFileSessionHandlerTest extends TestCase /** * @dataProvider savePathDataProvider */ - public function testConstructSavePath($savePath, $expectedSavePath, $path) - { + public function testConstructSavePath($savePath, $expectedSavePath, $path) { $handler = new NativeFileSessionHandler($savePath); $this->assertEquals($expectedSavePath, ini_get('session.save_path')); $this->assertTrue(is_dir(realpath($path))); @@ -48,8 +46,7 @@ class NativeFileSessionHandlerTest extends TestCase rmdir($path); } - public function savePathDataProvider() - { + public function savePathDataProvider() { $base = sys_get_temp_dir(); return array( @@ -62,13 +59,11 @@ class NativeFileSessionHandlerTest extends TestCase /** * @expectedException \InvalidArgumentException */ - public function testConstructException() - { + public function testConstructException() { $handler = new NativeFileSessionHandler('something;invalid;with;too-many-args'); } - public function testConstructDefault() - { + public function testConstructDefault() { $path = ini_get('session.save_path'); $storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeFileSessionHandler()); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeSessionHandlerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeSessionHandlerTest.php index 4a9fb60..07fa8c7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeSessionHandlerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NativeSessionHandlerTest.php @@ -28,8 +28,7 @@ class NativeSessionHandlerTest extends TestCase /** * @expectedDeprecation The Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler class is deprecated since Symfony 3.4 and will be removed in 4.0. Use the \SessionHandler class instead. */ - public function testConstruct() - { + public function testConstruct() { $handler = new NativeSessionHandler(); $this->assertInstanceOf('SessionHandler', $handler); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php index 718fd0f..9659796 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/NullSessionHandlerTest.php @@ -26,14 +26,12 @@ use Symfony\Component\HttpFoundation\Session\Session; */ class NullSessionHandlerTest extends TestCase { - public function testSaveHandlers() - { + public function testSaveHandlers() { $storage = $this->getStorage(); $this->assertEquals('user', ini_get('session.save_handler')); } - public function testSession() - { + public function testSession() { session_id('nullsessionstorage'); $storage = $this->getStorage(); $session = new Session($storage); @@ -42,8 +40,7 @@ class NullSessionHandlerTest extends TestCase $this->assertEquals('unique', $session->get('something')); } - public function testNothingIsPersisted() - { + public function testNothingIsPersisted() { session_id('nullsessionstorage'); $storage = $this->getStorage(); $session = new Session($storage); @@ -52,8 +49,7 @@ class NullSessionHandlerTest extends TestCase $this->assertNull($session->get('something')); } - public function getStorage() - { + public function getStorage() { return new NativeSessionStorage(array(), new NullSessionHandler()); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php index 0a0e449..02636df 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/PdoSessionHandlerTest.php @@ -22,8 +22,7 @@ class PdoSessionHandlerTest extends TestCase { private $dbFile; - protected function tearDown() - { + protected function tearDown() { // make sure the temporary database file is deleted when it has been created (even when a test fails) if ($this->dbFile) { @unlink($this->dbFile); @@ -31,15 +30,13 @@ class PdoSessionHandlerTest extends TestCase parent::tearDown(); } - protected function getPersistentSqliteDsn() - { + protected function getPersistentSqliteDsn() { $this->dbFile = tempnam(sys_get_temp_dir(), 'sf2_sqlite_sessions'); - return 'sqlite:'.$this->dbFile; + return 'sqlite:' . $this->dbFile; } - protected function getMemorySqlitePdo() - { + protected function getMemorySqlitePdo() { $pdo = new \PDO('sqlite::memory:'); $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $storage = new PdoSessionHandler($pdo); @@ -51,8 +48,7 @@ class PdoSessionHandlerTest extends TestCase /** * @expectedException \InvalidArgumentException */ - public function testWrongPdoErrMode() - { + public function testWrongPdoErrMode() { $pdo = $this->getMemorySqlitePdo(); $pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_SILENT); @@ -62,8 +58,7 @@ class PdoSessionHandlerTest extends TestCase /** * @expectedException \RuntimeException */ - public function testInexistentTable() - { + public function testInexistentTable() { $storage = new PdoSessionHandler($this->getMemorySqlitePdo(), array('db_table' => 'inexistent_table')); $storage->open('', 'sid'); $storage->read('id'); @@ -74,14 +69,12 @@ class PdoSessionHandlerTest extends TestCase /** * @expectedException \RuntimeException */ - public function testCreateTableTwice() - { + public function testCreateTableTwice() { $storage = new PdoSessionHandler($this->getMemorySqlitePdo()); $storage->createTable(); } - public function testWithLazyDsnConnection() - { + public function testWithLazyDsnConnection() { $dsn = $this->getPersistentSqliteDsn(); $storage = new PdoSessionHandler($dsn); @@ -98,12 +91,11 @@ class PdoSessionHandlerTest extends TestCase $this->assertSame('data', $data, 'Written value can be read back correctly'); } - public function testWithLazySavePathConnection() - { + public function testWithLazySavePathConnection() { $dsn = $this->getPersistentSqliteDsn(); // Open is called with what ini_set('session.save_path', $dsn) would mean - $storage = new PdoSessionHandler(null); + $storage = new PdoSessionHandler(NULL); $storage->open($dsn, 'sid'); $storage->createTable(); $data = $storage->read('id'); @@ -117,9 +109,8 @@ class PdoSessionHandlerTest extends TestCase $this->assertSame('data', $data, 'Written value can be read back correctly'); } - public function testReadWriteReadWithNullByte() - { - $sessionData = 'da'."\0".'ta'; + public function testReadWriteReadWithNullByte() { + $sessionData = 'da' . "\0" . 'ta'; $storage = new PdoSessionHandler($this->getMemorySqlitePdo()); $storage->open('', 'sid'); @@ -134,8 +125,7 @@ class PdoSessionHandlerTest extends TestCase $this->assertSame($sessionData, $readData, 'Written value can be read back correctly'); } - public function testReadConvertsStreamToString() - { + public function testReadConvertsStreamToString() { if (defined('HHVM_VERSION')) { $this->markTestSkipped('PHPUnit_MockObject cannot mock the PDOStatement class on HHVM. See https://github.com/sebastianbergmann/phpunit-mock-objects/pull/289'); } @@ -155,8 +145,7 @@ class PdoSessionHandlerTest extends TestCase $this->assertSame($content, $result); } - public function testReadLockedConvertsStreamToString() - { + public function testReadLockedConvertsStreamToString() { if (defined('HHVM_VERSION')) { $this->markTestSkipped('PHPUnit_MockObject cannot mock the PDOStatement class on HHVM. See https://github.com/sebastianbergmann/phpunit-mock-objects/pull/289'); } @@ -174,7 +163,7 @@ class PdoSessionHandlerTest extends TestCase $content = 'foobar'; $stream = $this->createStream($content); - $exception = null; + $exception = NULL; $selectStmt->expects($this->atLeast(2))->method('fetchAll') ->will($this->returnCallback(function () use (&$exception, $stream) { @@ -192,8 +181,7 @@ class PdoSessionHandlerTest extends TestCase $this->assertSame($content, $result); } - public function testReadingRequiresExactlySameId() - { + public function testReadingRequiresExactlySameId() { $storage = new PdoSessionHandler($this->getMemorySqlitePdo()); $storage->open('', 'sid'); $storage->write('id', 'data'); @@ -217,8 +205,7 @@ class PdoSessionHandlerTest extends TestCase /** * Simulates session_regenerate_id(true) which will require an INSERT or UPDATE (replace). */ - public function testWriteDifferentSessionIdThanRead() - { + public function testWriteDifferentSessionIdThanRead() { $storage = new PdoSessionHandler($this->getMemorySqlitePdo()); $storage->open('', 'sid'); $storage->read('id'); @@ -233,8 +220,7 @@ class PdoSessionHandlerTest extends TestCase $this->assertSame('data_of_new_session_id', $data, 'Data of regenerated session id is available'); } - public function testWrongUsageStillWorks() - { + public function testWrongUsageStillWorks() { // wrong method sequence that should no happen, but still works $storage = new PdoSessionHandler($this->getMemorySqlitePdo()); $storage->write('id', 'data'); @@ -249,8 +235,7 @@ class PdoSessionHandlerTest extends TestCase $this->assertSame('other_data', $otherData); } - public function testSessionDestroy() - { + public function testSessionDestroy() { $pdo = $this->getMemorySqlitePdo(); $storage = new PdoSessionHandler($pdo); @@ -275,8 +260,7 @@ class PdoSessionHandlerTest extends TestCase /** * @runInSeparateProcess */ - public function testSessionGC() - { + public function testSessionGC() { $previousLifeTime = ini_set('session.gc_maxlifetime', 1000); $pdo = $this->getMemorySqlitePdo(); $storage = new PdoSessionHandler($pdo); @@ -304,22 +288,20 @@ class PdoSessionHandlerTest extends TestCase $this->assertEquals(1, $pdo->query('SELECT COUNT(*) FROM sessions')->fetchColumn(), 'Expired session is pruned'); } - public function testGetConnection() - { + public function testGetConnection() { $storage = new PdoSessionHandler($this->getMemorySqlitePdo()); $method = new \ReflectionMethod($storage, 'getConnection'); - $method->setAccessible(true); + $method->setAccessible(TRUE); $this->assertInstanceOf('\PDO', $method->invoke($storage)); } - public function testGetConnectionConnectsIfNeeded() - { + public function testGetConnectionConnectsIfNeeded() { $storage = new PdoSessionHandler('sqlite::memory:'); $method = new \ReflectionMethod($storage, 'getConnection'); - $method->setAccessible(true); + $method->setAccessible(TRUE); $this->assertInstanceOf('\PDO', $method->invoke($storage)); } @@ -327,23 +309,21 @@ class PdoSessionHandlerTest extends TestCase /** * @dataProvider provideUrlDsnPairs */ - public function testUrlDsn($url, $expectedDsn, $expectedUser = null, $expectedPassword = null) - { + public function testUrlDsn($url, $expectedDsn, $expectedUser = NULL, $expectedPassword = NULL) { $storage = new PdoSessionHandler($url); $this->assertAttributeEquals($expectedDsn, 'dsn', $storage); - if (null !== $expectedUser) { + if (NULL !== $expectedUser) { $this->assertAttributeEquals($expectedUser, 'username', $storage); } - if (null !== $expectedPassword) { + if (NULL !== $expectedPassword) { $this->assertAttributeEquals($expectedPassword, 'password', $storage); } } - public function provideUrlDsnPairs() - { + public function provideUrlDsnPairs() { yield array('mysql://localhost/test', 'mysql:host=localhost;dbname=test;'); yield array('mysql://localhost:56/test', 'mysql:host=localhost;port=56;dbname=test;'); yield array('mysql2://root:pwd@localhost/test', 'mysql:host=localhost;dbname=test;', 'root', 'pwd'); @@ -359,8 +339,7 @@ class PdoSessionHandlerTest extends TestCase yield array('mssql://localhost:56/test', 'sqlsrv:server=localhost,56;Database=test'); } - private function createStream($content) - { + private function createStream($content) { $stream = tmpfile(); fwrite($stream, $content); fseek($stream, 0); @@ -375,14 +354,12 @@ class MockPdo extends \PDO private $driverName; private $errorMode; - public function __construct($driverName = null, $errorMode = null) - { + public function __construct($driverName = NULL, $errorMode = NULL) { $this->driverName = $driverName; - $this->errorMode = null !== $errorMode ?: \PDO::ERRMODE_EXCEPTION; + $this->errorMode = NULL !== $errorMode ?: \PDO::ERRMODE_EXCEPTION; } - public function getAttribute($attribute) - { + public function getAttribute($attribute) { if (\PDO::ATTR_ERRMODE === $attribute) { return $this->errorMode; } @@ -394,18 +371,15 @@ class MockPdo extends \PDO return parent::getAttribute($attribute); } - public function prepare($statement, $driverOptions = array()) - { + public function prepare($statement, $driverOptions = array()) { return is_callable($this->prepareResult) ? call_user_func($this->prepareResult, $statement, $driverOptions) : $this->prepareResult; } - public function beginTransaction() - { + public function beginTransaction() { } - public function rollBack() - { + public function rollBack() { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php index b02c41a..c2602f5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/StrictSessionHandlerTest.php @@ -17,11 +17,10 @@ use Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandle class StrictSessionHandlerTest extends TestCase { - public function testOpen() - { + public function testOpen() { $handler = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $handler->expects($this->once())->method('open') - ->with('path', 'name')->willReturn(true); + ->with('path', 'name')->willReturn(TRUE); $proxy = new StrictSessionHandler($handler); $this->assertInstanceOf('SessionUpdateTimestampHandlerInterface', $proxy); @@ -29,18 +28,16 @@ class StrictSessionHandlerTest extends TestCase $this->assertTrue($proxy->open('path', 'name')); } - public function testCloseSession() - { + public function testCloseSession() { $handler = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $handler->expects($this->once())->method('close') - ->willReturn(true); + ->willReturn(TRUE); $proxy = new StrictSessionHandler($handler); $this->assertTrue($proxy->close()); } - public function testValidateIdOK() - { + public function testValidateIdOK() { $handler = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $handler->expects($this->once())->method('read') ->with('id')->willReturn('data'); @@ -49,8 +46,7 @@ class StrictSessionHandlerTest extends TestCase $this->assertTrue($proxy->validateId('id')); } - public function testValidateIdKO() - { + public function testValidateIdKO() { $handler = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $handler->expects($this->once())->method('read') ->with('id')->willReturn(''); @@ -59,8 +55,7 @@ class StrictSessionHandlerTest extends TestCase $this->assertFalse($proxy->validateId('id')); } - public function testRead() - { + public function testRead() { $handler = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $handler->expects($this->once())->method('read') ->with('id')->willReturn('data'); @@ -69,8 +64,7 @@ class StrictSessionHandlerTest extends TestCase $this->assertSame('data', $proxy->read('id')); } - public function testReadWithValidateIdOK() - { + public function testReadWithValidateIdOK() { $handler = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $handler->expects($this->once())->method('read') ->with('id')->willReturn('data'); @@ -80,8 +74,7 @@ class StrictSessionHandlerTest extends TestCase $this->assertSame('data', $proxy->read('id')); } - public function testReadWithValidateIdMismatch() - { + public function testReadWithValidateIdMismatch() { $handler = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $handler->expects($this->exactly(2))->method('read') ->withConsecutive(array('id1'), array('id2')) @@ -92,33 +85,30 @@ class StrictSessionHandlerTest extends TestCase $this->assertSame('data2', $proxy->read('id2')); } - public function testUpdateTimestamp() - { + public function testUpdateTimestamp() { $handler = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $handler->expects($this->once())->method('write') - ->with('id', 'data')->willReturn(true); + ->with('id', 'data')->willReturn(TRUE); $proxy = new StrictSessionHandler($handler); $this->assertTrue($proxy->updateTimestamp('id', 'data')); } - public function testWrite() - { + public function testWrite() { $handler = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $handler->expects($this->once())->method('write') - ->with('id', 'data')->willReturn(true); + ->with('id', 'data')->willReturn(TRUE); $proxy = new StrictSessionHandler($handler); $this->assertTrue($proxy->write('id', 'data')); } - public function testWriteEmptyNewSession() - { + public function testWriteEmptyNewSession() { $handler = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $handler->expects($this->once())->method('read') ->with('id')->willReturn(''); $handler->expects($this->never())->method('write'); - $handler->expects($this->once())->method('destroy')->willReturn(true); + $handler->expects($this->once())->method('destroy')->willReturn(TRUE); $proxy = new StrictSessionHandler($handler); $this->assertFalse($proxy->validateId('id')); @@ -126,50 +116,46 @@ class StrictSessionHandlerTest extends TestCase $this->assertTrue($proxy->write('id', '')); } - public function testWriteEmptyExistingSession() - { + public function testWriteEmptyExistingSession() { $handler = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $handler->expects($this->once())->method('read') ->with('id')->willReturn('data'); $handler->expects($this->never())->method('write'); - $handler->expects($this->once())->method('destroy')->willReturn(true); + $handler->expects($this->once())->method('destroy')->willReturn(TRUE); $proxy = new StrictSessionHandler($handler); $this->assertSame('data', $proxy->read('id')); $this->assertTrue($proxy->write('id', '')); } - public function testDestroy() - { + public function testDestroy() { $handler = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $handler->expects($this->once())->method('destroy') - ->with('id')->willReturn(true); + ->with('id')->willReturn(TRUE); $proxy = new StrictSessionHandler($handler); $this->assertTrue($proxy->destroy('id')); } - public function testDestroyNewSession() - { + public function testDestroyNewSession() { $handler = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $handler->expects($this->once())->method('read') ->with('id')->willReturn(''); - $handler->expects($this->once())->method('destroy')->willReturn(true); + $handler->expects($this->once())->method('destroy')->willReturn(TRUE); $proxy = new StrictSessionHandler($handler); $this->assertSame('', $proxy->read('id')); $this->assertTrue($proxy->destroy('id')); } - public function testDestroyNonEmptyNewSession() - { + public function testDestroyNonEmptyNewSession() { $handler = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $handler->expects($this->once())->method('read') ->with('id')->willReturn(''); $handler->expects($this->once())->method('write') - ->with('id', 'data')->willReturn(true); + ->with('id', 'data')->willReturn(TRUE); $handler->expects($this->once())->method('destroy') - ->with('id')->willReturn(true); + ->with('id')->willReturn(TRUE); $proxy = new StrictSessionHandler($handler); $this->assertSame('', $proxy->read('id')); @@ -177,11 +163,10 @@ class StrictSessionHandlerTest extends TestCase $this->assertTrue($proxy->destroy('id')); } - public function testGc() - { + public function testGc() { $handler = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $handler->expects($this->once())->method('gc') - ->with(123)->willReturn(true); + ->with(123)->willReturn(TRUE); $proxy = new StrictSessionHandler($handler); $this->assertTrue($proxy->gc(123)); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/WriteCheckSessionHandlerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/WriteCheckSessionHandlerTest.php index 898a7d1..b2edbf5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/WriteCheckSessionHandlerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Handler/WriteCheckSessionHandlerTest.php @@ -21,8 +21,7 @@ use Symfony\Component\HttpFoundation\Session\Storage\Handler\WriteCheckSessionHa */ class WriteCheckSessionHandlerTest extends TestCase { - public function test() - { + public function test() { $wrappedSessionHandlerMock = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $writeCheckSessionHandler = new WriteCheckSessionHandler($wrappedSessionHandlerMock); @@ -30,14 +29,12 @@ class WriteCheckSessionHandlerTest extends TestCase ->expects($this->once()) ->method('close') ->with() - ->will($this->returnValue(true)) - ; + ->will($this->returnValue(TRUE)); $this->assertTrue($writeCheckSessionHandler->close()); } - public function testWrite() - { + public function testWrite() { $wrappedSessionHandlerMock = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $writeCheckSessionHandler = new WriteCheckSessionHandler($wrappedSessionHandlerMock); @@ -45,14 +42,12 @@ class WriteCheckSessionHandlerTest extends TestCase ->expects($this->once()) ->method('write') ->with('foo', 'bar') - ->will($this->returnValue(true)) - ; + ->will($this->returnValue(TRUE)); $this->assertTrue($writeCheckSessionHandler->write('foo', 'bar')); } - public function testSkippedWrite() - { + public function testSkippedWrite() { $wrappedSessionHandlerMock = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $writeCheckSessionHandler = new WriteCheckSessionHandler($wrappedSessionHandlerMock); @@ -60,20 +55,17 @@ class WriteCheckSessionHandlerTest extends TestCase ->expects($this->once()) ->method('read') ->with('foo') - ->will($this->returnValue('bar')) - ; + ->will($this->returnValue('bar')); $wrappedSessionHandlerMock ->expects($this->never()) - ->method('write') - ; + ->method('write'); $this->assertEquals('bar', $writeCheckSessionHandler->read('foo')); $this->assertTrue($writeCheckSessionHandler->write('foo', 'bar')); } - public function testNonSkippedWrite() - { + public function testNonSkippedWrite() { $wrappedSessionHandlerMock = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $writeCheckSessionHandler = new WriteCheckSessionHandler($wrappedSessionHandlerMock); @@ -81,15 +73,13 @@ class WriteCheckSessionHandlerTest extends TestCase ->expects($this->once()) ->method('read') ->with('foo') - ->will($this->returnValue('bar')) - ; + ->will($this->returnValue('bar')); $wrappedSessionHandlerMock ->expects($this->once()) ->method('write') ->with('foo', 'baZZZ') - ->will($this->returnValue(true)) - ; + ->will($this->returnValue(TRUE)); $this->assertEquals('bar', $writeCheckSessionHandler->read('foo')); $this->assertTrue($writeCheckSessionHandler->write('foo', 'baZZZ')); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/MetadataBagTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/MetadataBagTest.php index 69cf616..3e43496 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/MetadataBagTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/MetadataBagTest.php @@ -28,23 +28,20 @@ class MetadataBagTest extends TestCase protected $array = array(); - protected function setUp() - { + protected function setUp() { parent::setUp(); $this->bag = new MetadataBag(); $this->array = array(MetadataBag::CREATED => 1234567, MetadataBag::UPDATED => 12345678, MetadataBag::LIFETIME => 0); $this->bag->initialize($this->array); } - protected function tearDown() - { + protected function tearDown() { $this->array = array(); - $this->bag = null; + $this->bag = NULL; parent::tearDown(); } - public function testInitialize() - { + public function testInitialize() { $sessionMetadata = array(); $bag1 = new MetadataBag(); @@ -67,46 +64,39 @@ class MetadataBagTest extends TestCase $this->assertNotEquals($bag3->getCreated(), $bag3->getLastUsed()); } - public function testGetSetName() - { + public function testGetSetName() { $this->assertEquals('__metadata', $this->bag->getName()); $this->bag->setName('foo'); $this->assertEquals('foo', $this->bag->getName()); } - public function testGetStorageKey() - { + public function testGetStorageKey() { $this->assertEquals('_sf2_meta', $this->bag->getStorageKey()); } - public function testGetLifetime() - { + public function testGetLifetime() { $bag = new MetadataBag(); $array = array(MetadataBag::CREATED => 1234567, MetadataBag::UPDATED => 12345678, MetadataBag::LIFETIME => 1000); $bag->initialize($array); $this->assertEquals(1000, $bag->getLifetime()); } - public function testGetCreated() - { + public function testGetCreated() { $this->assertEquals(1234567, $this->bag->getCreated()); } - public function testGetLastUsed() - { + public function testGetLastUsed() { $this->assertLessThanOrEqual(time(), $this->bag->getLastUsed()); } - public function testClear() - { + public function testClear() { $this->bag->clear(); // the clear method has no side effects, we just want to ensure it doesn't trigger any exceptions $this->addToAssertionCount(1); } - public function testSkipLastUsedUpdate() - { + public function testSkipLastUsedUpdate() { $bag = new MetadataBag('', 30); $timeStamp = time(); @@ -121,8 +111,7 @@ class MetadataBagTest extends TestCase $this->assertEquals($created, $sessionMetadata[MetadataBag::UPDATED]); } - public function testDoesNotSkipLastUsedUpdate() - { + public function testDoesNotSkipLastUsedUpdate() { $bag = new MetadataBag('', 30); $timeStamp = time(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/MockArraySessionStorageTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/MockArraySessionStorageTest.php index 82df554..339c557 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/MockArraySessionStorageTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/MockArraySessionStorageTest.php @@ -40,15 +40,14 @@ class MockArraySessionStorageTest extends TestCase private $data; - protected function setUp() - { + protected function setUp() { $this->attributes = new AttributeBag(); $this->flashes = new FlashBag(); $this->data = array( $this->attributes->getStorageKey() => array('foo' => 'bar'), $this->flashes->getStorageKey() => array('notice' => 'hello'), - ); + ); $this->storage = new MockArraySessionStorage(); $this->storage->registerBag($this->flashes); @@ -56,16 +55,14 @@ class MockArraySessionStorageTest extends TestCase $this->storage->setSessionData($this->data); } - protected function tearDown() - { - $this->data = null; - $this->flashes = null; - $this->attributes = null; - $this->storage = null; + protected function tearDown() { + $this->data = NULL; + $this->flashes = NULL; + $this->attributes = NULL; + $this->storage = NULL; } - public function testStart() - { + public function testStart() { $this->assertEquals('', $this->storage->getId()); $this->storage->start(); $id = $this->storage->getId(); @@ -74,8 +71,7 @@ class MockArraySessionStorageTest extends TestCase $this->assertEquals($id, $this->storage->getId()); } - public function testRegenerate() - { + public function testRegenerate() { $this->storage->start(); $id = $this->storage->getId(); $this->storage->regenerate(); @@ -84,36 +80,32 @@ class MockArraySessionStorageTest extends TestCase $this->assertEquals(array('notice' => 'hello'), $this->storage->getBag('flashes')->peekAll()); $id = $this->storage->getId(); - $this->storage->regenerate(true); + $this->storage->regenerate(TRUE); $this->assertNotEquals($id, $this->storage->getId()); $this->assertEquals(array('foo' => 'bar'), $this->storage->getBag('attributes')->all()); $this->assertEquals(array('notice' => 'hello'), $this->storage->getBag('flashes')->peekAll()); } - public function testGetId() - { + public function testGetId() { $this->assertEquals('', $this->storage->getId()); $this->storage->start(); $this->assertNotEquals('', $this->storage->getId()); } - public function testClearClearsBags() - { + public function testClearClearsBags() { $this->storage->clear(); $this->assertSame(array(), $this->storage->getBag('attributes')->all()); $this->assertSame(array(), $this->storage->getBag('flashes')->peekAll()); } - public function testClearStartsSession() - { + public function testClearStartsSession() { $this->storage->clear(); $this->assertTrue($this->storage->isStarted()); } - public function testClearWithNoBagsStartsSession() - { + public function testClearWithNoBagsStartsSession() { $storage = new MockArraySessionStorage(); $storage->clear(); @@ -124,8 +116,7 @@ class MockArraySessionStorageTest extends TestCase /** * @expectedException \RuntimeException */ - public function testUnstartedSave() - { + public function testUnstartedSave() { $this->storage->save(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php index 53accd3..fa4e4a9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php @@ -33,24 +33,21 @@ class MockFileSessionStorageTest extends TestCase */ protected $storage; - protected function setUp() - { - $this->sessionDir = sys_get_temp_dir().'/sf2test'; + protected function setUp() { + $this->sessionDir = sys_get_temp_dir() . '/sf2test'; $this->storage = $this->getStorage(); } - protected function tearDown() - { - $this->sessionDir = null; - $this->storage = null; - array_map('unlink', glob($this->sessionDir.'/*.session')); + protected function tearDown() { + $this->sessionDir = NULL; + $this->storage = NULL; + array_map('unlink', glob($this->sessionDir . '/*.session')); if (is_dir($this->sessionDir)) { rmdir($this->sessionDir); } } - public function testStart() - { + public function testStart() { $this->assertEquals('', $this->storage->getId()); $this->assertTrue($this->storage->start()); $id = $this->storage->getId(); @@ -59,25 +56,22 @@ class MockFileSessionStorageTest extends TestCase $this->assertEquals($id, $this->storage->getId()); } - public function testRegenerate() - { + public function testRegenerate() { $this->storage->start(); $this->storage->getBag('attributes')->set('regenerate', 1234); $this->storage->regenerate(); $this->assertEquals(1234, $this->storage->getBag('attributes')->get('regenerate')); - $this->storage->regenerate(true); + $this->storage->regenerate(TRUE); $this->assertEquals(1234, $this->storage->getBag('attributes')->get('regenerate')); } - public function testGetId() - { + public function testGetId() { $this->assertEquals('', $this->storage->getId()); $this->storage->start(); $this->assertNotEquals('', $this->storage->getId()); } - public function testSave() - { + public function testSave() { $this->storage->start(); $id = $this->storage->getId(); $this->assertNotEquals('108', $this->storage->getBag('attributes')->get('new')); @@ -94,8 +88,7 @@ class MockFileSessionStorageTest extends TestCase $this->assertEquals(array('test'), $storage->getBag('flashes')->peek('newkey')); } - public function testMultipleInstances() - { + public function testMultipleInstances() { $storage1 = $this->getStorage(); $storage1->start(); $storage1->getBag('attributes')->set('foo', 'bar'); @@ -110,14 +103,12 @@ class MockFileSessionStorageTest extends TestCase /** * @expectedException \RuntimeException */ - public function testSaveWithoutStart() - { + public function testSaveWithoutStart() { $storage1 = $this->getStorage(); $storage1->save(); } - private function getStorage() - { + private function getStorage() { $storage = new MockFileSessionStorage($this->sessionDir); $storage->registerBag(new FlashBag()); $storage->registerBag(new AttributeBag()); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php index 8fb8b42..6648001 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php @@ -33,39 +33,35 @@ class NativeSessionStorageTest extends TestCase { private $savePath; - protected function setUp() - { + protected function setUp() { $this->iniSet('session.save_handler', 'files'); - $this->iniSet('session.save_path', $this->savePath = sys_get_temp_dir().'/sf2test'); + $this->iniSet('session.save_path', $this->savePath = sys_get_temp_dir() . '/sf2test'); if (!is_dir($this->savePath)) { mkdir($this->savePath); } } - protected function tearDown() - { + protected function tearDown() { session_write_close(); - array_map('unlink', glob($this->savePath.'/*')); + array_map('unlink', glob($this->savePath . '/*')); if (is_dir($this->savePath)) { rmdir($this->savePath); } - $this->savePath = null; + $this->savePath = NULL; } /** * @return NativeSessionStorage */ - protected function getStorage(array $options = array()) - { + protected function getStorage(array $options = array()) { $storage = new NativeSessionStorage($options); $storage->registerBag(new AttributeBag()); return $storage; } - public function testBag() - { + public function testBag() { $storage = $this->getStorage(); $bag = new FlashBag(); $storage->registerBag($bag); @@ -75,8 +71,7 @@ class NativeSessionStorageTest extends TestCase /** * @expectedException \InvalidArgumentException */ - public function testRegisterBagException() - { + public function testRegisterBagException() { $storage = $this->getStorage(); $storage->getBag('non_existing'); } @@ -84,15 +79,13 @@ class NativeSessionStorageTest extends TestCase /** * @expectedException \LogicException */ - public function testRegisterBagForAStartedSessionThrowsException() - { + public function testRegisterBagForAStartedSessionThrowsException() { $storage = $this->getStorage(); $storage->start(); $storage->registerBag(new AttributeBag()); } - public function testGetId() - { + public function testGetId() { $storage = $this->getStorage(); $this->assertSame('', $storage->getId(), 'Empty ID before starting session'); @@ -105,8 +98,7 @@ class NativeSessionStorageTest extends TestCase $this->assertSame($id, $storage->getId(), 'ID stays after saving session'); } - public function testRegenerate() - { + public function testRegenerate() { $storage = $this->getStorage(); $storage->start(); $id = $storage->getId(); @@ -116,19 +108,17 @@ class NativeSessionStorageTest extends TestCase $this->assertEquals(7, $storage->getBag('attributes')->get('lucky')); } - public function testRegenerateDestroy() - { + public function testRegenerateDestroy() { $storage = $this->getStorage(); $storage->start(); $id = $storage->getId(); $storage->getBag('attributes')->set('legs', 11); - $storage->regenerate(true); + $storage->regenerate(TRUE); $this->assertNotEquals($id, $storage->getId()); $this->assertEquals(11, $storage->getBag('attributes')->get('legs')); } - public function testSessionGlobalIsUpToDateAfterIdRegeneration() - { + public function testSessionGlobalIsUpToDateAfterIdRegeneration() { $storage = $this->getStorage(); $storage->start(); $storage->getBag('attributes')->set('lucky', 7); @@ -138,37 +128,33 @@ class NativeSessionStorageTest extends TestCase $this->assertEquals(42, $_SESSION['_sf2_attributes']['lucky']); } - public function testRegenerationFailureDoesNotFlagStorageAsStarted() - { + public function testRegenerationFailureDoesNotFlagStorageAsStarted() { $storage = $this->getStorage(); $this->assertFalse($storage->regenerate()); $this->assertFalse($storage->isStarted()); } - public function testDefaultSessionCacheLimiter() - { + public function testDefaultSessionCacheLimiter() { $this->iniSet('session.cache_limiter', 'nocache'); $storage = new NativeSessionStorage(); $this->assertEquals('', ini_get('session.cache_limiter')); } - public function testExplicitSessionCacheLimiter() - { + public function testExplicitSessionCacheLimiter() { $this->iniSet('session.cache_limiter', 'nocache'); $storage = new NativeSessionStorage(array('cache_limiter' => 'public')); $this->assertEquals('public', ini_get('session.cache_limiter')); } - public function testCookieOptions() - { + public function testCookieOptions() { $options = array( 'cookie_lifetime' => 123456, 'cookie_path' => '/my/cookie/path', 'cookie_domain' => 'symfony.example.com', - 'cookie_secure' => true, - 'cookie_httponly' => false, + 'cookie_secure' => TRUE, + 'cookie_httponly' => FALSE, ); $this->getStorage($options); @@ -176,7 +162,7 @@ class NativeSessionStorageTest extends TestCase $gco = array(); foreach ($temp as $key => $value) { - $gco['cookie_'.$key] = $value; + $gco['cookie_' . $key] = $value; } $this->assertEquals($options, $gco); @@ -185,19 +171,17 @@ class NativeSessionStorageTest extends TestCase /** * @expectedException \InvalidArgumentException */ - public function testSetSaveHandlerException() - { + public function testSetSaveHandlerException() { $storage = $this->getStorage(); $storage->setSaveHandler(new \stdClass()); } - public function testSetSaveHandler() - { + public function testSetSaveHandler() { $this->iniSet('session.save_handler', 'files'); $storage = $this->getStorage(); $storage->setSaveHandler(); $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy', $storage->getSaveHandler()); - $storage->setSaveHandler(null); + $storage->setSaveHandler(NULL); $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy', $storage->getSaveHandler()); $storage->setSaveHandler(new SessionHandlerProxy(new NativeFileSessionHandler())); $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy', $storage->getSaveHandler()); @@ -212,8 +196,7 @@ class NativeSessionStorageTest extends TestCase /** * @expectedException \RuntimeException */ - public function testStarted() - { + public function testStarted() { $storage = $this->getStorage(); $this->assertFalse($storage->getSaveHandler()->isActive()); @@ -231,8 +214,7 @@ class NativeSessionStorageTest extends TestCase $storage->start(); } - public function testRestart() - { + public function testRestart() { $storage = $this->getStorage(); $storage->start(); $id = $storage->getId(); @@ -243,8 +225,7 @@ class NativeSessionStorageTest extends TestCase $this->assertSame(7, $storage->getBag('attributes')->get('lucky'), 'Data still available'); } - public function testCanCreateNativeSessionStorageWhenSessionAlreadyStarted() - { + public function testCanCreateNativeSessionStorageWhenSessionAlreadyStarted() { session_start(); $this->getStorage(); @@ -252,8 +233,7 @@ class NativeSessionStorageTest extends TestCase $this->addToAssertionCount(1); } - public function testSetSessionOptionsOnceSessionStartedIsIgnored() - { + public function testSetSessionOptionsOnceSessionStartedIsIgnored() { session_start(); $this->getStorage(array( 'name' => 'something-else', @@ -263,8 +243,7 @@ class NativeSessionStorageTest extends TestCase $this->addToAssertionCount(1); } - public function testGetBagsOnceSessionStartedIsIgnored() - { + public function testGetBagsOnceSessionStartedIsIgnored() { session_start(); $bag = new AttributeBag(); $bag->setName('flashes'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php index 958dc0b..be6cefb 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php @@ -29,39 +29,35 @@ class PhpBridgeSessionStorageTest extends TestCase { private $savePath; - protected function setUp() - { + protected function setUp() { $this->iniSet('session.save_handler', 'files'); - $this->iniSet('session.save_path', $this->savePath = sys_get_temp_dir().'/sf2test'); + $this->iniSet('session.save_path', $this->savePath = sys_get_temp_dir() . '/sf2test'); if (!is_dir($this->savePath)) { mkdir($this->savePath); } } - protected function tearDown() - { + protected function tearDown() { session_write_close(); - array_map('unlink', glob($this->savePath.'/*')); + array_map('unlink', glob($this->savePath . '/*')); if (is_dir($this->savePath)) { rmdir($this->savePath); } - $this->savePath = null; + $this->savePath = NULL; } /** * @return PhpBridgeSessionStorage */ - protected function getStorage() - { + protected function getStorage() { $storage = new PhpBridgeSessionStorage(); $storage->registerBag(new AttributeBag()); return $storage; } - public function testPhpSession() - { + public function testPhpSession() { $storage = $this->getStorage(); $this->assertFalse($storage->getSaveHandler()->isActive()); @@ -80,8 +76,7 @@ class PhpBridgeSessionStorageTest extends TestCase $this->assertArrayHasKey($key, $_SESSION); } - public function testClear() - { + public function testClear() { $storage = $this->getStorage(); session_start(); $_SESSION['drak'] = 'loves symfony'; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php index cbb291f..399124c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php @@ -27,30 +27,25 @@ class AbstractProxyTest extends TestCase */ protected $proxy; - protected function setUp() - { + protected function setUp() { $this->proxy = $this->getMockForAbstractClass(AbstractProxy::class); } - protected function tearDown() - { - $this->proxy = null; + protected function tearDown() { + $this->proxy = NULL; } - public function testGetSaveHandlerName() - { + public function testGetSaveHandlerName() { $this->assertNull($this->proxy->getSaveHandlerName()); } - public function testIsSessionHandlerInterface() - { + public function testIsSessionHandlerInterface() { $this->assertFalse($this->proxy->isSessionHandlerInterface()); $sh = new SessionHandlerProxy(new \SessionHandler()); $this->assertTrue($sh->isSessionHandlerInterface()); } - public function testIsWrapper() - { + public function testIsWrapper() { $this->assertFalse($this->proxy->isWrapper()); } @@ -58,8 +53,7 @@ class AbstractProxyTest extends TestCase * @runInSeparateProcess * @preserveGlobalState disabled */ - public function testIsActive() - { + public function testIsActive() { $this->assertFalse($this->proxy->isActive()); session_start(); $this->assertTrue($this->proxy->isActive()); @@ -69,8 +63,7 @@ class AbstractProxyTest extends TestCase * @runInSeparateProcess * @preserveGlobalState disabled */ - public function testName() - { + public function testName() { $this->assertEquals(session_name(), $this->proxy->getName()); $this->proxy->setName('foo'); $this->assertEquals('foo', $this->proxy->getName()); @@ -82,8 +75,7 @@ class AbstractProxyTest extends TestCase * @preserveGlobalState disabled * @expectedException \LogicException */ - public function testNameException() - { + public function testNameException() { session_start(); $this->proxy->setName('foo'); } @@ -92,8 +84,7 @@ class AbstractProxyTest extends TestCase * @runInSeparateProcess * @preserveGlobalState disabled */ - public function testId() - { + public function testId() { $this->assertEquals(session_id(), $this->proxy->getId()); $this->proxy->setId('foo'); $this->assertEquals('foo', $this->proxy->getId()); @@ -105,8 +96,7 @@ class AbstractProxyTest extends TestCase * @preserveGlobalState disabled * @expectedException \LogicException */ - public function testIdException() - { + public function testIdException() { session_start(); $this->proxy->setId('foo'); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/NativeProxyTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/NativeProxyTest.php index ed4fee6..b3f91e1 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/NativeProxyTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/NativeProxyTest.php @@ -23,14 +23,12 @@ use Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy; */ class NativeProxyTest extends TestCase { - public function testIsWrapper() - { + public function testIsWrapper() { $proxy = new NativeProxy(); $this->assertFalse($proxy->isWrapper()); } - public function testGetSaveHandlerName() - { + public function testGetSaveHandlerName() { $name = ini_get('session.save_handler'); $proxy = new NativeProxy(); $this->assertEquals($name, $proxy->getSaveHandlerName()); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php index 6828253..d5631cd 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/Session/Storage/Proxy/SessionHandlerProxyTest.php @@ -34,88 +34,78 @@ class SessionHandlerProxyTest extends TestCase */ private $proxy; - protected function setUp() - { + protected function setUp() { $this->mock = $this->getMockBuilder('SessionHandlerInterface')->getMock(); $this->proxy = new SessionHandlerProxy($this->mock); } - protected function tearDown() - { - $this->mock = null; - $this->proxy = null; + protected function tearDown() { + $this->mock = NULL; + $this->proxy = NULL; } - public function testOpenTrue() - { + public function testOpenTrue() { $this->mock->expects($this->once()) ->method('open') - ->will($this->returnValue(true)); + ->will($this->returnValue(TRUE)); $this->assertFalse($this->proxy->isActive()); $this->proxy->open('name', 'id'); $this->assertFalse($this->proxy->isActive()); } - public function testOpenFalse() - { + public function testOpenFalse() { $this->mock->expects($this->once()) ->method('open') - ->will($this->returnValue(false)); + ->will($this->returnValue(FALSE)); $this->assertFalse($this->proxy->isActive()); $this->proxy->open('name', 'id'); $this->assertFalse($this->proxy->isActive()); } - public function testClose() - { + public function testClose() { $this->mock->expects($this->once()) ->method('close') - ->will($this->returnValue(true)); + ->will($this->returnValue(TRUE)); $this->assertFalse($this->proxy->isActive()); $this->proxy->close(); $this->assertFalse($this->proxy->isActive()); } - public function testCloseFalse() - { + public function testCloseFalse() { $this->mock->expects($this->once()) ->method('close') - ->will($this->returnValue(false)); + ->will($this->returnValue(FALSE)); $this->assertFalse($this->proxy->isActive()); $this->proxy->close(); $this->assertFalse($this->proxy->isActive()); } - public function testRead() - { + public function testRead() { $this->mock->expects($this->once()) ->method('read'); $this->proxy->read('id'); } - public function testWrite() - { + public function testWrite() { $this->mock->expects($this->once()) ->method('write'); $this->proxy->write('id', 'data'); } - public function testDestroy() - { + public function testDestroy() { $this->mock->expects($this->once()) ->method('destroy'); $this->proxy->destroy('id'); } - public function testGc() - { + public function testGc() { $this->mock->expects($this->once()) ->method('gc'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/StreamedResponseTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/StreamedResponseTest.php index c2ded99..e438896 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/StreamedResponseTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/StreamedResponseTest.php @@ -17,17 +17,19 @@ use Symfony\Component\HttpFoundation\StreamedResponse; class StreamedResponseTest extends TestCase { - public function testConstructor() - { - $response = new StreamedResponse(function () { echo 'foo'; }, 404, array('Content-Type' => 'text/plain')); + public function testConstructor() { + $response = new StreamedResponse(function () { + echo 'foo'; + }, 404, array('Content-Type' => 'text/plain')); $this->assertEquals(404, $response->getStatusCode()); $this->assertEquals('text/plain', $response->headers->get('Content-Type')); } - public function testPrepareWith11Protocol() - { - $response = new StreamedResponse(function () { echo 'foo'; }); + public function testPrepareWith11Protocol() { + $response = new StreamedResponse(function () { + echo 'foo'; + }); $request = Request::create('/'); $request->server->set('SERVER_PROTOCOL', 'HTTP/1.1'); @@ -37,9 +39,10 @@ class StreamedResponseTest extends TestCase $this->assertNotEquals('chunked', $response->headers->get('Transfer-Encoding'), 'Apache assumes responses with a Transfer-Encoding header set to chunked to already be encoded.'); } - public function testPrepareWith10Protocol() - { - $response = new StreamedResponse(function () { echo 'foo'; }); + public function testPrepareWith10Protocol() { + $response = new StreamedResponse(function () { + echo 'foo'; + }); $request = Request::create('/'); $request->server->set('SERVER_PROTOCOL', 'HTTP/1.0'); @@ -49,9 +52,10 @@ class StreamedResponseTest extends TestCase $this->assertNull($response->headers->get('Transfer-Encoding')); } - public function testPrepareWithHeadRequest() - { - $response = new StreamedResponse(function () { echo 'foo'; }, 200, array('Content-Length' => '123')); + public function testPrepareWithHeadRequest() { + $response = new StreamedResponse(function () { + echo 'foo'; + }, 200, array('Content-Length' => '123')); $request = Request::create('/', 'HEAD'); $response->prepare($request); @@ -59,20 +63,22 @@ class StreamedResponseTest extends TestCase $this->assertSame('123', $response->headers->get('Content-Length')); } - public function testPrepareWithCacheHeaders() - { - $response = new StreamedResponse(function () { echo 'foo'; }, 200, array('Cache-Control' => 'max-age=600, public')); + public function testPrepareWithCacheHeaders() { + $response = new StreamedResponse(function () { + echo 'foo'; + }, 200, array('Cache-Control' => 'max-age=600, public')); $request = Request::create('/', 'GET'); $response->prepare($request); $this->assertEquals('max-age=600, public', $response->headers->get('Cache-Control')); } - public function testSendContent() - { + public function testSendContent() { $called = 0; - $response = new StreamedResponse(function () use (&$called) { ++$called; }); + $response = new StreamedResponse(function () use (&$called) { + ++$called; + }); $response->sendContent(); $this->assertEquals(1, $called); @@ -84,42 +90,44 @@ class StreamedResponseTest extends TestCase /** * @expectedException \LogicException */ - public function testSendContentWithNonCallable() - { - $response = new StreamedResponse(null); + public function testSendContentWithNonCallable() { + $response = new StreamedResponse(NULL); $response->sendContent(); } /** * @expectedException \LogicException */ - public function testSetContent() - { - $response = new StreamedResponse(function () { echo 'foo'; }); + public function testSetContent() { + $response = new StreamedResponse(function () { + echo 'foo'; + }); $response->setContent('foo'); } - public function testGetContent() - { - $response = new StreamedResponse(function () { echo 'foo'; }); + public function testGetContent() { + $response = new StreamedResponse(function () { + echo 'foo'; + }); $this->assertFalse($response->getContent()); } - public function testCreate() - { - $response = StreamedResponse::create(function () {}, 204); + public function testCreate() { + $response = StreamedResponse::create(function () { + }, 204); $this->assertInstanceOf('Symfony\Component\HttpFoundation\StreamedResponse', $response); $this->assertEquals(204, $response->getStatusCode()); } - public function testReturnThis() - { - $response = new StreamedResponse(function () {}); + public function testReturnThis() { + $response = new StreamedResponse(function () { + }); $this->assertInstanceOf('Symfony\Component\HttpFoundation\StreamedResponse', $response->sendContent()); $this->assertInstanceOf('Symfony\Component\HttpFoundation\StreamedResponse', $response->sendContent()); - $response = new StreamedResponse(function () {}); + $response = new StreamedResponse(function () { + }); $this->assertInstanceOf('Symfony\Component\HttpFoundation\StreamedResponse', $response->sendHeaders()); $this->assertInstanceOf('Symfony\Component\HttpFoundation\StreamedResponse', $response->sendHeaders()); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/schema/http-status-codes.rng b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/schema/http-status-codes.rng index 73708ca..308910f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/schema/http-status-codes.rng +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/schema/http-status-codes.rng @@ -1,31 +1,39 @@ + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" + ns="http://www.iana.org/assignments"> - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/schema/iana-registry.rng b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/schema/iana-registry.rng index b9c3ca9..415af8c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/schema/iana-registry.rng +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/Tests/schema/iana-registry.rng @@ -1,198 +1,318 @@ + datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" + ns="http://www.iana.org/assignments"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - + - - - - - - - - uri - - - - rfc - - - (rfc|bcp|std)\d+ - - - - - rfc-errata - - - - draft - - - (draft|RFC)(-[a-zA-Z0-9]+)+ - - - - - registry - - - - person - - - - text - - - note - - - - unicode - - - ucd\d+\.\d+\.\d+ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + uri + + + + + + + + rfc + + + + (rfc|bcp|std)\d+ + + + + + + rfc-errata + + + + + + + + draft + + + + (draft|RFC)(-[a-zA-Z0-9]+)+ + + + + + + registry + + + + + + + + person + + + + + + + + text + + + + + note + + + + + + + + unicode + + + + ucd\d+\.\d+\.\d+ + + + + + + + - - - - - - - - + + + + + - - - + - - + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - (\d+|0x[\da-fA-F]+)(\s*-\s*(\d+|0x[\da-fA-F]+))? - - + + + (\d+|0x[\da-fA-F]+)(\s*-\s*(\d+|0x[\da-fA-F]+))? + + - - - - - - + + + + + + - - - 0x[0-9]{8} - - + + + 0x[0-9]{8} + + - - - [0-1]+ - - + + + [0-1]+ + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - legacy - mib - template - json - - - - - - - - + + + + + legacy + mib + template + json + + + + + + + + diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/composer.json index f6c6f2e..c60c0bc 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/composer.json @@ -1,38 +1,40 @@ { - "name": "symfony/http-foundation", - "type": "library", - "description": "Symfony HttpFoundation Component", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-mbstring": "~1.1", - "symfony/polyfill-php70": "~1.6" + "name": "symfony/http-foundation", + "type": "library", + "description": "Symfony HttpFoundation Component", + "keywords": [], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, - "require-dev": { - "symfony/expression-language": "~2.8|~3.0|~4.0" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\HttpFoundation\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": "^5.5.9|>=7.0.8", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php70": "~1.6" + }, + "require-dev": { + "symfony/expression-language": "~2.8|~3.0|~4.0" + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" } + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/phpunit.xml.dist b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/phpunit.xml.dist index c1d61f8..0c3f133 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/phpunit.xml.dist +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/http-foundation/phpunit.xml.dist @@ -9,7 +9,7 @@ failOnWarning="true" > - + diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/Mbstring.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/Mbstring.php index 67cf9ab..0dfbec9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -72,13 +72,12 @@ final class Mbstring private static $language = 'neutral'; private static $internalEncoding = 'UTF-8'; private static $caseFold = array( - array('µ','ſ',"\xCD\x85",'ς',"\xCF\x90","\xCF\x91","\xCF\x95","\xCF\x96","\xCF\xB0","\xCF\xB1","\xCF\xB5","\xE1\xBA\x9B","\xE1\xBE\xBE"), - array('μ','s','ι', 'σ','β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1",'ι'), + array('µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"), + array('μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'), ); - public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) - { - if (is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) { + public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = NULL) { + if (is_array($fromEncoding) || FALSE !== strpos($fromEncoding, ',')) { $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); } else { $fromEncoding = self::getEncoding($fromEncoding); @@ -111,50 +110,46 @@ final class Mbstring $fromEncoding = 'UTF-8'; } - return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); + return iconv($fromEncoding, $toEncoding . '//IGNORE', $s); } - public static function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) - { + public static function mb_convert_variables($toEncoding, $fromEncoding, &$a = NULL, &$b = NULL, &$c = NULL, &$d = NULL, &$e = NULL, &$f = NULL) { $vars = array(&$a, &$b, &$c, &$d, &$e, &$f); - $ok = true; + $ok = TRUE; array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { - if (false === $v = Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { - $ok = false; + if (FALSE === $v = Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { + $ok = FALSE; } }); - return $ok ? $fromEncoding : false; + return $ok ? $fromEncoding : FALSE; } - public static function mb_decode_mimeheader($s) - { + public static function mb_decode_mimeheader($s) { return iconv_mime_decode($s, 2, self::$internalEncoding); } - public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) - { + public static function mb_encode_mimeheader($s, $charset = NULL, $transferEncoding = NULL, $linefeed = NULL, $indent = NULL) { trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', E_USER_WARNING); } - public static function mb_decode_numericentity($s, $convmap, $encoding = null) - { - if (null !== $s && !is_scalar($s) && !(is_object($s) && method_exists($s, '__toString'))) { - trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.gettype($s).' given', E_USER_WARNING); - return null; + public static function mb_decode_numericentity($s, $convmap, $encoding = NULL) { + if (NULL !== $s && !is_scalar($s) && !(is_object($s) && method_exists($s, '__toString'))) { + trigger_error('mb_decode_numericentity() expects parameter 1 to be string, ' . gettype($s) . ' given', E_USER_WARNING); + return NULL; } if (!is_array($convmap) || !$convmap) { - return false; + return FALSE; } - if (null !== $encoding && !is_scalar($encoding)) { - trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.gettype($s).' given', E_USER_WARNING); + if (NULL !== $encoding && !is_scalar($encoding)) { + trigger_error('mb_decode_numericentity() expects parameter 3 to be string, ' . gettype($s) . ' given', E_USER_WARNING); return ''; // Instead of null (cf. mb_encode_numericentity). } - $s = (string) $s; + $s = (string)$s; if ('' === $s) { return ''; } @@ -162,7 +157,7 @@ final class Mbstring $encoding = self::getEncoding($encoding); if ('UTF-8' === $encoding) { - $encoding = null; + $encoding = NULL; if (!preg_match('//u', $s)) { $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); } @@ -179,7 +174,7 @@ final class Mbstring } $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { - $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; + $c = isset($m[2]) ? (int)hexdec($m[2]) : $m[1]; for ($i = 0; $i < $cnt; $i += 4) { if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { return Mbstring::mb_chr($c - $convmap[$i + 2]); @@ -188,35 +183,34 @@ final class Mbstring return $m[0]; }, $s); - if (null === $encoding) { + if (NULL === $encoding) { return $s; } - return iconv('UTF-8', $encoding.'//IGNORE', $s); + return iconv('UTF-8', $encoding . '//IGNORE', $s); } - public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) - { - if (null !== $s && !is_scalar($s) && !(is_object($s) && method_exists($s, '__toString'))) { - trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.gettype($s).' given', E_USER_WARNING); - return null; + public static function mb_encode_numericentity($s, $convmap, $encoding = NULL, $is_hex = FALSE) { + if (NULL !== $s && !is_scalar($s) && !(is_object($s) && method_exists($s, '__toString'))) { + trigger_error('mb_encode_numericentity() expects parameter 1 to be string, ' . gettype($s) . ' given', E_USER_WARNING); + return NULL; } if (!is_array($convmap) || !$convmap) { - return false; + return FALSE; } - if (null !== $encoding && !is_scalar($encoding)) { - trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.gettype($s).' given', E_USER_WARNING); - return null; // Instead of '' (cf. mb_decode_numericentity). + if (NULL !== $encoding && !is_scalar($encoding)) { + trigger_error('mb_encode_numericentity() expects parameter 3 to be string, ' . gettype($s) . ' given', E_USER_WARNING); + return NULL; // Instead of '' (cf. mb_decode_numericentity). } - if (null !== $is_hex && !is_scalar($is_hex)) { - trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.gettype($s).' given', E_USER_WARNING); - return null; + if (NULL !== $is_hex && !is_scalar($is_hex)) { + trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, ' . gettype($s) . ' given', E_USER_WARNING); + return NULL; } - $s = (string) $s; + $s = (string)$s; if ('' === $s) { return ''; } @@ -224,7 +218,7 @@ final class Mbstring $encoding = self::getEncoding($encoding); if ('UTF-8' === $encoding) { - $encoding = null; + $encoding = NULL; if (!preg_match('//u', $s)) { $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); } @@ -248,23 +242,22 @@ final class Mbstring for ($j = 0; $j < $cnt; $j += 4) { if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; - $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; + $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#' . $cOffset . ';'; continue 2; } } $result .= $uchr; } - if (null === $encoding) { + if (NULL === $encoding) { return $result; } - return iconv('UTF-8', $encoding.'//IGNORE', $result); + return iconv('UTF-8', $encoding . '//IGNORE', $result); } - public static function mb_convert_case($s, $mode, $encoding = null) - { - $s = (string) $s; + public static function mb_convert_case($s, $mode, $encoding = NULL) { + $s = (string)$s; if ('' === $s) { return ''; } @@ -272,7 +265,7 @@ final class Mbstring $encoding = self::getEncoding($encoding); if ('UTF-8' === $encoding) { - $encoding = null; + $encoding = NULL; if (!preg_match('//u', $s)) { $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); } @@ -285,8 +278,8 @@ final class Mbstring $s = preg_replace_callback('/\B[\p{Lu}\p{Lt}]+/u', array(__CLASS__, 'title_case_lower'), $s); } else { if (MB_CASE_UPPER == $mode) { - static $upper = null; - if (null === $upper) { + static $upper = NULL; + if (NULL === $upper) { $upper = self::getData('upperCase'); } $map = $upper; @@ -295,8 +288,8 @@ final class Mbstring $s = str_replace(self::$caseFold[0], self::$caseFold[1], $s); } - static $lower = null; - if (null === $lower) { + static $lower = NULL; + if (NULL === $lower) { $lower = self::getData('lowerCase'); } $map = $lower; @@ -324,39 +317,37 @@ final class Mbstring } else { $s = substr_replace($s, $uchr, $i - $ulen, $ulen); $len += $nlen - $ulen; - $i += $nlen - $ulen; + $i += $nlen - $ulen; } } } } - if (null === $encoding) { + if (NULL === $encoding) { return $s; } - return iconv('UTF-8', $encoding.'//IGNORE', $s); + return iconv('UTF-8', $encoding . '//IGNORE', $s); } - public static function mb_internal_encoding($encoding = null) - { - if (null === $encoding) { + public static function mb_internal_encoding($encoding = NULL) { + if (NULL === $encoding) { return self::$internalEncoding; } $encoding = self::getEncoding($encoding); - if ('UTF-8' === $encoding || false !== @iconv($encoding, $encoding, ' ')) { + if ('UTF-8' === $encoding || FALSE !== @iconv($encoding, $encoding, ' ')) { self::$internalEncoding = $encoding; - return true; + return TRUE; } - return false; + return FALSE; } - public static function mb_language($lang = null) - { - if (null === $lang) { + public static function mb_language($lang = NULL) { + if (NULL === $lang) { return self::$language; } @@ -365,43 +356,39 @@ final class Mbstring case 'neutral': self::$language = $lang; - return true; + return TRUE; } - return false; + return FALSE; } - public static function mb_list_encodings() - { + public static function mb_list_encodings() { return array('UTF-8'); } - public static function mb_encoding_aliases($encoding) - { + public static function mb_encoding_aliases($encoding) { switch (strtoupper($encoding)) { case 'UTF8': case 'UTF-8': return array('utf8'); } - return false; + return FALSE; } - public static function mb_check_encoding($var = null, $encoding = null) - { - if (null === $encoding) { - if (null === $var) { - return false; + public static function mb_check_encoding($var = NULL, $encoding = NULL) { + if (NULL === $encoding) { + if (NULL === $var) { + return FALSE; } $encoding = self::$internalEncoding; } - return self::mb_detect_encoding($var, array($encoding)) || false !== @iconv($encoding, $encoding, $var); + return self::mb_detect_encoding($var, array($encoding)) || FALSE !== @iconv($encoding, $encoding, $var); } - public static function mb_detect_encoding($str, $encodingList = null, $strict = false) - { - if (null === $encodingList) { + public static function mb_detect_encoding($str, $encodingList = NULL, $strict = FALSE) { + if (NULL === $encodingList) { $encodingList = self::$encodingList; } else { if (!is_array($encodingList)) { @@ -432,12 +419,11 @@ final class Mbstring } } - return false; + return FALSE; } - public static function mb_detect_order($encodingList = null) - { - if (null === $encodingList) { + public static function mb_detect_order($encodingList = NULL) { + if (NULL === $encodingList) { return self::$encodingList; } @@ -450,7 +436,7 @@ final class Mbstring switch ($enc) { default: if (strncmp($enc, 'ISO-8859-', 9)) { - return false; + return FALSE; } case 'ASCII': case 'UTF8': @@ -460,11 +446,10 @@ final class Mbstring self::$encodingList = $encodingList; - return true; + return TRUE; } - public static function mb_strlen($s, $encoding = null) - { + public static function mb_strlen($s, $encoding = NULL) { $encoding = self::getEncoding($encoding); if ('CP850' === $encoding || 'ASCII' === $encoding) { return strlen($s); @@ -473,33 +458,31 @@ final class Mbstring return @iconv_strlen($s, $encoding); } - public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) - { + public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = NULL) { $encoding = self::getEncoding($encoding); if ('CP850' === $encoding || 'ASCII' === $encoding) { return strpos($haystack, $needle, $offset); } - $needle = (string) $needle; + $needle = (string)$needle; if ('' === $needle) { - trigger_error(__METHOD__.': Empty delimiter', E_USER_WARNING); + trigger_error(__METHOD__ . ': Empty delimiter', E_USER_WARNING); - return false; + return FALSE; } return iconv_strpos($haystack, $needle, $offset, $encoding); } - public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) - { + public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = NULL) { $encoding = self::getEncoding($encoding); if ('CP850' === $encoding || 'ASCII' === $encoding) { return strrpos($haystack, $needle, $offset); } - if ($offset != (int) $offset) { + if ($offset != (int)$offset) { $offset = 0; - } elseif ($offset = (int) $offset) { + } else if ($offset = (int)$offset) { if ($offset < 0) { $haystack = self::mb_substr($haystack, 0, $offset, $encoding); $offset = 0; @@ -510,33 +493,29 @@ final class Mbstring $pos = iconv_strrpos($haystack, $needle, $encoding); - return false !== $pos ? $offset + $pos : false; + return FALSE !== $pos ? $offset + $pos : FALSE; } - public static function mb_strtolower($s, $encoding = null) - { + public static function mb_strtolower($s, $encoding = NULL) { return self::mb_convert_case($s, MB_CASE_LOWER, $encoding); } - public static function mb_strtoupper($s, $encoding = null) - { + public static function mb_strtoupper($s, $encoding = NULL) { return self::mb_convert_case($s, MB_CASE_UPPER, $encoding); } - public static function mb_substitute_character($c = null) - { + public static function mb_substitute_character($c = NULL) { if (0 === strcasecmp($c, 'none')) { - return true; + return TRUE; } - return null !== $c ? false : 'none'; + return NULL !== $c ? FALSE : 'none'; } - public static function mb_substr($s, $start, $length = null, $encoding = null) - { + public static function mb_substr($s, $start, $length = NULL, $encoding = NULL) { $encoding = self::getEncoding($encoding); if ('CP850' === $encoding || 'ASCII' === $encoding) { - return substr($s, $start, null === $length ? 2147483647 : $length); + return substr($s, $start, NULL === $length ? 2147483647 : $length); } if ($start < 0) { @@ -546,35 +525,32 @@ final class Mbstring } } - if (null === $length) { + if (NULL === $length) { $length = 2147483647; - } elseif ($length < 0) { + } else if ($length < 0) { $length = iconv_strlen($s, $encoding) + $length - $start; if ($length < 0) { return ''; } } - return (string) iconv_substr($s, $start, $length, $encoding); + return (string)iconv_substr($s, $start, $length, $encoding); } - public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) - { + public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = NULL) { $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); return self::mb_strpos($haystack, $needle, $offset, $encoding); } - public static function mb_stristr($haystack, $needle, $part = false, $encoding = null) - { + public static function mb_stristr($haystack, $needle, $part = FALSE, $encoding = NULL) { $pos = self::mb_stripos($haystack, $needle, 0, $encoding); return self::getSubpart($pos, $part, $haystack, $encoding); } - public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null) - { + public static function mb_strrchr($haystack, $needle, $part = FALSE, $encoding = NULL) { $encoding = self::getEncoding($encoding); if ('CP850' === $encoding || 'ASCII' === $encoding) { return strrchr($haystack, $needle, $part); @@ -585,27 +561,24 @@ final class Mbstring return self::getSubpart($pos, $part, $haystack, $encoding); } - public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null) - { + public static function mb_strrichr($haystack, $needle, $part = FALSE, $encoding = NULL) { $needle = self::mb_substr($needle, 0, 1, $encoding); $pos = self::mb_strripos($haystack, $needle, $encoding); return self::getSubpart($pos, $part, $haystack, $encoding); } - public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) - { + public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = NULL) { $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); return self::mb_strrpos($haystack, $needle, $offset, $encoding); } - public static function mb_strstr($haystack, $needle, $part = false, $encoding = null) - { + public static function mb_strstr($haystack, $needle, $part = FALSE, $encoding = NULL) { $pos = strpos($haystack, $needle); - if (false === $pos) { - return false; + if (FALSE === $pos) { + return FALSE; } if ($part) { return substr($haystack, 0, $pos); @@ -614,8 +587,7 @@ final class Mbstring return substr($haystack, $pos); } - public static function mb_get_info($type = 'all') - { + public static function mb_get_info($type = 'all') { $info = array( 'internal_encoding' => self::$internalEncoding, 'http_output' => 'pass', @@ -640,21 +612,18 @@ final class Mbstring return $info[$type]; } - return false; + return FALSE; } - public static function mb_http_input($type = '') - { - return false; + public static function mb_http_input($type = '') { + return FALSE; } - public static function mb_http_output($encoding = null) - { - return null !== $encoding ? 'pass' === $encoding : 'pass'; + public static function mb_http_output($encoding = NULL) { + return NULL !== $encoding ? 'pass' === $encoding : 'pass'; } - public static function mb_strwidth($s, $encoding = null) - { + public static function mb_strwidth($s, $encoding = NULL) { $encoding = self::getEncoding($encoding); if ('UTF-8' !== $encoding) { @@ -666,26 +635,23 @@ final class Mbstring return ($wide << 1) + iconv_strlen($s, 'UTF-8'); } - public static function mb_substr_count($haystack, $needle, $encoding = null) - { + public static function mb_substr_count($haystack, $needle, $encoding = NULL) { return substr_count($haystack, $needle); } - public static function mb_output_handler($contents, $status) - { + public static function mb_output_handler($contents, $status) { return $contents; } - public static function mb_chr($code, $encoding = null) - { + public static function mb_chr($code, $encoding = NULL) { if (0x80 > $code %= 0x200000) { $s = chr($code); - } elseif (0x800 > $code) { - $s = chr(0xC0 | $code >> 6).chr(0x80 | $code & 0x3F); - } elseif (0x10000 > $code) { - $s = chr(0xE0 | $code >> 12).chr(0x80 | $code >> 6 & 0x3F).chr(0x80 | $code & 0x3F); + } else if (0x800 > $code) { + $s = chr(0xC0 | $code >> 6) . chr(0x80 | $code & 0x3F); + } else if (0x10000 > $code) { + $s = chr(0xE0 | $code >> 12) . chr(0x80 | $code >> 6 & 0x3F) . chr(0x80 | $code & 0x3F); } else { - $s = chr(0xF0 | $code >> 18).chr(0x80 | $code >> 12 & 0x3F).chr(0x80 | $code >> 6 & 0x3F).chr(0x80 | $code & 0x3F); + $s = chr(0xF0 | $code >> 18) . chr(0x80 | $code >> 12 & 0x3F) . chr(0x80 | $code >> 6 & 0x3F) . chr(0x80 | $code & 0x3F); } if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { @@ -695,8 +661,7 @@ final class Mbstring return $s; } - public static function mb_ord($s, $encoding = null) - { + public static function mb_ord($s, $encoding = NULL) { if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { $s = mb_convert_encoding($s, 'UTF-8', $encoding); } @@ -715,20 +680,18 @@ final class Mbstring return $code; } - private static function getSubpart($pos, $part, $haystack, $encoding) - { - if (false === $pos) { - return false; + private static function getSubpart($pos, $part, $haystack, $encoding) { + if (FALSE === $pos) { + return FALSE; } if ($part) { return self::mb_substr($haystack, 0, $pos, $encoding); } - return self::mb_substr($haystack, $pos, null, $encoding); + return self::mb_substr($haystack, $pos, NULL, $encoding); } - private static function html_encoding_callback(array $m) - { + private static function html_encoding_callback(array $m) { $i = 1; $entities = ''; $m = unpack('C*', htmlentities($m[0], ENT_COMPAT, 'UTF-8')); @@ -740,40 +703,36 @@ final class Mbstring } if (0xF0 <= $m[$i]) { $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } elseif (0xE0 <= $m[$i]) { + } else if (0xE0 <= $m[$i]) { $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; } else { $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; } - $entities .= '&#'.$c.';'; + $entities .= '&#' . $c . ';'; } return $entities; } - private static function title_case_lower(array $s) - { + private static function title_case_lower(array $s) { return self::mb_convert_case($s[0], MB_CASE_LOWER, 'UTF-8'); } - private static function title_case_upper(array $s) - { + private static function title_case_upper(array $s) { return self::mb_convert_case($s[0], MB_CASE_UPPER, 'UTF-8'); } - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { + private static function getData($file) { + if (file_exists($file = __DIR__ . '/Resources/unidata/' . $file . '.php')) { return require $file; } - return false; + return FALSE; } - private static function getEncoding($encoding) - { - if (null === $encoding) { + private static function getEncoding($encoding) { + if (NULL === $encoding) { return self::$internalEncoding; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php index 3ca1641..0c96df7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php @@ -1,1098 +1,1098 @@ 'a', - 'B' => 'b', - 'C' => 'c', - 'D' => 'd', - 'E' => 'e', - 'F' => 'f', - 'G' => 'g', - 'H' => 'h', - 'I' => 'i', - 'J' => 'j', - 'K' => 'k', - 'L' => 'l', - 'M' => 'm', - 'N' => 'n', - 'O' => 'o', - 'P' => 'p', - 'Q' => 'q', - 'R' => 'r', - 'S' => 's', - 'T' => 't', - 'U' => 'u', - 'V' => 'v', - 'W' => 'w', - 'X' => 'x', - 'Y' => 'y', - 'Z' => 'z', - 'À' => 'à', - 'Á' => 'á', - 'Â' => 'â', - 'Ã' => 'ã', - 'Ä' => 'ä', - 'Å' => 'å', - 'Æ' => 'æ', - 'Ç' => 'ç', - 'È' => 'è', - 'É' => 'é', - 'Ê' => 'ê', - 'Ë' => 'ë', - 'Ì' => 'ì', - 'Í' => 'í', - 'Î' => 'î', - 'Ï' => 'ï', - 'Ð' => 'ð', - 'Ñ' => 'ñ', - 'Ò' => 'ò', - 'Ó' => 'ó', - 'Ô' => 'ô', - 'Õ' => 'õ', - 'Ö' => 'ö', - 'Ø' => 'ø', - 'Ù' => 'ù', - 'Ú' => 'ú', - 'Û' => 'û', - 'Ü' => 'ü', - 'Ý' => 'ý', - 'Þ' => 'þ', - 'Ā' => 'ā', - 'Ă' => 'ă', - 'Ą' => 'ą', - 'Ć' => 'ć', - 'Ĉ' => 'ĉ', - 'Ċ' => 'ċ', - 'Č' => 'č', - 'Ď' => 'ď', - 'Đ' => 'đ', - 'Ē' => 'ē', - 'Ĕ' => 'ĕ', - 'Ė' => 'ė', - 'Ę' => 'ę', - 'Ě' => 'ě', - 'Ĝ' => 'ĝ', - 'Ğ' => 'ğ', - 'Ġ' => 'ġ', - 'Ģ' => 'ģ', - 'Ĥ' => 'ĥ', - 'Ħ' => 'ħ', - 'Ĩ' => 'ĩ', - 'Ī' => 'ī', - 'Ĭ' => 'ĭ', - 'Į' => 'į', - 'İ' => 'i', - 'IJ' => 'ij', - 'Ĵ' => 'ĵ', - 'Ķ' => 'ķ', - 'Ĺ' => 'ĺ', - 'Ļ' => 'ļ', - 'Ľ' => 'ľ', - 'Ŀ' => 'ŀ', - 'Ł' => 'ł', - 'Ń' => 'ń', - 'Ņ' => 'ņ', - 'Ň' => 'ň', - 'Ŋ' => 'ŋ', - 'Ō' => 'ō', - 'Ŏ' => 'ŏ', - 'Ő' => 'ő', - 'Œ' => 'œ', - 'Ŕ' => 'ŕ', - 'Ŗ' => 'ŗ', - 'Ř' => 'ř', - 'Ś' => 'ś', - 'Ŝ' => 'ŝ', - 'Ş' => 'ş', - 'Š' => 'š', - 'Ţ' => 'ţ', - 'Ť' => 'ť', - 'Ŧ' => 'ŧ', - 'Ũ' => 'ũ', - 'Ū' => 'ū', - 'Ŭ' => 'ŭ', - 'Ů' => 'ů', - 'Ű' => 'ű', - 'Ų' => 'ų', - 'Ŵ' => 'ŵ', - 'Ŷ' => 'ŷ', - 'Ÿ' => 'ÿ', - 'Ź' => 'ź', - 'Ż' => 'ż', - 'Ž' => 'ž', - 'Ɓ' => 'ɓ', - 'Ƃ' => 'ƃ', - 'Ƅ' => 'ƅ', - 'Ɔ' => 'ɔ', - 'Ƈ' => 'ƈ', - 'Ɖ' => 'ɖ', - 'Ɗ' => 'ɗ', - 'Ƌ' => 'ƌ', - 'Ǝ' => 'ǝ', - 'Ə' => 'ə', - 'Ɛ' => 'ɛ', - 'Ƒ' => 'ƒ', - 'Ɠ' => 'ɠ', - 'Ɣ' => 'ɣ', - 'Ɩ' => 'ɩ', - 'Ɨ' => 'ɨ', - 'Ƙ' => 'ƙ', - 'Ɯ' => 'ɯ', - 'Ɲ' => 'ɲ', - 'Ɵ' => 'ɵ', - 'Ơ' => 'ơ', - 'Ƣ' => 'ƣ', - 'Ƥ' => 'ƥ', - 'Ʀ' => 'ʀ', - 'Ƨ' => 'ƨ', - 'Ʃ' => 'ʃ', - 'Ƭ' => 'ƭ', - 'Ʈ' => 'ʈ', - 'Ư' => 'ư', - 'Ʊ' => 'ʊ', - 'Ʋ' => 'ʋ', - 'Ƴ' => 'ƴ', - 'Ƶ' => 'ƶ', - 'Ʒ' => 'ʒ', - 'Ƹ' => 'ƹ', - 'Ƽ' => 'ƽ', - 'DŽ' => 'dž', - 'Dž' => 'dž', - 'LJ' => 'lj', - 'Lj' => 'lj', - 'NJ' => 'nj', - 'Nj' => 'nj', - 'Ǎ' => 'ǎ', - 'Ǐ' => 'ǐ', - 'Ǒ' => 'ǒ', - 'Ǔ' => 'ǔ', - 'Ǖ' => 'ǖ', - 'Ǘ' => 'ǘ', - 'Ǚ' => 'ǚ', - 'Ǜ' => 'ǜ', - 'Ǟ' => 'ǟ', - 'Ǡ' => 'ǡ', - 'Ǣ' => 'ǣ', - 'Ǥ' => 'ǥ', - 'Ǧ' => 'ǧ', - 'Ǩ' => 'ǩ', - 'Ǫ' => 'ǫ', - 'Ǭ' => 'ǭ', - 'Ǯ' => 'ǯ', - 'DZ' => 'dz', - 'Dz' => 'dz', - 'Ǵ' => 'ǵ', - 'Ƕ' => 'ƕ', - 'Ƿ' => 'ƿ', - 'Ǹ' => 'ǹ', - 'Ǻ' => 'ǻ', - 'Ǽ' => 'ǽ', - 'Ǿ' => 'ǿ', - 'Ȁ' => 'ȁ', - 'Ȃ' => 'ȃ', - 'Ȅ' => 'ȅ', - 'Ȇ' => 'ȇ', - 'Ȉ' => 'ȉ', - 'Ȋ' => 'ȋ', - 'Ȍ' => 'ȍ', - 'Ȏ' => 'ȏ', - 'Ȑ' => 'ȑ', - 'Ȓ' => 'ȓ', - 'Ȕ' => 'ȕ', - 'Ȗ' => 'ȗ', - 'Ș' => 'ș', - 'Ț' => 'ț', - 'Ȝ' => 'ȝ', - 'Ȟ' => 'ȟ', - 'Ƞ' => 'ƞ', - 'Ȣ' => 'ȣ', - 'Ȥ' => 'ȥ', - 'Ȧ' => 'ȧ', - 'Ȩ' => 'ȩ', - 'Ȫ' => 'ȫ', - 'Ȭ' => 'ȭ', - 'Ȯ' => 'ȯ', - 'Ȱ' => 'ȱ', - 'Ȳ' => 'ȳ', - 'Ⱥ' => 'ⱥ', - 'Ȼ' => 'ȼ', - 'Ƚ' => 'ƚ', - 'Ⱦ' => 'ⱦ', - 'Ɂ' => 'ɂ', - 'Ƀ' => 'ƀ', - 'Ʉ' => 'ʉ', - 'Ʌ' => 'ʌ', - 'Ɇ' => 'ɇ', - 'Ɉ' => 'ɉ', - 'Ɋ' => 'ɋ', - 'Ɍ' => 'ɍ', - 'Ɏ' => 'ɏ', - 'Ͱ' => 'ͱ', - 'Ͳ' => 'ͳ', - 'Ͷ' => 'ͷ', - 'Ϳ' => 'ϳ', - 'Ά' => 'ά', - 'Έ' => 'έ', - 'Ή' => 'ή', - 'Ί' => 'ί', - 'Ό' => 'ό', - 'Ύ' => 'ύ', - 'Ώ' => 'ώ', - 'Α' => 'α', - 'Β' => 'β', - 'Γ' => 'γ', - 'Δ' => 'δ', - 'Ε' => 'ε', - 'Ζ' => 'ζ', - 'Η' => 'η', - 'Θ' => 'θ', - 'Ι' => 'ι', - 'Κ' => 'κ', - 'Λ' => 'λ', - 'Μ' => 'μ', - 'Ν' => 'ν', - 'Ξ' => 'ξ', - 'Ο' => 'ο', - 'Π' => 'π', - 'Ρ' => 'ρ', - 'Σ' => 'σ', - 'Τ' => 'τ', - 'Υ' => 'υ', - 'Φ' => 'φ', - 'Χ' => 'χ', - 'Ψ' => 'ψ', - 'Ω' => 'ω', - 'Ϊ' => 'ϊ', - 'Ϋ' => 'ϋ', - 'Ϗ' => 'ϗ', - 'Ϙ' => 'ϙ', - 'Ϛ' => 'ϛ', - 'Ϝ' => 'ϝ', - 'Ϟ' => 'ϟ', - 'Ϡ' => 'ϡ', - 'Ϣ' => 'ϣ', - 'Ϥ' => 'ϥ', - 'Ϧ' => 'ϧ', - 'Ϩ' => 'ϩ', - 'Ϫ' => 'ϫ', - 'Ϭ' => 'ϭ', - 'Ϯ' => 'ϯ', - 'ϴ' => 'θ', - 'Ϸ' => 'ϸ', - 'Ϲ' => 'ϲ', - 'Ϻ' => 'ϻ', - 'Ͻ' => 'ͻ', - 'Ͼ' => 'ͼ', - 'Ͽ' => 'ͽ', - 'Ѐ' => 'ѐ', - 'Ё' => 'ё', - 'Ђ' => 'ђ', - 'Ѓ' => 'ѓ', - 'Є' => 'є', - 'Ѕ' => 'ѕ', - 'І' => 'і', - 'Ї' => 'ї', - 'Ј' => 'ј', - 'Љ' => 'љ', - 'Њ' => 'њ', - 'Ћ' => 'ћ', - 'Ќ' => 'ќ', - 'Ѝ' => 'ѝ', - 'Ў' => 'ў', - 'Џ' => 'џ', - 'А' => 'а', - 'Б' => 'б', - 'В' => 'в', - 'Г' => 'г', - 'Д' => 'д', - 'Е' => 'е', - 'Ж' => 'ж', - 'З' => 'з', - 'И' => 'и', - 'Й' => 'й', - 'К' => 'к', - 'Л' => 'л', - 'М' => 'м', - 'Н' => 'н', - 'О' => 'о', - 'П' => 'п', - 'Р' => 'р', - 'С' => 'с', - 'Т' => 'т', - 'У' => 'у', - 'Ф' => 'ф', - 'Х' => 'х', - 'Ц' => 'ц', - 'Ч' => 'ч', - 'Ш' => 'ш', - 'Щ' => 'щ', - 'Ъ' => 'ъ', - 'Ы' => 'ы', - 'Ь' => 'ь', - 'Э' => 'э', - 'Ю' => 'ю', - 'Я' => 'я', - 'Ѡ' => 'ѡ', - 'Ѣ' => 'ѣ', - 'Ѥ' => 'ѥ', - 'Ѧ' => 'ѧ', - 'Ѩ' => 'ѩ', - 'Ѫ' => 'ѫ', - 'Ѭ' => 'ѭ', - 'Ѯ' => 'ѯ', - 'Ѱ' => 'ѱ', - 'Ѳ' => 'ѳ', - 'Ѵ' => 'ѵ', - 'Ѷ' => 'ѷ', - 'Ѹ' => 'ѹ', - 'Ѻ' => 'ѻ', - 'Ѽ' => 'ѽ', - 'Ѿ' => 'ѿ', - 'Ҁ' => 'ҁ', - 'Ҋ' => 'ҋ', - 'Ҍ' => 'ҍ', - 'Ҏ' => 'ҏ', - 'Ґ' => 'ґ', - 'Ғ' => 'ғ', - 'Ҕ' => 'ҕ', - 'Җ' => 'җ', - 'Ҙ' => 'ҙ', - 'Қ' => 'қ', - 'Ҝ' => 'ҝ', - 'Ҟ' => 'ҟ', - 'Ҡ' => 'ҡ', - 'Ң' => 'ң', - 'Ҥ' => 'ҥ', - 'Ҧ' => 'ҧ', - 'Ҩ' => 'ҩ', - 'Ҫ' => 'ҫ', - 'Ҭ' => 'ҭ', - 'Ү' => 'ү', - 'Ұ' => 'ұ', - 'Ҳ' => 'ҳ', - 'Ҵ' => 'ҵ', - 'Ҷ' => 'ҷ', - 'Ҹ' => 'ҹ', - 'Һ' => 'һ', - 'Ҽ' => 'ҽ', - 'Ҿ' => 'ҿ', - 'Ӏ' => 'ӏ', - 'Ӂ' => 'ӂ', - 'Ӄ' => 'ӄ', - 'Ӆ' => 'ӆ', - 'Ӈ' => 'ӈ', - 'Ӊ' => 'ӊ', - 'Ӌ' => 'ӌ', - 'Ӎ' => 'ӎ', - 'Ӑ' => 'ӑ', - 'Ӓ' => 'ӓ', - 'Ӕ' => 'ӕ', - 'Ӗ' => 'ӗ', - 'Ә' => 'ә', - 'Ӛ' => 'ӛ', - 'Ӝ' => 'ӝ', - 'Ӟ' => 'ӟ', - 'Ӡ' => 'ӡ', - 'Ӣ' => 'ӣ', - 'Ӥ' => 'ӥ', - 'Ӧ' => 'ӧ', - 'Ө' => 'ө', - 'Ӫ' => 'ӫ', - 'Ӭ' => 'ӭ', - 'Ӯ' => 'ӯ', - 'Ӱ' => 'ӱ', - 'Ӳ' => 'ӳ', - 'Ӵ' => 'ӵ', - 'Ӷ' => 'ӷ', - 'Ӹ' => 'ӹ', - 'Ӻ' => 'ӻ', - 'Ӽ' => 'ӽ', - 'Ӿ' => 'ӿ', - 'Ԁ' => 'ԁ', - 'Ԃ' => 'ԃ', - 'Ԅ' => 'ԅ', - 'Ԇ' => 'ԇ', - 'Ԉ' => 'ԉ', - 'Ԋ' => 'ԋ', - 'Ԍ' => 'ԍ', - 'Ԏ' => 'ԏ', - 'Ԑ' => 'ԑ', - 'Ԓ' => 'ԓ', - 'Ԕ' => 'ԕ', - 'Ԗ' => 'ԗ', - 'Ԙ' => 'ԙ', - 'Ԛ' => 'ԛ', - 'Ԝ' => 'ԝ', - 'Ԟ' => 'ԟ', - 'Ԡ' => 'ԡ', - 'Ԣ' => 'ԣ', - 'Ԥ' => 'ԥ', - 'Ԧ' => 'ԧ', - 'Ԩ' => 'ԩ', - 'Ԫ' => 'ԫ', - 'Ԭ' => 'ԭ', - 'Ԯ' => 'ԯ', - 'Ա' => 'ա', - 'Բ' => 'բ', - 'Գ' => 'գ', - 'Դ' => 'դ', - 'Ե' => 'ե', - 'Զ' => 'զ', - 'Է' => 'է', - 'Ը' => 'ը', - 'Թ' => 'թ', - 'Ժ' => 'ժ', - 'Ի' => 'ի', - 'Լ' => 'լ', - 'Խ' => 'խ', - 'Ծ' => 'ծ', - 'Կ' => 'կ', - 'Հ' => 'հ', - 'Ձ' => 'ձ', - 'Ղ' => 'ղ', - 'Ճ' => 'ճ', - 'Մ' => 'մ', - 'Յ' => 'յ', - 'Ն' => 'ն', - 'Շ' => 'շ', - 'Ո' => 'ո', - 'Չ' => 'չ', - 'Պ' => 'պ', - 'Ջ' => 'ջ', - 'Ռ' => 'ռ', - 'Ս' => 'ս', - 'Վ' => 'վ', - 'Տ' => 'տ', - 'Ր' => 'ր', - 'Ց' => 'ց', - 'Ւ' => 'ւ', - 'Փ' => 'փ', - 'Ք' => 'ք', - 'Օ' => 'օ', - 'Ֆ' => 'ֆ', - 'Ⴀ' => 'ⴀ', - 'Ⴁ' => 'ⴁ', - 'Ⴂ' => 'ⴂ', - 'Ⴃ' => 'ⴃ', - 'Ⴄ' => 'ⴄ', - 'Ⴅ' => 'ⴅ', - 'Ⴆ' => 'ⴆ', - 'Ⴇ' => 'ⴇ', - 'Ⴈ' => 'ⴈ', - 'Ⴉ' => 'ⴉ', - 'Ⴊ' => 'ⴊ', - 'Ⴋ' => 'ⴋ', - 'Ⴌ' => 'ⴌ', - 'Ⴍ' => 'ⴍ', - 'Ⴎ' => 'ⴎ', - 'Ⴏ' => 'ⴏ', - 'Ⴐ' => 'ⴐ', - 'Ⴑ' => 'ⴑ', - 'Ⴒ' => 'ⴒ', - 'Ⴓ' => 'ⴓ', - 'Ⴔ' => 'ⴔ', - 'Ⴕ' => 'ⴕ', - 'Ⴖ' => 'ⴖ', - 'Ⴗ' => 'ⴗ', - 'Ⴘ' => 'ⴘ', - 'Ⴙ' => 'ⴙ', - 'Ⴚ' => 'ⴚ', - 'Ⴛ' => 'ⴛ', - 'Ⴜ' => 'ⴜ', - 'Ⴝ' => 'ⴝ', - 'Ⴞ' => 'ⴞ', - 'Ⴟ' => 'ⴟ', - 'Ⴠ' => 'ⴠ', - 'Ⴡ' => 'ⴡ', - 'Ⴢ' => 'ⴢ', - 'Ⴣ' => 'ⴣ', - 'Ⴤ' => 'ⴤ', - 'Ⴥ' => 'ⴥ', - 'Ⴧ' => 'ⴧ', - 'Ⴭ' => 'ⴭ', - 'Ḁ' => 'ḁ', - 'Ḃ' => 'ḃ', - 'Ḅ' => 'ḅ', - 'Ḇ' => 'ḇ', - 'Ḉ' => 'ḉ', - 'Ḋ' => 'ḋ', - 'Ḍ' => 'ḍ', - 'Ḏ' => 'ḏ', - 'Ḑ' => 'ḑ', - 'Ḓ' => 'ḓ', - 'Ḕ' => 'ḕ', - 'Ḗ' => 'ḗ', - 'Ḙ' => 'ḙ', - 'Ḛ' => 'ḛ', - 'Ḝ' => 'ḝ', - 'Ḟ' => 'ḟ', - 'Ḡ' => 'ḡ', - 'Ḣ' => 'ḣ', - 'Ḥ' => 'ḥ', - 'Ḧ' => 'ḧ', - 'Ḩ' => 'ḩ', - 'Ḫ' => 'ḫ', - 'Ḭ' => 'ḭ', - 'Ḯ' => 'ḯ', - 'Ḱ' => 'ḱ', - 'Ḳ' => 'ḳ', - 'Ḵ' => 'ḵ', - 'Ḷ' => 'ḷ', - 'Ḹ' => 'ḹ', - 'Ḻ' => 'ḻ', - 'Ḽ' => 'ḽ', - 'Ḿ' => 'ḿ', - 'Ṁ' => 'ṁ', - 'Ṃ' => 'ṃ', - 'Ṅ' => 'ṅ', - 'Ṇ' => 'ṇ', - 'Ṉ' => 'ṉ', - 'Ṋ' => 'ṋ', - 'Ṍ' => 'ṍ', - 'Ṏ' => 'ṏ', - 'Ṑ' => 'ṑ', - 'Ṓ' => 'ṓ', - 'Ṕ' => 'ṕ', - 'Ṗ' => 'ṗ', - 'Ṙ' => 'ṙ', - 'Ṛ' => 'ṛ', - 'Ṝ' => 'ṝ', - 'Ṟ' => 'ṟ', - 'Ṡ' => 'ṡ', - 'Ṣ' => 'ṣ', - 'Ṥ' => 'ṥ', - 'Ṧ' => 'ṧ', - 'Ṩ' => 'ṩ', - 'Ṫ' => 'ṫ', - 'Ṭ' => 'ṭ', - 'Ṯ' => 'ṯ', - 'Ṱ' => 'ṱ', - 'Ṳ' => 'ṳ', - 'Ṵ' => 'ṵ', - 'Ṷ' => 'ṷ', - 'Ṹ' => 'ṹ', - 'Ṻ' => 'ṻ', - 'Ṽ' => 'ṽ', - 'Ṿ' => 'ṿ', - 'Ẁ' => 'ẁ', - 'Ẃ' => 'ẃ', - 'Ẅ' => 'ẅ', - 'Ẇ' => 'ẇ', - 'Ẉ' => 'ẉ', - 'Ẋ' => 'ẋ', - 'Ẍ' => 'ẍ', - 'Ẏ' => 'ẏ', - 'Ẑ' => 'ẑ', - 'Ẓ' => 'ẓ', - 'Ẕ' => 'ẕ', - 'ẞ' => 'ß', - 'Ạ' => 'ạ', - 'Ả' => 'ả', - 'Ấ' => 'ấ', - 'Ầ' => 'ầ', - 'Ẩ' => 'ẩ', - 'Ẫ' => 'ẫ', - 'Ậ' => 'ậ', - 'Ắ' => 'ắ', - 'Ằ' => 'ằ', - 'Ẳ' => 'ẳ', - 'Ẵ' => 'ẵ', - 'Ặ' => 'ặ', - 'Ẹ' => 'ẹ', - 'Ẻ' => 'ẻ', - 'Ẽ' => 'ẽ', - 'Ế' => 'ế', - 'Ề' => 'ề', - 'Ể' => 'ể', - 'Ễ' => 'ễ', - 'Ệ' => 'ệ', - 'Ỉ' => 'ỉ', - 'Ị' => 'ị', - 'Ọ' => 'ọ', - 'Ỏ' => 'ỏ', - 'Ố' => 'ố', - 'Ồ' => 'ồ', - 'Ổ' => 'ổ', - 'Ỗ' => 'ỗ', - 'Ộ' => 'ộ', - 'Ớ' => 'ớ', - 'Ờ' => 'ờ', - 'Ở' => 'ở', - 'Ỡ' => 'ỡ', - 'Ợ' => 'ợ', - 'Ụ' => 'ụ', - 'Ủ' => 'ủ', - 'Ứ' => 'ứ', - 'Ừ' => 'ừ', - 'Ử' => 'ử', - 'Ữ' => 'ữ', - 'Ự' => 'ự', - 'Ỳ' => 'ỳ', - 'Ỵ' => 'ỵ', - 'Ỷ' => 'ỷ', - 'Ỹ' => 'ỹ', - 'Ỻ' => 'ỻ', - 'Ỽ' => 'ỽ', - 'Ỿ' => 'ỿ', - 'Ἀ' => 'ἀ', - 'Ἁ' => 'ἁ', - 'Ἂ' => 'ἂ', - 'Ἃ' => 'ἃ', - 'Ἄ' => 'ἄ', - 'Ἅ' => 'ἅ', - 'Ἆ' => 'ἆ', - 'Ἇ' => 'ἇ', - 'Ἐ' => 'ἐ', - 'Ἑ' => 'ἑ', - 'Ἒ' => 'ἒ', - 'Ἓ' => 'ἓ', - 'Ἔ' => 'ἔ', - 'Ἕ' => 'ἕ', - 'Ἠ' => 'ἠ', - 'Ἡ' => 'ἡ', - 'Ἢ' => 'ἢ', - 'Ἣ' => 'ἣ', - 'Ἤ' => 'ἤ', - 'Ἥ' => 'ἥ', - 'Ἦ' => 'ἦ', - 'Ἧ' => 'ἧ', - 'Ἰ' => 'ἰ', - 'Ἱ' => 'ἱ', - 'Ἲ' => 'ἲ', - 'Ἳ' => 'ἳ', - 'Ἴ' => 'ἴ', - 'Ἵ' => 'ἵ', - 'Ἶ' => 'ἶ', - 'Ἷ' => 'ἷ', - 'Ὀ' => 'ὀ', - 'Ὁ' => 'ὁ', - 'Ὂ' => 'ὂ', - 'Ὃ' => 'ὃ', - 'Ὄ' => 'ὄ', - 'Ὅ' => 'ὅ', - 'Ὑ' => 'ὑ', - 'Ὓ' => 'ὓ', - 'Ὕ' => 'ὕ', - 'Ὗ' => 'ὗ', - 'Ὠ' => 'ὠ', - 'Ὡ' => 'ὡ', - 'Ὢ' => 'ὢ', - 'Ὣ' => 'ὣ', - 'Ὤ' => 'ὤ', - 'Ὥ' => 'ὥ', - 'Ὦ' => 'ὦ', - 'Ὧ' => 'ὧ', - 'ᾈ' => 'ᾀ', - 'ᾉ' => 'ᾁ', - 'ᾊ' => 'ᾂ', - 'ᾋ' => 'ᾃ', - 'ᾌ' => 'ᾄ', - 'ᾍ' => 'ᾅ', - 'ᾎ' => 'ᾆ', - 'ᾏ' => 'ᾇ', - 'ᾘ' => 'ᾐ', - 'ᾙ' => 'ᾑ', - 'ᾚ' => 'ᾒ', - 'ᾛ' => 'ᾓ', - 'ᾜ' => 'ᾔ', - 'ᾝ' => 'ᾕ', - 'ᾞ' => 'ᾖ', - 'ᾟ' => 'ᾗ', - 'ᾨ' => 'ᾠ', - 'ᾩ' => 'ᾡ', - 'ᾪ' => 'ᾢ', - 'ᾫ' => 'ᾣ', - 'ᾬ' => 'ᾤ', - 'ᾭ' => 'ᾥ', - 'ᾮ' => 'ᾦ', - 'ᾯ' => 'ᾧ', - 'Ᾰ' => 'ᾰ', - 'Ᾱ' => 'ᾱ', - 'Ὰ' => 'ὰ', - 'Ά' => 'ά', - 'ᾼ' => 'ᾳ', - 'Ὲ' => 'ὲ', - 'Έ' => 'έ', - 'Ὴ' => 'ὴ', - 'Ή' => 'ή', - 'ῌ' => 'ῃ', - 'Ῐ' => 'ῐ', - 'Ῑ' => 'ῑ', - 'Ὶ' => 'ὶ', - 'Ί' => 'ί', - 'Ῠ' => 'ῠ', - 'Ῡ' => 'ῡ', - 'Ὺ' => 'ὺ', - 'Ύ' => 'ύ', - 'Ῥ' => 'ῥ', - 'Ὸ' => 'ὸ', - 'Ό' => 'ό', - 'Ὼ' => 'ὼ', - 'Ώ' => 'ώ', - 'ῼ' => 'ῳ', - 'Ω' => 'ω', - 'K' => 'k', - 'Å' => 'å', - 'Ⅎ' => 'ⅎ', - 'Ⅰ' => 'ⅰ', - 'Ⅱ' => 'ⅱ', - 'Ⅲ' => 'ⅲ', - 'Ⅳ' => 'ⅳ', - 'Ⅴ' => 'ⅴ', - 'Ⅵ' => 'ⅵ', - 'Ⅶ' => 'ⅶ', - 'Ⅷ' => 'ⅷ', - 'Ⅸ' => 'ⅸ', - 'Ⅹ' => 'ⅹ', - 'Ⅺ' => 'ⅺ', - 'Ⅻ' => 'ⅻ', - 'Ⅼ' => 'ⅼ', - 'Ⅽ' => 'ⅽ', - 'Ⅾ' => 'ⅾ', - 'Ⅿ' => 'ⅿ', - 'Ↄ' => 'ↄ', - 'Ⓐ' => 'ⓐ', - 'Ⓑ' => 'ⓑ', - 'Ⓒ' => 'ⓒ', - 'Ⓓ' => 'ⓓ', - 'Ⓔ' => 'ⓔ', - 'Ⓕ' => 'ⓕ', - 'Ⓖ' => 'ⓖ', - 'Ⓗ' => 'ⓗ', - 'Ⓘ' => 'ⓘ', - 'Ⓙ' => 'ⓙ', - 'Ⓚ' => 'ⓚ', - 'Ⓛ' => 'ⓛ', - 'Ⓜ' => 'ⓜ', - 'Ⓝ' => 'ⓝ', - 'Ⓞ' => 'ⓞ', - 'Ⓟ' => 'ⓟ', - 'Ⓠ' => 'ⓠ', - 'Ⓡ' => 'ⓡ', - 'Ⓢ' => 'ⓢ', - 'Ⓣ' => 'ⓣ', - 'Ⓤ' => 'ⓤ', - 'Ⓥ' => 'ⓥ', - 'Ⓦ' => 'ⓦ', - 'Ⓧ' => 'ⓧ', - 'Ⓨ' => 'ⓨ', - 'Ⓩ' => 'ⓩ', - 'Ⰰ' => 'ⰰ', - 'Ⰱ' => 'ⰱ', - 'Ⰲ' => 'ⰲ', - 'Ⰳ' => 'ⰳ', - 'Ⰴ' => 'ⰴ', - 'Ⰵ' => 'ⰵ', - 'Ⰶ' => 'ⰶ', - 'Ⰷ' => 'ⰷ', - 'Ⰸ' => 'ⰸ', - 'Ⰹ' => 'ⰹ', - 'Ⰺ' => 'ⰺ', - 'Ⰻ' => 'ⰻ', - 'Ⰼ' => 'ⰼ', - 'Ⰽ' => 'ⰽ', - 'Ⰾ' => 'ⰾ', - 'Ⰿ' => 'ⰿ', - 'Ⱀ' => 'ⱀ', - 'Ⱁ' => 'ⱁ', - 'Ⱂ' => 'ⱂ', - 'Ⱃ' => 'ⱃ', - 'Ⱄ' => 'ⱄ', - 'Ⱅ' => 'ⱅ', - 'Ⱆ' => 'ⱆ', - 'Ⱇ' => 'ⱇ', - 'Ⱈ' => 'ⱈ', - 'Ⱉ' => 'ⱉ', - 'Ⱊ' => 'ⱊ', - 'Ⱋ' => 'ⱋ', - 'Ⱌ' => 'ⱌ', - 'Ⱍ' => 'ⱍ', - 'Ⱎ' => 'ⱎ', - 'Ⱏ' => 'ⱏ', - 'Ⱐ' => 'ⱐ', - 'Ⱑ' => 'ⱑ', - 'Ⱒ' => 'ⱒ', - 'Ⱓ' => 'ⱓ', - 'Ⱔ' => 'ⱔ', - 'Ⱕ' => 'ⱕ', - 'Ⱖ' => 'ⱖ', - 'Ⱗ' => 'ⱗ', - 'Ⱘ' => 'ⱘ', - 'Ⱙ' => 'ⱙ', - 'Ⱚ' => 'ⱚ', - 'Ⱛ' => 'ⱛ', - 'Ⱜ' => 'ⱜ', - 'Ⱝ' => 'ⱝ', - 'Ⱞ' => 'ⱞ', - 'Ⱡ' => 'ⱡ', - 'Ɫ' => 'ɫ', - 'Ᵽ' => 'ᵽ', - 'Ɽ' => 'ɽ', - 'Ⱨ' => 'ⱨ', - 'Ⱪ' => 'ⱪ', - 'Ⱬ' => 'ⱬ', - 'Ɑ' => 'ɑ', - 'Ɱ' => 'ɱ', - 'Ɐ' => 'ɐ', - 'Ɒ' => 'ɒ', - 'Ⱳ' => 'ⱳ', - 'Ⱶ' => 'ⱶ', - 'Ȿ' => 'ȿ', - 'Ɀ' => 'ɀ', - 'Ⲁ' => 'ⲁ', - 'Ⲃ' => 'ⲃ', - 'Ⲅ' => 'ⲅ', - 'Ⲇ' => 'ⲇ', - 'Ⲉ' => 'ⲉ', - 'Ⲋ' => 'ⲋ', - 'Ⲍ' => 'ⲍ', - 'Ⲏ' => 'ⲏ', - 'Ⲑ' => 'ⲑ', - 'Ⲓ' => 'ⲓ', - 'Ⲕ' => 'ⲕ', - 'Ⲗ' => 'ⲗ', - 'Ⲙ' => 'ⲙ', - 'Ⲛ' => 'ⲛ', - 'Ⲝ' => 'ⲝ', - 'Ⲟ' => 'ⲟ', - 'Ⲡ' => 'ⲡ', - 'Ⲣ' => 'ⲣ', - 'Ⲥ' => 'ⲥ', - 'Ⲧ' => 'ⲧ', - 'Ⲩ' => 'ⲩ', - 'Ⲫ' => 'ⲫ', - 'Ⲭ' => 'ⲭ', - 'Ⲯ' => 'ⲯ', - 'Ⲱ' => 'ⲱ', - 'Ⲳ' => 'ⲳ', - 'Ⲵ' => 'ⲵ', - 'Ⲷ' => 'ⲷ', - 'Ⲹ' => 'ⲹ', - 'Ⲻ' => 'ⲻ', - 'Ⲽ' => 'ⲽ', - 'Ⲿ' => 'ⲿ', - 'Ⳁ' => 'ⳁ', - 'Ⳃ' => 'ⳃ', - 'Ⳅ' => 'ⳅ', - 'Ⳇ' => 'ⳇ', - 'Ⳉ' => 'ⳉ', - 'Ⳋ' => 'ⳋ', - 'Ⳍ' => 'ⳍ', - 'Ⳏ' => 'ⳏ', - 'Ⳑ' => 'ⳑ', - 'Ⳓ' => 'ⳓ', - 'Ⳕ' => 'ⳕ', - 'Ⳗ' => 'ⳗ', - 'Ⳙ' => 'ⳙ', - 'Ⳛ' => 'ⳛ', - 'Ⳝ' => 'ⳝ', - 'Ⳟ' => 'ⳟ', - 'Ⳡ' => 'ⳡ', - 'Ⳣ' => 'ⳣ', - 'Ⳬ' => 'ⳬ', - 'Ⳮ' => 'ⳮ', - 'Ⳳ' => 'ⳳ', - 'Ꙁ' => 'ꙁ', - 'Ꙃ' => 'ꙃ', - 'Ꙅ' => 'ꙅ', - 'Ꙇ' => 'ꙇ', - 'Ꙉ' => 'ꙉ', - 'Ꙋ' => 'ꙋ', - 'Ꙍ' => 'ꙍ', - 'Ꙏ' => 'ꙏ', - 'Ꙑ' => 'ꙑ', - 'Ꙓ' => 'ꙓ', - 'Ꙕ' => 'ꙕ', - 'Ꙗ' => 'ꙗ', - 'Ꙙ' => 'ꙙ', - 'Ꙛ' => 'ꙛ', - 'Ꙝ' => 'ꙝ', - 'Ꙟ' => 'ꙟ', - 'Ꙡ' => 'ꙡ', - 'Ꙣ' => 'ꙣ', - 'Ꙥ' => 'ꙥ', - 'Ꙧ' => 'ꙧ', - 'Ꙩ' => 'ꙩ', - 'Ꙫ' => 'ꙫ', - 'Ꙭ' => 'ꙭ', - 'Ꚁ' => 'ꚁ', - 'Ꚃ' => 'ꚃ', - 'Ꚅ' => 'ꚅ', - 'Ꚇ' => 'ꚇ', - 'Ꚉ' => 'ꚉ', - 'Ꚋ' => 'ꚋ', - 'Ꚍ' => 'ꚍ', - 'Ꚏ' => 'ꚏ', - 'Ꚑ' => 'ꚑ', - 'Ꚓ' => 'ꚓ', - 'Ꚕ' => 'ꚕ', - 'Ꚗ' => 'ꚗ', - 'Ꚙ' => 'ꚙ', - 'Ꚛ' => 'ꚛ', - 'Ꜣ' => 'ꜣ', - 'Ꜥ' => 'ꜥ', - 'Ꜧ' => 'ꜧ', - 'Ꜩ' => 'ꜩ', - 'Ꜫ' => 'ꜫ', - 'Ꜭ' => 'ꜭ', - 'Ꜯ' => 'ꜯ', - 'Ꜳ' => 'ꜳ', - 'Ꜵ' => 'ꜵ', - 'Ꜷ' => 'ꜷ', - 'Ꜹ' => 'ꜹ', - 'Ꜻ' => 'ꜻ', - 'Ꜽ' => 'ꜽ', - 'Ꜿ' => 'ꜿ', - 'Ꝁ' => 'ꝁ', - 'Ꝃ' => 'ꝃ', - 'Ꝅ' => 'ꝅ', - 'Ꝇ' => 'ꝇ', - 'Ꝉ' => 'ꝉ', - 'Ꝋ' => 'ꝋ', - 'Ꝍ' => 'ꝍ', - 'Ꝏ' => 'ꝏ', - 'Ꝑ' => 'ꝑ', - 'Ꝓ' => 'ꝓ', - 'Ꝕ' => 'ꝕ', - 'Ꝗ' => 'ꝗ', - 'Ꝙ' => 'ꝙ', - 'Ꝛ' => 'ꝛ', - 'Ꝝ' => 'ꝝ', - 'Ꝟ' => 'ꝟ', - 'Ꝡ' => 'ꝡ', - 'Ꝣ' => 'ꝣ', - 'Ꝥ' => 'ꝥ', - 'Ꝧ' => 'ꝧ', - 'Ꝩ' => 'ꝩ', - 'Ꝫ' => 'ꝫ', - 'Ꝭ' => 'ꝭ', - 'Ꝯ' => 'ꝯ', - 'Ꝺ' => 'ꝺ', - 'Ꝼ' => 'ꝼ', - 'Ᵹ' => 'ᵹ', - 'Ꝿ' => 'ꝿ', - 'Ꞁ' => 'ꞁ', - 'Ꞃ' => 'ꞃ', - 'Ꞅ' => 'ꞅ', - 'Ꞇ' => 'ꞇ', - 'Ꞌ' => 'ꞌ', - 'Ɥ' => 'ɥ', - 'Ꞑ' => 'ꞑ', - 'Ꞓ' => 'ꞓ', - 'Ꞗ' => 'ꞗ', - 'Ꞙ' => 'ꞙ', - 'Ꞛ' => 'ꞛ', - 'Ꞝ' => 'ꞝ', - 'Ꞟ' => 'ꞟ', - 'Ꞡ' => 'ꞡ', - 'Ꞣ' => 'ꞣ', - 'Ꞥ' => 'ꞥ', - 'Ꞧ' => 'ꞧ', - 'Ꞩ' => 'ꞩ', - 'Ɦ' => 'ɦ', - 'Ɜ' => 'ɜ', - 'Ɡ' => 'ɡ', - 'Ɬ' => 'ɬ', - 'Ʞ' => 'ʞ', - 'Ʇ' => 'ʇ', - 'A' => 'a', - 'B' => 'b', - 'C' => 'c', - 'D' => 'd', - 'E' => 'e', - 'F' => 'f', - 'G' => 'g', - 'H' => 'h', - 'I' => 'i', - 'J' => 'j', - 'K' => 'k', - 'L' => 'l', - 'M' => 'm', - 'N' => 'n', - 'O' => 'o', - 'P' => 'p', - 'Q' => 'q', - 'R' => 'r', - 'S' => 's', - 'T' => 't', - 'U' => 'u', - 'V' => 'v', - 'W' => 'w', - 'X' => 'x', - 'Y' => 'y', - 'Z' => 'z', - '𐐀' => '𐐨', - '𐐁' => '𐐩', - '𐐂' => '𐐪', - '𐐃' => '𐐫', - '𐐄' => '𐐬', - '𐐅' => '𐐭', - '𐐆' => '𐐮', - '𐐇' => '𐐯', - '𐐈' => '𐐰', - '𐐉' => '𐐱', - '𐐊' => '𐐲', - '𐐋' => '𐐳', - '𐐌' => '𐐴', - '𐐍' => '𐐵', - '𐐎' => '𐐶', - '𐐏' => '𐐷', - '𐐐' => '𐐸', - '𐐑' => '𐐹', - '𐐒' => '𐐺', - '𐐓' => '𐐻', - '𐐔' => '𐐼', - '𐐕' => '𐐽', - '𐐖' => '𐐾', - '𐐗' => '𐐿', - '𐐘' => '𐑀', - '𐐙' => '𐑁', - '𐐚' => '𐑂', - '𐐛' => '𐑃', - '𐐜' => '𐑄', - '𐐝' => '𐑅', - '𐐞' => '𐑆', - '𐐟' => '𐑇', - '𐐠' => '𐑈', - '𐐡' => '𐑉', - '𐐢' => '𐑊', - '𐐣' => '𐑋', - '𐐤' => '𐑌', - '𐐥' => '𐑍', - '𐐦' => '𐑎', - '𐐧' => '𐑏', - '𑢠' => '𑣀', - '𑢡' => '𑣁', - '𑢢' => '𑣂', - '𑢣' => '𑣃', - '𑢤' => '𑣄', - '𑢥' => '𑣅', - '𑢦' => '𑣆', - '𑢧' => '𑣇', - '𑢨' => '𑣈', - '𑢩' => '𑣉', - '𑢪' => '𑣊', - '𑢫' => '𑣋', - '𑢬' => '𑣌', - '𑢭' => '𑣍', - '𑢮' => '𑣎', - '𑢯' => '𑣏', - '𑢰' => '𑣐', - '𑢱' => '𑣑', - '𑢲' => '𑣒', - '𑢳' => '𑣓', - '𑢴' => '𑣔', - '𑢵' => '𑣕', - '𑢶' => '𑣖', - '𑢷' => '𑣗', - '𑢸' => '𑣘', - '𑢹' => '𑣙', - '𑢺' => '𑣚', - '𑢻' => '𑣛', - '𑢼' => '𑣜', - '𑢽' => '𑣝', - '𑢾' => '𑣞', - '𑢿' => '𑣟', +static $data = array( + 'A' => 'a', + 'B' => 'b', + 'C' => 'c', + 'D' => 'd', + 'E' => 'e', + 'F' => 'f', + 'G' => 'g', + 'H' => 'h', + 'I' => 'i', + 'J' => 'j', + 'K' => 'k', + 'L' => 'l', + 'M' => 'm', + 'N' => 'n', + 'O' => 'o', + 'P' => 'p', + 'Q' => 'q', + 'R' => 'r', + 'S' => 's', + 'T' => 't', + 'U' => 'u', + 'V' => 'v', + 'W' => 'w', + 'X' => 'x', + 'Y' => 'y', + 'Z' => 'z', + 'À' => 'à', + 'Á' => 'á', + 'Â' => 'â', + 'Ã' => 'ã', + 'Ä' => 'ä', + 'Å' => 'å', + 'Æ' => 'æ', + 'Ç' => 'ç', + 'È' => 'è', + 'É' => 'é', + 'Ê' => 'ê', + 'Ë' => 'ë', + 'Ì' => 'ì', + 'Í' => 'í', + 'Î' => 'î', + 'Ï' => 'ï', + 'Ð' => 'ð', + 'Ñ' => 'ñ', + 'Ò' => 'ò', + 'Ó' => 'ó', + 'Ô' => 'ô', + 'Õ' => 'õ', + 'Ö' => 'ö', + 'Ø' => 'ø', + 'Ù' => 'ù', + 'Ú' => 'ú', + 'Û' => 'û', + 'Ü' => 'ü', + 'Ý' => 'ý', + 'Þ' => 'þ', + 'Ā' => 'ā', + 'Ă' => 'ă', + 'Ą' => 'ą', + 'Ć' => 'ć', + 'Ĉ' => 'ĉ', + 'Ċ' => 'ċ', + 'Č' => 'č', + 'Ď' => 'ď', + 'Đ' => 'đ', + 'Ē' => 'ē', + 'Ĕ' => 'ĕ', + 'Ė' => 'ė', + 'Ę' => 'ę', + 'Ě' => 'ě', + 'Ĝ' => 'ĝ', + 'Ğ' => 'ğ', + 'Ġ' => 'ġ', + 'Ģ' => 'ģ', + 'Ĥ' => 'ĥ', + 'Ħ' => 'ħ', + 'Ĩ' => 'ĩ', + 'Ī' => 'ī', + 'Ĭ' => 'ĭ', + 'Į' => 'į', + 'İ' => 'i', + 'IJ' => 'ij', + 'Ĵ' => 'ĵ', + 'Ķ' => 'ķ', + 'Ĺ' => 'ĺ', + 'Ļ' => 'ļ', + 'Ľ' => 'ľ', + 'Ŀ' => 'ŀ', + 'Ł' => 'ł', + 'Ń' => 'ń', + 'Ņ' => 'ņ', + 'Ň' => 'ň', + 'Ŋ' => 'ŋ', + 'Ō' => 'ō', + 'Ŏ' => 'ŏ', + 'Ő' => 'ő', + 'Œ' => 'œ', + 'Ŕ' => 'ŕ', + 'Ŗ' => 'ŗ', + 'Ř' => 'ř', + 'Ś' => 'ś', + 'Ŝ' => 'ŝ', + 'Ş' => 'ş', + 'Š' => 'š', + 'Ţ' => 'ţ', + 'Ť' => 'ť', + 'Ŧ' => 'ŧ', + 'Ũ' => 'ũ', + 'Ū' => 'ū', + 'Ŭ' => 'ŭ', + 'Ů' => 'ů', + 'Ű' => 'ű', + 'Ų' => 'ų', + 'Ŵ' => 'ŵ', + 'Ŷ' => 'ŷ', + 'Ÿ' => 'ÿ', + 'Ź' => 'ź', + 'Ż' => 'ż', + 'Ž' => 'ž', + 'Ɓ' => 'ɓ', + 'Ƃ' => 'ƃ', + 'Ƅ' => 'ƅ', + 'Ɔ' => 'ɔ', + 'Ƈ' => 'ƈ', + 'Ɖ' => 'ɖ', + 'Ɗ' => 'ɗ', + 'Ƌ' => 'ƌ', + 'Ǝ' => 'ǝ', + 'Ə' => 'ə', + 'Ɛ' => 'ɛ', + 'Ƒ' => 'ƒ', + 'Ɠ' => 'ɠ', + 'Ɣ' => 'ɣ', + 'Ɩ' => 'ɩ', + 'Ɨ' => 'ɨ', + 'Ƙ' => 'ƙ', + 'Ɯ' => 'ɯ', + 'Ɲ' => 'ɲ', + 'Ɵ' => 'ɵ', + 'Ơ' => 'ơ', + 'Ƣ' => 'ƣ', + 'Ƥ' => 'ƥ', + 'Ʀ' => 'ʀ', + 'Ƨ' => 'ƨ', + 'Ʃ' => 'ʃ', + 'Ƭ' => 'ƭ', + 'Ʈ' => 'ʈ', + 'Ư' => 'ư', + 'Ʊ' => 'ʊ', + 'Ʋ' => 'ʋ', + 'Ƴ' => 'ƴ', + 'Ƶ' => 'ƶ', + 'Ʒ' => 'ʒ', + 'Ƹ' => 'ƹ', + 'Ƽ' => 'ƽ', + 'DŽ' => 'dž', + 'Dž' => 'dž', + 'LJ' => 'lj', + 'Lj' => 'lj', + 'NJ' => 'nj', + 'Nj' => 'nj', + 'Ǎ' => 'ǎ', + 'Ǐ' => 'ǐ', + 'Ǒ' => 'ǒ', + 'Ǔ' => 'ǔ', + 'Ǖ' => 'ǖ', + 'Ǘ' => 'ǘ', + 'Ǚ' => 'ǚ', + 'Ǜ' => 'ǜ', + 'Ǟ' => 'ǟ', + 'Ǡ' => 'ǡ', + 'Ǣ' => 'ǣ', + 'Ǥ' => 'ǥ', + 'Ǧ' => 'ǧ', + 'Ǩ' => 'ǩ', + 'Ǫ' => 'ǫ', + 'Ǭ' => 'ǭ', + 'Ǯ' => 'ǯ', + 'DZ' => 'dz', + 'Dz' => 'dz', + 'Ǵ' => 'ǵ', + 'Ƕ' => 'ƕ', + 'Ƿ' => 'ƿ', + 'Ǹ' => 'ǹ', + 'Ǻ' => 'ǻ', + 'Ǽ' => 'ǽ', + 'Ǿ' => 'ǿ', + 'Ȁ' => 'ȁ', + 'Ȃ' => 'ȃ', + 'Ȅ' => 'ȅ', + 'Ȇ' => 'ȇ', + 'Ȉ' => 'ȉ', + 'Ȋ' => 'ȋ', + 'Ȍ' => 'ȍ', + 'Ȏ' => 'ȏ', + 'Ȑ' => 'ȑ', + 'Ȓ' => 'ȓ', + 'Ȕ' => 'ȕ', + 'Ȗ' => 'ȗ', + 'Ș' => 'ș', + 'Ț' => 'ț', + 'Ȝ' => 'ȝ', + 'Ȟ' => 'ȟ', + 'Ƞ' => 'ƞ', + 'Ȣ' => 'ȣ', + 'Ȥ' => 'ȥ', + 'Ȧ' => 'ȧ', + 'Ȩ' => 'ȩ', + 'Ȫ' => 'ȫ', + 'Ȭ' => 'ȭ', + 'Ȯ' => 'ȯ', + 'Ȱ' => 'ȱ', + 'Ȳ' => 'ȳ', + 'Ⱥ' => 'ⱥ', + 'Ȼ' => 'ȼ', + 'Ƚ' => 'ƚ', + 'Ⱦ' => 'ⱦ', + 'Ɂ' => 'ɂ', + 'Ƀ' => 'ƀ', + 'Ʉ' => 'ʉ', + 'Ʌ' => 'ʌ', + 'Ɇ' => 'ɇ', + 'Ɉ' => 'ɉ', + 'Ɋ' => 'ɋ', + 'Ɍ' => 'ɍ', + 'Ɏ' => 'ɏ', + 'Ͱ' => 'ͱ', + 'Ͳ' => 'ͳ', + 'Ͷ' => 'ͷ', + 'Ϳ' => 'ϳ', + 'Ά' => 'ά', + 'Έ' => 'έ', + 'Ή' => 'ή', + 'Ί' => 'ί', + 'Ό' => 'ό', + 'Ύ' => 'ύ', + 'Ώ' => 'ώ', + 'Α' => 'α', + 'Β' => 'β', + 'Γ' => 'γ', + 'Δ' => 'δ', + 'Ε' => 'ε', + 'Ζ' => 'ζ', + 'Η' => 'η', + 'Θ' => 'θ', + 'Ι' => 'ι', + 'Κ' => 'κ', + 'Λ' => 'λ', + 'Μ' => 'μ', + 'Ν' => 'ν', + 'Ξ' => 'ξ', + 'Ο' => 'ο', + 'Π' => 'π', + 'Ρ' => 'ρ', + 'Σ' => 'σ', + 'Τ' => 'τ', + 'Υ' => 'υ', + 'Φ' => 'φ', + 'Χ' => 'χ', + 'Ψ' => 'ψ', + 'Ω' => 'ω', + 'Ϊ' => 'ϊ', + 'Ϋ' => 'ϋ', + 'Ϗ' => 'ϗ', + 'Ϙ' => 'ϙ', + 'Ϛ' => 'ϛ', + 'Ϝ' => 'ϝ', + 'Ϟ' => 'ϟ', + 'Ϡ' => 'ϡ', + 'Ϣ' => 'ϣ', + 'Ϥ' => 'ϥ', + 'Ϧ' => 'ϧ', + 'Ϩ' => 'ϩ', + 'Ϫ' => 'ϫ', + 'Ϭ' => 'ϭ', + 'Ϯ' => 'ϯ', + 'ϴ' => 'θ', + 'Ϸ' => 'ϸ', + 'Ϲ' => 'ϲ', + 'Ϻ' => 'ϻ', + 'Ͻ' => 'ͻ', + 'Ͼ' => 'ͼ', + 'Ͽ' => 'ͽ', + 'Ѐ' => 'ѐ', + 'Ё' => 'ё', + 'Ђ' => 'ђ', + 'Ѓ' => 'ѓ', + 'Є' => 'є', + 'Ѕ' => 'ѕ', + 'І' => 'і', + 'Ї' => 'ї', + 'Ј' => 'ј', + 'Љ' => 'љ', + 'Њ' => 'њ', + 'Ћ' => 'ћ', + 'Ќ' => 'ќ', + 'Ѝ' => 'ѝ', + 'Ў' => 'ў', + 'Џ' => 'џ', + 'А' => 'а', + 'Б' => 'б', + 'В' => 'в', + 'Г' => 'г', + 'Д' => 'д', + 'Е' => 'е', + 'Ж' => 'ж', + 'З' => 'з', + 'И' => 'и', + 'Й' => 'й', + 'К' => 'к', + 'Л' => 'л', + 'М' => 'м', + 'Н' => 'н', + 'О' => 'о', + 'П' => 'п', + 'Р' => 'р', + 'С' => 'с', + 'Т' => 'т', + 'У' => 'у', + 'Ф' => 'ф', + 'Х' => 'х', + 'Ц' => 'ц', + 'Ч' => 'ч', + 'Ш' => 'ш', + 'Щ' => 'щ', + 'Ъ' => 'ъ', + 'Ы' => 'ы', + 'Ь' => 'ь', + 'Э' => 'э', + 'Ю' => 'ю', + 'Я' => 'я', + 'Ѡ' => 'ѡ', + 'Ѣ' => 'ѣ', + 'Ѥ' => 'ѥ', + 'Ѧ' => 'ѧ', + 'Ѩ' => 'ѩ', + 'Ѫ' => 'ѫ', + 'Ѭ' => 'ѭ', + 'Ѯ' => 'ѯ', + 'Ѱ' => 'ѱ', + 'Ѳ' => 'ѳ', + 'Ѵ' => 'ѵ', + 'Ѷ' => 'ѷ', + 'Ѹ' => 'ѹ', + 'Ѻ' => 'ѻ', + 'Ѽ' => 'ѽ', + 'Ѿ' => 'ѿ', + 'Ҁ' => 'ҁ', + 'Ҋ' => 'ҋ', + 'Ҍ' => 'ҍ', + 'Ҏ' => 'ҏ', + 'Ґ' => 'ґ', + 'Ғ' => 'ғ', + 'Ҕ' => 'ҕ', + 'Җ' => 'җ', + 'Ҙ' => 'ҙ', + 'Қ' => 'қ', + 'Ҝ' => 'ҝ', + 'Ҟ' => 'ҟ', + 'Ҡ' => 'ҡ', + 'Ң' => 'ң', + 'Ҥ' => 'ҥ', + 'Ҧ' => 'ҧ', + 'Ҩ' => 'ҩ', + 'Ҫ' => 'ҫ', + 'Ҭ' => 'ҭ', + 'Ү' => 'ү', + 'Ұ' => 'ұ', + 'Ҳ' => 'ҳ', + 'Ҵ' => 'ҵ', + 'Ҷ' => 'ҷ', + 'Ҹ' => 'ҹ', + 'Һ' => 'һ', + 'Ҽ' => 'ҽ', + 'Ҿ' => 'ҿ', + 'Ӏ' => 'ӏ', + 'Ӂ' => 'ӂ', + 'Ӄ' => 'ӄ', + 'Ӆ' => 'ӆ', + 'Ӈ' => 'ӈ', + 'Ӊ' => 'ӊ', + 'Ӌ' => 'ӌ', + 'Ӎ' => 'ӎ', + 'Ӑ' => 'ӑ', + 'Ӓ' => 'ӓ', + 'Ӕ' => 'ӕ', + 'Ӗ' => 'ӗ', + 'Ә' => 'ә', + 'Ӛ' => 'ӛ', + 'Ӝ' => 'ӝ', + 'Ӟ' => 'ӟ', + 'Ӡ' => 'ӡ', + 'Ӣ' => 'ӣ', + 'Ӥ' => 'ӥ', + 'Ӧ' => 'ӧ', + 'Ө' => 'ө', + 'Ӫ' => 'ӫ', + 'Ӭ' => 'ӭ', + 'Ӯ' => 'ӯ', + 'Ӱ' => 'ӱ', + 'Ӳ' => 'ӳ', + 'Ӵ' => 'ӵ', + 'Ӷ' => 'ӷ', + 'Ӹ' => 'ӹ', + 'Ӻ' => 'ӻ', + 'Ӽ' => 'ӽ', + 'Ӿ' => 'ӿ', + 'Ԁ' => 'ԁ', + 'Ԃ' => 'ԃ', + 'Ԅ' => 'ԅ', + 'Ԇ' => 'ԇ', + 'Ԉ' => 'ԉ', + 'Ԋ' => 'ԋ', + 'Ԍ' => 'ԍ', + 'Ԏ' => 'ԏ', + 'Ԑ' => 'ԑ', + 'Ԓ' => 'ԓ', + 'Ԕ' => 'ԕ', + 'Ԗ' => 'ԗ', + 'Ԙ' => 'ԙ', + 'Ԛ' => 'ԛ', + 'Ԝ' => 'ԝ', + 'Ԟ' => 'ԟ', + 'Ԡ' => 'ԡ', + 'Ԣ' => 'ԣ', + 'Ԥ' => 'ԥ', + 'Ԧ' => 'ԧ', + 'Ԩ' => 'ԩ', + 'Ԫ' => 'ԫ', + 'Ԭ' => 'ԭ', + 'Ԯ' => 'ԯ', + 'Ա' => 'ա', + 'Բ' => 'բ', + 'Գ' => 'գ', + 'Դ' => 'դ', + 'Ե' => 'ե', + 'Զ' => 'զ', + 'Է' => 'է', + 'Ը' => 'ը', + 'Թ' => 'թ', + 'Ժ' => 'ժ', + 'Ի' => 'ի', + 'Լ' => 'լ', + 'Խ' => 'խ', + 'Ծ' => 'ծ', + 'Կ' => 'կ', + 'Հ' => 'հ', + 'Ձ' => 'ձ', + 'Ղ' => 'ղ', + 'Ճ' => 'ճ', + 'Մ' => 'մ', + 'Յ' => 'յ', + 'Ն' => 'ն', + 'Շ' => 'շ', + 'Ո' => 'ո', + 'Չ' => 'չ', + 'Պ' => 'պ', + 'Ջ' => 'ջ', + 'Ռ' => 'ռ', + 'Ս' => 'ս', + 'Վ' => 'վ', + 'Տ' => 'տ', + 'Ր' => 'ր', + 'Ց' => 'ց', + 'Ւ' => 'ւ', + 'Փ' => 'փ', + 'Ք' => 'ք', + 'Օ' => 'օ', + 'Ֆ' => 'ֆ', + 'Ⴀ' => 'ⴀ', + 'Ⴁ' => 'ⴁ', + 'Ⴂ' => 'ⴂ', + 'Ⴃ' => 'ⴃ', + 'Ⴄ' => 'ⴄ', + 'Ⴅ' => 'ⴅ', + 'Ⴆ' => 'ⴆ', + 'Ⴇ' => 'ⴇ', + 'Ⴈ' => 'ⴈ', + 'Ⴉ' => 'ⴉ', + 'Ⴊ' => 'ⴊ', + 'Ⴋ' => 'ⴋ', + 'Ⴌ' => 'ⴌ', + 'Ⴍ' => 'ⴍ', + 'Ⴎ' => 'ⴎ', + 'Ⴏ' => 'ⴏ', + 'Ⴐ' => 'ⴐ', + 'Ⴑ' => 'ⴑ', + 'Ⴒ' => 'ⴒ', + 'Ⴓ' => 'ⴓ', + 'Ⴔ' => 'ⴔ', + 'Ⴕ' => 'ⴕ', + 'Ⴖ' => 'ⴖ', + 'Ⴗ' => 'ⴗ', + 'Ⴘ' => 'ⴘ', + 'Ⴙ' => 'ⴙ', + 'Ⴚ' => 'ⴚ', + 'Ⴛ' => 'ⴛ', + 'Ⴜ' => 'ⴜ', + 'Ⴝ' => 'ⴝ', + 'Ⴞ' => 'ⴞ', + 'Ⴟ' => 'ⴟ', + 'Ⴠ' => 'ⴠ', + 'Ⴡ' => 'ⴡ', + 'Ⴢ' => 'ⴢ', + 'Ⴣ' => 'ⴣ', + 'Ⴤ' => 'ⴤ', + 'Ⴥ' => 'ⴥ', + 'Ⴧ' => 'ⴧ', + 'Ⴭ' => 'ⴭ', + 'Ḁ' => 'ḁ', + 'Ḃ' => 'ḃ', + 'Ḅ' => 'ḅ', + 'Ḇ' => 'ḇ', + 'Ḉ' => 'ḉ', + 'Ḋ' => 'ḋ', + 'Ḍ' => 'ḍ', + 'Ḏ' => 'ḏ', + 'Ḑ' => 'ḑ', + 'Ḓ' => 'ḓ', + 'Ḕ' => 'ḕ', + 'Ḗ' => 'ḗ', + 'Ḙ' => 'ḙ', + 'Ḛ' => 'ḛ', + 'Ḝ' => 'ḝ', + 'Ḟ' => 'ḟ', + 'Ḡ' => 'ḡ', + 'Ḣ' => 'ḣ', + 'Ḥ' => 'ḥ', + 'Ḧ' => 'ḧ', + 'Ḩ' => 'ḩ', + 'Ḫ' => 'ḫ', + 'Ḭ' => 'ḭ', + 'Ḯ' => 'ḯ', + 'Ḱ' => 'ḱ', + 'Ḳ' => 'ḳ', + 'Ḵ' => 'ḵ', + 'Ḷ' => 'ḷ', + 'Ḹ' => 'ḹ', + 'Ḻ' => 'ḻ', + 'Ḽ' => 'ḽ', + 'Ḿ' => 'ḿ', + 'Ṁ' => 'ṁ', + 'Ṃ' => 'ṃ', + 'Ṅ' => 'ṅ', + 'Ṇ' => 'ṇ', + 'Ṉ' => 'ṉ', + 'Ṋ' => 'ṋ', + 'Ṍ' => 'ṍ', + 'Ṏ' => 'ṏ', + 'Ṑ' => 'ṑ', + 'Ṓ' => 'ṓ', + 'Ṕ' => 'ṕ', + 'Ṗ' => 'ṗ', + 'Ṙ' => 'ṙ', + 'Ṛ' => 'ṛ', + 'Ṝ' => 'ṝ', + 'Ṟ' => 'ṟ', + 'Ṡ' => 'ṡ', + 'Ṣ' => 'ṣ', + 'Ṥ' => 'ṥ', + 'Ṧ' => 'ṧ', + 'Ṩ' => 'ṩ', + 'Ṫ' => 'ṫ', + 'Ṭ' => 'ṭ', + 'Ṯ' => 'ṯ', + 'Ṱ' => 'ṱ', + 'Ṳ' => 'ṳ', + 'Ṵ' => 'ṵ', + 'Ṷ' => 'ṷ', + 'Ṹ' => 'ṹ', + 'Ṻ' => 'ṻ', + 'Ṽ' => 'ṽ', + 'Ṿ' => 'ṿ', + 'Ẁ' => 'ẁ', + 'Ẃ' => 'ẃ', + 'Ẅ' => 'ẅ', + 'Ẇ' => 'ẇ', + 'Ẉ' => 'ẉ', + 'Ẋ' => 'ẋ', + 'Ẍ' => 'ẍ', + 'Ẏ' => 'ẏ', + 'Ẑ' => 'ẑ', + 'Ẓ' => 'ẓ', + 'Ẕ' => 'ẕ', + 'ẞ' => 'ß', + 'Ạ' => 'ạ', + 'Ả' => 'ả', + 'Ấ' => 'ấ', + 'Ầ' => 'ầ', + 'Ẩ' => 'ẩ', + 'Ẫ' => 'ẫ', + 'Ậ' => 'ậ', + 'Ắ' => 'ắ', + 'Ằ' => 'ằ', + 'Ẳ' => 'ẳ', + 'Ẵ' => 'ẵ', + 'Ặ' => 'ặ', + 'Ẹ' => 'ẹ', + 'Ẻ' => 'ẻ', + 'Ẽ' => 'ẽ', + 'Ế' => 'ế', + 'Ề' => 'ề', + 'Ể' => 'ể', + 'Ễ' => 'ễ', + 'Ệ' => 'ệ', + 'Ỉ' => 'ỉ', + 'Ị' => 'ị', + 'Ọ' => 'ọ', + 'Ỏ' => 'ỏ', + 'Ố' => 'ố', + 'Ồ' => 'ồ', + 'Ổ' => 'ổ', + 'Ỗ' => 'ỗ', + 'Ộ' => 'ộ', + 'Ớ' => 'ớ', + 'Ờ' => 'ờ', + 'Ở' => 'ở', + 'Ỡ' => 'ỡ', + 'Ợ' => 'ợ', + 'Ụ' => 'ụ', + 'Ủ' => 'ủ', + 'Ứ' => 'ứ', + 'Ừ' => 'ừ', + 'Ử' => 'ử', + 'Ữ' => 'ữ', + 'Ự' => 'ự', + 'Ỳ' => 'ỳ', + 'Ỵ' => 'ỵ', + 'Ỷ' => 'ỷ', + 'Ỹ' => 'ỹ', + 'Ỻ' => 'ỻ', + 'Ỽ' => 'ỽ', + 'Ỿ' => 'ỿ', + 'Ἀ' => 'ἀ', + 'Ἁ' => 'ἁ', + 'Ἂ' => 'ἂ', + 'Ἃ' => 'ἃ', + 'Ἄ' => 'ἄ', + 'Ἅ' => 'ἅ', + 'Ἆ' => 'ἆ', + 'Ἇ' => 'ἇ', + 'Ἐ' => 'ἐ', + 'Ἑ' => 'ἑ', + 'Ἒ' => 'ἒ', + 'Ἓ' => 'ἓ', + 'Ἔ' => 'ἔ', + 'Ἕ' => 'ἕ', + 'Ἠ' => 'ἠ', + 'Ἡ' => 'ἡ', + 'Ἢ' => 'ἢ', + 'Ἣ' => 'ἣ', + 'Ἤ' => 'ἤ', + 'Ἥ' => 'ἥ', + 'Ἦ' => 'ἦ', + 'Ἧ' => 'ἧ', + 'Ἰ' => 'ἰ', + 'Ἱ' => 'ἱ', + 'Ἲ' => 'ἲ', + 'Ἳ' => 'ἳ', + 'Ἴ' => 'ἴ', + 'Ἵ' => 'ἵ', + 'Ἶ' => 'ἶ', + 'Ἷ' => 'ἷ', + 'Ὀ' => 'ὀ', + 'Ὁ' => 'ὁ', + 'Ὂ' => 'ὂ', + 'Ὃ' => 'ὃ', + 'Ὄ' => 'ὄ', + 'Ὅ' => 'ὅ', + 'Ὑ' => 'ὑ', + 'Ὓ' => 'ὓ', + 'Ὕ' => 'ὕ', + 'Ὗ' => 'ὗ', + 'Ὠ' => 'ὠ', + 'Ὡ' => 'ὡ', + 'Ὢ' => 'ὢ', + 'Ὣ' => 'ὣ', + 'Ὤ' => 'ὤ', + 'Ὥ' => 'ὥ', + 'Ὦ' => 'ὦ', + 'Ὧ' => 'ὧ', + 'ᾈ' => 'ᾀ', + 'ᾉ' => 'ᾁ', + 'ᾊ' => 'ᾂ', + 'ᾋ' => 'ᾃ', + 'ᾌ' => 'ᾄ', + 'ᾍ' => 'ᾅ', + 'ᾎ' => 'ᾆ', + 'ᾏ' => 'ᾇ', + 'ᾘ' => 'ᾐ', + 'ᾙ' => 'ᾑ', + 'ᾚ' => 'ᾒ', + 'ᾛ' => 'ᾓ', + 'ᾜ' => 'ᾔ', + 'ᾝ' => 'ᾕ', + 'ᾞ' => 'ᾖ', + 'ᾟ' => 'ᾗ', + 'ᾨ' => 'ᾠ', + 'ᾩ' => 'ᾡ', + 'ᾪ' => 'ᾢ', + 'ᾫ' => 'ᾣ', + 'ᾬ' => 'ᾤ', + 'ᾭ' => 'ᾥ', + 'ᾮ' => 'ᾦ', + 'ᾯ' => 'ᾧ', + 'Ᾰ' => 'ᾰ', + 'Ᾱ' => 'ᾱ', + 'Ὰ' => 'ὰ', + 'Ά' => 'ά', + 'ᾼ' => 'ᾳ', + 'Ὲ' => 'ὲ', + 'Έ' => 'έ', + 'Ὴ' => 'ὴ', + 'Ή' => 'ή', + 'ῌ' => 'ῃ', + 'Ῐ' => 'ῐ', + 'Ῑ' => 'ῑ', + 'Ὶ' => 'ὶ', + 'Ί' => 'ί', + 'Ῠ' => 'ῠ', + 'Ῡ' => 'ῡ', + 'Ὺ' => 'ὺ', + 'Ύ' => 'ύ', + 'Ῥ' => 'ῥ', + 'Ὸ' => 'ὸ', + 'Ό' => 'ό', + 'Ὼ' => 'ὼ', + 'Ώ' => 'ώ', + 'ῼ' => 'ῳ', + 'Ω' => 'ω', + 'K' => 'k', + 'Å' => 'å', + 'Ⅎ' => 'ⅎ', + 'Ⅰ' => 'ⅰ', + 'Ⅱ' => 'ⅱ', + 'Ⅲ' => 'ⅲ', + 'Ⅳ' => 'ⅳ', + 'Ⅴ' => 'ⅴ', + 'Ⅵ' => 'ⅵ', + 'Ⅶ' => 'ⅶ', + 'Ⅷ' => 'ⅷ', + 'Ⅸ' => 'ⅸ', + 'Ⅹ' => 'ⅹ', + 'Ⅺ' => 'ⅺ', + 'Ⅻ' => 'ⅻ', + 'Ⅼ' => 'ⅼ', + 'Ⅽ' => 'ⅽ', + 'Ⅾ' => 'ⅾ', + 'Ⅿ' => 'ⅿ', + 'Ↄ' => 'ↄ', + 'Ⓐ' => 'ⓐ', + 'Ⓑ' => 'ⓑ', + 'Ⓒ' => 'ⓒ', + 'Ⓓ' => 'ⓓ', + 'Ⓔ' => 'ⓔ', + 'Ⓕ' => 'ⓕ', + 'Ⓖ' => 'ⓖ', + 'Ⓗ' => 'ⓗ', + 'Ⓘ' => 'ⓘ', + 'Ⓙ' => 'ⓙ', + 'Ⓚ' => 'ⓚ', + 'Ⓛ' => 'ⓛ', + 'Ⓜ' => 'ⓜ', + 'Ⓝ' => 'ⓝ', + 'Ⓞ' => 'ⓞ', + 'Ⓟ' => 'ⓟ', + 'Ⓠ' => 'ⓠ', + 'Ⓡ' => 'ⓡ', + 'Ⓢ' => 'ⓢ', + 'Ⓣ' => 'ⓣ', + 'Ⓤ' => 'ⓤ', + 'Ⓥ' => 'ⓥ', + 'Ⓦ' => 'ⓦ', + 'Ⓧ' => 'ⓧ', + 'Ⓨ' => 'ⓨ', + 'Ⓩ' => 'ⓩ', + 'Ⰰ' => 'ⰰ', + 'Ⰱ' => 'ⰱ', + 'Ⰲ' => 'ⰲ', + 'Ⰳ' => 'ⰳ', + 'Ⰴ' => 'ⰴ', + 'Ⰵ' => 'ⰵ', + 'Ⰶ' => 'ⰶ', + 'Ⰷ' => 'ⰷ', + 'Ⰸ' => 'ⰸ', + 'Ⰹ' => 'ⰹ', + 'Ⰺ' => 'ⰺ', + 'Ⰻ' => 'ⰻ', + 'Ⰼ' => 'ⰼ', + 'Ⰽ' => 'ⰽ', + 'Ⰾ' => 'ⰾ', + 'Ⰿ' => 'ⰿ', + 'Ⱀ' => 'ⱀ', + 'Ⱁ' => 'ⱁ', + 'Ⱂ' => 'ⱂ', + 'Ⱃ' => 'ⱃ', + 'Ⱄ' => 'ⱄ', + 'Ⱅ' => 'ⱅ', + 'Ⱆ' => 'ⱆ', + 'Ⱇ' => 'ⱇ', + 'Ⱈ' => 'ⱈ', + 'Ⱉ' => 'ⱉ', + 'Ⱊ' => 'ⱊ', + 'Ⱋ' => 'ⱋ', + 'Ⱌ' => 'ⱌ', + 'Ⱍ' => 'ⱍ', + 'Ⱎ' => 'ⱎ', + 'Ⱏ' => 'ⱏ', + 'Ⱐ' => 'ⱐ', + 'Ⱑ' => 'ⱑ', + 'Ⱒ' => 'ⱒ', + 'Ⱓ' => 'ⱓ', + 'Ⱔ' => 'ⱔ', + 'Ⱕ' => 'ⱕ', + 'Ⱖ' => 'ⱖ', + 'Ⱗ' => 'ⱗ', + 'Ⱘ' => 'ⱘ', + 'Ⱙ' => 'ⱙ', + 'Ⱚ' => 'ⱚ', + 'Ⱛ' => 'ⱛ', + 'Ⱜ' => 'ⱜ', + 'Ⱝ' => 'ⱝ', + 'Ⱞ' => 'ⱞ', + 'Ⱡ' => 'ⱡ', + 'Ɫ' => 'ɫ', + 'Ᵽ' => 'ᵽ', + 'Ɽ' => 'ɽ', + 'Ⱨ' => 'ⱨ', + 'Ⱪ' => 'ⱪ', + 'Ⱬ' => 'ⱬ', + 'Ɑ' => 'ɑ', + 'Ɱ' => 'ɱ', + 'Ɐ' => 'ɐ', + 'Ɒ' => 'ɒ', + 'Ⱳ' => 'ⱳ', + 'Ⱶ' => 'ⱶ', + 'Ȿ' => 'ȿ', + 'Ɀ' => 'ɀ', + 'Ⲁ' => 'ⲁ', + 'Ⲃ' => 'ⲃ', + 'Ⲅ' => 'ⲅ', + 'Ⲇ' => 'ⲇ', + 'Ⲉ' => 'ⲉ', + 'Ⲋ' => 'ⲋ', + 'Ⲍ' => 'ⲍ', + 'Ⲏ' => 'ⲏ', + 'Ⲑ' => 'ⲑ', + 'Ⲓ' => 'ⲓ', + 'Ⲕ' => 'ⲕ', + 'Ⲗ' => 'ⲗ', + 'Ⲙ' => 'ⲙ', + 'Ⲛ' => 'ⲛ', + 'Ⲝ' => 'ⲝ', + 'Ⲟ' => 'ⲟ', + 'Ⲡ' => 'ⲡ', + 'Ⲣ' => 'ⲣ', + 'Ⲥ' => 'ⲥ', + 'Ⲧ' => 'ⲧ', + 'Ⲩ' => 'ⲩ', + 'Ⲫ' => 'ⲫ', + 'Ⲭ' => 'ⲭ', + 'Ⲯ' => 'ⲯ', + 'Ⲱ' => 'ⲱ', + 'Ⲳ' => 'ⲳ', + 'Ⲵ' => 'ⲵ', + 'Ⲷ' => 'ⲷ', + 'Ⲹ' => 'ⲹ', + 'Ⲻ' => 'ⲻ', + 'Ⲽ' => 'ⲽ', + 'Ⲿ' => 'ⲿ', + 'Ⳁ' => 'ⳁ', + 'Ⳃ' => 'ⳃ', + 'Ⳅ' => 'ⳅ', + 'Ⳇ' => 'ⳇ', + 'Ⳉ' => 'ⳉ', + 'Ⳋ' => 'ⳋ', + 'Ⳍ' => 'ⳍ', + 'Ⳏ' => 'ⳏ', + 'Ⳑ' => 'ⳑ', + 'Ⳓ' => 'ⳓ', + 'Ⳕ' => 'ⳕ', + 'Ⳗ' => 'ⳗ', + 'Ⳙ' => 'ⳙ', + 'Ⳛ' => 'ⳛ', + 'Ⳝ' => 'ⳝ', + 'Ⳟ' => 'ⳟ', + 'Ⳡ' => 'ⳡ', + 'Ⳣ' => 'ⳣ', + 'Ⳬ' => 'ⳬ', + 'Ⳮ' => 'ⳮ', + 'Ⳳ' => 'ⳳ', + 'Ꙁ' => 'ꙁ', + 'Ꙃ' => 'ꙃ', + 'Ꙅ' => 'ꙅ', + 'Ꙇ' => 'ꙇ', + 'Ꙉ' => 'ꙉ', + 'Ꙋ' => 'ꙋ', + 'Ꙍ' => 'ꙍ', + 'Ꙏ' => 'ꙏ', + 'Ꙑ' => 'ꙑ', + 'Ꙓ' => 'ꙓ', + 'Ꙕ' => 'ꙕ', + 'Ꙗ' => 'ꙗ', + 'Ꙙ' => 'ꙙ', + 'Ꙛ' => 'ꙛ', + 'Ꙝ' => 'ꙝ', + 'Ꙟ' => 'ꙟ', + 'Ꙡ' => 'ꙡ', + 'Ꙣ' => 'ꙣ', + 'Ꙥ' => 'ꙥ', + 'Ꙧ' => 'ꙧ', + 'Ꙩ' => 'ꙩ', + 'Ꙫ' => 'ꙫ', + 'Ꙭ' => 'ꙭ', + 'Ꚁ' => 'ꚁ', + 'Ꚃ' => 'ꚃ', + 'Ꚅ' => 'ꚅ', + 'Ꚇ' => 'ꚇ', + 'Ꚉ' => 'ꚉ', + 'Ꚋ' => 'ꚋ', + 'Ꚍ' => 'ꚍ', + 'Ꚏ' => 'ꚏ', + 'Ꚑ' => 'ꚑ', + 'Ꚓ' => 'ꚓ', + 'Ꚕ' => 'ꚕ', + 'Ꚗ' => 'ꚗ', + 'Ꚙ' => 'ꚙ', + 'Ꚛ' => 'ꚛ', + 'Ꜣ' => 'ꜣ', + 'Ꜥ' => 'ꜥ', + 'Ꜧ' => 'ꜧ', + 'Ꜩ' => 'ꜩ', + 'Ꜫ' => 'ꜫ', + 'Ꜭ' => 'ꜭ', + 'Ꜯ' => 'ꜯ', + 'Ꜳ' => 'ꜳ', + 'Ꜵ' => 'ꜵ', + 'Ꜷ' => 'ꜷ', + 'Ꜹ' => 'ꜹ', + 'Ꜻ' => 'ꜻ', + 'Ꜽ' => 'ꜽ', + 'Ꜿ' => 'ꜿ', + 'Ꝁ' => 'ꝁ', + 'Ꝃ' => 'ꝃ', + 'Ꝅ' => 'ꝅ', + 'Ꝇ' => 'ꝇ', + 'Ꝉ' => 'ꝉ', + 'Ꝋ' => 'ꝋ', + 'Ꝍ' => 'ꝍ', + 'Ꝏ' => 'ꝏ', + 'Ꝑ' => 'ꝑ', + 'Ꝓ' => 'ꝓ', + 'Ꝕ' => 'ꝕ', + 'Ꝗ' => 'ꝗ', + 'Ꝙ' => 'ꝙ', + 'Ꝛ' => 'ꝛ', + 'Ꝝ' => 'ꝝ', + 'Ꝟ' => 'ꝟ', + 'Ꝡ' => 'ꝡ', + 'Ꝣ' => 'ꝣ', + 'Ꝥ' => 'ꝥ', + 'Ꝧ' => 'ꝧ', + 'Ꝩ' => 'ꝩ', + 'Ꝫ' => 'ꝫ', + 'Ꝭ' => 'ꝭ', + 'Ꝯ' => 'ꝯ', + 'Ꝺ' => 'ꝺ', + 'Ꝼ' => 'ꝼ', + 'Ᵹ' => 'ᵹ', + 'Ꝿ' => 'ꝿ', + 'Ꞁ' => 'ꞁ', + 'Ꞃ' => 'ꞃ', + 'Ꞅ' => 'ꞅ', + 'Ꞇ' => 'ꞇ', + 'Ꞌ' => 'ꞌ', + 'Ɥ' => 'ɥ', + 'Ꞑ' => 'ꞑ', + 'Ꞓ' => 'ꞓ', + 'Ꞗ' => 'ꞗ', + 'Ꞙ' => 'ꞙ', + 'Ꞛ' => 'ꞛ', + 'Ꞝ' => 'ꞝ', + 'Ꞟ' => 'ꞟ', + 'Ꞡ' => 'ꞡ', + 'Ꞣ' => 'ꞣ', + 'Ꞥ' => 'ꞥ', + 'Ꞧ' => 'ꞧ', + 'Ꞩ' => 'ꞩ', + 'Ɦ' => 'ɦ', + 'Ɜ' => 'ɜ', + 'Ɡ' => 'ɡ', + 'Ɬ' => 'ɬ', + 'Ʞ' => 'ʞ', + 'Ʇ' => 'ʇ', + 'A' => 'a', + 'B' => 'b', + 'C' => 'c', + 'D' => 'd', + 'E' => 'e', + 'F' => 'f', + 'G' => 'g', + 'H' => 'h', + 'I' => 'i', + 'J' => 'j', + 'K' => 'k', + 'L' => 'l', + 'M' => 'm', + 'N' => 'n', + 'O' => 'o', + 'P' => 'p', + 'Q' => 'q', + 'R' => 'r', + 'S' => 's', + 'T' => 't', + 'U' => 'u', + 'V' => 'v', + 'W' => 'w', + 'X' => 'x', + 'Y' => 'y', + 'Z' => 'z', + '𐐀' => '𐐨', + '𐐁' => '𐐩', + '𐐂' => '𐐪', + '𐐃' => '𐐫', + '𐐄' => '𐐬', + '𐐅' => '𐐭', + '𐐆' => '𐐮', + '𐐇' => '𐐯', + '𐐈' => '𐐰', + '𐐉' => '𐐱', + '𐐊' => '𐐲', + '𐐋' => '𐐳', + '𐐌' => '𐐴', + '𐐍' => '𐐵', + '𐐎' => '𐐶', + '𐐏' => '𐐷', + '𐐐' => '𐐸', + '𐐑' => '𐐹', + '𐐒' => '𐐺', + '𐐓' => '𐐻', + '𐐔' => '𐐼', + '𐐕' => '𐐽', + '𐐖' => '𐐾', + '𐐗' => '𐐿', + '𐐘' => '𐑀', + '𐐙' => '𐑁', + '𐐚' => '𐑂', + '𐐛' => '𐑃', + '𐐜' => '𐑄', + '𐐝' => '𐑅', + '𐐞' => '𐑆', + '𐐟' => '𐑇', + '𐐠' => '𐑈', + '𐐡' => '𐑉', + '𐐢' => '𐑊', + '𐐣' => '𐑋', + '𐐤' => '𐑌', + '𐐥' => '𐑍', + '𐐦' => '𐑎', + '𐐧' => '𐑏', + '𑢠' => '𑣀', + '𑢡' => '𑣁', + '𑢢' => '𑣂', + '𑢣' => '𑣃', + '𑢤' => '𑣄', + '𑢥' => '𑣅', + '𑢦' => '𑣆', + '𑢧' => '𑣇', + '𑢨' => '𑣈', + '𑢩' => '𑣉', + '𑢪' => '𑣊', + '𑢫' => '𑣋', + '𑢬' => '𑣌', + '𑢭' => '𑣍', + '𑢮' => '𑣎', + '𑢯' => '𑣏', + '𑢰' => '𑣐', + '𑢱' => '𑣑', + '𑢲' => '𑣒', + '𑢳' => '𑣓', + '𑢴' => '𑣔', + '𑢵' => '𑣕', + '𑢶' => '𑣖', + '𑢷' => '𑣗', + '𑢸' => '𑣘', + '𑢹' => '𑣙', + '𑢺' => '𑣚', + '𑢻' => '𑣛', + '𑢼' => '𑣜', + '𑢽' => '𑣝', + '𑢾' => '𑣞', + '𑢿' => '𑣟', ); $result =& $data; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php index ec94221..5052f25 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php @@ -1,1106 +1,1106 @@ 'A', - 'b' => 'B', - 'c' => 'C', - 'd' => 'D', - 'e' => 'E', - 'f' => 'F', - 'g' => 'G', - 'h' => 'H', - 'i' => 'I', - 'j' => 'J', - 'k' => 'K', - 'l' => 'L', - 'm' => 'M', - 'n' => 'N', - 'o' => 'O', - 'p' => 'P', - 'q' => 'Q', - 'r' => 'R', - 's' => 'S', - 't' => 'T', - 'u' => 'U', - 'v' => 'V', - 'w' => 'W', - 'x' => 'X', - 'y' => 'Y', - 'z' => 'Z', - 'µ' => 'Μ', - 'à' => 'À', - 'á' => 'Á', - 'â' => 'Â', - 'ã' => 'Ã', - 'ä' => 'Ä', - 'å' => 'Å', - 'æ' => 'Æ', - 'ç' => 'Ç', - 'è' => 'È', - 'é' => 'É', - 'ê' => 'Ê', - 'ë' => 'Ë', - 'ì' => 'Ì', - 'í' => 'Í', - 'î' => 'Î', - 'ï' => 'Ï', - 'ð' => 'Ð', - 'ñ' => 'Ñ', - 'ò' => 'Ò', - 'ó' => 'Ó', - 'ô' => 'Ô', - 'õ' => 'Õ', - 'ö' => 'Ö', - 'ø' => 'Ø', - 'ù' => 'Ù', - 'ú' => 'Ú', - 'û' => 'Û', - 'ü' => 'Ü', - 'ý' => 'Ý', - 'þ' => 'Þ', - 'ÿ' => 'Ÿ', - 'ā' => 'Ā', - 'ă' => 'Ă', - 'ą' => 'Ą', - 'ć' => 'Ć', - 'ĉ' => 'Ĉ', - 'ċ' => 'Ċ', - 'č' => 'Č', - 'ď' => 'Ď', - 'đ' => 'Đ', - 'ē' => 'Ē', - 'ĕ' => 'Ĕ', - 'ė' => 'Ė', - 'ę' => 'Ę', - 'ě' => 'Ě', - 'ĝ' => 'Ĝ', - 'ğ' => 'Ğ', - 'ġ' => 'Ġ', - 'ģ' => 'Ģ', - 'ĥ' => 'Ĥ', - 'ħ' => 'Ħ', - 'ĩ' => 'Ĩ', - 'ī' => 'Ī', - 'ĭ' => 'Ĭ', - 'į' => 'Į', - 'ı' => 'I', - 'ij' => 'IJ', - 'ĵ' => 'Ĵ', - 'ķ' => 'Ķ', - 'ĺ' => 'Ĺ', - 'ļ' => 'Ļ', - 'ľ' => 'Ľ', - 'ŀ' => 'Ŀ', - 'ł' => 'Ł', - 'ń' => 'Ń', - 'ņ' => 'Ņ', - 'ň' => 'Ň', - 'ŋ' => 'Ŋ', - 'ō' => 'Ō', - 'ŏ' => 'Ŏ', - 'ő' => 'Ő', - 'œ' => 'Œ', - 'ŕ' => 'Ŕ', - 'ŗ' => 'Ŗ', - 'ř' => 'Ř', - 'ś' => 'Ś', - 'ŝ' => 'Ŝ', - 'ş' => 'Ş', - 'š' => 'Š', - 'ţ' => 'Ţ', - 'ť' => 'Ť', - 'ŧ' => 'Ŧ', - 'ũ' => 'Ũ', - 'ū' => 'Ū', - 'ŭ' => 'Ŭ', - 'ů' => 'Ů', - 'ű' => 'Ű', - 'ų' => 'Ų', - 'ŵ' => 'Ŵ', - 'ŷ' => 'Ŷ', - 'ź' => 'Ź', - 'ż' => 'Ż', - 'ž' => 'Ž', - 'ſ' => 'S', - 'ƀ' => 'Ƀ', - 'ƃ' => 'Ƃ', - 'ƅ' => 'Ƅ', - 'ƈ' => 'Ƈ', - 'ƌ' => 'Ƌ', - 'ƒ' => 'Ƒ', - 'ƕ' => 'Ƕ', - 'ƙ' => 'Ƙ', - 'ƚ' => 'Ƚ', - 'ƞ' => 'Ƞ', - 'ơ' => 'Ơ', - 'ƣ' => 'Ƣ', - 'ƥ' => 'Ƥ', - 'ƨ' => 'Ƨ', - 'ƭ' => 'Ƭ', - 'ư' => 'Ư', - 'ƴ' => 'Ƴ', - 'ƶ' => 'Ƶ', - 'ƹ' => 'Ƹ', - 'ƽ' => 'Ƽ', - 'ƿ' => 'Ƿ', - 'Dž' => 'DŽ', - 'dž' => 'DŽ', - 'Lj' => 'LJ', - 'lj' => 'LJ', - 'Nj' => 'NJ', - 'nj' => 'NJ', - 'ǎ' => 'Ǎ', - 'ǐ' => 'Ǐ', - 'ǒ' => 'Ǒ', - 'ǔ' => 'Ǔ', - 'ǖ' => 'Ǖ', - 'ǘ' => 'Ǘ', - 'ǚ' => 'Ǚ', - 'ǜ' => 'Ǜ', - 'ǝ' => 'Ǝ', - 'ǟ' => 'Ǟ', - 'ǡ' => 'Ǡ', - 'ǣ' => 'Ǣ', - 'ǥ' => 'Ǥ', - 'ǧ' => 'Ǧ', - 'ǩ' => 'Ǩ', - 'ǫ' => 'Ǫ', - 'ǭ' => 'Ǭ', - 'ǯ' => 'Ǯ', - 'Dz' => 'DZ', - 'dz' => 'DZ', - 'ǵ' => 'Ǵ', - 'ǹ' => 'Ǹ', - 'ǻ' => 'Ǻ', - 'ǽ' => 'Ǽ', - 'ǿ' => 'Ǿ', - 'ȁ' => 'Ȁ', - 'ȃ' => 'Ȃ', - 'ȅ' => 'Ȅ', - 'ȇ' => 'Ȇ', - 'ȉ' => 'Ȉ', - 'ȋ' => 'Ȋ', - 'ȍ' => 'Ȍ', - 'ȏ' => 'Ȏ', - 'ȑ' => 'Ȑ', - 'ȓ' => 'Ȓ', - 'ȕ' => 'Ȕ', - 'ȗ' => 'Ȗ', - 'ș' => 'Ș', - 'ț' => 'Ț', - 'ȝ' => 'Ȝ', - 'ȟ' => 'Ȟ', - 'ȣ' => 'Ȣ', - 'ȥ' => 'Ȥ', - 'ȧ' => 'Ȧ', - 'ȩ' => 'Ȩ', - 'ȫ' => 'Ȫ', - 'ȭ' => 'Ȭ', - 'ȯ' => 'Ȯ', - 'ȱ' => 'Ȱ', - 'ȳ' => 'Ȳ', - 'ȼ' => 'Ȼ', - 'ȿ' => 'Ȿ', - 'ɀ' => 'Ɀ', - 'ɂ' => 'Ɂ', - 'ɇ' => 'Ɇ', - 'ɉ' => 'Ɉ', - 'ɋ' => 'Ɋ', - 'ɍ' => 'Ɍ', - 'ɏ' => 'Ɏ', - 'ɐ' => 'Ɐ', - 'ɑ' => 'Ɑ', - 'ɒ' => 'Ɒ', - 'ɓ' => 'Ɓ', - 'ɔ' => 'Ɔ', - 'ɖ' => 'Ɖ', - 'ɗ' => 'Ɗ', - 'ə' => 'Ə', - 'ɛ' => 'Ɛ', - 'ɜ' => 'Ɜ', - 'ɠ' => 'Ɠ', - 'ɡ' => 'Ɡ', - 'ɣ' => 'Ɣ', - 'ɥ' => 'Ɥ', - 'ɦ' => 'Ɦ', - 'ɨ' => 'Ɨ', - 'ɩ' => 'Ɩ', - 'ɫ' => 'Ɫ', - 'ɬ' => 'Ɬ', - 'ɯ' => 'Ɯ', - 'ɱ' => 'Ɱ', - 'ɲ' => 'Ɲ', - 'ɵ' => 'Ɵ', - 'ɽ' => 'Ɽ', - 'ʀ' => 'Ʀ', - 'ʃ' => 'Ʃ', - 'ʇ' => 'Ʇ', - 'ʈ' => 'Ʈ', - 'ʉ' => 'Ʉ', - 'ʊ' => 'Ʊ', - 'ʋ' => 'Ʋ', - 'ʌ' => 'Ʌ', - 'ʒ' => 'Ʒ', - 'ʞ' => 'Ʞ', - 'ͅ' => 'Ι', - 'ͱ' => 'Ͱ', - 'ͳ' => 'Ͳ', - 'ͷ' => 'Ͷ', - 'ͻ' => 'Ͻ', - 'ͼ' => 'Ͼ', - 'ͽ' => 'Ͽ', - 'ά' => 'Ά', - 'έ' => 'Έ', - 'ή' => 'Ή', - 'ί' => 'Ί', - 'α' => 'Α', - 'β' => 'Β', - 'γ' => 'Γ', - 'δ' => 'Δ', - 'ε' => 'Ε', - 'ζ' => 'Ζ', - 'η' => 'Η', - 'θ' => 'Θ', - 'ι' => 'Ι', - 'κ' => 'Κ', - 'λ' => 'Λ', - 'μ' => 'Μ', - 'ν' => 'Ν', - 'ξ' => 'Ξ', - 'ο' => 'Ο', - 'π' => 'Π', - 'ρ' => 'Ρ', - 'ς' => 'Σ', - 'σ' => 'Σ', - 'τ' => 'Τ', - 'υ' => 'Υ', - 'φ' => 'Φ', - 'χ' => 'Χ', - 'ψ' => 'Ψ', - 'ω' => 'Ω', - 'ϊ' => 'Ϊ', - 'ϋ' => 'Ϋ', - 'ό' => 'Ό', - 'ύ' => 'Ύ', - 'ώ' => 'Ώ', - 'ϐ' => 'Β', - 'ϑ' => 'Θ', - 'ϕ' => 'Φ', - 'ϖ' => 'Π', - 'ϗ' => 'Ϗ', - 'ϙ' => 'Ϙ', - 'ϛ' => 'Ϛ', - 'ϝ' => 'Ϝ', - 'ϟ' => 'Ϟ', - 'ϡ' => 'Ϡ', - 'ϣ' => 'Ϣ', - 'ϥ' => 'Ϥ', - 'ϧ' => 'Ϧ', - 'ϩ' => 'Ϩ', - 'ϫ' => 'Ϫ', - 'ϭ' => 'Ϭ', - 'ϯ' => 'Ϯ', - 'ϰ' => 'Κ', - 'ϱ' => 'Ρ', - 'ϲ' => 'Ϲ', - 'ϳ' => 'Ϳ', - 'ϵ' => 'Ε', - 'ϸ' => 'Ϸ', - 'ϻ' => 'Ϻ', - 'а' => 'А', - 'б' => 'Б', - 'в' => 'В', - 'г' => 'Г', - 'д' => 'Д', - 'е' => 'Е', - 'ж' => 'Ж', - 'з' => 'З', - 'и' => 'И', - 'й' => 'Й', - 'к' => 'К', - 'л' => 'Л', - 'м' => 'М', - 'н' => 'Н', - 'о' => 'О', - 'п' => 'П', - 'р' => 'Р', - 'с' => 'С', - 'т' => 'Т', - 'у' => 'У', - 'ф' => 'Ф', - 'х' => 'Х', - 'ц' => 'Ц', - 'ч' => 'Ч', - 'ш' => 'Ш', - 'щ' => 'Щ', - 'ъ' => 'Ъ', - 'ы' => 'Ы', - 'ь' => 'Ь', - 'э' => 'Э', - 'ю' => 'Ю', - 'я' => 'Я', - 'ѐ' => 'Ѐ', - 'ё' => 'Ё', - 'ђ' => 'Ђ', - 'ѓ' => 'Ѓ', - 'є' => 'Є', - 'ѕ' => 'Ѕ', - 'і' => 'І', - 'ї' => 'Ї', - 'ј' => 'Ј', - 'љ' => 'Љ', - 'њ' => 'Њ', - 'ћ' => 'Ћ', - 'ќ' => 'Ќ', - 'ѝ' => 'Ѝ', - 'ў' => 'Ў', - 'џ' => 'Џ', - 'ѡ' => 'Ѡ', - 'ѣ' => 'Ѣ', - 'ѥ' => 'Ѥ', - 'ѧ' => 'Ѧ', - 'ѩ' => 'Ѩ', - 'ѫ' => 'Ѫ', - 'ѭ' => 'Ѭ', - 'ѯ' => 'Ѯ', - 'ѱ' => 'Ѱ', - 'ѳ' => 'Ѳ', - 'ѵ' => 'Ѵ', - 'ѷ' => 'Ѷ', - 'ѹ' => 'Ѹ', - 'ѻ' => 'Ѻ', - 'ѽ' => 'Ѽ', - 'ѿ' => 'Ѿ', - 'ҁ' => 'Ҁ', - 'ҋ' => 'Ҋ', - 'ҍ' => 'Ҍ', - 'ҏ' => 'Ҏ', - 'ґ' => 'Ґ', - 'ғ' => 'Ғ', - 'ҕ' => 'Ҕ', - 'җ' => 'Җ', - 'ҙ' => 'Ҙ', - 'қ' => 'Қ', - 'ҝ' => 'Ҝ', - 'ҟ' => 'Ҟ', - 'ҡ' => 'Ҡ', - 'ң' => 'Ң', - 'ҥ' => 'Ҥ', - 'ҧ' => 'Ҧ', - 'ҩ' => 'Ҩ', - 'ҫ' => 'Ҫ', - 'ҭ' => 'Ҭ', - 'ү' => 'Ү', - 'ұ' => 'Ұ', - 'ҳ' => 'Ҳ', - 'ҵ' => 'Ҵ', - 'ҷ' => 'Ҷ', - 'ҹ' => 'Ҹ', - 'һ' => 'Һ', - 'ҽ' => 'Ҽ', - 'ҿ' => 'Ҿ', - 'ӂ' => 'Ӂ', - 'ӄ' => 'Ӄ', - 'ӆ' => 'Ӆ', - 'ӈ' => 'Ӈ', - 'ӊ' => 'Ӊ', - 'ӌ' => 'Ӌ', - 'ӎ' => 'Ӎ', - 'ӏ' => 'Ӏ', - 'ӑ' => 'Ӑ', - 'ӓ' => 'Ӓ', - 'ӕ' => 'Ӕ', - 'ӗ' => 'Ӗ', - 'ә' => 'Ә', - 'ӛ' => 'Ӛ', - 'ӝ' => 'Ӝ', - 'ӟ' => 'Ӟ', - 'ӡ' => 'Ӡ', - 'ӣ' => 'Ӣ', - 'ӥ' => 'Ӥ', - 'ӧ' => 'Ӧ', - 'ө' => 'Ө', - 'ӫ' => 'Ӫ', - 'ӭ' => 'Ӭ', - 'ӯ' => 'Ӯ', - 'ӱ' => 'Ӱ', - 'ӳ' => 'Ӳ', - 'ӵ' => 'Ӵ', - 'ӷ' => 'Ӷ', - 'ӹ' => 'Ӹ', - 'ӻ' => 'Ӻ', - 'ӽ' => 'Ӽ', - 'ӿ' => 'Ӿ', - 'ԁ' => 'Ԁ', - 'ԃ' => 'Ԃ', - 'ԅ' => 'Ԅ', - 'ԇ' => 'Ԇ', - 'ԉ' => 'Ԉ', - 'ԋ' => 'Ԋ', - 'ԍ' => 'Ԍ', - 'ԏ' => 'Ԏ', - 'ԑ' => 'Ԑ', - 'ԓ' => 'Ԓ', - 'ԕ' => 'Ԕ', - 'ԗ' => 'Ԗ', - 'ԙ' => 'Ԙ', - 'ԛ' => 'Ԛ', - 'ԝ' => 'Ԝ', - 'ԟ' => 'Ԟ', - 'ԡ' => 'Ԡ', - 'ԣ' => 'Ԣ', - 'ԥ' => 'Ԥ', - 'ԧ' => 'Ԧ', - 'ԩ' => 'Ԩ', - 'ԫ' => 'Ԫ', - 'ԭ' => 'Ԭ', - 'ԯ' => 'Ԯ', - 'ա' => 'Ա', - 'բ' => 'Բ', - 'գ' => 'Գ', - 'դ' => 'Դ', - 'ե' => 'Ե', - 'զ' => 'Զ', - 'է' => 'Է', - 'ը' => 'Ը', - 'թ' => 'Թ', - 'ժ' => 'Ժ', - 'ի' => 'Ի', - 'լ' => 'Լ', - 'խ' => 'Խ', - 'ծ' => 'Ծ', - 'կ' => 'Կ', - 'հ' => 'Հ', - 'ձ' => 'Ձ', - 'ղ' => 'Ղ', - 'ճ' => 'Ճ', - 'մ' => 'Մ', - 'յ' => 'Յ', - 'ն' => 'Ն', - 'շ' => 'Շ', - 'ո' => 'Ո', - 'չ' => 'Չ', - 'պ' => 'Պ', - 'ջ' => 'Ջ', - 'ռ' => 'Ռ', - 'ս' => 'Ս', - 'վ' => 'Վ', - 'տ' => 'Տ', - 'ր' => 'Ր', - 'ց' => 'Ց', - 'ւ' => 'Ւ', - 'փ' => 'Փ', - 'ք' => 'Ք', - 'օ' => 'Օ', - 'ֆ' => 'Ֆ', - 'ᵹ' => 'Ᵹ', - 'ᵽ' => 'Ᵽ', - 'ḁ' => 'Ḁ', - 'ḃ' => 'Ḃ', - 'ḅ' => 'Ḅ', - 'ḇ' => 'Ḇ', - 'ḉ' => 'Ḉ', - 'ḋ' => 'Ḋ', - 'ḍ' => 'Ḍ', - 'ḏ' => 'Ḏ', - 'ḑ' => 'Ḑ', - 'ḓ' => 'Ḓ', - 'ḕ' => 'Ḕ', - 'ḗ' => 'Ḗ', - 'ḙ' => 'Ḙ', - 'ḛ' => 'Ḛ', - 'ḝ' => 'Ḝ', - 'ḟ' => 'Ḟ', - 'ḡ' => 'Ḡ', - 'ḣ' => 'Ḣ', - 'ḥ' => 'Ḥ', - 'ḧ' => 'Ḧ', - 'ḩ' => 'Ḩ', - 'ḫ' => 'Ḫ', - 'ḭ' => 'Ḭ', - 'ḯ' => 'Ḯ', - 'ḱ' => 'Ḱ', - 'ḳ' => 'Ḳ', - 'ḵ' => 'Ḵ', - 'ḷ' => 'Ḷ', - 'ḹ' => 'Ḹ', - 'ḻ' => 'Ḻ', - 'ḽ' => 'Ḽ', - 'ḿ' => 'Ḿ', - 'ṁ' => 'Ṁ', - 'ṃ' => 'Ṃ', - 'ṅ' => 'Ṅ', - 'ṇ' => 'Ṇ', - 'ṉ' => 'Ṉ', - 'ṋ' => 'Ṋ', - 'ṍ' => 'Ṍ', - 'ṏ' => 'Ṏ', - 'ṑ' => 'Ṑ', - 'ṓ' => 'Ṓ', - 'ṕ' => 'Ṕ', - 'ṗ' => 'Ṗ', - 'ṙ' => 'Ṙ', - 'ṛ' => 'Ṛ', - 'ṝ' => 'Ṝ', - 'ṟ' => 'Ṟ', - 'ṡ' => 'Ṡ', - 'ṣ' => 'Ṣ', - 'ṥ' => 'Ṥ', - 'ṧ' => 'Ṧ', - 'ṩ' => 'Ṩ', - 'ṫ' => 'Ṫ', - 'ṭ' => 'Ṭ', - 'ṯ' => 'Ṯ', - 'ṱ' => 'Ṱ', - 'ṳ' => 'Ṳ', - 'ṵ' => 'Ṵ', - 'ṷ' => 'Ṷ', - 'ṹ' => 'Ṹ', - 'ṻ' => 'Ṻ', - 'ṽ' => 'Ṽ', - 'ṿ' => 'Ṿ', - 'ẁ' => 'Ẁ', - 'ẃ' => 'Ẃ', - 'ẅ' => 'Ẅ', - 'ẇ' => 'Ẇ', - 'ẉ' => 'Ẉ', - 'ẋ' => 'Ẋ', - 'ẍ' => 'Ẍ', - 'ẏ' => 'Ẏ', - 'ẑ' => 'Ẑ', - 'ẓ' => 'Ẓ', - 'ẕ' => 'Ẕ', - 'ẛ' => 'Ṡ', - 'ạ' => 'Ạ', - 'ả' => 'Ả', - 'ấ' => 'Ấ', - 'ầ' => 'Ầ', - 'ẩ' => 'Ẩ', - 'ẫ' => 'Ẫ', - 'ậ' => 'Ậ', - 'ắ' => 'Ắ', - 'ằ' => 'Ằ', - 'ẳ' => 'Ẳ', - 'ẵ' => 'Ẵ', - 'ặ' => 'Ặ', - 'ẹ' => 'Ẹ', - 'ẻ' => 'Ẻ', - 'ẽ' => 'Ẽ', - 'ế' => 'Ế', - 'ề' => 'Ề', - 'ể' => 'Ể', - 'ễ' => 'Ễ', - 'ệ' => 'Ệ', - 'ỉ' => 'Ỉ', - 'ị' => 'Ị', - 'ọ' => 'Ọ', - 'ỏ' => 'Ỏ', - 'ố' => 'Ố', - 'ồ' => 'Ồ', - 'ổ' => 'Ổ', - 'ỗ' => 'Ỗ', - 'ộ' => 'Ộ', - 'ớ' => 'Ớ', - 'ờ' => 'Ờ', - 'ở' => 'Ở', - 'ỡ' => 'Ỡ', - 'ợ' => 'Ợ', - 'ụ' => 'Ụ', - 'ủ' => 'Ủ', - 'ứ' => 'Ứ', - 'ừ' => 'Ừ', - 'ử' => 'Ử', - 'ữ' => 'Ữ', - 'ự' => 'Ự', - 'ỳ' => 'Ỳ', - 'ỵ' => 'Ỵ', - 'ỷ' => 'Ỷ', - 'ỹ' => 'Ỹ', - 'ỻ' => 'Ỻ', - 'ỽ' => 'Ỽ', - 'ỿ' => 'Ỿ', - 'ἀ' => 'Ἀ', - 'ἁ' => 'Ἁ', - 'ἂ' => 'Ἂ', - 'ἃ' => 'Ἃ', - 'ἄ' => 'Ἄ', - 'ἅ' => 'Ἅ', - 'ἆ' => 'Ἆ', - 'ἇ' => 'Ἇ', - 'ἐ' => 'Ἐ', - 'ἑ' => 'Ἑ', - 'ἒ' => 'Ἒ', - 'ἓ' => 'Ἓ', - 'ἔ' => 'Ἔ', - 'ἕ' => 'Ἕ', - 'ἠ' => 'Ἠ', - 'ἡ' => 'Ἡ', - 'ἢ' => 'Ἢ', - 'ἣ' => 'Ἣ', - 'ἤ' => 'Ἤ', - 'ἥ' => 'Ἥ', - 'ἦ' => 'Ἦ', - 'ἧ' => 'Ἧ', - 'ἰ' => 'Ἰ', - 'ἱ' => 'Ἱ', - 'ἲ' => 'Ἲ', - 'ἳ' => 'Ἳ', - 'ἴ' => 'Ἴ', - 'ἵ' => 'Ἵ', - 'ἶ' => 'Ἶ', - 'ἷ' => 'Ἷ', - 'ὀ' => 'Ὀ', - 'ὁ' => 'Ὁ', - 'ὂ' => 'Ὂ', - 'ὃ' => 'Ὃ', - 'ὄ' => 'Ὄ', - 'ὅ' => 'Ὅ', - 'ὑ' => 'Ὑ', - 'ὓ' => 'Ὓ', - 'ὕ' => 'Ὕ', - 'ὗ' => 'Ὗ', - 'ὠ' => 'Ὠ', - 'ὡ' => 'Ὡ', - 'ὢ' => 'Ὢ', - 'ὣ' => 'Ὣ', - 'ὤ' => 'Ὤ', - 'ὥ' => 'Ὥ', - 'ὦ' => 'Ὦ', - 'ὧ' => 'Ὧ', - 'ὰ' => 'Ὰ', - 'ά' => 'Ά', - 'ὲ' => 'Ὲ', - 'έ' => 'Έ', - 'ὴ' => 'Ὴ', - 'ή' => 'Ή', - 'ὶ' => 'Ὶ', - 'ί' => 'Ί', - 'ὸ' => 'Ὸ', - 'ό' => 'Ό', - 'ὺ' => 'Ὺ', - 'ύ' => 'Ύ', - 'ὼ' => 'Ὼ', - 'ώ' => 'Ώ', - 'ᾀ' => 'ᾈ', - 'ᾁ' => 'ᾉ', - 'ᾂ' => 'ᾊ', - 'ᾃ' => 'ᾋ', - 'ᾄ' => 'ᾌ', - 'ᾅ' => 'ᾍ', - 'ᾆ' => 'ᾎ', - 'ᾇ' => 'ᾏ', - 'ᾐ' => 'ᾘ', - 'ᾑ' => 'ᾙ', - 'ᾒ' => 'ᾚ', - 'ᾓ' => 'ᾛ', - 'ᾔ' => 'ᾜ', - 'ᾕ' => 'ᾝ', - 'ᾖ' => 'ᾞ', - 'ᾗ' => 'ᾟ', - 'ᾠ' => 'ᾨ', - 'ᾡ' => 'ᾩ', - 'ᾢ' => 'ᾪ', - 'ᾣ' => 'ᾫ', - 'ᾤ' => 'ᾬ', - 'ᾥ' => 'ᾭ', - 'ᾦ' => 'ᾮ', - 'ᾧ' => 'ᾯ', - 'ᾰ' => 'Ᾰ', - 'ᾱ' => 'Ᾱ', - 'ᾳ' => 'ᾼ', - 'ι' => 'Ι', - 'ῃ' => 'ῌ', - 'ῐ' => 'Ῐ', - 'ῑ' => 'Ῑ', - 'ῠ' => 'Ῠ', - 'ῡ' => 'Ῡ', - 'ῥ' => 'Ῥ', - 'ῳ' => 'ῼ', - 'ⅎ' => 'Ⅎ', - 'ⅰ' => 'Ⅰ', - 'ⅱ' => 'Ⅱ', - 'ⅲ' => 'Ⅲ', - 'ⅳ' => 'Ⅳ', - 'ⅴ' => 'Ⅴ', - 'ⅵ' => 'Ⅵ', - 'ⅶ' => 'Ⅶ', - 'ⅷ' => 'Ⅷ', - 'ⅸ' => 'Ⅸ', - 'ⅹ' => 'Ⅹ', - 'ⅺ' => 'Ⅺ', - 'ⅻ' => 'Ⅻ', - 'ⅼ' => 'Ⅼ', - 'ⅽ' => 'Ⅽ', - 'ⅾ' => 'Ⅾ', - 'ⅿ' => 'Ⅿ', - 'ↄ' => 'Ↄ', - 'ⓐ' => 'Ⓐ', - 'ⓑ' => 'Ⓑ', - 'ⓒ' => 'Ⓒ', - 'ⓓ' => 'Ⓓ', - 'ⓔ' => 'Ⓔ', - 'ⓕ' => 'Ⓕ', - 'ⓖ' => 'Ⓖ', - 'ⓗ' => 'Ⓗ', - 'ⓘ' => 'Ⓘ', - 'ⓙ' => 'Ⓙ', - 'ⓚ' => 'Ⓚ', - 'ⓛ' => 'Ⓛ', - 'ⓜ' => 'Ⓜ', - 'ⓝ' => 'Ⓝ', - 'ⓞ' => 'Ⓞ', - 'ⓟ' => 'Ⓟ', - 'ⓠ' => 'Ⓠ', - 'ⓡ' => 'Ⓡ', - 'ⓢ' => 'Ⓢ', - 'ⓣ' => 'Ⓣ', - 'ⓤ' => 'Ⓤ', - 'ⓥ' => 'Ⓥ', - 'ⓦ' => 'Ⓦ', - 'ⓧ' => 'Ⓧ', - 'ⓨ' => 'Ⓨ', - 'ⓩ' => 'Ⓩ', - 'ⰰ' => 'Ⰰ', - 'ⰱ' => 'Ⰱ', - 'ⰲ' => 'Ⰲ', - 'ⰳ' => 'Ⰳ', - 'ⰴ' => 'Ⰴ', - 'ⰵ' => 'Ⰵ', - 'ⰶ' => 'Ⰶ', - 'ⰷ' => 'Ⰷ', - 'ⰸ' => 'Ⰸ', - 'ⰹ' => 'Ⰹ', - 'ⰺ' => 'Ⰺ', - 'ⰻ' => 'Ⰻ', - 'ⰼ' => 'Ⰼ', - 'ⰽ' => 'Ⰽ', - 'ⰾ' => 'Ⰾ', - 'ⰿ' => 'Ⰿ', - 'ⱀ' => 'Ⱀ', - 'ⱁ' => 'Ⱁ', - 'ⱂ' => 'Ⱂ', - 'ⱃ' => 'Ⱃ', - 'ⱄ' => 'Ⱄ', - 'ⱅ' => 'Ⱅ', - 'ⱆ' => 'Ⱆ', - 'ⱇ' => 'Ⱇ', - 'ⱈ' => 'Ⱈ', - 'ⱉ' => 'Ⱉ', - 'ⱊ' => 'Ⱊ', - 'ⱋ' => 'Ⱋ', - 'ⱌ' => 'Ⱌ', - 'ⱍ' => 'Ⱍ', - 'ⱎ' => 'Ⱎ', - 'ⱏ' => 'Ⱏ', - 'ⱐ' => 'Ⱐ', - 'ⱑ' => 'Ⱑ', - 'ⱒ' => 'Ⱒ', - 'ⱓ' => 'Ⱓ', - 'ⱔ' => 'Ⱔ', - 'ⱕ' => 'Ⱕ', - 'ⱖ' => 'Ⱖ', - 'ⱗ' => 'Ⱗ', - 'ⱘ' => 'Ⱘ', - 'ⱙ' => 'Ⱙ', - 'ⱚ' => 'Ⱚ', - 'ⱛ' => 'Ⱛ', - 'ⱜ' => 'Ⱜ', - 'ⱝ' => 'Ⱝ', - 'ⱞ' => 'Ⱞ', - 'ⱡ' => 'Ⱡ', - 'ⱥ' => 'Ⱥ', - 'ⱦ' => 'Ⱦ', - 'ⱨ' => 'Ⱨ', - 'ⱪ' => 'Ⱪ', - 'ⱬ' => 'Ⱬ', - 'ⱳ' => 'Ⱳ', - 'ⱶ' => 'Ⱶ', - 'ⲁ' => 'Ⲁ', - 'ⲃ' => 'Ⲃ', - 'ⲅ' => 'Ⲅ', - 'ⲇ' => 'Ⲇ', - 'ⲉ' => 'Ⲉ', - 'ⲋ' => 'Ⲋ', - 'ⲍ' => 'Ⲍ', - 'ⲏ' => 'Ⲏ', - 'ⲑ' => 'Ⲑ', - 'ⲓ' => 'Ⲓ', - 'ⲕ' => 'Ⲕ', - 'ⲗ' => 'Ⲗ', - 'ⲙ' => 'Ⲙ', - 'ⲛ' => 'Ⲛ', - 'ⲝ' => 'Ⲝ', - 'ⲟ' => 'Ⲟ', - 'ⲡ' => 'Ⲡ', - 'ⲣ' => 'Ⲣ', - 'ⲥ' => 'Ⲥ', - 'ⲧ' => 'Ⲧ', - 'ⲩ' => 'Ⲩ', - 'ⲫ' => 'Ⲫ', - 'ⲭ' => 'Ⲭ', - 'ⲯ' => 'Ⲯ', - 'ⲱ' => 'Ⲱ', - 'ⲳ' => 'Ⲳ', - 'ⲵ' => 'Ⲵ', - 'ⲷ' => 'Ⲷ', - 'ⲹ' => 'Ⲹ', - 'ⲻ' => 'Ⲻ', - 'ⲽ' => 'Ⲽ', - 'ⲿ' => 'Ⲿ', - 'ⳁ' => 'Ⳁ', - 'ⳃ' => 'Ⳃ', - 'ⳅ' => 'Ⳅ', - 'ⳇ' => 'Ⳇ', - 'ⳉ' => 'Ⳉ', - 'ⳋ' => 'Ⳋ', - 'ⳍ' => 'Ⳍ', - 'ⳏ' => 'Ⳏ', - 'ⳑ' => 'Ⳑ', - 'ⳓ' => 'Ⳓ', - 'ⳕ' => 'Ⳕ', - 'ⳗ' => 'Ⳗ', - 'ⳙ' => 'Ⳙ', - 'ⳛ' => 'Ⳛ', - 'ⳝ' => 'Ⳝ', - 'ⳟ' => 'Ⳟ', - 'ⳡ' => 'Ⳡ', - 'ⳣ' => 'Ⳣ', - 'ⳬ' => 'Ⳬ', - 'ⳮ' => 'Ⳮ', - 'ⳳ' => 'Ⳳ', - 'ⴀ' => 'Ⴀ', - 'ⴁ' => 'Ⴁ', - 'ⴂ' => 'Ⴂ', - 'ⴃ' => 'Ⴃ', - 'ⴄ' => 'Ⴄ', - 'ⴅ' => 'Ⴅ', - 'ⴆ' => 'Ⴆ', - 'ⴇ' => 'Ⴇ', - 'ⴈ' => 'Ⴈ', - 'ⴉ' => 'Ⴉ', - 'ⴊ' => 'Ⴊ', - 'ⴋ' => 'Ⴋ', - 'ⴌ' => 'Ⴌ', - 'ⴍ' => 'Ⴍ', - 'ⴎ' => 'Ⴎ', - 'ⴏ' => 'Ⴏ', - 'ⴐ' => 'Ⴐ', - 'ⴑ' => 'Ⴑ', - 'ⴒ' => 'Ⴒ', - 'ⴓ' => 'Ⴓ', - 'ⴔ' => 'Ⴔ', - 'ⴕ' => 'Ⴕ', - 'ⴖ' => 'Ⴖ', - 'ⴗ' => 'Ⴗ', - 'ⴘ' => 'Ⴘ', - 'ⴙ' => 'Ⴙ', - 'ⴚ' => 'Ⴚ', - 'ⴛ' => 'Ⴛ', - 'ⴜ' => 'Ⴜ', - 'ⴝ' => 'Ⴝ', - 'ⴞ' => 'Ⴞ', - 'ⴟ' => 'Ⴟ', - 'ⴠ' => 'Ⴠ', - 'ⴡ' => 'Ⴡ', - 'ⴢ' => 'Ⴢ', - 'ⴣ' => 'Ⴣ', - 'ⴤ' => 'Ⴤ', - 'ⴥ' => 'Ⴥ', - 'ⴧ' => 'Ⴧ', - 'ⴭ' => 'Ⴭ', - 'ꙁ' => 'Ꙁ', - 'ꙃ' => 'Ꙃ', - 'ꙅ' => 'Ꙅ', - 'ꙇ' => 'Ꙇ', - 'ꙉ' => 'Ꙉ', - 'ꙋ' => 'Ꙋ', - 'ꙍ' => 'Ꙍ', - 'ꙏ' => 'Ꙏ', - 'ꙑ' => 'Ꙑ', - 'ꙓ' => 'Ꙓ', - 'ꙕ' => 'Ꙕ', - 'ꙗ' => 'Ꙗ', - 'ꙙ' => 'Ꙙ', - 'ꙛ' => 'Ꙛ', - 'ꙝ' => 'Ꙝ', - 'ꙟ' => 'Ꙟ', - 'ꙡ' => 'Ꙡ', - 'ꙣ' => 'Ꙣ', - 'ꙥ' => 'Ꙥ', - 'ꙧ' => 'Ꙧ', - 'ꙩ' => 'Ꙩ', - 'ꙫ' => 'Ꙫ', - 'ꙭ' => 'Ꙭ', - 'ꚁ' => 'Ꚁ', - 'ꚃ' => 'Ꚃ', - 'ꚅ' => 'Ꚅ', - 'ꚇ' => 'Ꚇ', - 'ꚉ' => 'Ꚉ', - 'ꚋ' => 'Ꚋ', - 'ꚍ' => 'Ꚍ', - 'ꚏ' => 'Ꚏ', - 'ꚑ' => 'Ꚑ', - 'ꚓ' => 'Ꚓ', - 'ꚕ' => 'Ꚕ', - 'ꚗ' => 'Ꚗ', - 'ꚙ' => 'Ꚙ', - 'ꚛ' => 'Ꚛ', - 'ꜣ' => 'Ꜣ', - 'ꜥ' => 'Ꜥ', - 'ꜧ' => 'Ꜧ', - 'ꜩ' => 'Ꜩ', - 'ꜫ' => 'Ꜫ', - 'ꜭ' => 'Ꜭ', - 'ꜯ' => 'Ꜯ', - 'ꜳ' => 'Ꜳ', - 'ꜵ' => 'Ꜵ', - 'ꜷ' => 'Ꜷ', - 'ꜹ' => 'Ꜹ', - 'ꜻ' => 'Ꜻ', - 'ꜽ' => 'Ꜽ', - 'ꜿ' => 'Ꜿ', - 'ꝁ' => 'Ꝁ', - 'ꝃ' => 'Ꝃ', - 'ꝅ' => 'Ꝅ', - 'ꝇ' => 'Ꝇ', - 'ꝉ' => 'Ꝉ', - 'ꝋ' => 'Ꝋ', - 'ꝍ' => 'Ꝍ', - 'ꝏ' => 'Ꝏ', - 'ꝑ' => 'Ꝑ', - 'ꝓ' => 'Ꝓ', - 'ꝕ' => 'Ꝕ', - 'ꝗ' => 'Ꝗ', - 'ꝙ' => 'Ꝙ', - 'ꝛ' => 'Ꝛ', - 'ꝝ' => 'Ꝝ', - 'ꝟ' => 'Ꝟ', - 'ꝡ' => 'Ꝡ', - 'ꝣ' => 'Ꝣ', - 'ꝥ' => 'Ꝥ', - 'ꝧ' => 'Ꝧ', - 'ꝩ' => 'Ꝩ', - 'ꝫ' => 'Ꝫ', - 'ꝭ' => 'Ꝭ', - 'ꝯ' => 'Ꝯ', - 'ꝺ' => 'Ꝺ', - 'ꝼ' => 'Ꝼ', - 'ꝿ' => 'Ꝿ', - 'ꞁ' => 'Ꞁ', - 'ꞃ' => 'Ꞃ', - 'ꞅ' => 'Ꞅ', - 'ꞇ' => 'Ꞇ', - 'ꞌ' => 'Ꞌ', - 'ꞑ' => 'Ꞑ', - 'ꞓ' => 'Ꞓ', - 'ꞗ' => 'Ꞗ', - 'ꞙ' => 'Ꞙ', - 'ꞛ' => 'Ꞛ', - 'ꞝ' => 'Ꞝ', - 'ꞟ' => 'Ꞟ', - 'ꞡ' => 'Ꞡ', - 'ꞣ' => 'Ꞣ', - 'ꞥ' => 'Ꞥ', - 'ꞧ' => 'Ꞧ', - 'ꞩ' => 'Ꞩ', - 'a' => 'A', - 'b' => 'B', - 'c' => 'C', - 'd' => 'D', - 'e' => 'E', - 'f' => 'F', - 'g' => 'G', - 'h' => 'H', - 'i' => 'I', - 'j' => 'J', - 'k' => 'K', - 'l' => 'L', - 'm' => 'M', - 'n' => 'N', - 'o' => 'O', - 'p' => 'P', - 'q' => 'Q', - 'r' => 'R', - 's' => 'S', - 't' => 'T', - 'u' => 'U', - 'v' => 'V', - 'w' => 'W', - 'x' => 'X', - 'y' => 'Y', - 'z' => 'Z', - '𐐨' => '𐐀', - '𐐩' => '𐐁', - '𐐪' => '𐐂', - '𐐫' => '𐐃', - '𐐬' => '𐐄', - '𐐭' => '𐐅', - '𐐮' => '𐐆', - '𐐯' => '𐐇', - '𐐰' => '𐐈', - '𐐱' => '𐐉', - '𐐲' => '𐐊', - '𐐳' => '𐐋', - '𐐴' => '𐐌', - '𐐵' => '𐐍', - '𐐶' => '𐐎', - '𐐷' => '𐐏', - '𐐸' => '𐐐', - '𐐹' => '𐐑', - '𐐺' => '𐐒', - '𐐻' => '𐐓', - '𐐼' => '𐐔', - '𐐽' => '𐐕', - '𐐾' => '𐐖', - '𐐿' => '𐐗', - '𐑀' => '𐐘', - '𐑁' => '𐐙', - '𐑂' => '𐐚', - '𐑃' => '𐐛', - '𐑄' => '𐐜', - '𐑅' => '𐐝', - '𐑆' => '𐐞', - '𐑇' => '𐐟', - '𐑈' => '𐐠', - '𐑉' => '𐐡', - '𐑊' => '𐐢', - '𐑋' => '𐐣', - '𐑌' => '𐐤', - '𐑍' => '𐐥', - '𐑎' => '𐐦', - '𐑏' => '𐐧', - '𑣀' => '𑢠', - '𑣁' => '𑢡', - '𑣂' => '𑢢', - '𑣃' => '𑢣', - '𑣄' => '𑢤', - '𑣅' => '𑢥', - '𑣆' => '𑢦', - '𑣇' => '𑢧', - '𑣈' => '𑢨', - '𑣉' => '𑢩', - '𑣊' => '𑢪', - '𑣋' => '𑢫', - '𑣌' => '𑢬', - '𑣍' => '𑢭', - '𑣎' => '𑢮', - '𑣏' => '𑢯', - '𑣐' => '𑢰', - '𑣑' => '𑢱', - '𑣒' => '𑢲', - '𑣓' => '𑢳', - '𑣔' => '𑢴', - '𑣕' => '𑢵', - '𑣖' => '𑢶', - '𑣗' => '𑢷', - '𑣘' => '𑢸', - '𑣙' => '𑢹', - '𑣚' => '𑢺', - '𑣛' => '𑢻', - '𑣜' => '𑢼', - '𑣝' => '𑢽', - '𑣞' => '𑢾', - '𑣟' => '𑢿', +static $data = array( + 'a' => 'A', + 'b' => 'B', + 'c' => 'C', + 'd' => 'D', + 'e' => 'E', + 'f' => 'F', + 'g' => 'G', + 'h' => 'H', + 'i' => 'I', + 'j' => 'J', + 'k' => 'K', + 'l' => 'L', + 'm' => 'M', + 'n' => 'N', + 'o' => 'O', + 'p' => 'P', + 'q' => 'Q', + 'r' => 'R', + 's' => 'S', + 't' => 'T', + 'u' => 'U', + 'v' => 'V', + 'w' => 'W', + 'x' => 'X', + 'y' => 'Y', + 'z' => 'Z', + 'µ' => 'Μ', + 'à' => 'À', + 'á' => 'Á', + 'â' => 'Â', + 'ã' => 'Ã', + 'ä' => 'Ä', + 'å' => 'Å', + 'æ' => 'Æ', + 'ç' => 'Ç', + 'è' => 'È', + 'é' => 'É', + 'ê' => 'Ê', + 'ë' => 'Ë', + 'ì' => 'Ì', + 'í' => 'Í', + 'î' => 'Î', + 'ï' => 'Ï', + 'ð' => 'Ð', + 'ñ' => 'Ñ', + 'ò' => 'Ò', + 'ó' => 'Ó', + 'ô' => 'Ô', + 'õ' => 'Õ', + 'ö' => 'Ö', + 'ø' => 'Ø', + 'ù' => 'Ù', + 'ú' => 'Ú', + 'û' => 'Û', + 'ü' => 'Ü', + 'ý' => 'Ý', + 'þ' => 'Þ', + 'ÿ' => 'Ÿ', + 'ā' => 'Ā', + 'ă' => 'Ă', + 'ą' => 'Ą', + 'ć' => 'Ć', + 'ĉ' => 'Ĉ', + 'ċ' => 'Ċ', + 'č' => 'Č', + 'ď' => 'Ď', + 'đ' => 'Đ', + 'ē' => 'Ē', + 'ĕ' => 'Ĕ', + 'ė' => 'Ė', + 'ę' => 'Ę', + 'ě' => 'Ě', + 'ĝ' => 'Ĝ', + 'ğ' => 'Ğ', + 'ġ' => 'Ġ', + 'ģ' => 'Ģ', + 'ĥ' => 'Ĥ', + 'ħ' => 'Ħ', + 'ĩ' => 'Ĩ', + 'ī' => 'Ī', + 'ĭ' => 'Ĭ', + 'į' => 'Į', + 'ı' => 'I', + 'ij' => 'IJ', + 'ĵ' => 'Ĵ', + 'ķ' => 'Ķ', + 'ĺ' => 'Ĺ', + 'ļ' => 'Ļ', + 'ľ' => 'Ľ', + 'ŀ' => 'Ŀ', + 'ł' => 'Ł', + 'ń' => 'Ń', + 'ņ' => 'Ņ', + 'ň' => 'Ň', + 'ŋ' => 'Ŋ', + 'ō' => 'Ō', + 'ŏ' => 'Ŏ', + 'ő' => 'Ő', + 'œ' => 'Œ', + 'ŕ' => 'Ŕ', + 'ŗ' => 'Ŗ', + 'ř' => 'Ř', + 'ś' => 'Ś', + 'ŝ' => 'Ŝ', + 'ş' => 'Ş', + 'š' => 'Š', + 'ţ' => 'Ţ', + 'ť' => 'Ť', + 'ŧ' => 'Ŧ', + 'ũ' => 'Ũ', + 'ū' => 'Ū', + 'ŭ' => 'Ŭ', + 'ů' => 'Ů', + 'ű' => 'Ű', + 'ų' => 'Ų', + 'ŵ' => 'Ŵ', + 'ŷ' => 'Ŷ', + 'ź' => 'Ź', + 'ż' => 'Ż', + 'ž' => 'Ž', + 'ſ' => 'S', + 'ƀ' => 'Ƀ', + 'ƃ' => 'Ƃ', + 'ƅ' => 'Ƅ', + 'ƈ' => 'Ƈ', + 'ƌ' => 'Ƌ', + 'ƒ' => 'Ƒ', + 'ƕ' => 'Ƕ', + 'ƙ' => 'Ƙ', + 'ƚ' => 'Ƚ', + 'ƞ' => 'Ƞ', + 'ơ' => 'Ơ', + 'ƣ' => 'Ƣ', + 'ƥ' => 'Ƥ', + 'ƨ' => 'Ƨ', + 'ƭ' => 'Ƭ', + 'ư' => 'Ư', + 'ƴ' => 'Ƴ', + 'ƶ' => 'Ƶ', + 'ƹ' => 'Ƹ', + 'ƽ' => 'Ƽ', + 'ƿ' => 'Ƿ', + 'Dž' => 'DŽ', + 'dž' => 'DŽ', + 'Lj' => 'LJ', + 'lj' => 'LJ', + 'Nj' => 'NJ', + 'nj' => 'NJ', + 'ǎ' => 'Ǎ', + 'ǐ' => 'Ǐ', + 'ǒ' => 'Ǒ', + 'ǔ' => 'Ǔ', + 'ǖ' => 'Ǖ', + 'ǘ' => 'Ǘ', + 'ǚ' => 'Ǚ', + 'ǜ' => 'Ǜ', + 'ǝ' => 'Ǝ', + 'ǟ' => 'Ǟ', + 'ǡ' => 'Ǡ', + 'ǣ' => 'Ǣ', + 'ǥ' => 'Ǥ', + 'ǧ' => 'Ǧ', + 'ǩ' => 'Ǩ', + 'ǫ' => 'Ǫ', + 'ǭ' => 'Ǭ', + 'ǯ' => 'Ǯ', + 'Dz' => 'DZ', + 'dz' => 'DZ', + 'ǵ' => 'Ǵ', + 'ǹ' => 'Ǹ', + 'ǻ' => 'Ǻ', + 'ǽ' => 'Ǽ', + 'ǿ' => 'Ǿ', + 'ȁ' => 'Ȁ', + 'ȃ' => 'Ȃ', + 'ȅ' => 'Ȅ', + 'ȇ' => 'Ȇ', + 'ȉ' => 'Ȉ', + 'ȋ' => 'Ȋ', + 'ȍ' => 'Ȍ', + 'ȏ' => 'Ȏ', + 'ȑ' => 'Ȑ', + 'ȓ' => 'Ȓ', + 'ȕ' => 'Ȕ', + 'ȗ' => 'Ȗ', + 'ș' => 'Ș', + 'ț' => 'Ț', + 'ȝ' => 'Ȝ', + 'ȟ' => 'Ȟ', + 'ȣ' => 'Ȣ', + 'ȥ' => 'Ȥ', + 'ȧ' => 'Ȧ', + 'ȩ' => 'Ȩ', + 'ȫ' => 'Ȫ', + 'ȭ' => 'Ȭ', + 'ȯ' => 'Ȯ', + 'ȱ' => 'Ȱ', + 'ȳ' => 'Ȳ', + 'ȼ' => 'Ȼ', + 'ȿ' => 'Ȿ', + 'ɀ' => 'Ɀ', + 'ɂ' => 'Ɂ', + 'ɇ' => 'Ɇ', + 'ɉ' => 'Ɉ', + 'ɋ' => 'Ɋ', + 'ɍ' => 'Ɍ', + 'ɏ' => 'Ɏ', + 'ɐ' => 'Ɐ', + 'ɑ' => 'Ɑ', + 'ɒ' => 'Ɒ', + 'ɓ' => 'Ɓ', + 'ɔ' => 'Ɔ', + 'ɖ' => 'Ɖ', + 'ɗ' => 'Ɗ', + 'ə' => 'Ə', + 'ɛ' => 'Ɛ', + 'ɜ' => 'Ɜ', + 'ɠ' => 'Ɠ', + 'ɡ' => 'Ɡ', + 'ɣ' => 'Ɣ', + 'ɥ' => 'Ɥ', + 'ɦ' => 'Ɦ', + 'ɨ' => 'Ɨ', + 'ɩ' => 'Ɩ', + 'ɫ' => 'Ɫ', + 'ɬ' => 'Ɬ', + 'ɯ' => 'Ɯ', + 'ɱ' => 'Ɱ', + 'ɲ' => 'Ɲ', + 'ɵ' => 'Ɵ', + 'ɽ' => 'Ɽ', + 'ʀ' => 'Ʀ', + 'ʃ' => 'Ʃ', + 'ʇ' => 'Ʇ', + 'ʈ' => 'Ʈ', + 'ʉ' => 'Ʉ', + 'ʊ' => 'Ʊ', + 'ʋ' => 'Ʋ', + 'ʌ' => 'Ʌ', + 'ʒ' => 'Ʒ', + 'ʞ' => 'Ʞ', + 'ͅ' => 'Ι', + 'ͱ' => 'Ͱ', + 'ͳ' => 'Ͳ', + 'ͷ' => 'Ͷ', + 'ͻ' => 'Ͻ', + 'ͼ' => 'Ͼ', + 'ͽ' => 'Ͽ', + 'ά' => 'Ά', + 'έ' => 'Έ', + 'ή' => 'Ή', + 'ί' => 'Ί', + 'α' => 'Α', + 'β' => 'Β', + 'γ' => 'Γ', + 'δ' => 'Δ', + 'ε' => 'Ε', + 'ζ' => 'Ζ', + 'η' => 'Η', + 'θ' => 'Θ', + 'ι' => 'Ι', + 'κ' => 'Κ', + 'λ' => 'Λ', + 'μ' => 'Μ', + 'ν' => 'Ν', + 'ξ' => 'Ξ', + 'ο' => 'Ο', + 'π' => 'Π', + 'ρ' => 'Ρ', + 'ς' => 'Σ', + 'σ' => 'Σ', + 'τ' => 'Τ', + 'υ' => 'Υ', + 'φ' => 'Φ', + 'χ' => 'Χ', + 'ψ' => 'Ψ', + 'ω' => 'Ω', + 'ϊ' => 'Ϊ', + 'ϋ' => 'Ϋ', + 'ό' => 'Ό', + 'ύ' => 'Ύ', + 'ώ' => 'Ώ', + 'ϐ' => 'Β', + 'ϑ' => 'Θ', + 'ϕ' => 'Φ', + 'ϖ' => 'Π', + 'ϗ' => 'Ϗ', + 'ϙ' => 'Ϙ', + 'ϛ' => 'Ϛ', + 'ϝ' => 'Ϝ', + 'ϟ' => 'Ϟ', + 'ϡ' => 'Ϡ', + 'ϣ' => 'Ϣ', + 'ϥ' => 'Ϥ', + 'ϧ' => 'Ϧ', + 'ϩ' => 'Ϩ', + 'ϫ' => 'Ϫ', + 'ϭ' => 'Ϭ', + 'ϯ' => 'Ϯ', + 'ϰ' => 'Κ', + 'ϱ' => 'Ρ', + 'ϲ' => 'Ϲ', + 'ϳ' => 'Ϳ', + 'ϵ' => 'Ε', + 'ϸ' => 'Ϸ', + 'ϻ' => 'Ϻ', + 'а' => 'А', + 'б' => 'Б', + 'в' => 'В', + 'г' => 'Г', + 'д' => 'Д', + 'е' => 'Е', + 'ж' => 'Ж', + 'з' => 'З', + 'и' => 'И', + 'й' => 'Й', + 'к' => 'К', + 'л' => 'Л', + 'м' => 'М', + 'н' => 'Н', + 'о' => 'О', + 'п' => 'П', + 'р' => 'Р', + 'с' => 'С', + 'т' => 'Т', + 'у' => 'У', + 'ф' => 'Ф', + 'х' => 'Х', + 'ц' => 'Ц', + 'ч' => 'Ч', + 'ш' => 'Ш', + 'щ' => 'Щ', + 'ъ' => 'Ъ', + 'ы' => 'Ы', + 'ь' => 'Ь', + 'э' => 'Э', + 'ю' => 'Ю', + 'я' => 'Я', + 'ѐ' => 'Ѐ', + 'ё' => 'Ё', + 'ђ' => 'Ђ', + 'ѓ' => 'Ѓ', + 'є' => 'Є', + 'ѕ' => 'Ѕ', + 'і' => 'І', + 'ї' => 'Ї', + 'ј' => 'Ј', + 'љ' => 'Љ', + 'њ' => 'Њ', + 'ћ' => 'Ћ', + 'ќ' => 'Ќ', + 'ѝ' => 'Ѝ', + 'ў' => 'Ў', + 'џ' => 'Џ', + 'ѡ' => 'Ѡ', + 'ѣ' => 'Ѣ', + 'ѥ' => 'Ѥ', + 'ѧ' => 'Ѧ', + 'ѩ' => 'Ѩ', + 'ѫ' => 'Ѫ', + 'ѭ' => 'Ѭ', + 'ѯ' => 'Ѯ', + 'ѱ' => 'Ѱ', + 'ѳ' => 'Ѳ', + 'ѵ' => 'Ѵ', + 'ѷ' => 'Ѷ', + 'ѹ' => 'Ѹ', + 'ѻ' => 'Ѻ', + 'ѽ' => 'Ѽ', + 'ѿ' => 'Ѿ', + 'ҁ' => 'Ҁ', + 'ҋ' => 'Ҋ', + 'ҍ' => 'Ҍ', + 'ҏ' => 'Ҏ', + 'ґ' => 'Ґ', + 'ғ' => 'Ғ', + 'ҕ' => 'Ҕ', + 'җ' => 'Җ', + 'ҙ' => 'Ҙ', + 'қ' => 'Қ', + 'ҝ' => 'Ҝ', + 'ҟ' => 'Ҟ', + 'ҡ' => 'Ҡ', + 'ң' => 'Ң', + 'ҥ' => 'Ҥ', + 'ҧ' => 'Ҧ', + 'ҩ' => 'Ҩ', + 'ҫ' => 'Ҫ', + 'ҭ' => 'Ҭ', + 'ү' => 'Ү', + 'ұ' => 'Ұ', + 'ҳ' => 'Ҳ', + 'ҵ' => 'Ҵ', + 'ҷ' => 'Ҷ', + 'ҹ' => 'Ҹ', + 'һ' => 'Һ', + 'ҽ' => 'Ҽ', + 'ҿ' => 'Ҿ', + 'ӂ' => 'Ӂ', + 'ӄ' => 'Ӄ', + 'ӆ' => 'Ӆ', + 'ӈ' => 'Ӈ', + 'ӊ' => 'Ӊ', + 'ӌ' => 'Ӌ', + 'ӎ' => 'Ӎ', + 'ӏ' => 'Ӏ', + 'ӑ' => 'Ӑ', + 'ӓ' => 'Ӓ', + 'ӕ' => 'Ӕ', + 'ӗ' => 'Ӗ', + 'ә' => 'Ә', + 'ӛ' => 'Ӛ', + 'ӝ' => 'Ӝ', + 'ӟ' => 'Ӟ', + 'ӡ' => 'Ӡ', + 'ӣ' => 'Ӣ', + 'ӥ' => 'Ӥ', + 'ӧ' => 'Ӧ', + 'ө' => 'Ө', + 'ӫ' => 'Ӫ', + 'ӭ' => 'Ӭ', + 'ӯ' => 'Ӯ', + 'ӱ' => 'Ӱ', + 'ӳ' => 'Ӳ', + 'ӵ' => 'Ӵ', + 'ӷ' => 'Ӷ', + 'ӹ' => 'Ӹ', + 'ӻ' => 'Ӻ', + 'ӽ' => 'Ӽ', + 'ӿ' => 'Ӿ', + 'ԁ' => 'Ԁ', + 'ԃ' => 'Ԃ', + 'ԅ' => 'Ԅ', + 'ԇ' => 'Ԇ', + 'ԉ' => 'Ԉ', + 'ԋ' => 'Ԋ', + 'ԍ' => 'Ԍ', + 'ԏ' => 'Ԏ', + 'ԑ' => 'Ԑ', + 'ԓ' => 'Ԓ', + 'ԕ' => 'Ԕ', + 'ԗ' => 'Ԗ', + 'ԙ' => 'Ԙ', + 'ԛ' => 'Ԛ', + 'ԝ' => 'Ԝ', + 'ԟ' => 'Ԟ', + 'ԡ' => 'Ԡ', + 'ԣ' => 'Ԣ', + 'ԥ' => 'Ԥ', + 'ԧ' => 'Ԧ', + 'ԩ' => 'Ԩ', + 'ԫ' => 'Ԫ', + 'ԭ' => 'Ԭ', + 'ԯ' => 'Ԯ', + 'ա' => 'Ա', + 'բ' => 'Բ', + 'գ' => 'Գ', + 'դ' => 'Դ', + 'ե' => 'Ե', + 'զ' => 'Զ', + 'է' => 'Է', + 'ը' => 'Ը', + 'թ' => 'Թ', + 'ժ' => 'Ժ', + 'ի' => 'Ի', + 'լ' => 'Լ', + 'խ' => 'Խ', + 'ծ' => 'Ծ', + 'կ' => 'Կ', + 'հ' => 'Հ', + 'ձ' => 'Ձ', + 'ղ' => 'Ղ', + 'ճ' => 'Ճ', + 'մ' => 'Մ', + 'յ' => 'Յ', + 'ն' => 'Ն', + 'շ' => 'Շ', + 'ո' => 'Ո', + 'չ' => 'Չ', + 'պ' => 'Պ', + 'ջ' => 'Ջ', + 'ռ' => 'Ռ', + 'ս' => 'Ս', + 'վ' => 'Վ', + 'տ' => 'Տ', + 'ր' => 'Ր', + 'ց' => 'Ց', + 'ւ' => 'Ւ', + 'փ' => 'Փ', + 'ք' => 'Ք', + 'օ' => 'Օ', + 'ֆ' => 'Ֆ', + 'ᵹ' => 'Ᵹ', + 'ᵽ' => 'Ᵽ', + 'ḁ' => 'Ḁ', + 'ḃ' => 'Ḃ', + 'ḅ' => 'Ḅ', + 'ḇ' => 'Ḇ', + 'ḉ' => 'Ḉ', + 'ḋ' => 'Ḋ', + 'ḍ' => 'Ḍ', + 'ḏ' => 'Ḏ', + 'ḑ' => 'Ḑ', + 'ḓ' => 'Ḓ', + 'ḕ' => 'Ḕ', + 'ḗ' => 'Ḗ', + 'ḙ' => 'Ḙ', + 'ḛ' => 'Ḛ', + 'ḝ' => 'Ḝ', + 'ḟ' => 'Ḟ', + 'ḡ' => 'Ḡ', + 'ḣ' => 'Ḣ', + 'ḥ' => 'Ḥ', + 'ḧ' => 'Ḧ', + 'ḩ' => 'Ḩ', + 'ḫ' => 'Ḫ', + 'ḭ' => 'Ḭ', + 'ḯ' => 'Ḯ', + 'ḱ' => 'Ḱ', + 'ḳ' => 'Ḳ', + 'ḵ' => 'Ḵ', + 'ḷ' => 'Ḷ', + 'ḹ' => 'Ḹ', + 'ḻ' => 'Ḻ', + 'ḽ' => 'Ḽ', + 'ḿ' => 'Ḿ', + 'ṁ' => 'Ṁ', + 'ṃ' => 'Ṃ', + 'ṅ' => 'Ṅ', + 'ṇ' => 'Ṇ', + 'ṉ' => 'Ṉ', + 'ṋ' => 'Ṋ', + 'ṍ' => 'Ṍ', + 'ṏ' => 'Ṏ', + 'ṑ' => 'Ṑ', + 'ṓ' => 'Ṓ', + 'ṕ' => 'Ṕ', + 'ṗ' => 'Ṗ', + 'ṙ' => 'Ṙ', + 'ṛ' => 'Ṛ', + 'ṝ' => 'Ṝ', + 'ṟ' => 'Ṟ', + 'ṡ' => 'Ṡ', + 'ṣ' => 'Ṣ', + 'ṥ' => 'Ṥ', + 'ṧ' => 'Ṧ', + 'ṩ' => 'Ṩ', + 'ṫ' => 'Ṫ', + 'ṭ' => 'Ṭ', + 'ṯ' => 'Ṯ', + 'ṱ' => 'Ṱ', + 'ṳ' => 'Ṳ', + 'ṵ' => 'Ṵ', + 'ṷ' => 'Ṷ', + 'ṹ' => 'Ṹ', + 'ṻ' => 'Ṻ', + 'ṽ' => 'Ṽ', + 'ṿ' => 'Ṿ', + 'ẁ' => 'Ẁ', + 'ẃ' => 'Ẃ', + 'ẅ' => 'Ẅ', + 'ẇ' => 'Ẇ', + 'ẉ' => 'Ẉ', + 'ẋ' => 'Ẋ', + 'ẍ' => 'Ẍ', + 'ẏ' => 'Ẏ', + 'ẑ' => 'Ẑ', + 'ẓ' => 'Ẓ', + 'ẕ' => 'Ẕ', + 'ẛ' => 'Ṡ', + 'ạ' => 'Ạ', + 'ả' => 'Ả', + 'ấ' => 'Ấ', + 'ầ' => 'Ầ', + 'ẩ' => 'Ẩ', + 'ẫ' => 'Ẫ', + 'ậ' => 'Ậ', + 'ắ' => 'Ắ', + 'ằ' => 'Ằ', + 'ẳ' => 'Ẳ', + 'ẵ' => 'Ẵ', + 'ặ' => 'Ặ', + 'ẹ' => 'Ẹ', + 'ẻ' => 'Ẻ', + 'ẽ' => 'Ẽ', + 'ế' => 'Ế', + 'ề' => 'Ề', + 'ể' => 'Ể', + 'ễ' => 'Ễ', + 'ệ' => 'Ệ', + 'ỉ' => 'Ỉ', + 'ị' => 'Ị', + 'ọ' => 'Ọ', + 'ỏ' => 'Ỏ', + 'ố' => 'Ố', + 'ồ' => 'Ồ', + 'ổ' => 'Ổ', + 'ỗ' => 'Ỗ', + 'ộ' => 'Ộ', + 'ớ' => 'Ớ', + 'ờ' => 'Ờ', + 'ở' => 'Ở', + 'ỡ' => 'Ỡ', + 'ợ' => 'Ợ', + 'ụ' => 'Ụ', + 'ủ' => 'Ủ', + 'ứ' => 'Ứ', + 'ừ' => 'Ừ', + 'ử' => 'Ử', + 'ữ' => 'Ữ', + 'ự' => 'Ự', + 'ỳ' => 'Ỳ', + 'ỵ' => 'Ỵ', + 'ỷ' => 'Ỷ', + 'ỹ' => 'Ỹ', + 'ỻ' => 'Ỻ', + 'ỽ' => 'Ỽ', + 'ỿ' => 'Ỿ', + 'ἀ' => 'Ἀ', + 'ἁ' => 'Ἁ', + 'ἂ' => 'Ἂ', + 'ἃ' => 'Ἃ', + 'ἄ' => 'Ἄ', + 'ἅ' => 'Ἅ', + 'ἆ' => 'Ἆ', + 'ἇ' => 'Ἇ', + 'ἐ' => 'Ἐ', + 'ἑ' => 'Ἑ', + 'ἒ' => 'Ἒ', + 'ἓ' => 'Ἓ', + 'ἔ' => 'Ἔ', + 'ἕ' => 'Ἕ', + 'ἠ' => 'Ἠ', + 'ἡ' => 'Ἡ', + 'ἢ' => 'Ἢ', + 'ἣ' => 'Ἣ', + 'ἤ' => 'Ἤ', + 'ἥ' => 'Ἥ', + 'ἦ' => 'Ἦ', + 'ἧ' => 'Ἧ', + 'ἰ' => 'Ἰ', + 'ἱ' => 'Ἱ', + 'ἲ' => 'Ἲ', + 'ἳ' => 'Ἳ', + 'ἴ' => 'Ἴ', + 'ἵ' => 'Ἵ', + 'ἶ' => 'Ἶ', + 'ἷ' => 'Ἷ', + 'ὀ' => 'Ὀ', + 'ὁ' => 'Ὁ', + 'ὂ' => 'Ὂ', + 'ὃ' => 'Ὃ', + 'ὄ' => 'Ὄ', + 'ὅ' => 'Ὅ', + 'ὑ' => 'Ὑ', + 'ὓ' => 'Ὓ', + 'ὕ' => 'Ὕ', + 'ὗ' => 'Ὗ', + 'ὠ' => 'Ὠ', + 'ὡ' => 'Ὡ', + 'ὢ' => 'Ὢ', + 'ὣ' => 'Ὣ', + 'ὤ' => 'Ὤ', + 'ὥ' => 'Ὥ', + 'ὦ' => 'Ὦ', + 'ὧ' => 'Ὧ', + 'ὰ' => 'Ὰ', + 'ά' => 'Ά', + 'ὲ' => 'Ὲ', + 'έ' => 'Έ', + 'ὴ' => 'Ὴ', + 'ή' => 'Ή', + 'ὶ' => 'Ὶ', + 'ί' => 'Ί', + 'ὸ' => 'Ὸ', + 'ό' => 'Ό', + 'ὺ' => 'Ὺ', + 'ύ' => 'Ύ', + 'ὼ' => 'Ὼ', + 'ώ' => 'Ώ', + 'ᾀ' => 'ᾈ', + 'ᾁ' => 'ᾉ', + 'ᾂ' => 'ᾊ', + 'ᾃ' => 'ᾋ', + 'ᾄ' => 'ᾌ', + 'ᾅ' => 'ᾍ', + 'ᾆ' => 'ᾎ', + 'ᾇ' => 'ᾏ', + 'ᾐ' => 'ᾘ', + 'ᾑ' => 'ᾙ', + 'ᾒ' => 'ᾚ', + 'ᾓ' => 'ᾛ', + 'ᾔ' => 'ᾜ', + 'ᾕ' => 'ᾝ', + 'ᾖ' => 'ᾞ', + 'ᾗ' => 'ᾟ', + 'ᾠ' => 'ᾨ', + 'ᾡ' => 'ᾩ', + 'ᾢ' => 'ᾪ', + 'ᾣ' => 'ᾫ', + 'ᾤ' => 'ᾬ', + 'ᾥ' => 'ᾭ', + 'ᾦ' => 'ᾮ', + 'ᾧ' => 'ᾯ', + 'ᾰ' => 'Ᾰ', + 'ᾱ' => 'Ᾱ', + 'ᾳ' => 'ᾼ', + 'ι' => 'Ι', + 'ῃ' => 'ῌ', + 'ῐ' => 'Ῐ', + 'ῑ' => 'Ῑ', + 'ῠ' => 'Ῠ', + 'ῡ' => 'Ῡ', + 'ῥ' => 'Ῥ', + 'ῳ' => 'ῼ', + 'ⅎ' => 'Ⅎ', + 'ⅰ' => 'Ⅰ', + 'ⅱ' => 'Ⅱ', + 'ⅲ' => 'Ⅲ', + 'ⅳ' => 'Ⅳ', + 'ⅴ' => 'Ⅴ', + 'ⅵ' => 'Ⅵ', + 'ⅶ' => 'Ⅶ', + 'ⅷ' => 'Ⅷ', + 'ⅸ' => 'Ⅸ', + 'ⅹ' => 'Ⅹ', + 'ⅺ' => 'Ⅺ', + 'ⅻ' => 'Ⅻ', + 'ⅼ' => 'Ⅼ', + 'ⅽ' => 'Ⅽ', + 'ⅾ' => 'Ⅾ', + 'ⅿ' => 'Ⅿ', + 'ↄ' => 'Ↄ', + 'ⓐ' => 'Ⓐ', + 'ⓑ' => 'Ⓑ', + 'ⓒ' => 'Ⓒ', + 'ⓓ' => 'Ⓓ', + 'ⓔ' => 'Ⓔ', + 'ⓕ' => 'Ⓕ', + 'ⓖ' => 'Ⓖ', + 'ⓗ' => 'Ⓗ', + 'ⓘ' => 'Ⓘ', + 'ⓙ' => 'Ⓙ', + 'ⓚ' => 'Ⓚ', + 'ⓛ' => 'Ⓛ', + 'ⓜ' => 'Ⓜ', + 'ⓝ' => 'Ⓝ', + 'ⓞ' => 'Ⓞ', + 'ⓟ' => 'Ⓟ', + 'ⓠ' => 'Ⓠ', + 'ⓡ' => 'Ⓡ', + 'ⓢ' => 'Ⓢ', + 'ⓣ' => 'Ⓣ', + 'ⓤ' => 'Ⓤ', + 'ⓥ' => 'Ⓥ', + 'ⓦ' => 'Ⓦ', + 'ⓧ' => 'Ⓧ', + 'ⓨ' => 'Ⓨ', + 'ⓩ' => 'Ⓩ', + 'ⰰ' => 'Ⰰ', + 'ⰱ' => 'Ⰱ', + 'ⰲ' => 'Ⰲ', + 'ⰳ' => 'Ⰳ', + 'ⰴ' => 'Ⰴ', + 'ⰵ' => 'Ⰵ', + 'ⰶ' => 'Ⰶ', + 'ⰷ' => 'Ⰷ', + 'ⰸ' => 'Ⰸ', + 'ⰹ' => 'Ⰹ', + 'ⰺ' => 'Ⰺ', + 'ⰻ' => 'Ⰻ', + 'ⰼ' => 'Ⰼ', + 'ⰽ' => 'Ⰽ', + 'ⰾ' => 'Ⰾ', + 'ⰿ' => 'Ⰿ', + 'ⱀ' => 'Ⱀ', + 'ⱁ' => 'Ⱁ', + 'ⱂ' => 'Ⱂ', + 'ⱃ' => 'Ⱃ', + 'ⱄ' => 'Ⱄ', + 'ⱅ' => 'Ⱅ', + 'ⱆ' => 'Ⱆ', + 'ⱇ' => 'Ⱇ', + 'ⱈ' => 'Ⱈ', + 'ⱉ' => 'Ⱉ', + 'ⱊ' => 'Ⱊ', + 'ⱋ' => 'Ⱋ', + 'ⱌ' => 'Ⱌ', + 'ⱍ' => 'Ⱍ', + 'ⱎ' => 'Ⱎ', + 'ⱏ' => 'Ⱏ', + 'ⱐ' => 'Ⱐ', + 'ⱑ' => 'Ⱑ', + 'ⱒ' => 'Ⱒ', + 'ⱓ' => 'Ⱓ', + 'ⱔ' => 'Ⱔ', + 'ⱕ' => 'Ⱕ', + 'ⱖ' => 'Ⱖ', + 'ⱗ' => 'Ⱗ', + 'ⱘ' => 'Ⱘ', + 'ⱙ' => 'Ⱙ', + 'ⱚ' => 'Ⱚ', + 'ⱛ' => 'Ⱛ', + 'ⱜ' => 'Ⱜ', + 'ⱝ' => 'Ⱝ', + 'ⱞ' => 'Ⱞ', + 'ⱡ' => 'Ⱡ', + 'ⱥ' => 'Ⱥ', + 'ⱦ' => 'Ⱦ', + 'ⱨ' => 'Ⱨ', + 'ⱪ' => 'Ⱪ', + 'ⱬ' => 'Ⱬ', + 'ⱳ' => 'Ⱳ', + 'ⱶ' => 'Ⱶ', + 'ⲁ' => 'Ⲁ', + 'ⲃ' => 'Ⲃ', + 'ⲅ' => 'Ⲅ', + 'ⲇ' => 'Ⲇ', + 'ⲉ' => 'Ⲉ', + 'ⲋ' => 'Ⲋ', + 'ⲍ' => 'Ⲍ', + 'ⲏ' => 'Ⲏ', + 'ⲑ' => 'Ⲑ', + 'ⲓ' => 'Ⲓ', + 'ⲕ' => 'Ⲕ', + 'ⲗ' => 'Ⲗ', + 'ⲙ' => 'Ⲙ', + 'ⲛ' => 'Ⲛ', + 'ⲝ' => 'Ⲝ', + 'ⲟ' => 'Ⲟ', + 'ⲡ' => 'Ⲡ', + 'ⲣ' => 'Ⲣ', + 'ⲥ' => 'Ⲥ', + 'ⲧ' => 'Ⲧ', + 'ⲩ' => 'Ⲩ', + 'ⲫ' => 'Ⲫ', + 'ⲭ' => 'Ⲭ', + 'ⲯ' => 'Ⲯ', + 'ⲱ' => 'Ⲱ', + 'ⲳ' => 'Ⲳ', + 'ⲵ' => 'Ⲵ', + 'ⲷ' => 'Ⲷ', + 'ⲹ' => 'Ⲹ', + 'ⲻ' => 'Ⲻ', + 'ⲽ' => 'Ⲽ', + 'ⲿ' => 'Ⲿ', + 'ⳁ' => 'Ⳁ', + 'ⳃ' => 'Ⳃ', + 'ⳅ' => 'Ⳅ', + 'ⳇ' => 'Ⳇ', + 'ⳉ' => 'Ⳉ', + 'ⳋ' => 'Ⳋ', + 'ⳍ' => 'Ⳍ', + 'ⳏ' => 'Ⳏ', + 'ⳑ' => 'Ⳑ', + 'ⳓ' => 'Ⳓ', + 'ⳕ' => 'Ⳕ', + 'ⳗ' => 'Ⳗ', + 'ⳙ' => 'Ⳙ', + 'ⳛ' => 'Ⳛ', + 'ⳝ' => 'Ⳝ', + 'ⳟ' => 'Ⳟ', + 'ⳡ' => 'Ⳡ', + 'ⳣ' => 'Ⳣ', + 'ⳬ' => 'Ⳬ', + 'ⳮ' => 'Ⳮ', + 'ⳳ' => 'Ⳳ', + 'ⴀ' => 'Ⴀ', + 'ⴁ' => 'Ⴁ', + 'ⴂ' => 'Ⴂ', + 'ⴃ' => 'Ⴃ', + 'ⴄ' => 'Ⴄ', + 'ⴅ' => 'Ⴅ', + 'ⴆ' => 'Ⴆ', + 'ⴇ' => 'Ⴇ', + 'ⴈ' => 'Ⴈ', + 'ⴉ' => 'Ⴉ', + 'ⴊ' => 'Ⴊ', + 'ⴋ' => 'Ⴋ', + 'ⴌ' => 'Ⴌ', + 'ⴍ' => 'Ⴍ', + 'ⴎ' => 'Ⴎ', + 'ⴏ' => 'Ⴏ', + 'ⴐ' => 'Ⴐ', + 'ⴑ' => 'Ⴑ', + 'ⴒ' => 'Ⴒ', + 'ⴓ' => 'Ⴓ', + 'ⴔ' => 'Ⴔ', + 'ⴕ' => 'Ⴕ', + 'ⴖ' => 'Ⴖ', + 'ⴗ' => 'Ⴗ', + 'ⴘ' => 'Ⴘ', + 'ⴙ' => 'Ⴙ', + 'ⴚ' => 'Ⴚ', + 'ⴛ' => 'Ⴛ', + 'ⴜ' => 'Ⴜ', + 'ⴝ' => 'Ⴝ', + 'ⴞ' => 'Ⴞ', + 'ⴟ' => 'Ⴟ', + 'ⴠ' => 'Ⴠ', + 'ⴡ' => 'Ⴡ', + 'ⴢ' => 'Ⴢ', + 'ⴣ' => 'Ⴣ', + 'ⴤ' => 'Ⴤ', + 'ⴥ' => 'Ⴥ', + 'ⴧ' => 'Ⴧ', + 'ⴭ' => 'Ⴭ', + 'ꙁ' => 'Ꙁ', + 'ꙃ' => 'Ꙃ', + 'ꙅ' => 'Ꙅ', + 'ꙇ' => 'Ꙇ', + 'ꙉ' => 'Ꙉ', + 'ꙋ' => 'Ꙋ', + 'ꙍ' => 'Ꙍ', + 'ꙏ' => 'Ꙏ', + 'ꙑ' => 'Ꙑ', + 'ꙓ' => 'Ꙓ', + 'ꙕ' => 'Ꙕ', + 'ꙗ' => 'Ꙗ', + 'ꙙ' => 'Ꙙ', + 'ꙛ' => 'Ꙛ', + 'ꙝ' => 'Ꙝ', + 'ꙟ' => 'Ꙟ', + 'ꙡ' => 'Ꙡ', + 'ꙣ' => 'Ꙣ', + 'ꙥ' => 'Ꙥ', + 'ꙧ' => 'Ꙧ', + 'ꙩ' => 'Ꙩ', + 'ꙫ' => 'Ꙫ', + 'ꙭ' => 'Ꙭ', + 'ꚁ' => 'Ꚁ', + 'ꚃ' => 'Ꚃ', + 'ꚅ' => 'Ꚅ', + 'ꚇ' => 'Ꚇ', + 'ꚉ' => 'Ꚉ', + 'ꚋ' => 'Ꚋ', + 'ꚍ' => 'Ꚍ', + 'ꚏ' => 'Ꚏ', + 'ꚑ' => 'Ꚑ', + 'ꚓ' => 'Ꚓ', + 'ꚕ' => 'Ꚕ', + 'ꚗ' => 'Ꚗ', + 'ꚙ' => 'Ꚙ', + 'ꚛ' => 'Ꚛ', + 'ꜣ' => 'Ꜣ', + 'ꜥ' => 'Ꜥ', + 'ꜧ' => 'Ꜧ', + 'ꜩ' => 'Ꜩ', + 'ꜫ' => 'Ꜫ', + 'ꜭ' => 'Ꜭ', + 'ꜯ' => 'Ꜯ', + 'ꜳ' => 'Ꜳ', + 'ꜵ' => 'Ꜵ', + 'ꜷ' => 'Ꜷ', + 'ꜹ' => 'Ꜹ', + 'ꜻ' => 'Ꜻ', + 'ꜽ' => 'Ꜽ', + 'ꜿ' => 'Ꜿ', + 'ꝁ' => 'Ꝁ', + 'ꝃ' => 'Ꝃ', + 'ꝅ' => 'Ꝅ', + 'ꝇ' => 'Ꝇ', + 'ꝉ' => 'Ꝉ', + 'ꝋ' => 'Ꝋ', + 'ꝍ' => 'Ꝍ', + 'ꝏ' => 'Ꝏ', + 'ꝑ' => 'Ꝑ', + 'ꝓ' => 'Ꝓ', + 'ꝕ' => 'Ꝕ', + 'ꝗ' => 'Ꝗ', + 'ꝙ' => 'Ꝙ', + 'ꝛ' => 'Ꝛ', + 'ꝝ' => 'Ꝝ', + 'ꝟ' => 'Ꝟ', + 'ꝡ' => 'Ꝡ', + 'ꝣ' => 'Ꝣ', + 'ꝥ' => 'Ꝥ', + 'ꝧ' => 'Ꝧ', + 'ꝩ' => 'Ꝩ', + 'ꝫ' => 'Ꝫ', + 'ꝭ' => 'Ꝭ', + 'ꝯ' => 'Ꝯ', + 'ꝺ' => 'Ꝺ', + 'ꝼ' => 'Ꝼ', + 'ꝿ' => 'Ꝿ', + 'ꞁ' => 'Ꞁ', + 'ꞃ' => 'Ꞃ', + 'ꞅ' => 'Ꞅ', + 'ꞇ' => 'Ꞇ', + 'ꞌ' => 'Ꞌ', + 'ꞑ' => 'Ꞑ', + 'ꞓ' => 'Ꞓ', + 'ꞗ' => 'Ꞗ', + 'ꞙ' => 'Ꞙ', + 'ꞛ' => 'Ꞛ', + 'ꞝ' => 'Ꞝ', + 'ꞟ' => 'Ꞟ', + 'ꞡ' => 'Ꞡ', + 'ꞣ' => 'Ꞣ', + 'ꞥ' => 'Ꞥ', + 'ꞧ' => 'Ꞧ', + 'ꞩ' => 'Ꞩ', + 'a' => 'A', + 'b' => 'B', + 'c' => 'C', + 'd' => 'D', + 'e' => 'E', + 'f' => 'F', + 'g' => 'G', + 'h' => 'H', + 'i' => 'I', + 'j' => 'J', + 'k' => 'K', + 'l' => 'L', + 'm' => 'M', + 'n' => 'N', + 'o' => 'O', + 'p' => 'P', + 'q' => 'Q', + 'r' => 'R', + 's' => 'S', + 't' => 'T', + 'u' => 'U', + 'v' => 'V', + 'w' => 'W', + 'x' => 'X', + 'y' => 'Y', + 'z' => 'Z', + '𐐨' => '𐐀', + '𐐩' => '𐐁', + '𐐪' => '𐐂', + '𐐫' => '𐐃', + '𐐬' => '𐐄', + '𐐭' => '𐐅', + '𐐮' => '𐐆', + '𐐯' => '𐐇', + '𐐰' => '𐐈', + '𐐱' => '𐐉', + '𐐲' => '𐐊', + '𐐳' => '𐐋', + '𐐴' => '𐐌', + '𐐵' => '𐐍', + '𐐶' => '𐐎', + '𐐷' => '𐐏', + '𐐸' => '𐐐', + '𐐹' => '𐐑', + '𐐺' => '𐐒', + '𐐻' => '𐐓', + '𐐼' => '𐐔', + '𐐽' => '𐐕', + '𐐾' => '𐐖', + '𐐿' => '𐐗', + '𐑀' => '𐐘', + '𐑁' => '𐐙', + '𐑂' => '𐐚', + '𐑃' => '𐐛', + '𐑄' => '𐐜', + '𐑅' => '𐐝', + '𐑆' => '𐐞', + '𐑇' => '𐐟', + '𐑈' => '𐐠', + '𐑉' => '𐐡', + '𐑊' => '𐐢', + '𐑋' => '𐐣', + '𐑌' => '𐐤', + '𐑍' => '𐐥', + '𐑎' => '𐐦', + '𐑏' => '𐐧', + '𑣀' => '𑢠', + '𑣁' => '𑢡', + '𑣂' => '𑢢', + '𑣃' => '𑢣', + '𑣄' => '𑢤', + '𑣅' => '𑢥', + '𑣆' => '𑢦', + '𑣇' => '𑢧', + '𑣈' => '𑢨', + '𑣉' => '𑢩', + '𑣊' => '𑢪', + '𑣋' => '𑢫', + '𑣌' => '𑢬', + '𑣍' => '𑢭', + '𑣎' => '𑢮', + '𑣏' => '𑢯', + '𑣐' => '𑢰', + '𑣑' => '𑢱', + '𑣒' => '𑢲', + '𑣓' => '𑢳', + '𑣔' => '𑢴', + '𑣕' => '𑢵', + '𑣖' => '𑢶', + '𑣗' => '𑢷', + '𑣘' => '𑢸', + '𑣙' => '𑢹', + '𑣚' => '𑢺', + '𑣛' => '𑢻', + '𑣜' => '𑢼', + '𑣝' => '𑢽', + '𑣞' => '𑢾', + '𑣟' => '𑢿', ); $result =& $data; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/bootstrap.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/bootstrap.php index 2fdcc5a..2c97b94 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/bootstrap.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -16,43 +16,153 @@ if (!function_exists('mb_strlen')) { define('MB_CASE_LOWER', 1); define('MB_CASE_TITLE', 2); - function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); } - function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); } - function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); } - function mb_decode_numericentity($s, $convmap, $enc = null) { return p\Mbstring::mb_decode_numericentity($s, $convmap, $enc); } - function mb_encode_numericentity($s, $convmap, $enc = null, $is_hex = false) { return p\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex); } - function mb_convert_case($s, $mode, $enc = null) { return p\Mbstring::mb_convert_case($s, $mode, $enc); } - function mb_internal_encoding($enc = null) { return p\Mbstring::mb_internal_encoding($enc); } - function mb_language($lang = null) { return p\Mbstring::mb_language($lang); } - function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } - function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } - function mb_check_encoding($var = null, $encoding = null) { return p\Mbstring::mb_check_encoding($var, $encoding); } - function mb_detect_encoding($str, $encodingList = null, $strict = false) { return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict); } - function mb_detect_order($encodingList = null) { return p\Mbstring::mb_detect_order($encodingList); } - function mb_parse_str($s, &$result = array()) { parse_str($s, $result); } - function mb_strlen($s, $enc = null) { return p\Mbstring::mb_strlen($s, $enc); } - function mb_strpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strpos($s, $needle, $offset, $enc); } - function mb_strtolower($s, $enc = null) { return p\Mbstring::mb_strtolower($s, $enc); } - function mb_strtoupper($s, $enc = null) { return p\Mbstring::mb_strtoupper($s, $enc); } - function mb_substitute_character($char = null) { return p\Mbstring::mb_substitute_character($char); } - function mb_substr($s, $start, $length = 2147483647, $enc = null) { return p\Mbstring::mb_substr($s, $start, $length, $enc); } - function mb_stripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_stripos($s, $needle, $offset, $enc); } - function mb_stristr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_stristr($s, $needle, $part, $enc); } - function mb_strrchr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrchr($s, $needle, $part, $enc); } - function mb_strrichr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrichr($s, $needle, $part, $enc); } - function mb_strripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strripos($s, $needle, $offset, $enc); } - function mb_strrpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strrpos($s, $needle, $offset, $enc); } - function mb_strstr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strstr($s, $needle, $part, $enc); } - function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } - function mb_http_output($enc = null) { return p\Mbstring::mb_http_output($enc); } - function mb_strwidth($s, $enc = null) { return p\Mbstring::mb_strwidth($s, $enc); } - function mb_substr_count($haystack, $needle, $enc = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $enc); } - function mb_output_handler($contents, $status) { return p\Mbstring::mb_output_handler($contents, $status); } - function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); } - 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); } + function mb_convert_encoding($s, $to, $from = NULL) { + return p\Mbstring::mb_convert_encoding($s, $to, $from); + } + + function mb_decode_mimeheader($s) { + return p\Mbstring::mb_decode_mimeheader($s); + } + + function mb_encode_mimeheader($s, $charset = NULL, $transferEnc = NULL, $lf = NULL, $indent = NULL) { + return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); + } + + function mb_decode_numericentity($s, $convmap, $enc = NULL) { + return p\Mbstring::mb_decode_numericentity($s, $convmap, $enc); + } + + function mb_encode_numericentity($s, $convmap, $enc = NULL, $is_hex = FALSE) { + return p\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex); + } + + function mb_convert_case($s, $mode, $enc = NULL) { + return p\Mbstring::mb_convert_case($s, $mode, $enc); + } + + function mb_internal_encoding($enc = NULL) { + return p\Mbstring::mb_internal_encoding($enc); + } + + function mb_language($lang = NULL) { + return p\Mbstring::mb_language($lang); + } + + function mb_list_encodings() { + return p\Mbstring::mb_list_encodings(); + } + + function mb_encoding_aliases($encoding) { + return p\Mbstring::mb_encoding_aliases($encoding); + } + + function mb_check_encoding($var = NULL, $encoding = NULL) { + return p\Mbstring::mb_check_encoding($var, $encoding); + } + + function mb_detect_encoding($str, $encodingList = NULL, $strict = FALSE) { + return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict); + } + + function mb_detect_order($encodingList = NULL) { + return p\Mbstring::mb_detect_order($encodingList); + } + + function mb_parse_str($s, &$result = array()) { + parse_str($s, $result); + } + + function mb_strlen($s, $enc = NULL) { + return p\Mbstring::mb_strlen($s, $enc); + } + + function mb_strpos($s, $needle, $offset = 0, $enc = NULL) { + return p\Mbstring::mb_strpos($s, $needle, $offset, $enc); + } + + function mb_strtolower($s, $enc = NULL) { + return p\Mbstring::mb_strtolower($s, $enc); + } + + function mb_strtoupper($s, $enc = NULL) { + return p\Mbstring::mb_strtoupper($s, $enc); + } + + function mb_substitute_character($char = NULL) { + return p\Mbstring::mb_substitute_character($char); + } + + function mb_substr($s, $start, $length = 2147483647, $enc = NULL) { + return p\Mbstring::mb_substr($s, $start, $length, $enc); + } + + function mb_stripos($s, $needle, $offset = 0, $enc = NULL) { + return p\Mbstring::mb_stripos($s, $needle, $offset, $enc); + } + + function mb_stristr($s, $needle, $part = FALSE, $enc = NULL) { + return p\Mbstring::mb_stristr($s, $needle, $part, $enc); + } + + function mb_strrchr($s, $needle, $part = FALSE, $enc = NULL) { + return p\Mbstring::mb_strrchr($s, $needle, $part, $enc); + } + + function mb_strrichr($s, $needle, $part = FALSE, $enc = NULL) { + return p\Mbstring::mb_strrichr($s, $needle, $part, $enc); + } + + function mb_strripos($s, $needle, $offset = 0, $enc = NULL) { + return p\Mbstring::mb_strripos($s, $needle, $offset, $enc); + } + + function mb_strrpos($s, $needle, $offset = 0, $enc = NULL) { + return p\Mbstring::mb_strrpos($s, $needle, $offset, $enc); + } + + function mb_strstr($s, $needle, $part = FALSE, $enc = NULL) { + return p\Mbstring::mb_strstr($s, $needle, $part, $enc); + } + + function mb_get_info($type = 'all') { + return p\Mbstring::mb_get_info($type); + } + + function mb_http_output($enc = NULL) { + return p\Mbstring::mb_http_output($enc); + } + + function mb_strwidth($s, $enc = NULL) { + return p\Mbstring::mb_strwidth($s, $enc); + } + + function mb_substr_count($haystack, $needle, $enc = NULL) { + return p\Mbstring::mb_substr_count($haystack, $needle, $enc); + } + + function mb_output_handler($contents, $status) { + return p\Mbstring::mb_output_handler($contents, $status); + } + + function mb_http_input($type = '') { + return p\Mbstring::mb_http_input($type); + } + + 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); + } } if (!function_exists('mb_chr')) { - function mb_ord($s, $enc = null) { return p\Mbstring::mb_ord($s, $enc); } - function mb_chr($code, $enc = null) { return p\Mbstring::mb_chr($code, $enc); } - function mb_scrub($s, $enc = null) { $enc = null === $enc ? mb_internal_encoding() : $enc; return mb_convert_encoding($s, $enc, $enc); } + function mb_ord($s, $enc = NULL) { + return p\Mbstring::mb_ord($s, $enc); + } + + function mb_chr($code, $enc = NULL) { + return p\Mbstring::mb_chr($code, $enc); + } + + function mb_scrub($s, $enc = NULL) { + $enc = NULL === $enc ? mb_internal_encoding() : $enc; + return mb_convert_encoding($s, $enc, $enc); + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/composer.json index 4febcdd..4b2213c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-mbstring/composer.json @@ -1,34 +1,44 @@ { - "name": "symfony/polyfill-mbstring", - "type": "library", - "description": "Symfony polyfill for the Mbstring extension", - "keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.3" + "name": "symfony/polyfill-mbstring", + "type": "library", + "description": "Symfony polyfill for the Mbstring extension", + "keywords": [ + "polyfill", + "shim", + "compatibility", + "portable", + "mbstring" + ], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-mbstring": "For best performance" + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3" + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } + "files": [ + "bootstrap.php" + ] + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" } + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-php70/Php70.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-php70/Php70.php index 8e78450..f339d99 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-php70/Php70.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-php70/Php70.php @@ -18,8 +18,7 @@ namespace Symfony\Polyfill\Php70; */ final class Php70 { - public static function intdiv($dividend, $divisor) - { + public static function intdiv($dividend, $divisor) { $dividend = self::intArg($dividend, __FUNCTION__, 1); $divisor = self::intArg($divisor, __FUNCTION__, 2); @@ -33,10 +32,9 @@ final class Php70 return ($dividend - ($dividend % $divisor)) / $divisor; } - public static function preg_replace_callback_array(array $patterns, $subject, $limit = -1, &$count = 0) - { + public static function preg_replace_callback_array(array $patterns, $subject, $limit = -1, &$count = 0) { $count = 0; - $result = (string) $subject; + $result = (string)$subject; if (0 === $limit = self::intArg($limit, __FUNCTION__, 3)) { return $result; } @@ -49,19 +47,19 @@ final class Php70 return $result; } - public static function error_clear_last() - { + public static function error_clear_last() { static $handler; if (!$handler) { - $handler = function() { return false; }; + $handler = function () { + return FALSE; + }; } set_error_handler($handler); @trigger_error(''); restore_error_handler(); } - public static function intArg($value, $caller, $pos) - { + public static function intArg($value, $caller, $pos) { if (is_int($value)) { return $value; } @@ -69,6 +67,6 @@ final class Php70 throw new \TypeError(sprintf('%s() expects parameter %d to be integer, %s given', $caller, $pos, gettype($value))); } - return (int) $value; + return (int)$value; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-php70/bootstrap.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-php70/bootstrap.php index 445c398..01be22d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-php70/bootstrap.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-php70/bootstrap.php @@ -16,12 +16,18 @@ if (PHP_VERSION_ID < 70000) { define('PHP_INT_MIN', ~PHP_INT_MAX); } if (!function_exists('intdiv')) { - function intdiv($dividend, $divisor) { return p\Php70::intdiv($dividend, $divisor); } + function intdiv($dividend, $divisor) { + return p\Php70::intdiv($dividend, $divisor); + } } if (!function_exists('preg_replace_callback_array')) { - function preg_replace_callback_array(array $patterns, $subject, $limit = -1, &$count = 0) { return p\Php70::preg_replace_callback_array($patterns, $subject, $limit, $count); } + function preg_replace_callback_array(array $patterns, $subject, $limit = -1, &$count = 0) { + return p\Php70::preg_replace_callback_array($patterns, $subject, $limit, $count); + } } if (!function_exists('error_clear_last')) { - function error_clear_last() { return p\Php70::error_clear_last(); } + function error_clear_last() { + return p\Php70::error_clear_last(); + } } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-php70/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-php70/composer.json index 88ff357..7ebe32b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-php70/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/polyfill-php70/composer.json @@ -1,33 +1,44 @@ { - "name": "symfony/polyfill-php70", - "type": "library", - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=5.3.3", - "paragonie/random_compat": "~1.0|~2.0" + "name": "symfony/polyfill-php70", + "type": "library", + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "keywords": [ + "polyfill", + "shim", + "compatibility", + "portable" + ], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php70\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3", + "paragonie/random_compat": "~1.0|~2.0" + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php70\\": "" }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" } + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Exception/ProcessFailedException.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Exception/ProcessFailedException.php index 328acfd..379b960 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Exception/ProcessFailedException.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Exception/ProcessFailedException.php @@ -22,13 +22,12 @@ class ProcessFailedException extends RuntimeException { private $process; - public function __construct(Process $process) - { + public function __construct(Process $process) { if ($process->isSuccessful()) { throw new InvalidArgumentException('Expected a failed process, but the given process was successful.'); } - $error = sprintf('The command "%s" failed.'."\n\nExit Code: %s(%s)\n\nWorking directory: %s", + $error = sprintf('The command "%s" failed.' . "\n\nExit Code: %s(%s)\n\nWorking directory: %s", $process->getCommandLine(), $process->getExitCode(), $process->getExitCodeText(), @@ -47,8 +46,7 @@ class ProcessFailedException extends RuntimeException $this->process = $process; } - public function getProcess() - { + public function getProcess() { return $this->process; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Exception/ProcessTimedOutException.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Exception/ProcessTimedOutException.php index fef4a8a..bac8636 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Exception/ProcessTimedOutException.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Exception/ProcessTimedOutException.php @@ -26,8 +26,7 @@ class ProcessTimedOutException extends RuntimeException private $process; private $timeoutType; - public function __construct(Process $process, $timeoutType) - { + public function __construct(Process $process, $timeoutType) { $this->process = $process; $this->timeoutType = $timeoutType; @@ -38,23 +37,19 @@ class ProcessTimedOutException extends RuntimeException )); } - public function getProcess() - { + public function getProcess() { return $this->process; } - public function isGeneralTimeout() - { + public function isGeneralTimeout() { return self::TYPE_GENERAL === $this->timeoutType; } - public function isIdleTimeout() - { + public function isIdleTimeout() { return self::TYPE_IDLE === $this->timeoutType; } - public function getExceededTimeout() - { + public function getExceededTimeout() { switch ($this->timeoutType) { case self::TYPE_GENERAL: return $this->process->getTimeout(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/ExecutableFinder.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/ExecutableFinder.php index d042a5b..546e6e3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/ExecutableFinder.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/ExecutableFinder.php @@ -24,8 +24,7 @@ class ExecutableFinder /** * Replaces default suffixes of executable. */ - public function setSuffixes(array $suffixes) - { + public function setSuffixes(array $suffixes) { $this->suffixes = $suffixes; } @@ -34,22 +33,20 @@ class ExecutableFinder * * @param string $suffix */ - public function addSuffix($suffix) - { + public function addSuffix($suffix) { $this->suffixes[] = $suffix; } /** * Finds an executable by name. * - * @param string $name The executable name (without the extension) - * @param string $default The default to return if no executable is found - * @param array $extraDirs Additional dirs to check into + * @param string $name The executable name (without the extension) + * @param string $default The default to return if no executable is found + * @param array $extraDirs Additional dirs to check into * * @return string The executable path or default value */ - public function find($name, $default = null, array $extraDirs = array()) - { + public function find($name, $default = NULL, array $extraDirs = array()) { if (ini_get('open_basedir')) { $searchPath = explode(PATH_SEPARATOR, ini_get('open_basedir')); $dirs = array(); @@ -77,7 +74,7 @@ class ExecutableFinder } foreach ($suffixes as $suffix) { foreach ($dirs as $dir) { - if (@is_file($file = $dir.DIRECTORY_SEPARATOR.$name.$suffix) && ('\\' === DIRECTORY_SEPARATOR || is_executable($file))) { + if (@is_file($file = $dir . DIRECTORY_SEPARATOR . $name . $suffix) && ('\\' === DIRECTORY_SEPARATOR || is_executable($file))) { return $file; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/InputStream.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/InputStream.php index 9bd917a..024e224 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/InputStream.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/InputStream.php @@ -21,15 +21,14 @@ use Symfony\Component\Process\Exception\RuntimeException; class InputStream implements \IteratorAggregate { /** @var null|callable */ - private $onEmpty = null; + private $onEmpty = NULL; private $input = array(); - private $open = true; + private $open = TRUE; /** * Sets a callback that is called when the write buffer becomes empty. */ - public function onEmpty(callable $onEmpty = null) - { + public function onEmpty(callable $onEmpty = NULL) { $this->onEmpty = $onEmpty; } @@ -39,9 +38,8 @@ class InputStream implements \IteratorAggregate * @param resource|string|int|float|bool|\Traversable|null The input to append as scalar, * stream resource or \Traversable */ - public function write($input) - { - if (null === $input) { + public function write($input) { + if (NULL === $input) { return; } if ($this->isClosed()) { @@ -53,22 +51,19 @@ class InputStream implements \IteratorAggregate /** * Closes the write buffer. */ - public function close() - { - $this->open = false; + public function close() { + $this->open = FALSE; } /** * Tells whether the write buffer is closed or not. */ - public function isClosed() - { + public function isClosed() { return !$this->open; } - public function getIterator() - { - $this->open = true; + public function getIterator() { + $this->open = TRUE; while ($this->open || $this->input) { if (!$this->input) { @@ -84,7 +79,7 @@ class InputStream implements \IteratorAggregate } else { yield $current; } - if (!$this->input && $this->open && null !== $onEmpty = $this->onEmpty) { + if (!$this->input && $this->open && NULL !== $onEmpty = $this->onEmpty) { $this->write($onEmpty($this)); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/PhpExecutableFinder.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/PhpExecutableFinder.php index c9c113c..e059dd6 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/PhpExecutableFinder.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/PhpExecutableFinder.php @@ -21,8 +21,7 @@ class PhpExecutableFinder { private $executableFinder; - public function __construct() - { + public function __construct() { $this->executableFinder = new ExecutableFinder(); } @@ -33,24 +32,23 @@ class PhpExecutableFinder * * @return string|false The PHP executable path or false if it cannot be found */ - public function find($includeArgs = true) - { + public function find($includeArgs = TRUE) { $args = $this->findArguments(); - $args = $includeArgs && $args ? ' '.implode(' ', $args) : ''; + $args = $includeArgs && $args ? ' ' . implode(' ', $args) : ''; // HHVM support if (defined('HHVM_VERSION')) { - return (getenv('PHP_BINARY') ?: PHP_BINARY).$args; + return (getenv('PHP_BINARY') ?: PHP_BINARY) . $args; } // PHP_BINARY return the current sapi executable - if (PHP_BINARY && \in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg'), true)) { - return PHP_BINARY.$args; + if (PHP_BINARY && \in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg'), TRUE)) { + return PHP_BINARY . $args; } if ($php = getenv('PHP_PATH')) { if (!is_executable($php)) { - return false; + return FALSE; } return $php; @@ -62,7 +60,7 @@ class PhpExecutableFinder } } - if (is_executable($php = PHP_BINDIR.('\\' === DIRECTORY_SEPARATOR ? '\\php.exe' : '/php'))) { + if (is_executable($php = PHP_BINDIR . ('\\' === DIRECTORY_SEPARATOR ? '\\php.exe' : '/php'))) { return $php; } @@ -71,7 +69,7 @@ class PhpExecutableFinder $dirs[] = 'C:\xampp\php\\'; } - return $this->executableFinder->find('php', false, $dirs); + return $this->executableFinder->find('php', FALSE, $dirs); } /** @@ -79,13 +77,12 @@ class PhpExecutableFinder * * @return array The PHP executable arguments */ - public function findArguments() - { + public function findArguments() { $arguments = array(); if (defined('HHVM_VERSION')) { $arguments[] = '--php'; - } elseif ('phpdbg' === PHP_SAPI) { + } else if ('phpdbg' === PHP_SAPI) { $arguments[] = '-qrr'; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/PhpProcess.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/PhpProcess.php index d3fd384..3222d84 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/PhpProcess.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/PhpProcess.php @@ -25,17 +25,16 @@ use Symfony\Component\Process\Exception\RuntimeException; class PhpProcess extends Process { /** - * @param string $script The PHP script to run (as a string) - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to use the same environment as the current PHP process - * @param int $timeout The timeout in seconds - * @param array $options An array of options for proc_open + * @param string $script The PHP script to run (as a string) + * @param string|null $cwd The working directory or null to use the working dir of the current PHP process + * @param array|null $env The environment variables or null to use the same environment as the current PHP process + * @param int $timeout The timeout in seconds + * @param array $options An array of options for proc_open */ - public function __construct($script, $cwd = null, array $env = null, $timeout = 60, array $options = null) - { + public function __construct($script, $cwd = NULL, array $env = NULL, $timeout = 60, array $options = NULL) { $executableFinder = new PhpExecutableFinder(); - if (false === $php = $executableFinder->find(false)) { - $php = null; + if (FALSE === $php = $executableFinder->find(FALSE)) { + $php = NULL; } else { $php = array_merge(array($php), $executableFinder->findArguments()); } @@ -44,9 +43,9 @@ class PhpProcess extends Process file_put_contents($file, $script); register_shutdown_function('unlink', $file); $php[] = $file; - $script = null; + $script = NULL; } - if (null !== $options) { + if (NULL !== $options) { @trigger_error(sprintf('The $options parameter of the %s constructor is deprecated since Symfony 3.3 and will be removed in 4.0.', __CLASS__), E_USER_DEPRECATED); } @@ -56,20 +55,18 @@ class PhpProcess extends Process /** * Sets the path to the PHP binary to use. */ - public function setPhpBinary($php) - { + public function setPhpBinary($php) { $this->setCommandLine($php); } /** * {@inheritdoc} */ - public function start(callable $callback = null/*, array $env = array()*/) - { - if (null === $this->getCommandLine()) { + public function start(callable $callback = NULL/*, array $env = array()*/) { + if (NULL === $this->getCommandLine()) { throw new RuntimeException('Unable to find the PHP executable.'); } - $env = 1 < func_num_args() ? func_get_arg(1) : null; + $env = 1 < func_num_args() ? func_get_arg(1) : NULL; parent::start($callback, $env); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Pipes/AbstractPipes.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Pipes/AbstractPipes.php index 2bd1fe7..c0944e6 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Pipes/AbstractPipes.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Pipes/AbstractPipes.php @@ -24,27 +24,25 @@ abstract class AbstractPipes implements PipesInterface private $inputBuffer = ''; private $input; - private $blocked = true; + private $blocked = TRUE; /** * @param resource|string|int|float|bool|\Iterator|null $input */ - public function __construct($input) - { + public function __construct($input) { if (is_resource($input) || $input instanceof \Iterator) { $this->input = $input; - } elseif (is_string($input)) { + } else if (is_string($input)) { $this->inputBuffer = $input; } else { - $this->inputBuffer = (string) $input; + $this->inputBuffer = (string)$input; } } /** * {@inheritdoc} */ - public function close() - { + public function close() { foreach ($this->pipes as $pipe) { fclose($pipe); } @@ -56,19 +54,17 @@ abstract class AbstractPipes implements PipesInterface * * @return bool */ - protected function hasSystemCallBeenInterrupted() - { + protected function hasSystemCallBeenInterrupted() { $lastError = error_get_last(); // stream_select returns false when the `select` system call is interrupted by an incoming signal - return isset($lastError['message']) && false !== stripos($lastError['message'], 'interrupted system call'); + return isset($lastError['message']) && FALSE !== stripos($lastError['message'], 'interrupted system call'); } /** * Unblocks streams. */ - protected function unblock() - { + protected function unblock() { if (!$this->blocked) { return; } @@ -80,7 +76,7 @@ abstract class AbstractPipes implements PipesInterface stream_set_blocking($this->input, 0); } - $this->blocked = false; + $this->blocked = FALSE; } /** @@ -88,8 +84,7 @@ abstract class AbstractPipes implements PipesInterface * * @throws InvalidArgumentException When an input iterator yields a non supported value */ - protected function write() - { + protected function write() { if (!isset($this->pipes[0])) { return; } @@ -97,21 +92,21 @@ abstract class AbstractPipes implements PipesInterface if ($input instanceof \Iterator) { if (!$input->valid()) { - $input = null; - } elseif (is_resource($input = $input->current())) { + $input = NULL; + } else if (is_resource($input = $input->current())) { stream_set_blocking($input, 0); - } elseif (!isset($this->inputBuffer[0])) { + } else if (!isset($this->inputBuffer[0])) { if (!is_string($input)) { if (!is_scalar($input)) { throw new InvalidArgumentException(sprintf('%s yielded a value of type "%s", but only scalars and stream resources are supported', get_class($this->input), gettype($input))); } - $input = (string) $input; + $input = (string)$input; } $this->inputBuffer = $input; $this->input->next(); - $input = null; + $input = NULL; } else { - $input = null; + $input = NULL; } } @@ -119,7 +114,7 @@ abstract class AbstractPipes implements PipesInterface $w = array($this->pipes[0]); // let's have a look if something changed in streams - if (false === @stream_select($r, $w, $e, 0, 0)) { + if (FALSE === @stream_select($r, $w, $e, 0, 0)) { return; } @@ -133,7 +128,7 @@ abstract class AbstractPipes implements PipesInterface } if ($input) { - for (;;) { + for (; ;) { $data = fread($input, self::CHUNK_SIZE); if (!isset($data[0])) { break; @@ -150,7 +145,7 @@ abstract class AbstractPipes implements PipesInterface if ($this->input instanceof \Iterator) { $this->input->next(); } else { - $this->input = null; + $this->input = NULL; } } } @@ -158,10 +153,10 @@ abstract class AbstractPipes implements PipesInterface // no input to read on resource, buffer is empty if (!isset($this->inputBuffer[0]) && !($this->input instanceof \Iterator ? $this->input->valid() : $this->input)) { - $this->input = null; + $this->input = NULL; fclose($this->pipes[0]); unset($this->pipes[0]); - } elseif (!$w) { + } else if (!$w) { return array($this->pipes[0]); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Pipes/PipesInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Pipes/PipesInterface.php index 52bbe76..e7c2066 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Pipes/PipesInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Pipes/PipesInterface.php @@ -40,11 +40,11 @@ interface PipesInterface * Reads data in file handles and pipes. * * @param bool $blocking Whether to use blocking calls or not - * @param bool $close Whether to close pipes if they've reached EOF + * @param bool $close Whether to close pipes if they've reached EOF * * @return string[] An array of read data indexed by their fd */ - public function readAndWrite($blocking, $close = false); + public function readAndWrite($blocking, $close = FALSE); /** * Returns if the current state has open file handles or pipes. diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Pipes/UnixPipes.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Pipes/UnixPipes.php index 78ffee7..22c3bd7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Pipes/UnixPipes.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Pipes/UnixPipes.php @@ -26,25 +26,22 @@ class UnixPipes extends AbstractPipes private $ptyMode; private $haveReadSupport; - public function __construct($ttyMode, $ptyMode, $input, $haveReadSupport) - { - $this->ttyMode = (bool) $ttyMode; - $this->ptyMode = (bool) $ptyMode; - $this->haveReadSupport = (bool) $haveReadSupport; + public function __construct($ttyMode, $ptyMode, $input, $haveReadSupport) { + $this->ttyMode = (bool)$ttyMode; + $this->ptyMode = (bool)$ptyMode; + $this->haveReadSupport = (bool)$haveReadSupport; parent::__construct($input); } - public function __destruct() - { + public function __destruct() { $this->close(); } /** * {@inheritdoc} */ - public function getDescriptors() - { + public function getDescriptors() { if (!$this->haveReadSupport) { $nullstream = fopen('/dev/null', 'c'); @@ -81,16 +78,14 @@ class UnixPipes extends AbstractPipes /** * {@inheritdoc} */ - public function getFiles() - { + public function getFiles() { return array(); } /** * {@inheritdoc} */ - public function readAndWrite($blocking, $close = false) - { + public function readAndWrite($blocking, $close = FALSE) { $this->unblock(); $w = $this->write(); @@ -99,7 +94,7 @@ class UnixPipes extends AbstractPipes unset($r[0]); // let's have a look if something changed in streams - if (($r || $w) && false === @stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) { + if (($r || $w) && FALSE === @stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) { // if a system call has been interrupted, forget about it, let's try again // otherwise, an error occurred, let's reset pipes if (!$this->hasSystemCallBeenInterrupted()) { @@ -112,7 +107,7 @@ class UnixPipes extends AbstractPipes foreach ($r as $pipe) { // prior PHP 5.4 the array passed to stream_select is modified and // lose key association, we have to find back the key - $read[$type = array_search($pipe, $this->pipes, true)] = ''; + $read[$type = array_search($pipe, $this->pipes, TRUE)] = ''; do { $data = fread($pipe, self::CHUNK_SIZE); @@ -135,16 +130,14 @@ class UnixPipes extends AbstractPipes /** * {@inheritdoc} */ - public function haveReadSupport() - { + public function haveReadSupport() { return $this->haveReadSupport; } /** * {@inheritdoc} */ - public function areOpen() - { - return (bool) $this->pipes; + public function areOpen() { + return (bool)$this->pipes; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Pipes/WindowsPipes.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Pipes/WindowsPipes.php index d5fa2fd..2d83839 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Pipes/WindowsPipes.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Pipes/WindowsPipes.php @@ -34,9 +34,8 @@ class WindowsPipes extends AbstractPipes ); private $haveReadSupport; - public function __construct($input, $haveReadSupport) - { - $this->haveReadSupport = (bool) $haveReadSupport; + public function __construct($input, $haveReadSupport) { + $this->haveReadSupport = (bool)$haveReadSupport; if ($this->haveReadSupport) { // Fix for PHP bug #51800: reading from STDOUT pipe hangs forever on Windows if the output is too big. @@ -47,11 +46,13 @@ class WindowsPipes extends AbstractPipes Process::STDOUT => Process::OUT, Process::STDERR => Process::ERR, ); - $tmpCheck = false; + $tmpCheck = FALSE; $tmpDir = sys_get_temp_dir(); $lastError = 'unknown reason'; - set_error_handler(function ($type, $msg) use (&$lastError) { $lastError = $msg; }); - for ($i = 0;; ++$i) { + set_error_handler(function ($type, $msg) use (&$lastError) { + $lastError = $msg; + }); + for ($i = 0; ; ++$i) { foreach ($pipes as $pipe => $name) { $file = sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name); if (file_exists($file) && !unlink($file)) { @@ -60,7 +61,7 @@ class WindowsPipes extends AbstractPipes $h = fopen($file, 'xb'); if (!$h) { $error = $lastError; - if ($tmpCheck || $tmpCheck = unlink(tempnam(false, 'sf_check_'))) { + if ($tmpCheck || $tmpCheck = unlink(tempnam(FALSE, 'sf_check_'))) { continue; } restore_error_handler(); @@ -82,8 +83,7 @@ class WindowsPipes extends AbstractPipes parent::__construct($input); } - public function __destruct() - { + public function __destruct() { $this->close(); $this->removeFiles(); } @@ -91,8 +91,7 @@ class WindowsPipes extends AbstractPipes /** * {@inheritdoc} */ - public function getDescriptors() - { + public function getDescriptors() { if (!$this->haveReadSupport) { $nullstream = fopen('NUL', 'c'); @@ -116,16 +115,14 @@ class WindowsPipes extends AbstractPipes /** * {@inheritdoc} */ - public function getFiles() - { + public function getFiles() { return $this->files; } /** * {@inheritdoc} */ - public function readAndWrite($blocking, $close = false) - { + public function readAndWrite($blocking, $close = FALSE) { $this->unblock(); $w = $this->write(); $read = $r = $e = array(); @@ -133,7 +130,7 @@ class WindowsPipes extends AbstractPipes if ($blocking) { if ($w) { @stream_select($r, $w, $e, 0, Process::TIMEOUT_PRECISION * 1E6); - } elseif ($this->fileHandles) { + } else if ($this->fileHandles) { usleep(Process::TIMEOUT_PRECISION * 1E6); } } @@ -156,24 +153,21 @@ class WindowsPipes extends AbstractPipes /** * {@inheritdoc} */ - public function haveReadSupport() - { + public function haveReadSupport() { return $this->haveReadSupport; } /** * {@inheritdoc} */ - public function areOpen() - { + public function areOpen() { return $this->pipes && $this->fileHandles; } /** * {@inheritdoc} */ - public function close() - { + public function close() { parent::close(); foreach ($this->fileHandles as $handle) { fclose($handle); @@ -184,8 +178,7 @@ class WindowsPipes extends AbstractPipes /** * Removes temporary files. */ - private function removeFiles() - { + private function removeFiles() { foreach ($this->files as $filename) { if (file_exists($filename)) { @unlink($filename); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Process.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Process.php index 830c623..8091e90 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Process.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Process.php @@ -49,7 +49,7 @@ class Process implements \IteratorAggregate const ITER_SKIP_ERR = 8; // Use this flag to skip STDERR while iterating private $callback; - private $hasCallback = false; + private $hasCallback = FALSE; private $commandline; private $cwd; private $env; @@ -58,14 +58,14 @@ class Process implements \IteratorAggregate private $lastOutputTime; private $timeout; private $idleTimeout; - private $options = array('suppress_errors' => true); + private $options = array('suppress_errors' => TRUE); private $exitcode; private $fallbackStatus = array(); private $processInformation; - private $outputDisabled = false; + private $outputDisabled = FALSE; private $stdout; private $stderr; - private $enhanceWindowsCompatibility = true; + private $enhanceWindowsCompatibility = TRUE; private $enhanceSigchildCompatibility; private $process; private $status = self::STATUS_READY; @@ -73,9 +73,9 @@ class Process implements \IteratorAggregate private $incrementalErrorOutputOffset = 0; private $tty; private $pty; - private $inheritEnv = false; + private $inheritEnv = FALSE; - private $useFileHandles = false; + private $useFileHandles = FALSE; /** @var PipesInterface */ private $processPipes; @@ -132,17 +132,16 @@ class Process implements \IteratorAggregate ); /** - * @param string|array $commandline The command line to run - * @param string|null $cwd The working directory or null to use the working dir of the current PHP process - * @param array|null $env The environment variables or null to use the same environment as the current PHP process - * @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input - * @param int|float|null $timeout The timeout in seconds or null to disable - * @param array $options An array of options for proc_open + * @param string|array $commandline The command line to run + * @param string|null $cwd The working directory or null to use the working dir of the current PHP process + * @param array|null $env The environment variables or null to use the same environment as the current PHP process + * @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input + * @param int|float|null $timeout The timeout in seconds or null to disable + * @param array $options An array of options for proc_open * * @throws RuntimeException When proc_open is not installed */ - public function __construct($commandline, $cwd = null, array $env = null, $input = null, $timeout = 60, array $options = null) - { + public function __construct($commandline, $cwd = NULL, array $env = NULL, $input = NULL, $timeout = 60, array $options = NULL) { if (!function_exists('proc_open')) { throw new RuntimeException('The Process class relies on proc_open, which is not available on your PHP installation.'); } @@ -154,31 +153,29 @@ class Process implements \IteratorAggregate // on Gnu/Linux, PHP builds with --enable-maintainer-zts are also affected // @see : https://bugs.php.net/bug.php?id=51800 // @see : https://bugs.php.net/bug.php?id=50524 - if (null === $this->cwd && (defined('ZEND_THREAD_SAFE') || '\\' === DIRECTORY_SEPARATOR)) { + if (NULL === $this->cwd && (defined('ZEND_THREAD_SAFE') || '\\' === DIRECTORY_SEPARATOR)) { $this->cwd = getcwd(); } - if (null !== $env) { + if (NULL !== $env) { $this->setEnv($env); } $this->setInput($input); $this->setTimeout($timeout); $this->useFileHandles = '\\' === DIRECTORY_SEPARATOR; - $this->pty = false; + $this->pty = FALSE; $this->enhanceSigchildCompatibility = '\\' !== DIRECTORY_SEPARATOR && $this->isSigchildEnabled(); - if (null !== $options) { + if (NULL !== $options) { @trigger_error(sprintf('The $options parameter of the %s constructor is deprecated since Symfony 3.3 and will be removed in 4.0.', __CLASS__), E_USER_DEPRECATED); $this->options = array_replace($this->options, $options); } } - public function __destruct() - { + public function __destruct() { $this->stop(0); } - public function __clone() - { + public function __clone() { $this->resetProcessData(); } @@ -194,7 +191,7 @@ class Process implements \IteratorAggregate * * @param callable|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR - * @param array $env An array of additional env vars to set when running the process + * @param array $env An array of additional env vars to set when running the process * * @return int The exit status code * @@ -204,9 +201,8 @@ class Process implements \IteratorAggregate * * @final since version 3.3 */ - public function run($callback = null/*, array $env = array()*/) - { - $env = 1 < func_num_args() ? func_get_arg(1) : null; + public function run($callback = NULL/*, array $env = array()*/) { + $env = 1 < func_num_args() ? func_get_arg(1) : NULL; $this->start($callback, $env); return $this->wait(); @@ -219,7 +215,7 @@ class Process implements \IteratorAggregate * exits with a non-zero exit code. * * @param callable|null $callback - * @param array $env An array of additional env vars to set when running the process + * @param array $env An array of additional env vars to set when running the process * * @return self * @@ -228,12 +224,11 @@ class Process implements \IteratorAggregate * * @final since version 3.3 */ - public function mustRun(callable $callback = null/*, array $env = array()*/) - { + public function mustRun(callable $callback = NULL/*, array $env = array()*/) { if (!$this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) { throw new RuntimeException('This PHP has been compiled with --enable-sigchild. You must use setEnhanceSigchildCompatibility() to use this method.'); } - $env = 1 < func_num_args() ? func_get_arg(1) : null; + $env = 1 < func_num_args() ? func_get_arg(1) : NULL; if (0 !== $this->run($callback, $env)) { throw new ProcessFailedException($this); @@ -256,14 +251,13 @@ class Process implements \IteratorAggregate * * @param callable|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR - * @param array $env An array of additional env vars to set when running the process + * @param array $env An array of additional env vars to set when running the process * * @throws RuntimeException When process can't be launched * @throws RuntimeException When process is already running * @throws LogicException In case a callback is provided and output has been disabled */ - public function start(callable $callback = null/*, array $env = array()*/) - { + public function start(callable $callback = NULL/*, array $env = array()*/) { if ($this->isRunning()) { throw new RuntimeException('Process is already running'); } @@ -276,13 +270,13 @@ class Process implements \IteratorAggregate @trigger_error(sprintf('The %s::start() method expects a second "$env" argument since Symfony 3.3. It will be made mandatory in 4.0.', static::class), E_USER_DEPRECATED); } } - $env = null; + $env = NULL; } $this->resetProcessData(); - $this->starttime = $this->lastOutputTime = microtime(true); + $this->starttime = $this->lastOutputTime = microtime(TRUE); $this->callback = $this->buildCallback($callback); - $this->hasCallback = null !== $callback; + $this->hasCallback = NULL !== $callback; $descriptors = $this->getDescriptors(); $inheritEnv = $this->inheritEnv; @@ -291,35 +285,35 @@ class Process implements \IteratorAggregate if ('\\' !== DIRECTORY_SEPARATOR) { // exec is mandatory to deal with sending a signal to the process - $commandline = 'exec '.$commandline; + $commandline = 'exec ' . $commandline; } } - if (null === $env) { + if (NULL === $env) { $env = $this->env; } else { if ($this->env) { $env += $this->env; } - $inheritEnv = true; + $inheritEnv = TRUE; } - if (null !== $env && $inheritEnv) { + if (NULL !== $env && $inheritEnv) { $env += $this->getDefaultEnv(); - } elseif (null !== $env) { + } else if (NULL !== $env) { @trigger_error('Not inheriting environment variables is deprecated since Symfony 3.3 and will always happen in 4.0. Set "Process::inheritEnvironmentVariables()" to true instead.', E_USER_DEPRECATED); } else { $env = $this->getDefaultEnv(); } if ('\\' === DIRECTORY_SEPARATOR && $this->enhanceWindowsCompatibility) { - $this->options['bypass_shell'] = true; + $this->options['bypass_shell'] = TRUE; $commandline = $this->prepareWindowsCommandLine($commandline, $env); - } elseif (!$this->useFileHandles && $this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) { + } else if (!$this->useFileHandles && $this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) { // last exit code is output on the fourth pipe and caught to work around --enable-sigchild $descriptors[3] = array('pipe', 'w'); // See https://unix.stackexchange.com/questions/71205/background-process-pipe-input - $commandline = '{ ('.$commandline.') <&3 3<&- 3>/dev/null & } 3<&0;'; + $commandline = '{ (' . $commandline . ') <&3 3<&- 3>/dev/null & } 3<&0;'; $commandline .= 'pid=$!; echo $pid >&3; wait $pid; code=$?; echo $code >&3; exit $code'; // Workaround for the bug, when PTS functionality is enabled. @@ -331,8 +325,8 @@ class Process implements \IteratorAggregate } else { $envPairs = array(); foreach ($env as $k => $v) { - if (false !== $v) { - $envPairs[] = $k.'='.$v; + if (FALSE !== $v) { + $envPairs[] = $k . '=' . $v; } } } @@ -349,14 +343,14 @@ class Process implements \IteratorAggregate $this->status = self::STATUS_STARTED; if (isset($descriptors[3])) { - $this->fallbackStatus['pid'] = (int) fgets($this->processPipes->pipes[3]); + $this->fallbackStatus['pid'] = (int)fgets($this->processPipes->pipes[3]); } if ($this->tty) { return; } - $this->updateStatus(false); + $this->updateStatus(FALSE); $this->checkTimeout(); } @@ -367,7 +361,7 @@ class Process implements \IteratorAggregate * * @param callable|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR - * @param array $env An array of additional env vars to set when running the process + * @param array $env An array of additional env vars to set when running the process * * @return $this * @@ -378,12 +372,11 @@ class Process implements \IteratorAggregate * * @final since version 3.3 */ - public function restart(callable $callback = null/*, array $env = array()*/) - { + public function restart(callable $callback = NULL/*, array $env = array()*/) { if ($this->isRunning()) { throw new RuntimeException('Process is already running'); } - $env = 1 < func_num_args() ? func_get_arg(1) : null; + $env = 1 < func_num_args() ? func_get_arg(1) : NULL; $process = clone $this; $process->start($callback, $env); @@ -406,13 +399,12 @@ class Process implements \IteratorAggregate * @throws RuntimeException When process stopped after receiving signal * @throws LogicException When process is not yet started */ - public function wait(callable $callback = null) - { + public function wait(callable $callback = NULL) { $this->requireProcessIsStarted(__FUNCTION__); - $this->updateStatus(false); + $this->updateStatus(FALSE); - if (null !== $callback) { + if (NULL !== $callback) { if (!$this->processPipes->haveReadSupport()) { $this->stop(0); throw new \LogicException('Pass the callback to the Process::start method or enableOutput to use a callback with Process::wait'); @@ -442,9 +434,8 @@ class Process implements \IteratorAggregate * * @return int|null The process id if running, null otherwise */ - public function getPid() - { - return $this->isRunning() ? $this->processInformation['pid'] : null; + public function getPid() { + return $this->isRunning() ? $this->processInformation['pid'] : NULL; } /** @@ -458,9 +449,8 @@ class Process implements \IteratorAggregate * @throws RuntimeException In case --enable-sigchild is activated and the process can't be killed * @throws RuntimeException In case of failure */ - public function signal($signal) - { - $this->doSignal($signal, true); + public function signal($signal) { + $this->doSignal($signal, TRUE); return $this; } @@ -473,16 +463,15 @@ class Process implements \IteratorAggregate * @throws RuntimeException In case the process is already running * @throws LogicException if an idle timeout is set */ - public function disableOutput() - { + public function disableOutput() { if ($this->isRunning()) { throw new RuntimeException('Disabling output while the process is running is not possible.'); } - if (null !== $this->idleTimeout) { + if (NULL !== $this->idleTimeout) { throw new LogicException('Output can not be disabled while an idle timeout is set.'); } - $this->outputDisabled = true; + $this->outputDisabled = TRUE; return $this; } @@ -494,13 +483,12 @@ class Process implements \IteratorAggregate * * @throws RuntimeException In case the process is already running */ - public function enableOutput() - { + public function enableOutput() { if ($this->isRunning()) { throw new RuntimeException('Enabling output while the process is running is not possible.'); } - $this->outputDisabled = false; + $this->outputDisabled = FALSE; return $this; } @@ -510,8 +498,7 @@ class Process implements \IteratorAggregate * * @return bool */ - public function isOutputDisabled() - { + public function isOutputDisabled() { return $this->outputDisabled; } @@ -523,11 +510,10 @@ class Process implements \IteratorAggregate * @throws LogicException in case the output has been disabled * @throws LogicException In case the process is not started */ - public function getOutput() - { + public function getOutput() { $this->readPipesForOutput(__FUNCTION__); - if (false === $ret = stream_get_contents($this->stdout, -1, 0)) { + if (FALSE === $ret = stream_get_contents($this->stdout, -1, 0)) { return ''; } @@ -545,14 +531,13 @@ class Process implements \IteratorAggregate * @throws LogicException in case the output has been disabled * @throws LogicException In case the process is not started */ - public function getIncrementalOutput() - { + public function getIncrementalOutput() { $this->readPipesForOutput(__FUNCTION__); $latest = stream_get_contents($this->stdout, -1, $this->incrementalOutputOffset); $this->incrementalOutputOffset = ftell($this->stdout); - if (false === $latest) { + if (FALSE === $latest) { return ''; } @@ -569,16 +554,15 @@ class Process implements \IteratorAggregate * * @return \Generator */ - public function getIterator($flags = 0) - { - $this->readPipesForOutput(__FUNCTION__, false); + public function getIterator($flags = 0) { + $this->readPipesForOutput(__FUNCTION__, FALSE); $clearOutput = !(self::ITER_KEEP_OUTPUT & $flags); $blocking = !(self::ITER_NON_BLOCKING & $flags); $yieldOut = !(self::ITER_SKIP_OUT & $flags); $yieldErr = !(self::ITER_SKIP_ERR & $flags); - while (null !== $this->callback || ($yieldOut && !feof($this->stdout)) || ($yieldErr && !feof($this->stderr))) { + while (NULL !== $this->callback || ($yieldOut && !feof($this->stdout)) || ($yieldErr && !feof($this->stderr))) { if ($yieldOut) { $out = stream_get_contents($this->stdout, -1, $this->incrementalOutputOffset); @@ -621,8 +605,7 @@ class Process implements \IteratorAggregate * * @return $this */ - public function clearOutput() - { + public function clearOutput() { ftruncate($this->stdout, 0); fseek($this->stdout, 0); $this->incrementalOutputOffset = 0; @@ -638,11 +621,10 @@ class Process implements \IteratorAggregate * @throws LogicException in case the output has been disabled * @throws LogicException In case the process is not started */ - public function getErrorOutput() - { + public function getErrorOutput() { $this->readPipesForOutput(__FUNCTION__); - if (false === $ret = stream_get_contents($this->stderr, -1, 0)) { + if (FALSE === $ret = stream_get_contents($this->stderr, -1, 0)) { return ''; } @@ -661,14 +643,13 @@ class Process implements \IteratorAggregate * @throws LogicException in case the output has been disabled * @throws LogicException In case the process is not started */ - public function getIncrementalErrorOutput() - { + public function getIncrementalErrorOutput() { $this->readPipesForOutput(__FUNCTION__); $latest = stream_get_contents($this->stderr, -1, $this->incrementalErrorOutputOffset); $this->incrementalErrorOutputOffset = ftell($this->stderr); - if (false === $latest) { + if (FALSE === $latest) { return ''; } @@ -680,8 +661,7 @@ class Process implements \IteratorAggregate * * @return $this */ - public function clearErrorOutput() - { + public function clearErrorOutput() { ftruncate($this->stderr, 0); fseek($this->stderr, 0); $this->incrementalErrorOutputOffset = 0; @@ -696,13 +676,12 @@ class Process implements \IteratorAggregate * * @throws RuntimeException In case --enable-sigchild is activated and the sigchild compatibility mode is disabled */ - public function getExitCode() - { + public function getExitCode() { if (!$this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) { throw new RuntimeException('This PHP has been compiled with --enable-sigchild. You must use setEnhanceSigchildCompatibility() to use this method.'); } - $this->updateStatus(false); + $this->updateStatus(FALSE); return $this->exitcode; } @@ -718,9 +697,8 @@ class Process implements \IteratorAggregate * @see http://tldp.org/LDP/abs/html/exitcodes.html * @see http://en.wikipedia.org/wiki/Unix_signal */ - public function getExitCodeText() - { - if (null === $exitcode = $this->getExitCode()) { + public function getExitCodeText() { + if (NULL === $exitcode = $this->getExitCode()) { return; } @@ -732,8 +710,7 @@ class Process implements \IteratorAggregate * * @return bool true if the process ended successfully, false otherwise */ - public function isSuccessful() - { + public function isSuccessful() { return 0 === $this->getExitCode(); } @@ -747,8 +724,7 @@ class Process implements \IteratorAggregate * @throws RuntimeException In case --enable-sigchild is activated * @throws LogicException In case the process is not terminated */ - public function hasBeenSignaled() - { + public function hasBeenSignaled() { $this->requireProcessIsTerminated(__FUNCTION__); if (!$this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) { @@ -768,8 +744,7 @@ class Process implements \IteratorAggregate * @throws RuntimeException In case --enable-sigchild is activated * @throws LogicException In case the process is not terminated */ - public function getTermSignal() - { + public function getTermSignal() { $this->requireProcessIsTerminated(__FUNCTION__); if ($this->isSigchildEnabled() && (!$this->enhanceSigchildCompatibility || -1 === $this->processInformation['termsig'])) { @@ -788,8 +763,7 @@ class Process implements \IteratorAggregate * * @throws LogicException In case the process is not terminated */ - public function hasBeenStopped() - { + public function hasBeenStopped() { $this->requireProcessIsTerminated(__FUNCTION__); return $this->processInformation['stopped']; @@ -804,8 +778,7 @@ class Process implements \IteratorAggregate * * @throws LogicException In case the process is not terminated */ - public function getStopSignal() - { + public function getStopSignal() { $this->requireProcessIsTerminated(__FUNCTION__); return $this->processInformation['stopsig']; @@ -816,13 +789,12 @@ class Process implements \IteratorAggregate * * @return bool true if the process is currently running, false otherwise */ - public function isRunning() - { + public function isRunning() { if (self::STATUS_STARTED !== $this->status) { - return false; + return FALSE; } - $this->updateStatus(false); + $this->updateStatus(FALSE); return $this->processInformation['running']; } @@ -832,8 +804,7 @@ class Process implements \IteratorAggregate * * @return bool true if status is ready, false otherwise */ - public function isStarted() - { + public function isStarted() { return self::STATUS_READY != $this->status; } @@ -842,9 +813,8 @@ class Process implements \IteratorAggregate * * @return bool true if process is terminated, false otherwise */ - public function isTerminated() - { - $this->updateStatus(false); + public function isTerminated() { + $this->updateStatus(FALSE); return self::STATUS_TERMINATED == $this->status; } @@ -856,9 +826,8 @@ class Process implements \IteratorAggregate * * @return string The current process status */ - public function getStatus() - { - $this->updateStatus(false); + public function getStatus() { + $this->updateStatus(FALSE); return $this->status; } @@ -867,24 +836,23 @@ class Process implements \IteratorAggregate * Stops the process. * * @param int|float $timeout The timeout in seconds - * @param int $signal A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9) + * @param int $signal A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9) * * @return int The exit-code of the process */ - public function stop($timeout = 10, $signal = null) - { - $timeoutMicro = microtime(true) + $timeout; + public function stop($timeout = 10, $signal = NULL) { + $timeoutMicro = microtime(TRUE) + $timeout; if ($this->isRunning()) { // given `SIGTERM` may not be defined and that `proc_terminate` uses the constant value and not the constant itself, we use the same here - $this->doSignal(15, false); + $this->doSignal(15, FALSE); do { usleep(1000); - } while ($this->isRunning() && microtime(true) < $timeoutMicro); + } while ($this->isRunning() && microtime(TRUE) < $timeoutMicro); if ($this->isRunning()) { // Avoid exception here: process is supposed to be running, but it might have stopped just // after this line. In any case, let's silently discard the error, we cannot do anything. - $this->doSignal($signal ?: 9, false); + $this->doSignal($signal ?: 9, FALSE); } } @@ -907,9 +875,8 @@ class Process implements \IteratorAggregate * * @param string $line The line to append */ - public function addOutput($line) - { - $this->lastOutputTime = microtime(true); + public function addOutput($line) { + $this->lastOutputTime = microtime(TRUE); fseek($this->stdout, 0, SEEK_END); fwrite($this->stdout, $line); @@ -923,9 +890,8 @@ class Process implements \IteratorAggregate * * @param string $line The line to append */ - public function addErrorOutput($line) - { - $this->lastOutputTime = microtime(true); + public function addErrorOutput($line) { + $this->lastOutputTime = microtime(TRUE); fseek($this->stderr, 0, SEEK_END); fwrite($this->stderr, $line); @@ -937,8 +903,7 @@ class Process implements \IteratorAggregate * * @return string The command to execute */ - public function getCommandLine() - { + public function getCommandLine() { return is_array($this->commandline) ? implode(' ', array_map(array($this, 'escapeArgument'), $this->commandline)) : $this->commandline; } @@ -949,8 +914,7 @@ class Process implements \IteratorAggregate * * @return self The current Process instance */ - public function setCommandLine($commandline) - { + public function setCommandLine($commandline) { $this->commandline = $commandline; return $this; @@ -961,8 +925,7 @@ class Process implements \IteratorAggregate * * @return float|null The timeout in seconds or null if it's disabled */ - public function getTimeout() - { + public function getTimeout() { return $this->timeout; } @@ -971,8 +934,7 @@ class Process implements \IteratorAggregate * * @return float|null The timeout in seconds or null if it's disabled */ - public function getIdleTimeout() - { + public function getIdleTimeout() { return $this->idleTimeout; } @@ -987,8 +949,7 @@ class Process implements \IteratorAggregate * * @throws InvalidArgumentException if the timeout is negative */ - public function setTimeout($timeout) - { + public function setTimeout($timeout) { $this->timeout = $this->validateTimeout($timeout); return $this; @@ -1006,9 +967,8 @@ class Process implements \IteratorAggregate * @throws LogicException if the output is disabled * @throws InvalidArgumentException if the timeout is negative */ - public function setIdleTimeout($timeout) - { - if (null !== $timeout && $this->outputDisabled) { + public function setIdleTimeout($timeout) { + if (NULL !== $timeout && $this->outputDisabled) { throw new LogicException('Idle timeout can not be set while the output is disabled.'); } @@ -1026,16 +986,15 @@ class Process implements \IteratorAggregate * * @throws RuntimeException In case the TTY mode is not supported */ - public function setTty($tty) - { + public function setTty($tty) { if ('\\' === DIRECTORY_SEPARATOR && $tty) { throw new RuntimeException('TTY mode is not supported on Windows platform.'); } if ($tty) { static $isTtySupported; - if (null === $isTtySupported) { - $isTtySupported = (bool) @proc_open('echo 1 >/dev/null', array(array('file', '/dev/tty', 'r'), array('file', '/dev/tty', 'w'), array('file', '/dev/tty', 'w')), $pipes); + if (NULL === $isTtySupported) { + $isTtySupported = (bool)@proc_open('echo 1 >/dev/null', array(array('file', '/dev/tty', 'r'), array('file', '/dev/tty', 'w'), array('file', '/dev/tty', 'w')), $pipes); } if (!$isTtySupported) { @@ -1043,7 +1002,7 @@ class Process implements \IteratorAggregate } } - $this->tty = (bool) $tty; + $this->tty = (bool)$tty; return $this; } @@ -1053,8 +1012,7 @@ class Process implements \IteratorAggregate * * @return bool true if the TTY mode is enabled, false otherwise */ - public function isTty() - { + public function isTty() { return $this->tty; } @@ -1065,9 +1023,8 @@ class Process implements \IteratorAggregate * * @return self */ - public function setPty($bool) - { - $this->pty = (bool) $bool; + public function setPty($bool) { + $this->pty = (bool)$bool; return $this; } @@ -1077,8 +1034,7 @@ class Process implements \IteratorAggregate * * @return bool */ - public function isPty() - { + public function isPty() { return $this->pty; } @@ -1087,12 +1043,11 @@ class Process implements \IteratorAggregate * * @return string|null The current working directory or null on failure */ - public function getWorkingDirectory() - { - if (null === $this->cwd) { + public function getWorkingDirectory() { + if (NULL === $this->cwd) { // getcwd() will return false if any one of the parent directories does not have // the readable or search mode set, even if the current directory does - return getcwd() ?: null; + return getcwd() ?: NULL; } return $this->cwd; @@ -1105,8 +1060,7 @@ class Process implements \IteratorAggregate * * @return self The current Process instance */ - public function setWorkingDirectory($cwd) - { + public function setWorkingDirectory($cwd) { $this->cwd = $cwd; return $this; @@ -1117,8 +1071,7 @@ class Process implements \IteratorAggregate * * @return array The current environment variables */ - public function getEnv() - { + public function getEnv() { return $this->env; } @@ -1137,8 +1090,7 @@ class Process implements \IteratorAggregate * * @return self The current Process instance */ - public function setEnv(array $env) - { + public function setEnv(array $env) { // Process can not handle env values that are arrays $env = array_filter($env, function ($value) { return !is_array($value); @@ -1154,8 +1106,7 @@ class Process implements \IteratorAggregate * * @return resource|string|\Iterator|null The Process input */ - public function getInput() - { + public function getInput() { return $this->input; } @@ -1170,8 +1121,7 @@ class Process implements \IteratorAggregate * * @throws LogicException In case the process is running */ - public function setInput($input) - { + public function setInput($input) { if ($this->isRunning()) { throw new LogicException('Input can not be set while the process is running.'); } @@ -1188,8 +1138,7 @@ class Process implements \IteratorAggregate * * @deprecated since version 3.3, to be removed in 4.0. */ - public function getOptions() - { + public function getOptions() { @trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); return $this->options; @@ -1204,8 +1153,7 @@ class Process implements \IteratorAggregate * * @deprecated since version 3.3, to be removed in 4.0. */ - public function setOptions(array $options) - { + public function setOptions(array $options) { @trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0.', __METHOD__), E_USER_DEPRECATED); $this->options = $options; @@ -1222,8 +1170,7 @@ class Process implements \IteratorAggregate * * @deprecated since version 3.3, to be removed in 4.0. Enhanced Windows compatibility will always be enabled. */ - public function getEnhanceWindowsCompatibility() - { + public function getEnhanceWindowsCompatibility() { @trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Enhanced Windows compatibility will always be enabled.', __METHOD__), E_USER_DEPRECATED); return $this->enhanceWindowsCompatibility; @@ -1238,11 +1185,10 @@ class Process implements \IteratorAggregate * * @deprecated since version 3.3, to be removed in 4.0. Enhanced Windows compatibility will always be enabled. */ - public function setEnhanceWindowsCompatibility($enhance) - { + public function setEnhanceWindowsCompatibility($enhance) { @trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Enhanced Windows compatibility will always be enabled.', __METHOD__), E_USER_DEPRECATED); - $this->enhanceWindowsCompatibility = (bool) $enhance; + $this->enhanceWindowsCompatibility = (bool)$enhance; return $this; } @@ -1254,8 +1200,7 @@ class Process implements \IteratorAggregate * * @deprecated since version 3.3, to be removed in 4.0. Sigchild compatibility will always be enabled. */ - public function getEnhanceSigchildCompatibility() - { + public function getEnhanceSigchildCompatibility() { @trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Sigchild compatibility will always be enabled.', __METHOD__), E_USER_DEPRECATED); return $this->enhanceSigchildCompatibility; @@ -1274,11 +1219,10 @@ class Process implements \IteratorAggregate * * @deprecated since version 3.3, to be removed in 4.0. */ - public function setEnhanceSigchildCompatibility($enhance) - { + public function setEnhanceSigchildCompatibility($enhance) { @trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Sigchild compatibility will always be enabled.', __METHOD__), E_USER_DEPRECATED); - $this->enhanceSigchildCompatibility = (bool) $enhance; + $this->enhanceSigchildCompatibility = (bool)$enhance; return $this; } @@ -1290,13 +1234,12 @@ class Process implements \IteratorAggregate * * @return self The current Process instance */ - public function inheritEnvironmentVariables($inheritEnv = true) - { + public function inheritEnvironmentVariables($inheritEnv = TRUE) { if (!$inheritEnv) { @trigger_error('Not inheriting environment variables is deprecated since Symfony 3.3 and will always happen in 4.0. Set "Process::inheritEnvironmentVariables()" to true instead.', E_USER_DEPRECATED); } - $this->inheritEnv = (bool) $inheritEnv; + $this->inheritEnv = (bool)$inheritEnv; return $this; } @@ -1308,8 +1251,7 @@ class Process implements \IteratorAggregate * * @deprecated since version 3.3, to be removed in 4.0. Environment variables will always be inherited. */ - public function areEnvironmentVariablesInherited() - { + public function areEnvironmentVariablesInherited() { @trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Environment variables will always be inherited.', __METHOD__), E_USER_DEPRECATED); return $this->inheritEnv; @@ -1323,19 +1265,18 @@ class Process implements \IteratorAggregate * * @throws ProcessTimedOutException In case the timeout was reached */ - public function checkTimeout() - { + public function checkTimeout() { if (self::STATUS_STARTED !== $this->status) { return; } - if (null !== $this->timeout && $this->timeout < microtime(true) - $this->starttime) { + if (NULL !== $this->timeout && $this->timeout < microtime(TRUE) - $this->starttime) { $this->stop(0); throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_GENERAL); } - if (null !== $this->idleTimeout && $this->idleTimeout < microtime(true) - $this->lastOutputTime) { + if (NULL !== $this->idleTimeout && $this->idleTimeout < microtime(TRUE) - $this->lastOutputTime) { $this->stop(0); throw new ProcessTimedOutException($this, ProcessTimedOutException::TYPE_IDLE); @@ -1347,19 +1288,18 @@ class Process implements \IteratorAggregate * * @return bool */ - public static function isPtySupported() - { + public static function isPtySupported() { static $result; - if (null !== $result) { + if (NULL !== $result) { return $result; } if ('\\' === DIRECTORY_SEPARATOR) { - return $result = false; + return $result = FALSE; } - return $result = (bool) @proc_open('echo 1 >/dev/null', array(array('pty'), array('pty'), array('pty')), $pipes); + return $result = (bool)@proc_open('echo 1 >/dev/null', array(array('pty'), array('pty'), array('pty')), $pipes); } /** @@ -1367,8 +1307,7 @@ class Process implements \IteratorAggregate * * @return array */ - private function getDescriptors() - { + private function getDescriptors() { if ($this->input instanceof \Iterator) { $this->input->rewind(); } @@ -1391,11 +1330,10 @@ class Process implements \IteratorAggregate * * @return \Closure A PHP closure */ - protected function buildCallback(callable $callback = null) - { + protected function buildCallback(callable $callback = NULL) { if ($this->outputDisabled) { return function ($type, $data) use ($callback) { - if (null !== $callback) { + if (NULL !== $callback) { call_user_func($callback, $type, $data); } }; @@ -1410,7 +1348,7 @@ class Process implements \IteratorAggregate $this->addErrorOutput($data); } - if (null !== $callback) { + if (NULL !== $callback) { call_user_func($callback, $type, $data); } }; @@ -1421,8 +1359,7 @@ class Process implements \IteratorAggregate * * @param bool $blocking Whether to use a blocking read call */ - protected function updateStatus($blocking) - { + protected function updateStatus($blocking) { if (self::STATUS_STARTED !== $this->status) { return; } @@ -1446,32 +1383,30 @@ class Process implements \IteratorAggregate * * @return bool */ - protected function isSigchildEnabled() - { - if (null !== self::$sigchild) { + protected function isSigchildEnabled() { + if (NULL !== self::$sigchild) { return self::$sigchild; } if (!function_exists('phpinfo') || defined('HHVM_VERSION')) { - return self::$sigchild = false; + return self::$sigchild = FALSE; } ob_start(); phpinfo(INFO_GENERAL); - return self::$sigchild = false !== strpos(ob_get_clean(), '--enable-sigchild'); + return self::$sigchild = FALSE !== strpos(ob_get_clean(), '--enable-sigchild'); } /** * Reads pipes for the freshest output. * - * @param string $caller The name of the method that needs fresh outputs - * @param bool $blocking Whether to use blocking calls or not + * @param string $caller The name of the method that needs fresh outputs + * @param bool $blocking Whether to use blocking calls or not * * @throws LogicException in case output has been disabled or process is not started */ - private function readPipesForOutput($caller, $blocking = false) - { + private function readPipesForOutput($caller, $blocking = FALSE) { if ($this->outputDisabled) { throw new LogicException('Output has been disabled.'); } @@ -1490,13 +1425,12 @@ class Process implements \IteratorAggregate * * @throws InvalidArgumentException if the given timeout is a negative number */ - private function validateTimeout($timeout) - { - $timeout = (float) $timeout; + private function validateTimeout($timeout) { + $timeout = (float)$timeout; if (0.0 === $timeout) { - $timeout = null; - } elseif ($timeout < 0) { + $timeout = NULL; + } else if ($timeout < 0) { throw new InvalidArgumentException('The timeout value must be a valid positive integer or float number.'); } @@ -1507,18 +1441,17 @@ class Process implements \IteratorAggregate * Reads pipes, executes callback. * * @param bool $blocking Whether to use blocking calls or not - * @param bool $close Whether to close file handles or not + * @param bool $close Whether to close file handles or not */ - private function readPipes($blocking, $close) - { + private function readPipes($blocking, $close) { $result = $this->processPipes->readAndWrite($blocking, $close); $callback = $this->callback; foreach ($result as $type => $data) { if (3 !== $type) { $callback(self::STDOUT === $type ? self::OUT : self::ERR, $data); - } elseif (!isset($this->fallbackStatus['signaled'])) { - $this->fallbackStatus['exitcode'] = (int) $data; + } else if (!isset($this->fallbackStatus['signaled'])) { + $this->fallbackStatus['exitcode'] = (int)$data; } } } @@ -1528,8 +1461,7 @@ class Process implements \IteratorAggregate * * @return int The exitcode */ - private function close() - { + private function close() { $this->processPipes->close(); if (is_resource($this->process)) { proc_close($this->process); @@ -1541,8 +1473,8 @@ class Process implements \IteratorAggregate if ($this->processInformation['signaled'] && 0 < $this->processInformation['termsig']) { // if process has been signaled, no exitcode but a valid termsig, apply Unix convention $this->exitcode = 128 + $this->processInformation['termsig']; - } elseif ($this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) { - $this->processInformation['signaled'] = true; + } else if ($this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) { + $this->processInformation['signaled'] = TRUE; $this->processInformation['termsig'] = -1; } } @@ -1550,7 +1482,7 @@ class Process implements \IteratorAggregate // Free memory from self-reference callback created by buildCallback // Doing so in other contexts like __destruct or by garbage collector is ineffective // Now pipes are closed, so the callback is no longer necessary - $this->callback = null; + $this->callback = NULL; return $this->exitcode; } @@ -1558,17 +1490,16 @@ class Process implements \IteratorAggregate /** * Resets data related to the latest run of the process. */ - private function resetProcessData() - { - $this->starttime = null; - $this->callback = null; - $this->exitcode = null; + private function resetProcessData() { + $this->starttime = NULL; + $this->callback = NULL; + $this->exitcode = NULL; $this->fallbackStatus = array(); - $this->processInformation = null; - $this->stdout = fopen('php://temp/maxmemory:'.(1024 * 1024), 'wb+'); - $this->stderr = fopen('php://temp/maxmemory:'.(1024 * 1024), 'wb+'); - $this->process = null; - $this->latestSignal = null; + $this->processInformation = NULL; + $this->stdout = fopen('php://temp/maxmemory:' . (1024 * 1024), 'wb+'); + $this->stderr = fopen('php://temp/maxmemory:' . (1024 * 1024), 'wb+'); + $this->process = NULL; + $this->latestSignal = NULL; $this->status = self::STATUS_READY; $this->incrementalOutputOffset = 0; $this->incrementalErrorOutputOffset = 0; @@ -1577,7 +1508,7 @@ class Process implements \IteratorAggregate /** * Sends a POSIX signal to the process. * - * @param int $signal A valid POSIX signal (see http://www.php.net/manual/en/pcntl.constants.php) + * @param int $signal A valid POSIX signal (see http://www.php.net/manual/en/pcntl.constants.php) * @param bool $throwException Whether to throw exception in case signal failed * * @return bool True if the signal was sent successfully, false otherwise @@ -1586,14 +1517,13 @@ class Process implements \IteratorAggregate * @throws RuntimeException In case --enable-sigchild is activated and the process can't be killed * @throws RuntimeException In case of failure */ - private function doSignal($signal, $throwException) - { - if (null === $pid = $this->getPid()) { + private function doSignal($signal, $throwException) { + if (NULL === $pid = $this->getPid()) { if ($throwException) { throw new LogicException('Can not send signal on a non running process.'); } - return false; + return FALSE; } if ('\\' === DIRECTORY_SEPARATOR) { @@ -1603,36 +1533,35 @@ class Process implements \IteratorAggregate throw new RuntimeException(sprintf('Unable to kill the process (%s).', implode(' ', $output))); } - return false; + return FALSE; } } else { if (!$this->enhanceSigchildCompatibility || !$this->isSigchildEnabled()) { $ok = @proc_terminate($this->process, $signal); - } elseif (function_exists('posix_kill')) { + } else if (function_exists('posix_kill')) { $ok = @posix_kill($pid, $signal); - } elseif ($ok = proc_open(sprintf('kill -%d %d', $signal, $pid), array(2 => array('pipe', 'w')), $pipes)) { - $ok = false === fgets($pipes[2]); + } else if ($ok = proc_open(sprintf('kill -%d %d', $signal, $pid), array(2 => array('pipe', 'w')), $pipes)) { + $ok = FALSE === fgets($pipes[2]); } if (!$ok) { if ($throwException) { throw new RuntimeException(sprintf('Error while sending signal `%s`.', $signal)); } - return false; + return FALSE; } } - $this->latestSignal = (int) $signal; - $this->fallbackStatus['signaled'] = true; + $this->latestSignal = (int)$signal; + $this->fallbackStatus['signaled'] = TRUE; $this->fallbackStatus['exitcode'] = -1; $this->fallbackStatus['termsig'] = $this->latestSignal; - return true; + return TRUE; } - private function prepareWindowsCommandLine($cmd, array &$env) - { - $uid = uniqid('', true); + private function prepareWindowsCommandLine($cmd, array &$env) { + $uid = uniqid('', TRUE); $varCount = 0; $varCache = array(); $cmd = preg_replace_callback( @@ -1650,27 +1579,27 @@ class Process implements \IteratorAggregate if (isset($varCache[$m[0]])) { return $varCache[$m[0]]; } - if (false !== strpos($value = $m[1], "\0")) { + if (FALSE !== strpos($value = $m[1], "\0")) { $value = str_replace("\0", '?', $value); } - if (false === strpbrk($value, "\"%!\n")) { - return '"'.$value.'"'; + if (FALSE === strpbrk($value, "\"%!\n")) { + return '"' . $value . '"'; } $value = str_replace(array('!LF!', '"^!"', '"^%"', '"^^"', '""'), array("\n", '!', '%', '^', '"'), $value); - $value = '"'.preg_replace('/(\\\\*)"/', '$1$1\\"', $value).'"'; - $var = $uid.++$varCount; + $value = '"' . preg_replace('/(\\\\*)"/', '$1$1\\"', $value) . '"'; + $var = $uid . ++$varCount; $env[$var] = $value; - return $varCache[$m[0]] = '!'.$var.'!'; + return $varCache[$m[0]] = '!' . $var . '!'; }, $cmd ); - $cmd = 'cmd /V:ON /E:ON /D /C ('.str_replace("\n", ' ', $cmd).')'; + $cmd = 'cmd /V:ON /E:ON /D /C (' . str_replace("\n", ' ', $cmd) . ')'; foreach ($this->processPipes->getFiles() as $offset => $filename) { - $cmd .= ' '.$offset.'>"'.$filename.'"'; + $cmd .= ' ' . $offset . '>"' . $filename . '"'; } return $cmd; @@ -1683,8 +1612,7 @@ class Process implements \IteratorAggregate * * @throws LogicException if the process has not run */ - private function requireProcessIsStarted($functionName) - { + private function requireProcessIsStarted($functionName) { if (!$this->isStarted()) { throw new LogicException(sprintf('Process must be started before calling %s.', $functionName)); } @@ -1697,8 +1625,7 @@ class Process implements \IteratorAggregate * * @throws LogicException if the process is not yet terminated */ - private function requireProcessIsTerminated($functionName) - { + private function requireProcessIsTerminated($functionName) { if (!$this->isTerminated()) { throw new LogicException(sprintf('Process must be terminated before calling %s.', $functionName)); } @@ -1711,15 +1638,14 @@ class Process implements \IteratorAggregate * * @return string The escaped argument */ - private function escapeArgument($argument) - { + private function escapeArgument($argument) { if ('\\' !== DIRECTORY_SEPARATOR) { - return "'".str_replace("'", "'\\''", $argument)."'"; + return "'" . str_replace("'", "'\\''", $argument) . "'"; } - if ('' === $argument = (string) $argument) { + if ('' === $argument = (string)$argument) { return '""'; } - if (false !== strpos($argument, "\0")) { + if (FALSE !== strpos($argument, "\0")) { $argument = str_replace("\0", '?', $argument); } if (!preg_match('/[\/()%!^"<>&|\s]/', $argument)) { @@ -1727,15 +1653,14 @@ class Process implements \IteratorAggregate } $argument = preg_replace('/(\\\\+)$/', '$1$1', $argument); - return '"'.str_replace(array('"', '^', '%', '!', "\n"), array('""', '"^^"', '"^%"', '"^!"', '!LF!'), $argument).'"'; + return '"' . str_replace(array('"', '^', '%', '!', "\n"), array('""', '"^^"', '"^%"', '"^!"', '!LF!'), $argument) . '"'; } - private function getDefaultEnv() - { + private function getDefaultEnv() { $env = array(); foreach ($_SERVER as $k => $v) { - if (is_string($v) && false !== $v = getenv($k)) { + if (is_string($v) && FALSE !== $v = getenv($k)) { $env[$k] = $v; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/ProcessBuilder.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/ProcessBuilder.php index a91147c..f5189ef 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/ProcessBuilder.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/ProcessBuilder.php @@ -29,15 +29,14 @@ class ProcessBuilder private $input; private $timeout = 60; private $options; - private $inheritEnv = true; + private $inheritEnv = TRUE; private $prefix = array(); - private $outputDisabled = false; + private $outputDisabled = FALSE; /** * @param string[] $arguments An array of arguments */ - public function __construct(array $arguments = array()) - { + public function __construct(array $arguments = array()) { $this->arguments = $arguments; } @@ -48,8 +47,7 @@ class ProcessBuilder * * @return static */ - public static function create(array $arguments = array()) - { + public static function create(array $arguments = array()) { return new static($arguments); } @@ -60,8 +58,7 @@ class ProcessBuilder * * @return $this */ - public function add($argument) - { + public function add($argument) { $this->arguments[] = $argument; return $this; @@ -76,8 +73,7 @@ class ProcessBuilder * * @return $this */ - public function setPrefix($prefix) - { + public function setPrefix($prefix) { $this->prefix = is_array($prefix) ? $prefix : array($prefix); return $this; @@ -93,8 +89,7 @@ class ProcessBuilder * * @return $this */ - public function setArguments(array $arguments) - { + public function setArguments(array $arguments) { $this->arguments = $arguments; return $this; @@ -107,8 +102,7 @@ class ProcessBuilder * * @return $this */ - public function setWorkingDirectory($cwd) - { + public function setWorkingDirectory($cwd) { $this->cwd = $cwd; return $this; @@ -121,8 +115,7 @@ class ProcessBuilder * * @return $this */ - public function inheritEnvironmentVariables($inheritEnv = true) - { + public function inheritEnvironmentVariables($inheritEnv = TRUE) { $this->inheritEnv = $inheritEnv; return $this; @@ -134,13 +127,12 @@ class ProcessBuilder * Setting a variable overrides its previous value. Use `null` to unset a * defined environment variable. * - * @param string $name The variable name + * @param string $name The variable name * @param null|string $value The variable value * * @return $this */ - public function setEnv($name, $value) - { + public function setEnv($name, $value) { $this->env[$name] = $value; return $this; @@ -157,8 +149,7 @@ class ProcessBuilder * * @return $this */ - public function addEnvironmentVariables(array $variables) - { + public function addEnvironmentVariables(array $variables) { $this->env = array_replace($this->env, $variables); return $this; @@ -173,8 +164,7 @@ class ProcessBuilder * * @throws InvalidArgumentException In case the argument is invalid */ - public function setInput($input) - { + public function setInput($input) { $this->input = ProcessUtils::validateInput(__METHOD__, $input); return $this; @@ -191,15 +181,14 @@ class ProcessBuilder * * @throws InvalidArgumentException */ - public function setTimeout($timeout) - { - if (null === $timeout) { - $this->timeout = null; + public function setTimeout($timeout) { + if (NULL === $timeout) { + $this->timeout = NULL; return $this; } - $timeout = (float) $timeout; + $timeout = (float)$timeout; if ($timeout < 0) { throw new InvalidArgumentException('The timeout value must be a valid positive integer or float number.'); @@ -213,13 +202,12 @@ class ProcessBuilder /** * Adds a proc_open option. * - * @param string $name The option name + * @param string $name The option name * @param string $value The option value * * @return $this */ - public function setOption($name, $value) - { + public function setOption($name, $value) { $this->options[$name] = $value; return $this; @@ -230,9 +218,8 @@ class ProcessBuilder * * @return $this */ - public function disableOutput() - { - $this->outputDisabled = true; + public function disableOutput() { + $this->outputDisabled = TRUE; return $this; } @@ -242,9 +229,8 @@ class ProcessBuilder * * @return $this */ - public function enableOutput() - { - $this->outputDisabled = false; + public function enableOutput() { + $this->outputDisabled = FALSE; return $this; } @@ -256,8 +242,7 @@ class ProcessBuilder * * @throws LogicException In case no arguments have been provided */ - public function getProcess() - { + public function getProcess() { if (0 === count($this->prefix) && 0 === count($this->arguments)) { throw new LogicException('You must add() command arguments before calling getProcess().'); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/ProcessUtils.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/ProcessUtils.php index c30950c..d47effb 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/ProcessUtils.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/ProcessUtils.php @@ -25,8 +25,7 @@ class ProcessUtils /** * This class should not be instantiated. */ - private function __construct() - { + private function __construct() { } /** @@ -38,9 +37,8 @@ class ProcessUtils * * @deprecated since version 3.3, to be removed in 4.0. Use a command line array or give env vars to the `Process::start/run()` method instead. */ - public static function escapeArgument($argument) - { - @trigger_error('The '.__METHOD__.'() method is deprecated since Symfony 3.3 and will be removed in 4.0. Use a command line array or give env vars to the Process::start/run() method instead.', E_USER_DEPRECATED); + public static function escapeArgument($argument) { + @trigger_error('The ' . __METHOD__ . '() method is deprecated since Symfony 3.3 and will be removed in 4.0. Use a command line array or give env vars to the Process::start/run() method instead.', E_USER_DEPRECATED); //Fix for PHP bug #43784 escapeshellarg removes % from given string //Fix for PHP bug #49446 escapeshellarg doesn't work on Windows @@ -52,45 +50,44 @@ class ProcessUtils } $escapedArgument = ''; - $quote = false; + $quote = FALSE; foreach (preg_split('/(")/', $argument, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $part) { if ('"' === $part) { $escapedArgument .= '\\"'; - } elseif (self::isSurroundedBy($part, '%')) { + } else if (self::isSurroundedBy($part, '%')) { // Avoid environment variable expansion - $escapedArgument .= '^%"'.substr($part, 1, -1).'"^%'; + $escapedArgument .= '^%"' . substr($part, 1, -1) . '"^%'; } else { // escape trailing backslash if ('\\' === substr($part, -1)) { $part .= '\\'; } - $quote = true; + $quote = TRUE; $escapedArgument .= $part; } } if ($quote) { - $escapedArgument = '"'.$escapedArgument.'"'; + $escapedArgument = '"' . $escapedArgument . '"'; } return $escapedArgument; } - return "'".str_replace("'", "'\\''", $argument)."'"; + return "'" . str_replace("'", "'\\''", $argument) . "'"; } /** * Validates and normalizes a Process input. * * @param string $caller The name of method call that validates the input - * @param mixed $input The input to validate + * @param mixed $input The input to validate * * @return mixed The validated input * * @throws InvalidArgumentException In case the input is not valid */ - public static function validateInput($caller, $input) - { - if (null !== $input) { + public static function validateInput($caller, $input) { + if (NULL !== $input) { if (is_resource($input)) { return $input; } @@ -98,7 +95,7 @@ class ProcessUtils return $input; } if (is_scalar($input)) { - return (string) $input; + return (string)$input; } if ($input instanceof Process) { return $input->getIterator($input::ITER_SKIP_ERR); @@ -116,8 +113,7 @@ class ProcessUtils return $input; } - private static function isSurroundedBy($arg, $char) - { + private static function isSurroundedBy($arg, $char) { return 2 < strlen($arg) && $char === $arg[0] && $char === $arg[strlen($arg) - 1]; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ExecutableFinderTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ExecutableFinderTest.php index bc692f6..323feab 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ExecutableFinderTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ExecutableFinderTest.php @@ -21,22 +21,19 @@ class ExecutableFinderTest extends TestCase { private $path; - protected function tearDown() - { + protected function tearDown() { if ($this->path) { // Restore path if it was changed. - putenv('PATH='.$this->path); + putenv('PATH=' . $this->path); } } - private function setPath($path) - { + private function setPath($path) { $this->path = getenv('PATH'); - putenv('PATH='.$path); + putenv('PATH=' . $path); } - public function testFind() - { + public function testFind() { if (ini_get('open_basedir')) { $this->markTestSkipped('Cannot test when open_basedir is set'); } @@ -49,8 +46,7 @@ class ExecutableFinderTest extends TestCase $this->assertSamePath(PHP_BINARY, $result); } - public function testFindWithDefault() - { + public function testFindWithDefault() { if (ini_get('open_basedir')) { $this->markTestSkipped('Cannot test when open_basedir is set'); } @@ -65,8 +61,7 @@ class ExecutableFinderTest extends TestCase $this->assertEquals($expected, $result); } - public function testFindWithExtraDirs() - { + public function testFindWithExtraDirs() { if (ini_get('open_basedir')) { $this->markTestSkipped('Cannot test when open_basedir is set'); } @@ -76,13 +71,12 @@ class ExecutableFinderTest extends TestCase $extraDirs = array(dirname(PHP_BINARY)); $finder = new ExecutableFinder(); - $result = $finder->find($this->getPhpBinaryName(), null, $extraDirs); + $result = $finder->find($this->getPhpBinaryName(), NULL, $extraDirs); $this->assertSamePath(PHP_BINARY, $result); } - public function testFindWithOpenBaseDir() - { + public function testFindWithOpenBaseDir() { if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Cannot run test on windows'); } @@ -91,7 +85,7 @@ class ExecutableFinderTest extends TestCase $this->markTestSkipped('Cannot test when open_basedir is set'); } - $this->iniSet('open_basedir', dirname(PHP_BINARY).(!defined('HHVM_VERSION') || HHVM_VERSION_ID >= 30800 ? PATH_SEPARATOR.'/' : '')); + $this->iniSet('open_basedir', dirname(PHP_BINARY) . (!defined('HHVM_VERSION') || HHVM_VERSION_ID >= 30800 ? PATH_SEPARATOR . '/' : '')); $finder = new ExecutableFinder(); $result = $finder->find($this->getPhpBinaryName()); @@ -99,8 +93,7 @@ class ExecutableFinderTest extends TestCase $this->assertSamePath(PHP_BINARY, $result); } - public function testFindProcessInOpenBasedir() - { + public function testFindProcessInOpenBasedir() { if (ini_get('open_basedir')) { $this->markTestSkipped('Cannot test when open_basedir is set'); } @@ -109,16 +102,15 @@ class ExecutableFinderTest extends TestCase } $this->setPath(''); - $this->iniSet('open_basedir', PHP_BINARY.(!defined('HHVM_VERSION') || HHVM_VERSION_ID >= 30800 ? PATH_SEPARATOR.'/' : '')); + $this->iniSet('open_basedir', PHP_BINARY . (!defined('HHVM_VERSION') || HHVM_VERSION_ID >= 30800 ? PATH_SEPARATOR . '/' : '')); $finder = new ExecutableFinder(); - $result = $finder->find($this->getPhpBinaryName(), false); + $result = $finder->find($this->getPhpBinaryName(), FALSE); $this->assertSamePath(PHP_BINARY, $result); } - private function assertSamePath($expected, $tested) - { + private function assertSamePath($expected, $tested) { if ('\\' === DIRECTORY_SEPARATOR) { $this->assertEquals(strtolower($expected), strtolower($tested)); } else { @@ -126,8 +118,7 @@ class ExecutableFinderTest extends TestCase } } - private function getPhpBinaryName() - { + private function getPhpBinaryName() { return basename(PHP_BINARY, '\\' === DIRECTORY_SEPARATOR ? '.exe' : ''); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/NonStopableProcess.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/NonStopableProcess.php index 5643259..b3b9960 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/NonStopableProcess.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/NonStopableProcess.php @@ -16,8 +16,7 @@ * * @example `php NonStopableProcess.php 42` will run the script for 42 seconds */ -function handleSignal($signal) -{ +function handleSignal($signal) { switch ($signal) { case SIGTERM: $name = 'SIGTERM'; @@ -26,7 +25,7 @@ function handleSignal($signal) $name = 'SIGINT'; break; default: - $name = $signal.' (unknown)'; + $name = $signal . ' (unknown)'; break; } @@ -38,10 +37,10 @@ pcntl_signal(SIGINT, 'handleSignal'); echo 'received '; -$duration = isset($argv[1]) ? (int) $argv[1] : 3; -$start = microtime(true); +$duration = isset($argv[1]) ? (int)$argv[1] : 3; +$start = microtime(TRUE); -while ($duration > (microtime(true) - $start)) { +while ($duration > (microtime(TRUE) - $start)) { usleep(10000); pcntl_signal_dispatch(); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/PhpExecutableFinderTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/PhpExecutableFinderTest.php index b08ad5d..727187a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/PhpExecutableFinderTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/PhpExecutableFinderTest.php @@ -22,8 +22,7 @@ class PhpExecutableFinderTest extends TestCase /** * tests find() with the constant PHP_BINARY. */ - public function testFind() - { + public function testFind() { if (defined('HHVM_VERSION')) { $this->markTestSkipped('Should not be executed in HHVM context.'); } @@ -33,15 +32,14 @@ class PhpExecutableFinderTest extends TestCase $current = PHP_BINARY; $args = 'phpdbg' === PHP_SAPI ? ' -qrr' : ''; - $this->assertEquals($current.$args, $f->find(), '::find() returns the executable PHP'); - $this->assertEquals($current, $f->find(false), '::find() returns the executable PHP'); + $this->assertEquals($current . $args, $f->find(), '::find() returns the executable PHP'); + $this->assertEquals($current, $f->find(FALSE), '::find() returns the executable PHP'); } /** * tests find() with the env var / constant PHP_BINARY with HHVM. */ - public function testFindWithHHVM() - { + public function testFindWithHHVM() { if (!defined('HHVM_VERSION')) { $this->markTestSkipped('Should be executed in HHVM context.'); } @@ -50,20 +48,19 @@ class PhpExecutableFinderTest extends TestCase $current = getenv('PHP_BINARY') ?: PHP_BINARY; - $this->assertEquals($current.' --php', $f->find(), '::find() returns the executable PHP'); - $this->assertEquals($current, $f->find(false), '::find() returns the executable PHP'); + $this->assertEquals($current . ' --php', $f->find(), '::find() returns the executable PHP'); + $this->assertEquals($current, $f->find(FALSE), '::find() returns the executable PHP'); } /** * tests find() with the env var PHP_PATH. */ - public function testFindArguments() - { + public function testFindArguments() { $f = new PhpExecutableFinder(); if (defined('HHVM_VERSION')) { $this->assertEquals($f->findArguments(), array('--php'), '::findArguments() returns HHVM arguments'); - } elseif ('phpdbg' === PHP_SAPI) { + } else if ('phpdbg' === PHP_SAPI) { $this->assertEquals($f->findArguments(), array('-qrr'), '::findArguments() returns phpdbg arguments'); } else { $this->assertEquals($f->findArguments(), array(), '::findArguments() returns no arguments'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/PhpProcessTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/PhpProcessTest.php index f67368c..189c3e3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/PhpProcessTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/PhpProcessTest.php @@ -16,8 +16,7 @@ use Symfony\Component\Process\PhpProcess; class PhpProcessTest extends TestCase { - public function testNonBlockingWorks() - { + public function testNonBlockingWorks() { $expected = 'hello world!'; $process = new PhpProcess(<<assertEquals($expected, $process->getOutput()); } - public function testCommandLine() - { + public function testCommandLine() { $process = new PhpProcess(<<<'PHP' wait(); $this->assertContains($commandLine, $process->getCommandLine(), '::getCommandLine() returns the command line of PHP after wait'); - $this->assertSame(PHP_VERSION.PHP_SAPI, $process->getOutput()); + $this->assertSame(PHP_VERSION . PHP_SAPI, $process->getOutput()); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php index bbd7ddf..923c3b2 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/PipeStdinInStdoutStdErrStreamSelect.php @@ -25,45 +25,45 @@ $out = $err = ''; while ($read || $write) { $r = $read; $w = $write; - $e = null; + $e = NULL; $n = stream_select($r, $w, $e, 5); - if (false === $n) { + if (FALSE === $n) { die(ERR_SELECT_FAILED); - } elseif ($n < 1) { + } else if ($n < 1) { die(ERR_TIMEOUT); } if (in_array(STDOUT, $w) && strlen($out) > 0) { - $written = fwrite(STDOUT, (binary) $out, 32768); - if (false === $written) { + $written = fwrite(STDOUT, (binary)$out, 32768); + if (FALSE === $written) { die(ERR_WRITE_FAILED); } - $out = (binary) substr($out, $written); + $out = (binary)substr($out, $written); } - if (null === $read && '' === $out) { + if (NULL === $read && '' === $out) { $write = array_diff($write, array(STDOUT)); } if (in_array(STDERR, $w) && strlen($err) > 0) { - $written = fwrite(STDERR, (binary) $err, 32768); - if (false === $written) { + $written = fwrite(STDERR, (binary)$err, 32768); + if (FALSE === $written) { die(ERR_WRITE_FAILED); } - $err = (binary) substr($err, $written); + $err = (binary)substr($err, $written); } - if (null === $read && '' === $err) { + if (NULL === $read && '' === $err) { $write = array_diff($write, array(STDERR)); } if ($r) { $str = fread(STDIN, 32768); - if (false !== $str) { + if (FALSE !== $str) { $out .= $str; $err .= $str; } - if (false === $str || feof(STDIN)) { - $read = null; + if (FALSE === $str || feof(STDIN)) { + $read = NULL; if (!feof(STDIN)) { die(ERR_READ_FAILED); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ProcessBuilderTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ProcessBuilderTest.php index 36c40bf..5753003 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ProcessBuilderTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ProcessBuilderTest.php @@ -19,8 +19,7 @@ use Symfony\Component\Process\ProcessBuilder; */ class ProcessBuilderTest extends TestCase { - public function testInheritEnvironmentVars() - { + public function testInheritEnvironmentVars() { $proc = ProcessBuilder::create() ->add('foo') ->getProcess(); @@ -29,14 +28,13 @@ class ProcessBuilderTest extends TestCase $proc = ProcessBuilder::create() ->add('foo') - ->inheritEnvironmentVariables(false) + ->inheritEnvironmentVariables(FALSE) ->getProcess(); $this->assertFalse($proc->areEnvironmentVariablesInherited()); } - public function testAddEnvironmentVariables() - { + public function testAddEnvironmentVariables() { $pb = new ProcessBuilder(); $env = array( 'foo' => 'bar', @@ -46,8 +44,7 @@ class ProcessBuilderTest extends TestCase ->add('command') ->setEnv('foo', 'bar2') ->addEnvironmentVariables($env) - ->getProcess() - ; + ->getProcess(); $this->assertSame($env, $proc->getEnv()); } @@ -55,27 +52,24 @@ class ProcessBuilderTest extends TestCase /** * @expectedException \Symfony\Component\Process\Exception\InvalidArgumentException */ - public function testNegativeTimeoutFromSetter() - { + public function testNegativeTimeoutFromSetter() { $pb = new ProcessBuilder(); $pb->setTimeout(-1); } - public function testNullTimeout() - { + public function testNullTimeout() { $pb = new ProcessBuilder(); $pb->setTimeout(10); - $pb->setTimeout(null); + $pb->setTimeout(NULL); $r = new \ReflectionObject($pb); $p = $r->getProperty('timeout'); - $p->setAccessible(true); + $p->setAccessible(TRUE); $this->assertNull($p->getValue($pb)); } - public function testShouldSetArguments() - { + public function testShouldSetArguments() { $pb = new ProcessBuilder(array('initial')); $pb->setArguments(array('second')); @@ -84,8 +78,7 @@ class ProcessBuilderTest extends TestCase $this->assertContains('second', $proc->getCommandLine()); } - public function testPrefixIsPrependedToAllGeneratedProcess() - { + public function testPrefixIsPrependedToAllGeneratedProcess() { $pb = new ProcessBuilder(); $pb->setPrefix('/usr/bin/php'); @@ -104,8 +97,7 @@ class ProcessBuilderTest extends TestCase } } - public function testArrayPrefixesArePrependedToAllGeneratedProcess() - { + public function testArrayPrefixesArePrependedToAllGeneratedProcess() { $pb = new ProcessBuilder(); $pb->setPrefix(array('/usr/bin/php', 'composer.phar')); @@ -124,8 +116,7 @@ class ProcessBuilderTest extends TestCase } } - public function testShouldEscapeArguments() - { + public function testShouldEscapeArguments() { $pb = new ProcessBuilder(array('%path%', 'foo " bar', '%baz%baz')); $proc = $pb->getProcess(); @@ -136,8 +127,7 @@ class ProcessBuilderTest extends TestCase } } - public function testShouldEscapeArgumentsAndPrefix() - { + public function testShouldEscapeArgumentsAndPrefix() { $pb = new ProcessBuilder(array('arg')); $pb->setPrefix('%prefix%'); $proc = $pb->getProcess(); @@ -152,13 +142,11 @@ class ProcessBuilderTest extends TestCase /** * @expectedException \Symfony\Component\Process\Exception\LogicException */ - public function testShouldThrowALogicExceptionIfNoPrefixAndNoArgument() - { + public function testShouldThrowALogicExceptionIfNoPrefixAndNoArgument() { ProcessBuilder::create()->getProcess(); } - public function testShouldNotThrowALogicExceptionIfNoArgument() - { + public function testShouldNotThrowALogicExceptionIfNoArgument() { $process = ProcessBuilder::create() ->setPrefix('/usr/bin/php') ->getProcess(); @@ -170,8 +158,7 @@ class ProcessBuilderTest extends TestCase } } - public function testShouldNotThrowALogicExceptionIfNoPrefix() - { + public function testShouldNotThrowALogicExceptionIfNoPrefix() { $process = ProcessBuilder::create(array('/usr/bin/php')) ->getProcess(); @@ -182,8 +169,7 @@ class ProcessBuilderTest extends TestCase } } - public function testShouldReturnProcessWithDisabledOutput() - { + public function testShouldReturnProcessWithDisabledOutput() { $process = ProcessBuilder::create(array('/usr/bin/php')) ->disableOutput() ->getProcess(); @@ -191,8 +177,7 @@ class ProcessBuilderTest extends TestCase $this->assertTrue($process->isOutputDisabled()); } - public function testShouldReturnProcessWithEnabledOutput() - { + public function testShouldReturnProcessWithEnabledOutput() { $process = ProcessBuilder::create(array('/usr/bin/php')) ->disableOutput() ->enableOutput() @@ -205,14 +190,12 @@ class ProcessBuilderTest extends TestCase * @expectedException \Symfony\Component\Process\Exception\InvalidArgumentException * @expectedExceptionMessage Symfony\Component\Process\ProcessBuilder::setInput only accepts strings, Traversable objects or stream resources. */ - public function testInvalidInput() - { + public function testInvalidInput() { $builder = ProcessBuilder::create(); $builder->setInput(array()); } - public function testDoesNotPrefixExec() - { + public function testDoesNotPrefixExec() { if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('This test cannot run on Windows.'); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ProcessFailedExceptionTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ProcessFailedExceptionTest.php index 25712af..4623791 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ProcessFailedExceptionTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ProcessFailedExceptionTest.php @@ -22,12 +22,11 @@ class ProcessFailedExceptionTest extends TestCase /** * tests ProcessFailedException throws exception if the process was successful. */ - public function testProcessFailedExceptionThrowsException() - { + public function testProcessFailedExceptionThrowsException() { $process = $this->getMockBuilder('Symfony\Component\Process\Process')->setMethods(array('isSuccessful'))->setConstructorArgs(array('php'))->getMock(); $process->expects($this->once()) ->method('isSuccessful') - ->will($this->returnValue(true)); + ->will($this->returnValue(TRUE)); if (method_exists($this, 'expectException')) { $this->expectException(\InvalidArgumentException::class); @@ -43,8 +42,7 @@ class ProcessFailedExceptionTest extends TestCase * tests ProcessFailedException uses information from process output * to generate exception message. */ - public function testProcessFailedExceptionPopulatesInformationFromProcessOutput() - { + public function testProcessFailedExceptionPopulatesInformationFromProcessOutput() { $cmd = 'php'; $exitCode = 1; $exitText = 'General error'; @@ -55,7 +53,7 @@ class ProcessFailedExceptionTest extends TestCase $process = $this->getMockBuilder('Symfony\Component\Process\Process')->setMethods(array('isSuccessful', 'getOutput', 'getErrorOutput', 'getExitCode', 'getExitCodeText', 'isOutputDisabled', 'getWorkingDirectory'))->setConstructorArgs(array($cmd))->getMock(); $process->expects($this->once()) ->method('isSuccessful') - ->will($this->returnValue(false)); + ->will($this->returnValue(FALSE)); $process->expects($this->once()) ->method('getOutput') @@ -75,7 +73,7 @@ class ProcessFailedExceptionTest extends TestCase $process->expects($this->once()) ->method('isOutputDisabled') - ->will($this->returnValue(false)); + ->will($this->returnValue(FALSE)); $process->expects($this->once()) ->method('getWorkingDirectory') @@ -93,8 +91,7 @@ class ProcessFailedExceptionTest extends TestCase * Tests that ProcessFailedException does not extract information from * process output if it was previously disabled. */ - public function testDisabledOutputInFailedExceptionDoesNotPopulateOutput() - { + public function testDisabledOutputInFailedExceptionDoesNotPopulateOutput() { $cmd = 'php'; $exitCode = 1; $exitText = 'General error'; @@ -103,7 +100,7 @@ class ProcessFailedExceptionTest extends TestCase $process = $this->getMockBuilder('Symfony\Component\Process\Process')->setMethods(array('isSuccessful', 'isOutputDisabled', 'getExitCode', 'getExitCodeText', 'getOutput', 'getErrorOutput', 'getWorkingDirectory'))->setConstructorArgs(array($cmd))->getMock(); $process->expects($this->once()) ->method('isSuccessful') - ->will($this->returnValue(false)); + ->will($this->returnValue(FALSE)); $process->expects($this->never()) ->method('getOutput'); @@ -121,7 +118,7 @@ class ProcessFailedExceptionTest extends TestCase $process->expects($this->once()) ->method('isOutputDisabled') - ->will($this->returnValue(true)); + ->will($this->returnValue(TRUE)); $process->expects($this->once()) ->method('getWorkingDirectory') diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ProcessTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ProcessTest.php index bca7ddd..3f16aad 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ProcessTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ProcessTest.php @@ -28,23 +28,21 @@ class ProcessTest extends TestCase private static $phpBin; private static $process; private static $sigchild; - private static $notEnhancedSigchild = false; + private static $notEnhancedSigchild = FALSE; - public static function setUpBeforeClass() - { + public static function setUpBeforeClass() { $phpBin = new PhpExecutableFinder(); self::$phpBin = getenv('SYMFONY_PROCESS_PHP_TEST_BINARY') ?: ('phpdbg' === PHP_SAPI ? 'php' : $phpBin->find()); ob_start(); phpinfo(INFO_GENERAL); - self::$sigchild = false !== strpos(ob_get_clean(), '--enable-sigchild'); + self::$sigchild = FALSE !== strpos(ob_get_clean(), '--enable-sigchild'); } - protected function tearDown() - { + protected function tearDown() { if (self::$process) { self::$process->stop(0); - self::$process = null; + self::$process = NULL; } } @@ -52,8 +50,7 @@ class ProcessTest extends TestCase * @group legacy * @expectedDeprecation The provided cwd does not exist. Command is currently ran against getcwd(). This behavior is deprecated since Symfony 3.4 and will be removed in 4.0. */ - public function testInvalidCwd() - { + public function testInvalidCwd() { if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('False-positive on Windows/appveyor.'); } @@ -62,12 +59,11 @@ class ProcessTest extends TestCase $cmd = new Process('echo test', __DIR__); $cmd->run(); - $cmd = new Process('echo test', __DIR__.'/notfound/'); + $cmd = new Process('echo test', __DIR__ . '/notfound/'); $cmd->run(); } - public function testThatProcessDoesNotThrowWarningDuringRun() - { + public function testThatProcessDoesNotThrowWarningDuringRun() { if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('This test is transient on Windows'); } @@ -82,28 +78,25 @@ class ProcessTest extends TestCase /** * @expectedException \Symfony\Component\Process\Exception\InvalidArgumentException */ - public function testNegativeTimeoutFromConstructor() - { - $this->getProcess('', null, null, null, -1); + public function testNegativeTimeoutFromConstructor() { + $this->getProcess('', NULL, NULL, NULL, -1); } /** * @expectedException \Symfony\Component\Process\Exception\InvalidArgumentException */ - public function testNegativeTimeoutFromSetter() - { + public function testNegativeTimeoutFromSetter() { $p = $this->getProcess(''); $p->setTimeout(-1); } - public function testFloatAndNullTimeout() - { + public function testFloatAndNullTimeout() { $p = $this->getProcess(''); $p->setTimeout(10); $this->assertSame(10.0, $p->getTimeout()); - $p->setTimeout(null); + $p->setTimeout(NULL); $this->assertNull($p->getTimeout()); $p->setTimeout(0.0); @@ -113,24 +106,22 @@ class ProcessTest extends TestCase /** * @requires extension pcntl */ - public function testStopWithTimeoutIsActuallyWorking() - { - $p = $this->getProcess(array(self::$phpBin, __DIR__.'/NonStopableProcess.php', 30)); + public function testStopWithTimeoutIsActuallyWorking() { + $p = $this->getProcess(array(self::$phpBin, __DIR__ . '/NonStopableProcess.php', 30)); $p->start(); - while (false === strpos($p->getOutput(), 'received')) { + while (FALSE === strpos($p->getOutput(), 'received')) { usleep(1000); } - $start = microtime(true); + $start = microtime(TRUE); $p->stop(0.1); $p->wait(); - $this->assertLessThan(15, microtime(true) - $start); + $this->assertLessThan(15, microtime(TRUE) - $start); } - public function testAllOutputIsActuallyReadOnTermination() - { + public function testAllOutputIsActuallyReadOnTermination() { // this code will result in a maximum of 2 reads of 8192 bytes by calling // start() and isRunning(). by the time getOutput() is called the process // has terminated so the internal pipes array is already empty. normally @@ -147,7 +138,7 @@ class ProcessTest extends TestCase // Don't call Process::run nor Process::wait to avoid any read of pipes $h = new \ReflectionProperty($p, 'process'); - $h->setAccessible(true); + $h->setAccessible(TRUE); $h = $h->getValue($p); $s = @proc_get_status($h); @@ -161,8 +152,7 @@ class ProcessTest extends TestCase $this->assertEquals($expectedOutputSize, strlen($o)); } - public function testCallbacksAreExecutedWithStart() - { + public function testCallbacksAreExecutedWithStart() { $process = $this->getProcess('echo foo'); $process->start(function ($type, $buffer) use (&$data) { $data .= $buffer; @@ -170,7 +160,7 @@ class ProcessTest extends TestCase $process->wait(); - $this->assertSame('foo'.PHP_EOL, $data); + $this->assertSame('foo' . PHP_EOL, $data); } /** @@ -178,8 +168,7 @@ class ProcessTest extends TestCase * * @dataProvider responsesCodeProvider */ - public function testProcessResponses($expected, $getter, $code) - { + public function testProcessResponses($expected, $getter, $code) { $p = $this->getProcessForCode($code); $p->run(); @@ -191,9 +180,8 @@ class ProcessTest extends TestCase * * @dataProvider pipesCodeProvider */ - public function testProcessPipes($code, $size) - { - $expected = str_repeat(str_repeat('*', 1024), $size).'!'; + public function testProcessPipes($code, $size) { + $expected = str_repeat(str_repeat('*', 1024), $size) . '!'; $expectedLength = (1024 * $size) + 1; $p = $this->getProcessForCode($code); @@ -207,9 +195,8 @@ class ProcessTest extends TestCase /** * @dataProvider pipesCodeProvider */ - public function testSetStreamAsInput($code, $size) - { - $expected = str_repeat(str_repeat('*', 1024), $size).'!'; + public function testSetStreamAsInput($code, $size) { + $expected = str_repeat(str_repeat('*', 1024), $size) . '!'; $expectedLength = (1024 * $size) + 1; $stream = fopen('php://temporary', 'w+'); @@ -226,8 +213,7 @@ class ProcessTest extends TestCase $this->assertEquals($expectedLength, strlen($p->getErrorOutput())); } - public function testLiveStreamAsInput() - { + public function testLiveStreamAsInput() { $stream = fopen('php://memory', 'r+'); fwrite($stream, 'hello'); rewind($stream); @@ -248,8 +234,7 @@ class ProcessTest extends TestCase * @expectedException \Symfony\Component\Process\Exception\LogicException * @expectedExceptionMessage Input can not be set while the process is running. */ - public function testSetInputWhileRunningThrowsAnException() - { + public function testSetInputWhileRunningThrowsAnException() { $process = $this->getProcessForCode('sleep(30);'); $process->start(); try { @@ -268,14 +253,12 @@ class ProcessTest extends TestCase * @expectedException \Symfony\Component\Process\Exception\InvalidArgumentException * @expectedExceptionMessage Symfony\Component\Process\Process::setInput only accepts strings, Traversable objects or stream resources. */ - public function testInvalidInput($value) - { + public function testInvalidInput($value) { $process = $this->getProcess('foo'); $process->setInput($value); } - public function provideInvalidInputValues() - { + public function provideInvalidInputValues() { return array( array(array()), array(new NonStringifiable()), @@ -285,24 +268,21 @@ class ProcessTest extends TestCase /** * @dataProvider provideInputValues */ - public function testValidInput($expected, $value) - { + public function testValidInput($expected, $value) { $process = $this->getProcess('foo'); $process->setInput($value); $this->assertSame($expected, $process->getInput()); } - public function provideInputValues() - { + public function provideInputValues() { return array( - array(null, null), + array(NULL, NULL), array('24.5', 24.5), array('input data', 'input data'), ); } - public function chainedCommandsOutputProvider() - { + public function chainedCommandsOutputProvider() { if ('\\' === DIRECTORY_SEPARATOR) { return array( array("2 \r\n2\r\n", '&&', '2'), @@ -318,18 +298,16 @@ class ProcessTest extends TestCase /** * @dataProvider chainedCommandsOutputProvider */ - public function testChainedCommandsOutput($expected, $operator, $input) - { + public function testChainedCommandsOutput($expected, $operator, $input) { $process = $this->getProcess(sprintf('echo %s %s echo %s', $input, $operator, $input)); $process->run(); $this->assertEquals($expected, $process->getOutput()); } - public function testCallbackIsExecutedForOutput() - { + public function testCallbackIsExecutedForOutput() { $p = $this->getProcessForCode('echo \'foo\';'); - $called = false; + $called = FALSE; $p->run(function ($type, $buffer) use (&$called) { $called = 'foo' === $buffer; }); @@ -337,12 +315,11 @@ class ProcessTest extends TestCase $this->assertTrue($called, 'The callback should be executed with the output'); } - public function testCallbackIsExecutedForOutputWheneverOutputIsDisabled() - { + public function testCallbackIsExecutedForOutputWheneverOutputIsDisabled() { $p = $this->getProcessForCode('echo \'foo\';'); $p->disableOutput(); - $called = false; + $called = FALSE; $p->run(function ($type, $buffer) use (&$called) { $called = 'foo' === $buffer; }); @@ -350,16 +327,14 @@ class ProcessTest extends TestCase $this->assertTrue($called, 'The callback should be executed with the output'); } - public function testGetErrorOutput() - { + public function testGetErrorOutput() { $p = $this->getProcessForCode('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }'); $p->run(); $this->assertEquals(3, preg_match_all('/ERROR/', $p->getErrorOutput(), $matches)); } - public function testFlushErrorOutput() - { + public function testFlushErrorOutput() { $p = $this->getProcessForCode('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }'); $p->run(); @@ -370,11 +345,10 @@ class ProcessTest extends TestCase /** * @dataProvider provideIncrementalOutput */ - public function testIncrementalOutput($getOutput, $getIncrementalOutput, $uri) - { + public function testIncrementalOutput($getOutput, $getIncrementalOutput, $uri) { $lock = tempnam(sys_get_temp_dir(), __FUNCTION__); - $p = $this->getProcessForCode('file_put_contents($s = \''.$uri.'\', \'foo\'); flock(fopen('.var_export($lock, true).', \'r\'), LOCK_EX); file_put_contents($s, \'bar\');'); + $p = $this->getProcessForCode('file_put_contents($s = \'' . $uri . '\', \'foo\'); flock(fopen(' . var_export($lock, TRUE) . ', \'r\'), LOCK_EX); file_put_contents($s, \'bar\');'); $h = fopen($lock, 'w'); flock($h, LOCK_EX); @@ -382,7 +356,7 @@ class ProcessTest extends TestCase $p->start(); foreach (array('foo', 'bar') as $s) { - while (false === strpos($p->$getOutput(), $s)) { + while (FALSE === strpos($p->$getOutput(), $s)) { usleep(1000); } @@ -395,24 +369,21 @@ class ProcessTest extends TestCase fclose($h); } - public function provideIncrementalOutput() - { + public function provideIncrementalOutput() { return array( array('getOutput', 'getIncrementalOutput', 'php://stdout'), array('getErrorOutput', 'getIncrementalErrorOutput', 'php://stderr'), ); } - public function testGetOutput() - { + public function testGetOutput() { $p = $this->getProcessForCode('$n = 0; while ($n < 3) { echo \' foo \'; $n++; }'); $p->run(); $this->assertEquals(3, preg_match_all('/foo/', $p->getOutput(), $matches)); } - public function testFlushOutput() - { + public function testFlushOutput() { $p = $this->getProcessForCode('$n=0;while ($n<3) {echo \' foo \';$n++;}'); $p->run(); @@ -420,8 +391,7 @@ class ProcessTest extends TestCase $this->assertEmpty($p->getOutput()); } - public function testZeroAsOutput() - { + public function testZeroAsOutput() { if ('\\' === DIRECTORY_SEPARATOR) { // see http://stackoverflow.com/questions/7105433/windows-batch-echo-without-new-line $p = $this->getProcess('echo | set /p dummyName=0'); @@ -433,8 +403,7 @@ class ProcessTest extends TestCase $this->assertSame('0', $p->getOutput()); } - public function testExitCodeCommandFailed() - { + public function testExitCodeCommandFailed() { if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Windows does not support POSIX exit code'); } @@ -450,14 +419,13 @@ class ProcessTest extends TestCase /** * @group tty */ - public function testTTYCommand() - { + public function testTTYCommand() { if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Windows does not have /dev/tty support'); } - $process = $this->getProcess('echo "foo" >> /dev/null && '.$this->getProcessForCode('usleep(100000);')->getCommandLine()); - $process->setTty(true); + $process = $this->getProcess('echo "foo" >> /dev/null && ' . $this->getProcessForCode('usleep(100000);')->getCommandLine()); + $process->setTty(TRUE); $process->start(); $this->assertTrue($process->isRunning()); $process->wait(); @@ -468,15 +436,14 @@ class ProcessTest extends TestCase /** * @group tty */ - public function testTTYCommandExitCode() - { + public function testTTYCommandExitCode() { if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Windows does have /dev/tty support'); } $this->skipIfNotEnhancedSigchild(); $process = $this->getProcess('echo "foo" >> /dev/null'); - $process->setTty(true); + $process->setTty(TRUE); $process->run(); $this->assertTrue($process->isSuccessful()); @@ -486,51 +453,46 @@ class ProcessTest extends TestCase * @expectedException \Symfony\Component\Process\Exception\RuntimeException * @expectedExceptionMessage TTY mode is not supported on Windows platform. */ - public function testTTYInWindowsEnvironment() - { + public function testTTYInWindowsEnvironment() { if ('\\' !== DIRECTORY_SEPARATOR) { $this->markTestSkipped('This test is for Windows platform only'); } $process = $this->getProcess('echo "foo" >> /dev/null'); - $process->setTty(false); - $process->setTty(true); + $process->setTty(FALSE); + $process->setTty(TRUE); } - public function testExitCodeTextIsNullWhenExitCodeIsNull() - { + public function testExitCodeTextIsNullWhenExitCodeIsNull() { $this->skipIfNotEnhancedSigchild(); $process = $this->getProcess(''); $this->assertNull($process->getExitCodeText()); } - public function testPTYCommand() - { + public function testPTYCommand() { if (!Process::isPtySupported()) { $this->markTestSkipped('PTY is not supported on this operating system.'); } $process = $this->getProcess('echo "foo"'); - $process->setPty(true); + $process->setPty(TRUE); $process->run(); $this->assertSame(Process::STATUS_TERMINATED, $process->getStatus()); $this->assertEquals("foo\r\n", $process->getOutput()); } - public function testMustRun() - { + public function testMustRun() { $this->skipIfNotEnhancedSigchild(); $process = $this->getProcess('echo foo'); $this->assertSame($process, $process->mustRun()); - $this->assertEquals('foo'.PHP_EOL, $process->getOutput()); + $this->assertEquals('foo' . PHP_EOL, $process->getOutput()); } - public function testSuccessfulMustRunHasCorrectExitCode() - { + public function testSuccessfulMustRunHasCorrectExitCode() { $this->skipIfNotEnhancedSigchild(); $process = $this->getProcess('echo foo')->mustRun(); @@ -540,46 +502,41 @@ class ProcessTest extends TestCase /** * @expectedException \Symfony\Component\Process\Exception\ProcessFailedException */ - public function testMustRunThrowsException() - { + public function testMustRunThrowsException() { $this->skipIfNotEnhancedSigchild(); $process = $this->getProcess('exit 1'); $process->mustRun(); } - public function testExitCodeText() - { + public function testExitCodeText() { $this->skipIfNotEnhancedSigchild(); $process = $this->getProcess(''); $r = new \ReflectionObject($process); $p = $r->getProperty('exitcode'); - $p->setAccessible(true); + $p->setAccessible(TRUE); $p->setValue($process, 2); $this->assertEquals('Misuse of shell builtins', $process->getExitCodeText()); } - public function testStartIsNonBlocking() - { + public function testStartIsNonBlocking() { $process = $this->getProcessForCode('usleep(500000);'); - $start = microtime(true); + $start = microtime(TRUE); $process->start(); - $end = microtime(true); + $end = microtime(TRUE); $this->assertLessThan(0.4, $end - $start); $process->stop(); } - public function testUpdateStatus() - { + public function testUpdateStatus() { $process = $this->getProcess('echo foo'); $process->run(); $this->assertGreaterThan(0, strlen($process->getOutput())); } - public function testGetExitCodeIsNullOnStart() - { + public function testGetExitCodeIsNullOnStart() { $this->skipIfNotEnhancedSigchild(); $process = $this->getProcessForCode('usleep(100000);'); @@ -590,8 +547,7 @@ class ProcessTest extends TestCase $this->assertEquals(0, $process->getExitCode()); } - public function testGetExitCodeIsNullOnWhenStartingAgain() - { + public function testGetExitCodeIsNullOnWhenStartingAgain() { $this->skipIfNotEnhancedSigchild(); $process = $this->getProcessForCode('usleep(100000);'); @@ -603,8 +559,7 @@ class ProcessTest extends TestCase $this->assertEquals(0, $process->getExitCode()); } - public function testGetExitCode() - { + public function testGetExitCode() { $this->skipIfNotEnhancedSigchild(); $process = $this->getProcess('echo foo'); @@ -612,8 +567,7 @@ class ProcessTest extends TestCase $this->assertSame(0, $process->getExitCode()); } - public function testStatus() - { + public function testStatus() { $process = $this->getProcessForCode('usleep(100000);'); $this->assertFalse($process->isRunning()); $this->assertFalse($process->isStarted()); @@ -631,8 +585,7 @@ class ProcessTest extends TestCase $this->assertSame(Process::STATUS_TERMINATED, $process->getStatus()); } - public function testStop() - { + public function testStop() { $process = $this->getProcessForCode('sleep(31);'); $process->start(); $this->assertTrue($process->isRunning()); @@ -640,8 +593,7 @@ class ProcessTest extends TestCase $this->assertFalse($process->isRunning()); } - public function testIsSuccessful() - { + public function testIsSuccessful() { $this->skipIfNotEnhancedSigchild(); $process = $this->getProcess('echo foo'); @@ -649,8 +601,7 @@ class ProcessTest extends TestCase $this->assertTrue($process->isSuccessful()); } - public function testIsSuccessfulOnlyAfterTerminated() - { + public function testIsSuccessfulOnlyAfterTerminated() { $this->skipIfNotEnhancedSigchild(); $process = $this->getProcessForCode('usleep(100000);'); @@ -663,8 +614,7 @@ class ProcessTest extends TestCase $this->assertTrue($process->isSuccessful()); } - public function testIsNotSuccessful() - { + public function testIsNotSuccessful() { $this->skipIfNotEnhancedSigchild(); $process = $this->getProcessForCode('throw new \Exception(\'BOUM\');'); @@ -672,8 +622,7 @@ class ProcessTest extends TestCase $this->assertFalse($process->isSuccessful()); } - public function testProcessIsNotSignaled() - { + public function testProcessIsNotSignaled() { if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Windows does not support POSIX signals'); } @@ -684,8 +633,7 @@ class ProcessTest extends TestCase $this->assertFalse($process->hasBeenSignaled()); } - public function testProcessWithoutTermSignal() - { + public function testProcessWithoutTermSignal() { if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Windows does not support POSIX signals'); } @@ -696,8 +644,7 @@ class ProcessTest extends TestCase $this->assertEquals(0, $process->getTermSignal()); } - public function testProcessIsSignaledIfStopped() - { + public function testProcessIsSignaledIfStopped() { if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('Windows does not support POSIX signals'); } @@ -714,12 +661,11 @@ class ProcessTest extends TestCase * @expectedException \Symfony\Component\Process\Exception\RuntimeException * @expectedExceptionMessage The process has been signaled */ - public function testProcessThrowsExceptionWhenExternallySignaled() - { + public function testProcessThrowsExceptionWhenExternallySignaled() { if (!function_exists('posix_kill')) { $this->markTestSkipped('Function posix_kill is required.'); } - $this->skipIfNotEnhancedSigchild(false); + $this->skipIfNotEnhancedSigchild(FALSE); $process = $this->getProcessForCode('sleep(32.1);'); $process->start(); @@ -728,8 +674,7 @@ class ProcessTest extends TestCase $process->wait(); } - public function testRestart() - { + public function testRestart() { $process1 = $this->getProcessForCode('echo getmypid();'); $process1->run(); $process2 = $process1->restart(); @@ -750,18 +695,17 @@ class ProcessTest extends TestCase * @expectedException \Symfony\Component\Process\Exception\ProcessTimedOutException * @expectedExceptionMessage exceeded the timeout of 0.1 seconds. */ - public function testRunProcessWithTimeout() - { + public function testRunProcessWithTimeout() { $process = $this->getProcessForCode('sleep(30);'); $process->setTimeout(0.1); - $start = microtime(true); + $start = microtime(TRUE); try { $process->run(); $this->fail('A RuntimeException should have been raised'); } catch (RuntimeException $e) { } - $this->assertLessThan(15, microtime(true) - $start); + $this->assertLessThan(15, microtime(TRUE) - $start); throw $e; } @@ -770,31 +714,28 @@ class ProcessTest extends TestCase * @expectedException \Symfony\Component\Process\Exception\ProcessTimedOutException * @expectedExceptionMessage exceeded the timeout of 0.1 seconds. */ - public function testIterateOverProcessWithTimeout() - { + public function testIterateOverProcessWithTimeout() { $process = $this->getProcessForCode('sleep(30);'); $process->setTimeout(0.1); - $start = microtime(true); + $start = microtime(TRUE); try { $process->start(); - foreach ($process as $buffer); + foreach ($process as $buffer) ; $this->fail('A RuntimeException should have been raised'); } catch (RuntimeException $e) { } - $this->assertLessThan(15, microtime(true) - $start); + $this->assertLessThan(15, microtime(TRUE) - $start); throw $e; } - public function testCheckTimeoutOnNonStartedProcess() - { + public function testCheckTimeoutOnNonStartedProcess() { $process = $this->getProcess('echo foo'); $this->assertNull($process->checkTimeout()); } - public function testCheckTimeoutOnTerminatedProcess() - { + public function testCheckTimeoutOnTerminatedProcess() { $process = $this->getProcess('echo foo'); $process->run(); $this->assertNull($process->checkTimeout()); @@ -804,13 +745,12 @@ class ProcessTest extends TestCase * @expectedException \Symfony\Component\Process\Exception\ProcessTimedOutException * @expectedExceptionMessage exceeded the timeout of 0.1 seconds. */ - public function testCheckTimeoutOnStartedProcess() - { + public function testCheckTimeoutOnStartedProcess() { $process = $this->getProcessForCode('sleep(33);'); $process->setTimeout(0.1); $process->start(); - $start = microtime(true); + $start = microtime(TRUE); try { while ($process->isRunning()) { @@ -821,13 +761,12 @@ class ProcessTest extends TestCase } catch (ProcessTimedOutException $e) { } - $this->assertLessThan(15, microtime(true) - $start); + $this->assertLessThan(15, microtime(TRUE) - $start); throw $e; } - public function testIdleTimeout() - { + public function testIdleTimeout() { $process = $this->getProcessForCode('sleep(34);'); $process->setTimeout(60); $process->setIdleTimeout(0.1); @@ -843,13 +782,12 @@ class ProcessTest extends TestCase } } - public function testIdleTimeoutNotExceededWhenOutputIsSent() - { + public function testIdleTimeoutNotExceededWhenOutputIsSent() { $process = $this->getProcessForCode('while (true) {echo \'foo \'; usleep(1000);}'); $process->setTimeout(1); $process->start(); - while (false === strpos($process->getOutput(), 'foo')) { + while (FALSE === strpos($process->getOutput(), 'foo')) { usleep(1000); } @@ -869,8 +807,7 @@ class ProcessTest extends TestCase * @expectedException \Symfony\Component\Process\Exception\ProcessTimedOutException * @expectedExceptionMessage exceeded the timeout of 0.1 seconds. */ - public function testStartAfterATimeout() - { + public function testStartAfterATimeout() { $process = $this->getProcessForCode('sleep(35);'); $process->setTimeout(0.1); @@ -887,22 +824,19 @@ class ProcessTest extends TestCase throw $e; } - public function testGetPid() - { + public function testGetPid() { $process = $this->getProcessForCode('sleep(36);'); $process->start(); $this->assertGreaterThan(0, $process->getPid()); $process->stop(0); } - public function testGetPidIsNullBeforeStart() - { + public function testGetPidIsNullBeforeStart() { $process = $this->getProcess('foo'); $this->assertNull($process->getPid()); } - public function testGetPidIsNullAfterRun() - { + public function testGetPidIsNullAfterRun() { $process = $this->getProcess('echo foo'); $process->run(); $this->assertNull($process->getPid()); @@ -911,12 +845,11 @@ class ProcessTest extends TestCase /** * @requires extension pcntl */ - public function testSignal() - { - $process = $this->getProcess(array(self::$phpBin, __DIR__.'/SignalListener.php')); + public function testSignal() { + $process = $this->getProcess(array(self::$phpBin, __DIR__ . '/SignalListener.php')); $process->start(); - while (false === strpos($process->getOutput(), 'Caught')) { + while (FALSE === strpos($process->getOutput(), 'Caught')) { usleep(1000); } $process->signal(SIGUSR1); @@ -928,8 +861,7 @@ class ProcessTest extends TestCase /** * @requires extension pcntl */ - public function testExitCodeIsAvailableAfterSignal() - { + public function testExitCodeIsAvailableAfterSignal() { $this->skipIfNotEnhancedSigchild(); $process = $this->getProcess('sleep 4'); @@ -950,8 +882,7 @@ class ProcessTest extends TestCase * @expectedException \Symfony\Component\Process\Exception\LogicException * @expectedExceptionMessage Can not send signal on a non running process. */ - public function testSignalProcessNotRunning() - { + public function testSignalProcessNotRunning() { $process = $this->getProcess('foo'); $process->signal(1); // SIGHUP } @@ -959,8 +890,7 @@ class ProcessTest extends TestCase /** * @dataProvider provideMethodsThatNeedARunningProcess */ - public function testMethodsThatNeedARunningProcess($method) - { + public function testMethodsThatNeedARunningProcess($method) { $process = $this->getProcess('foo'); if (method_exists($this, 'expectException')) { @@ -973,8 +903,7 @@ class ProcessTest extends TestCase $process->{$method}(); } - public function provideMethodsThatNeedARunningProcess() - { + public function provideMethodsThatNeedARunningProcess() { return array( array('getOutput'), array('getIncrementalOutput'), @@ -989,8 +918,7 @@ class ProcessTest extends TestCase * @expectedException \Symfony\Component\Process\Exception\LogicException * @expectedExceptionMessage Process must be terminated before calling */ - public function testMethodsThatNeedATerminatedProcess($method) - { + public function testMethodsThatNeedATerminatedProcess($method) { $process = $this->getProcessForCode('sleep(37);'); $process->start(); try { @@ -1004,8 +932,7 @@ class ProcessTest extends TestCase throw $e; } - public function provideMethodsThatNeedATerminatedProcess() - { + public function provideMethodsThatNeedATerminatedProcess() { return array( array('hasBeenSignaled'), array('getTermSignal'), @@ -1018,8 +945,7 @@ class ProcessTest extends TestCase * @dataProvider provideWrongSignal * @expectedException \Symfony\Component\Process\Exception\RuntimeException */ - public function testWrongSignal($signal) - { + public function testWrongSignal($signal) { if ('\\' === DIRECTORY_SEPARATOR) { $this->markTestSkipped('POSIX signals do not work on Windows'); } @@ -1036,16 +962,14 @@ class ProcessTest extends TestCase throw $e; } - public function provideWrongSignal() - { + public function provideWrongSignal() { return array( array(-4), array('Céphalopodes'), ); } - public function testDisableOutputDisablesTheOutput() - { + public function testDisableOutputDisablesTheOutput() { $p = $this->getProcess('foo'); $this->assertFalse($p->isOutputDisabled()); $p->disableOutput(); @@ -1058,8 +982,7 @@ class ProcessTest extends TestCase * @expectedException \Symfony\Component\Process\Exception\RuntimeException * @expectedExceptionMessage Disabling output while the process is running is not possible. */ - public function testDisableOutputWhileRunningThrowsException() - { + public function testDisableOutputWhileRunningThrowsException() { $p = $this->getProcessForCode('sleep(39);'); $p->start(); $p->disableOutput(); @@ -1069,16 +992,14 @@ class ProcessTest extends TestCase * @expectedException \Symfony\Component\Process\Exception\RuntimeException * @expectedExceptionMessage Enabling output while the process is running is not possible. */ - public function testEnableOutputWhileRunningThrowsException() - { + public function testEnableOutputWhileRunningThrowsException() { $p = $this->getProcessForCode('sleep(40);'); $p->disableOutput(); $p->start(); $p->enableOutput(); } - public function testEnableOrDisableOutputAfterRunDoesNotThrowException() - { + public function testEnableOrDisableOutputAfterRunDoesNotThrowException() { $p = $this->getProcess('echo foo'); $p->disableOutput(); $p->run(); @@ -1091,8 +1012,7 @@ class ProcessTest extends TestCase * @expectedException \Symfony\Component\Process\Exception\LogicException * @expectedExceptionMessage Output can not be disabled while an idle timeout is set. */ - public function testDisableOutputWhileIdleTimeoutIsSet() - { + public function testDisableOutputWhileIdleTimeoutIsSet() { $process = $this->getProcess('foo'); $process->setIdleTimeout(1); $process->disableOutput(); @@ -1102,18 +1022,16 @@ class ProcessTest extends TestCase * @expectedException \Symfony\Component\Process\Exception\LogicException * @expectedExceptionMessage timeout can not be set while the output is disabled. */ - public function testSetIdleTimeoutWhileOutputIsDisabled() - { + public function testSetIdleTimeoutWhileOutputIsDisabled() { $process = $this->getProcess('foo'); $process->disableOutput(); $process->setIdleTimeout(1); } - public function testSetNullIdleTimeoutWhileOutputIsDisabled() - { + public function testSetNullIdleTimeoutWhileOutputIsDisabled() { $process = $this->getProcess('foo'); $process->disableOutput(); - $this->assertSame($process, $process->setIdleTimeout(null)); + $this->assertSame($process, $process->setIdleTimeout(NULL)); } /** @@ -1121,16 +1039,14 @@ class ProcessTest extends TestCase * @expectedException \Symfony\Component\Process\Exception\LogicException * @expectedExceptionMessage Output has been disabled. */ - public function testGetOutputWhileDisabled($fetchMethod) - { + public function testGetOutputWhileDisabled($fetchMethod) { $p = $this->getProcessForCode('sleep(41);'); $p->disableOutput(); $p->start(); $p->{$fetchMethod}(); } - public function provideOutputFetchingMethods() - { + public function provideOutputFetchingMethods() { return array( array('getOutput'), array('getIncrementalOutput'), @@ -1139,35 +1055,31 @@ class ProcessTest extends TestCase ); } - public function testStopTerminatesProcessCleanly() - { + public function testStopTerminatesProcessCleanly() { $process = $this->getProcessForCode('echo 123; sleep(42);'); $process->run(function () use ($process) { $process->stop(); }); - $this->assertTrue(true, 'A call to stop() is not expected to cause wait() to throw a RuntimeException'); + $this->assertTrue(TRUE, 'A call to stop() is not expected to cause wait() to throw a RuntimeException'); } - public function testKillSignalTerminatesProcessCleanly() - { + public function testKillSignalTerminatesProcessCleanly() { $process = $this->getProcessForCode('echo 123; sleep(43);'); $process->run(function () use ($process) { $process->signal(9); // SIGKILL }); - $this->assertTrue(true, 'A call to signal() is not expected to cause wait() to throw a RuntimeException'); + $this->assertTrue(TRUE, 'A call to signal() is not expected to cause wait() to throw a RuntimeException'); } - public function testTermSignalTerminatesProcessCleanly() - { + public function testTermSignalTerminatesProcessCleanly() { $process = $this->getProcessForCode('echo 123; sleep(44);'); $process->run(function () use ($process) { $process->signal(15); // SIGTERM }); - $this->assertTrue(true, 'A call to signal() is not expected to cause wait() to throw a RuntimeException'); + $this->assertTrue(TRUE, 'A call to signal() is not expected to cause wait() to throw a RuntimeException'); } - public function responsesCodeProvider() - { + public function responsesCodeProvider() { return array( //expected output / getter / code to execute //array(1,'getExitCode','exit(1);'), @@ -1176,11 +1088,10 @@ class ProcessTest extends TestCase ); } - public function pipesCodeProvider() - { + public function pipesCodeProvider() { $variations = array( 'fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);', - 'include \''.__DIR__.'/PipeStdinInStdoutStdErrStreamSelect.php\';', + 'include \'' . __DIR__ . '/PipeStdinInStdoutStdErrStreamSelect.php\';', ); if ('\\' === DIRECTORY_SEPARATOR) { @@ -1203,15 +1114,14 @@ class ProcessTest extends TestCase /** * @dataProvider provideVariousIncrementals */ - public function testIncrementalOutputDoesNotRequireAnotherCall($stream, $method) - { - $process = $this->getProcessForCode('$n = 0; while ($n < 3) { file_put_contents(\''.$stream.'\', $n, 1); $n++; usleep(1000); }', null, null, null, null); + public function testIncrementalOutputDoesNotRequireAnotherCall($stream, $method) { + $process = $this->getProcessForCode('$n = 0; while ($n < 3) { file_put_contents(\'' . $stream . '\', $n, 1); $n++; usleep(1000); }', NULL, NULL, NULL, NULL); $process->start(); $result = ''; - $limit = microtime(true) + 3; + $limit = microtime(TRUE) + 3; $expected = '012'; - while ($result !== $expected && microtime(true) < $limit) { + while ($result !== $expected && microtime(TRUE) < $limit) { $result .= $process->$method(); } @@ -1219,28 +1129,25 @@ class ProcessTest extends TestCase $process->stop(); } - public function provideVariousIncrementals() - { + public function provideVariousIncrementals() { return array( array('php://stdout', 'getIncrementalOutput'), array('php://stderr', 'getIncrementalErrorOutput'), ); } - public function testIteratorInput() - { + public function testIteratorInput() { $input = function () { yield 'ping'; yield 'pong'; }; - $process = $this->getProcessForCode('stream_copy_to_stream(STDIN, STDOUT);', null, null, $input()); + $process = $this->getProcessForCode('stream_copy_to_stream(STDIN, STDOUT);', NULL, NULL, $input()); $process->run(); $this->assertSame('pingpong', $process->getOutput()); } - public function testSimpleInputStream() - { + public function testSimpleInputStream() { $input = new InputStream(); $process = $this->getProcessForCode('echo \'ping\'; echo fread(STDIN, 4); echo fread(STDIN, 4);'); @@ -1249,7 +1156,7 @@ class ProcessTest extends TestCase $process->start(function ($type, $data) use ($input) { if ('ping' === $data) { $input->write('pang'); - } elseif (!$input->isClosed()) { + } else if (!$input->isClosed()) { $input->write('pong'); $input->close(); } @@ -1259,8 +1166,7 @@ class ProcessTest extends TestCase $this->assertSame('pingpangpong', $process->getOutput()); } - public function testInputStreamWithCallable() - { + public function testInputStreamWithCallable() { $i = 0; $stream = fopen('php://memory', 'w+'); $stream = function () use ($stream, &$i) { @@ -1287,8 +1193,7 @@ class ProcessTest extends TestCase $this->assertSame('123', $process->getOutput()); } - public function testInputStreamWithGenerator() - { + public function testInputStreamWithGenerator() { $input = new InputStream(); $input->onEmpty(function ($input) { yield 'pong'; @@ -1303,11 +1208,12 @@ class ProcessTest extends TestCase $this->assertSame('pingpong', $process->getOutput()); } - public function testInputStreamOnEmpty() - { + public function testInputStreamOnEmpty() { $i = 0; $input = new InputStream(); - $input->onEmpty(function () use (&$i) { ++$i; }); + $input->onEmpty(function () use (&$i) { + ++$i; + }); $process = $this->getProcessForCode('echo 123; echo fread(STDIN, 1); echo 456;'); $process->setInput($input); @@ -1322,8 +1228,7 @@ class ProcessTest extends TestCase $this->assertSame('123456', $process->getOutput()); } - public function testIteratorOutput() - { + public function testIteratorOutput() { $input = new InputStream(); $process = $this->getProcessForCode('fwrite(STDOUT, 123); fwrite(STDERR, 234); flush(); usleep(10000); fwrite(STDOUT, fread(STDIN, 3)); fwrite(STDERR, 456);'); @@ -1358,8 +1263,7 @@ class ProcessTest extends TestCase $this->assertSame($expectedOutput, $output); } - public function testNonBlockingNorClearingIteratorOutput() - { + public function testNonBlockingNorClearingIteratorOutput() { $input = new InputStream(); $process = $this->getProcessForCode('fwrite(STDOUT, fread(STDIN, 3));'); @@ -1394,8 +1298,7 @@ class ProcessTest extends TestCase $this->assertSame($expectedOutput, $output); } - public function testChainedProcesses() - { + public function testChainedProcesses() { $p1 = $this->getProcessForCode('fwrite(STDERR, 123); fwrite(STDOUT, 456);'); $p2 = $this->getProcessForCode('stream_copy_to_stream(STDIN, STDOUT);'); $p2->setInput($p1); @@ -1409,20 +1312,18 @@ class ProcessTest extends TestCase $this->assertSame('456', $p2->getOutput()); } - public function testSetBadEnv() - { + public function testSetBadEnv() { $process = $this->getProcess('echo hello'); $process->setEnv(array('bad%%' => '123')); - $process->inheritEnvironmentVariables(true); + $process->inheritEnvironmentVariables(TRUE); $process->run(); - $this->assertSame('hello'.PHP_EOL, $process->getOutput()); + $this->assertSame('hello' . PHP_EOL, $process->getOutput()); $this->assertSame('', $process->getErrorOutput()); } - public function testEnvBackupDoesNotDeleteExistingVars() - { + public function testEnvBackupDoesNotDeleteExistingVars() { putenv('existing_var=foo'); $_ENV['existing_var'] = 'foo'; $process = $this->getProcess('php -r "echo getenv(\'new_test_var\');"'); @@ -1439,9 +1340,8 @@ class ProcessTest extends TestCase unset($_ENV['existing_var']); } - public function testEnvIsInherited() - { - $process = $this->getProcessForCode('echo serialize($_SERVER);', null, array('BAR' => 'BAZ', 'EMPTY' => '')); + public function testEnvIsInherited() { + $process = $this->getProcessForCode('echo serialize($_SERVER);', NULL, array('BAR' => 'BAZ', 'EMPTY' => '')); putenv('FOO=BAR'); $_ENV['FOO'] = 'BAR'; @@ -1460,14 +1360,13 @@ class ProcessTest extends TestCase /** * @group legacy */ - public function testInheritEnvDisabled() - { - $process = $this->getProcessForCode('echo serialize($_SERVER);', null, array('BAR' => 'BAZ')); + public function testInheritEnvDisabled() { + $process = $this->getProcessForCode('echo serialize($_SERVER);', NULL, array('BAR' => 'BAZ')); putenv('FOO=BAR'); $_ENV['FOO'] = 'BAR'; - $this->assertSame($process, $process->inheritEnvironmentVariables(false)); + $this->assertSame($process, $process->inheritEnvironmentVariables(FALSE)); $this->assertFalse($process->areEnvironmentVariablesInherited()); $process->run(); @@ -1482,8 +1381,7 @@ class ProcessTest extends TestCase unset($_ENV['FOO']); } - public function testGetCommandLine() - { + public function testGetCommandLine() { $p = new Process(array('/usr/bin/php')); $expected = '\\' === DIRECTORY_SEPARATOR ? '"/usr/bin/php"' : "'/usr/bin/php'"; @@ -1493,8 +1391,7 @@ class ProcessTest extends TestCase /** * @dataProvider provideEscapeArgument */ - public function testEscapeArgument($arg) - { + public function testEscapeArgument($arg) { $p = new Process(array(self::$phpBin, '-r', 'echo $argv[1];', $arg)); $p->run(); @@ -1505,17 +1402,15 @@ class ProcessTest extends TestCase * @dataProvider provideEscapeArgument * @group legacy */ - public function testEscapeArgumentWhenInheritEnvDisabled($arg) - { - $p = new Process(array(self::$phpBin, '-r', 'echo $argv[1];', $arg), null, array('BAR' => 'BAZ')); - $p->inheritEnvironmentVariables(false); + public function testEscapeArgumentWhenInheritEnvDisabled($arg) { + $p = new Process(array(self::$phpBin, '-r', 'echo $argv[1];', $arg), NULL, array('BAR' => 'BAZ')); + $p->inheritEnvironmentVariables(FALSE); $p->run(); $this->assertSame($arg, $p->getOutput()); } - public function testRawCommandLine() - { + public function testRawCommandLine() { $p = new Process(sprintf('"%s" -r %s "a" "" "b"', self::$phpBin, escapeshellarg('print_r($argv);'))); $p->run(); @@ -1532,8 +1427,7 @@ EOTXT; $this->assertSame($expected, str_replace('Standard input code', '-', $p->getOutput())); } - public function provideEscapeArgument() - { + public function provideEscapeArgument() { yield array('a"b%c%'); yield array('a"b^c^'); yield array("a\nb'c"); @@ -1543,43 +1437,41 @@ EOTXT; yield array('éÉèÈàÀöä'); } - public function testEnvArgument() - { + public function testEnvArgument() { $env = array('FOO' => 'Foo', 'BAR' => 'Bar'); $cmd = '\\' === DIRECTORY_SEPARATOR ? 'echo !FOO! !BAR! !BAZ!' : 'echo $FOO $BAR $BAZ'; - $p = new Process($cmd, null, $env); - $p->run(null, array('BAR' => 'baR', 'BAZ' => 'baZ')); + $p = new Process($cmd, NULL, $env); + $p->run(NULL, array('BAR' => 'baR', 'BAZ' => 'baZ')); $this->assertSame('Foo baR baZ', rtrim($p->getOutput())); $this->assertSame($env, $p->getEnv()); } /** - * @param string $commandline + * @param string $commandline * @param null|string $cwd - * @param null|array $env + * @param null|array $env * @param null|string $input - * @param int $timeout - * @param array $options + * @param int $timeout + * @param array $options * * @return Process */ - private function getProcess($commandline, $cwd = null, array $env = null, $input = null, $timeout = 60) - { + private function getProcess($commandline, $cwd = NULL, array $env = NULL, $input = NULL, $timeout = 60) { $process = new Process($commandline, $cwd, $env, $input, $timeout); $process->inheritEnvironmentVariables(); - if (false !== $enhance = getenv('ENHANCE_SIGCHLD')) { + if (FALSE !== $enhance = getenv('ENHANCE_SIGCHLD')) { try { - $process->setEnhanceSigchildCompatibility(false); + $process->setEnhanceSigchildCompatibility(FALSE); $process->getExitCode(); $this->fail('ENHANCE_SIGCHLD must be used together with a sigchild-enabled PHP.'); } catch (RuntimeException $e) { $this->assertSame('This PHP has been compiled with --enable-sigchild. You must use setEnhanceSigchildCompatibility() to use this method.', $e->getMessage()); if ($enhance) { - $process->setEnhanceSigchildCompatibility(true); + $process->setEnhanceSigchildCompatibility(TRUE); } else { - self::$notEnhancedSigchild = true; + self::$notEnhancedSigchild = TRUE; } } } @@ -1594,17 +1486,15 @@ EOTXT; /** * @return Process */ - private function getProcessForCode($code, $cwd = null, array $env = null, $input = null, $timeout = 60) - { + private function getProcessForCode($code, $cwd = NULL, array $env = NULL, $input = NULL, $timeout = 60) { return $this->getProcess(array(self::$phpBin, '-r', $code), $cwd, $env, $input, $timeout); } - private function skipIfNotEnhancedSigchild($expectException = true) - { + private function skipIfNotEnhancedSigchild($expectException = TRUE) { if (self::$sigchild) { if (!$expectException) { $this->markTestSkipped('PHP is compiled with --enable-sigchild.'); - } elseif (self::$notEnhancedSigchild) { + } else if (self::$notEnhancedSigchild) { if (method_exists($this, 'expectException')) { $this->expectException('Symfony\Component\Process\Exception\RuntimeException'); $this->expectExceptionMessage('This PHP has been compiled with --enable-sigchild.'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ProcessUtilsTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ProcessUtilsTest.php index 82fd8cf..b3b1302 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ProcessUtilsTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/ProcessUtilsTest.php @@ -22,13 +22,11 @@ class ProcessUtilsTest extends TestCase /** * @dataProvider dataArguments */ - public function testEscapeArgument($result, $argument) - { + public function testEscapeArgument($result, $argument) { $this->assertSame($result, ProcessUtils::escapeArgument($argument)); } - public function dataArguments() - { + public function dataArguments() { if ('\\' === DIRECTORY_SEPARATOR) { return array( array('"\"php\" \"-v\""', '"php" "-v"'), diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/SignalListener.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/SignalListener.php index 9e30ce3..befc203 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/SignalListener.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/Tests/SignalListener.php @@ -9,7 +9,10 @@ * file that was distributed with this source code. */ -pcntl_signal(SIGUSR1, function () { echo 'SIGUSR1'; exit; }); +pcntl_signal(SIGUSR1, function () { + echo 'SIGUSR1'; + exit; +}); echo 'Caught '; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/composer.json index b8867db..f716a02 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/composer.json @@ -1,33 +1,35 @@ { - "name": "symfony/process", - "type": "library", - "description": "Symfony Process Component", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": "^5.5.9|>=7.0.8" + "name": "symfony/process", + "type": "library", + "description": "Symfony Process Component", + "keywords": [], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, - "autoload": { - "psr-4": { "Symfony\\Component\\Process\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" } + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/phpunit.xml.dist b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/phpunit.xml.dist index d388467..1134342 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/phpunit.xml.dist +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/process/phpunit.xml.dist @@ -9,7 +9,7 @@ failOnWarning="true" > - + diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Annotation/Route.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Annotation/Route.php index 5b3cbea..d248276 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Annotation/Route.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Annotation/Route.php @@ -36,15 +36,14 @@ class Route * * @throws \BadMethodCallException */ - public function __construct(array $data) - { + public function __construct(array $data) { if (isset($data['value'])) { $data['path'] = $data['value']; unset($data['value']); } foreach ($data as $key => $value) { - $method = 'set'.str_replace('_', '', $key); + $method = 'set' . str_replace('_', '', $key); if (!method_exists($this, $method)) { throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, get_class($this))); } @@ -52,93 +51,75 @@ class Route } } - public function setPath($path) - { + public function setPath($path) { $this->path = $path; } - public function getPath() - { + public function getPath() { return $this->path; } - public function setHost($pattern) - { + public function setHost($pattern) { $this->host = $pattern; } - public function getHost() - { + public function getHost() { return $this->host; } - public function setName($name) - { + public function setName($name) { $this->name = $name; } - public function getName() - { + public function getName() { return $this->name; } - public function setRequirements($requirements) - { + public function setRequirements($requirements) { $this->requirements = $requirements; } - public function getRequirements() - { + public function getRequirements() { return $this->requirements; } - public function setOptions($options) - { + public function setOptions($options) { $this->options = $options; } - public function getOptions() - { + public function getOptions() { return $this->options; } - public function setDefaults($defaults) - { + public function setDefaults($defaults) { $this->defaults = $defaults; } - public function getDefaults() - { + public function getDefaults() { return $this->defaults; } - public function setSchemes($schemes) - { + public function setSchemes($schemes) { $this->schemes = is_array($schemes) ? $schemes : array($schemes); } - public function getSchemes() - { + public function getSchemes() { return $this->schemes; } - public function setMethods($methods) - { + public function setMethods($methods) { $this->methods = is_array($methods) ? $methods : array($methods); } - public function getMethods() - { + public function getMethods() { return $this->methods; } - public function setCondition($condition) - { + public function setCondition($condition) { $this->condition = $condition; } - public function getCondition() - { + public function getCondition() { return $this->condition; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/CompiledRoute.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/CompiledRoute.php index 8ecf515..4e5443d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/CompiledRoute.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/CompiledRoute.php @@ -28,18 +28,17 @@ class CompiledRoute implements \Serializable private $hostTokens; /** - * @param string $staticPrefix The static prefix of the compiled route - * @param string $regex The regular expression to use to match this route - * @param array $tokens An array of tokens to use to generate URL for this route - * @param array $pathVariables An array of path variables - * @param string|null $hostRegex Host regex - * @param array $hostTokens Host tokens - * @param array $hostVariables An array of host variables - * @param array $variables An array of variables (variables defined in the path and in the host patterns) + * @param string $staticPrefix The static prefix of the compiled route + * @param string $regex The regular expression to use to match this route + * @param array $tokens An array of tokens to use to generate URL for this route + * @param array $pathVariables An array of path variables + * @param string|null $hostRegex Host regex + * @param array $hostTokens Host tokens + * @param array $hostVariables An array of host variables + * @param array $variables An array of variables (variables defined in the path and in the host patterns) */ - public function __construct($staticPrefix, $regex, array $tokens, array $pathVariables, $hostRegex = null, array $hostTokens = array(), array $hostVariables = array(), array $variables = array()) - { - $this->staticPrefix = (string) $staticPrefix; + public function __construct($staticPrefix, $regex, array $tokens, array $pathVariables, $hostRegex = NULL, array $hostTokens = array(), array $hostVariables = array(), array $variables = array()) { + $this->staticPrefix = (string)$staticPrefix; $this->regex = $regex; $this->tokens = $tokens; $this->pathVariables = $pathVariables; @@ -52,8 +51,7 @@ class CompiledRoute implements \Serializable /** * {@inheritdoc} */ - public function serialize() - { + public function serialize() { return serialize(array( 'vars' => $this->variables, 'path_prefix' => $this->staticPrefix, @@ -69,10 +67,9 @@ class CompiledRoute implements \Serializable /** * {@inheritdoc} */ - public function unserialize($serialized) - { + public function unserialize($serialized) { if (\PHP_VERSION_ID >= 70000) { - $data = unserialize($serialized, array('allowed_classes' => false)); + $data = unserialize($serialized, array('allowed_classes' => FALSE)); } else { $data = unserialize($serialized); } @@ -92,8 +89,7 @@ class CompiledRoute implements \Serializable * * @return string The static prefix */ - public function getStaticPrefix() - { + public function getStaticPrefix() { return $this->staticPrefix; } @@ -102,8 +98,7 @@ class CompiledRoute implements \Serializable * * @return string The regex */ - public function getRegex() - { + public function getRegex() { return $this->regex; } @@ -112,8 +107,7 @@ class CompiledRoute implements \Serializable * * @return string|null The host regex or null */ - public function getHostRegex() - { + public function getHostRegex() { return $this->hostRegex; } @@ -122,8 +116,7 @@ class CompiledRoute implements \Serializable * * @return array The tokens */ - public function getTokens() - { + public function getTokens() { return $this->tokens; } @@ -132,8 +125,7 @@ class CompiledRoute implements \Serializable * * @return array The tokens */ - public function getHostTokens() - { + public function getHostTokens() { return $this->hostTokens; } @@ -142,8 +134,7 @@ class CompiledRoute implements \Serializable * * @return array The variables */ - public function getVariables() - { + public function getVariables() { return $this->variables; } @@ -152,8 +143,7 @@ class CompiledRoute implements \Serializable * * @return array The variables */ - public function getPathVariables() - { + public function getPathVariables() { return $this->pathVariables; } @@ -162,8 +152,7 @@ class CompiledRoute implements \Serializable * * @return array The variables */ - public function getHostVariables() - { + public function getHostVariables() { return $this->hostVariables; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/DependencyInjection/RoutingResolverPass.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/DependencyInjection/RoutingResolverPass.php index 4af0a5a..a7a40f6 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/DependencyInjection/RoutingResolverPass.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/DependencyInjection/RoutingResolverPass.php @@ -28,15 +28,13 @@ class RoutingResolverPass implements CompilerPassInterface private $resolverServiceId; private $loaderTag; - public function __construct($resolverServiceId = 'routing.resolver', $loaderTag = 'routing.loader') - { + public function __construct($resolverServiceId = 'routing.resolver', $loaderTag = 'routing.loader') { $this->resolverServiceId = $resolverServiceId; $this->loaderTag = $loaderTag; } - public function process(ContainerBuilder $container) - { - if (false === $container->hasDefinition($this->resolverServiceId)) { + public function process(ContainerBuilder $container) { + if (FALSE === $container->hasDefinition($this->resolverServiceId)) { return; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Exception/MethodNotAllowedException.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Exception/MethodNotAllowedException.php index 712412f..ddbea50 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Exception/MethodNotAllowedException.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Exception/MethodNotAllowedException.php @@ -22,8 +22,7 @@ class MethodNotAllowedException extends \RuntimeException implements ExceptionIn { protected $allowedMethods = array(); - public function __construct(array $allowedMethods, $message = null, $code = 0, \Exception $previous = null) - { + public function __construct(array $allowedMethods, $message = NULL, $code = 0, \Exception $previous = NULL) { $this->allowedMethods = array_map('strtoupper', $allowedMethods); parent::__construct($message, $code, $previous); @@ -34,8 +33,7 @@ class MethodNotAllowedException extends \RuntimeException implements ExceptionIn * * @return array */ - public function getAllowedMethods() - { + public function getAllowedMethods() { return $this->allowedMethods; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Generator/Dumper/GeneratorDumper.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Generator/Dumper/GeneratorDumper.php index 659c5ba..179dd82 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Generator/Dumper/GeneratorDumper.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Generator/Dumper/GeneratorDumper.php @@ -22,16 +22,14 @@ abstract class GeneratorDumper implements GeneratorDumperInterface { private $routes; - public function __construct(RouteCollection $routes) - { + public function __construct(RouteCollection $routes) { $this->routes = $routes; } /** * {@inheritdoc} */ - public function getRoutes() - { + public function getRoutes() { return $this->routes; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Generator/Dumper/PhpGeneratorDumper.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Generator/Dumper/PhpGeneratorDumper.php index 60bdf1d..238a972 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Generator/Dumper/PhpGeneratorDumper.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Generator/Dumper/PhpGeneratorDumper.php @@ -31,8 +31,7 @@ class PhpGeneratorDumper extends GeneratorDumper * * @return string A PHP class representing the generator class */ - public function dump(array $options = array()) - { + public function dump(array $options = array()) { $options = array_merge(array( 'class' => 'ProjectUrlGenerator', 'base_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', @@ -74,8 +73,7 @@ EOF; * * @return string PHP code */ - private function generateDeclaredRoutes() - { + private function generateDeclaredRoutes() { $routes = "array(\n"; foreach ($this->getRoutes()->all() as $name => $route) { $compiledRoute = $route->compile(); @@ -88,7 +86,7 @@ EOF; $properties[] = $compiledRoute->getHostTokens(); $properties[] = $route->getSchemes(); - $routes .= sprintf(" '%s' => %s,\n", $name, str_replace("\n", '', var_export($properties, true))); + $routes .= sprintf(" '%s' => %s,\n", $name, str_replace("\n", '', var_export($properties, TRUE))); } $routes .= ' )'; @@ -100,8 +98,7 @@ EOF; * * @return string PHP code */ - private function generateGenerateMethod() - { + private function generateGenerateMethod() { return <<<'EOF' public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Generator/UrlGenerator.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Generator/UrlGenerator.php index 02a59a9..40a1751 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Generator/UrlGenerator.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Generator/UrlGenerator.php @@ -33,7 +33,7 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt /** * @var bool|null */ - protected $strictRequirements = true; + protected $strictRequirements = TRUE; protected $logger; @@ -65,8 +65,7 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt '%7C' => '|', ); - public function __construct(RouteCollection $routes, RequestContext $context, LoggerInterface $logger = null) - { + public function __construct(RouteCollection $routes, RequestContext $context, LoggerInterface $logger = NULL) { $this->routes = $routes; $this->context = $context; $this->logger = $logger; @@ -75,41 +74,36 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt /** * {@inheritdoc} */ - public function setContext(RequestContext $context) - { + public function setContext(RequestContext $context) { $this->context = $context; } /** * {@inheritdoc} */ - public function getContext() - { + public function getContext() { return $this->context; } /** * {@inheritdoc} */ - public function setStrictRequirements($enabled) - { - $this->strictRequirements = null === $enabled ? null : (bool) $enabled; + public function setStrictRequirements($enabled) { + $this->strictRequirements = NULL === $enabled ? NULL : (bool)$enabled; } /** * {@inheritdoc} */ - public function isStrictRequirements() - { + public function isStrictRequirements() { return $this->strictRequirements; } /** * {@inheritdoc} */ - public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH) - { - if (null === $route = $this->routes->get($name)) { + public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH) { + if (NULL === $route = $this->routes->get($name)) { throw new RouteNotFoundException(sprintf('Unable to generate a URL for the named route "%s" as such route does not exist.', $name)); } @@ -124,8 +118,7 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt * @throws InvalidParameterException When a parameter value for a placeholder is not correct because * it does not match the requirement */ - protected function doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $referenceType, $hostTokens, array $requiredSchemes = array()) - { + protected function doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $referenceType, $hostTokens, array $requiredSchemes = array()) { $variables = array_flip($variables); $mergedParams = array_replace($defaults, $this->context->getParameters(), $parameters); @@ -135,13 +128,13 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt } $url = ''; - $optional = true; + $optional = TRUE; $message = 'Parameter "{parameter}" for route "{route}" must match "{expected}" ("{given}" given) to generate a corresponding URL.'; foreach ($tokens as $token) { if ('variable' === $token[0]) { - if (!$optional || !array_key_exists($token[3], $defaults) || null !== $mergedParams[$token[3]] && (string) $mergedParams[$token[3]] !== (string) $defaults[$token[3]]) { + if (!$optional || !array_key_exists($token[3], $defaults) || NULL !== $mergedParams[$token[3]] && (string)$mergedParams[$token[3]] !== (string)$defaults[$token[3]]) { // check requirement - if (null !== $this->strictRequirements && !preg_match('#^'.$token[2].'$#'.(empty($token[4]) ? '' : 'u'), $mergedParams[$token[3]])) { + if (NULL !== $this->strictRequirements && !preg_match('#^' . $token[2] . '$#' . (empty($token[4]) ? '' : 'u'), $mergedParams[$token[3]])) { if ($this->strictRequirements) { throw new InvalidParameterException(strtr($message, array('{parameter}' => $token[3], '{route}' => $name, '{expected}' => $token[2], '{given}' => $mergedParams[$token[3]]))); } @@ -153,13 +146,13 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt return; } - $url = $token[1].$mergedParams[$token[3]].$url; - $optional = false; + $url = $token[1] . $mergedParams[$token[3]] . $url; + $optional = FALSE; } } else { // static text - $url = $token[1].$url; - $optional = false; + $url = $token[1] . $url; + $optional = FALSE; } } @@ -175,9 +168,9 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt // otherwise we would generate a URI that, when followed by a user agent (e.g. browser), does not match this route $url = strtr($url, array('/../' => '/%2E%2E/', '/./' => '/%2E/')); if ('/..' === substr($url, -3)) { - $url = substr($url, 0, -2).'%2E%2E'; - } elseif ('/.' === substr($url, -2)) { - $url = substr($url, 0, -1).'%2E'; + $url = substr($url, 0, -2) . '%2E%2E'; + } else if ('/.' === substr($url, -2)) { + $url = substr($url, 0, -1) . '%2E'; } $schemeAuthority = ''; @@ -185,7 +178,7 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt $scheme = $this->context->getScheme(); if ($requiredSchemes) { - if (!in_array($scheme, $requiredSchemes, true)) { + if (!in_array($scheme, $requiredSchemes, TRUE)) { $referenceType = self::ABSOLUTE_URL; $scheme = current($requiredSchemes); } @@ -195,7 +188,7 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt $routeHost = ''; foreach ($hostTokens as $token) { if ('variable' === $token[0]) { - if (null !== $this->strictRequirements && !preg_match('#^'.$token[2].'$#i'.(empty($token[4]) ? '' : 'u'), $mergedParams[$token[3]])) { + if (NULL !== $this->strictRequirements && !preg_match('#^' . $token[2] . '$#i' . (empty($token[4]) ? '' : 'u'), $mergedParams[$token[3]])) { if ($this->strictRequirements) { throw new InvalidParameterException(strtr($message, array('{parameter}' => $token[3], '{route}' => $name, '{expected}' => $token[2], '{given}' => $mergedParams[$token[3]]))); } @@ -207,9 +200,9 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt return; } - $routeHost = $token[1].$mergedParams[$token[3]].$routeHost; + $routeHost = $token[1] . $mergedParams[$token[3]] . $routeHost; } else { - $routeHost = $token[1].$routeHost; + $routeHost = $token[1] . $routeHost; } } @@ -224,19 +217,19 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt if ((self::ABSOLUTE_URL === $referenceType || self::NETWORK_PATH === $referenceType) && !empty($host)) { $port = ''; if ('http' === $scheme && 80 != $this->context->getHttpPort()) { - $port = ':'.$this->context->getHttpPort(); - } elseif ('https' === $scheme && 443 != $this->context->getHttpsPort()) { - $port = ':'.$this->context->getHttpsPort(); + $port = ':' . $this->context->getHttpPort(); + } else if ('https' === $scheme && 443 != $this->context->getHttpsPort()) { + $port = ':' . $this->context->getHttpsPort(); } $schemeAuthority = self::NETWORK_PATH === $referenceType ? '//' : "$scheme://"; - $schemeAuthority .= $host.$port; + $schemeAuthority .= $host . $port; } if (self::RELATIVE_PATH === $referenceType) { $url = self::getRelativePath($this->context->getPathInfo(), $url); } else { - $url = $schemeAuthority.$this->context->getBaseUrl().$url; + $url = $schemeAuthority . $this->context->getBaseUrl() . $url; } // add a query string if needed @@ -258,11 +251,11 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt if ($extra && $query = http_build_query($extra, '', '&', PHP_QUERY_RFC3986)) { // "/" and "?" can be left decoded for better user experience, see // http://tools.ietf.org/html/rfc3986#section-3.4 - $url .= '?'.strtr($query, array('%2F' => '/')); + $url .= '?' . strtr($query, array('%2F' => '/')); } if ('' !== $fragment) { - $url .= '#'.strtr(rawurlencode($fragment), array('%2F' => '/', '%3F' => '?')); + $url .= '#' . strtr(rawurlencode($fragment), array('%2F' => '/', '%3F' => '?')); } return $url; @@ -283,13 +276,12 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt * - "/a/b/c/other" -> "other" * - "/a/x/y" -> "../../x/y" * - * @param string $basePath The base path + * @param string $basePath The base path * @param string $targetPath The target path * * @return string The relative target path */ - public static function getRelativePath($basePath, $targetPath) - { + public static function getRelativePath($basePath, $targetPath) { if ($basePath === $targetPath) { return ''; } @@ -308,14 +300,14 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt } $targetDirs[] = $targetFile; - $path = str_repeat('../', count($sourceDirs)).implode('/', $targetDirs); + $path = str_repeat('../', count($sourceDirs)) . implode('/', $targetDirs); // A reference to the same base directory or an empty subdirectory must be prefixed with "./". // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used // as the first segment of a relative-path reference, as it would be mistaken for a scheme name // (see http://tools.ietf.org/html/rfc3986#section-4.2). return '' === $path || '/' === $path[0] - || false !== ($colonPos = strpos($path, ':')) && ($colonPos < ($slashPos = strpos($path, '/')) || false === $slashPos) + || FALSE !== ($colonPos = strpos($path, ':')) && ($colonPos < ($slashPos = strpos($path, '/')) || FALSE === $slashPos) ? "./$path" : $path; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Generator/UrlGeneratorInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Generator/UrlGeneratorInterface.php index d6e7938..5d6f324 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Generator/UrlGeneratorInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Generator/UrlGeneratorInterface.php @@ -71,9 +71,9 @@ interface UrlGeneratorInterface extends RequestContextAwareInterface * * The special parameter _fragment will be used as the document fragment suffixed to the final URL. * - * @param string $name The name of the route - * @param mixed $parameters An array of parameters - * @param int $referenceType The type of reference to be generated (one of the constants) + * @param string $name The name of the route + * @param mixed $parameters An array of parameters + * @param int $referenceType The type of reference to be generated (one of the constants) * * @return string The generated URL * diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/AnnotationClassLoader.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/AnnotationClassLoader.php index 2fe6fb5..344740f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/AnnotationClassLoader.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/AnnotationClassLoader.php @@ -69,8 +69,7 @@ abstract class AnnotationClassLoader implements LoaderInterface */ protected $defaultRouteIndex = 0; - public function __construct(Reader $reader) - { + public function __construct(Reader $reader) { $this->reader = $reader; } @@ -79,23 +78,21 @@ abstract class AnnotationClassLoader implements LoaderInterface * * @param string $class A fully-qualified class name */ - public function setRouteAnnotationClass($class) - { + public function setRouteAnnotationClass($class) { $this->routeAnnotationClass = $class; } /** * Loads from annotations from a class. * - * @param string $class A class name - * @param string|null $type The resource type + * @param string $class A class name + * @param string|null $type The resource type * * @return RouteCollection A RouteCollection instance * * @throws \InvalidArgumentException When route can't be parsed */ - public function load($class, $type = null) - { + public function load($class, $type = NULL) { if (!class_exists($class)) { throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class)); } @@ -128,17 +125,16 @@ abstract class AnnotationClassLoader implements LoaderInterface return $collection; } - protected function addRoute(RouteCollection $collection, $annot, $globals, \ReflectionClass $class, \ReflectionMethod $method) - { + protected function addRoute(RouteCollection $collection, $annot, $globals, \ReflectionClass $class, \ReflectionMethod $method) { $name = $annot->getName(); - if (null === $name) { + if (NULL === $name) { $name = $this->getDefaultRouteName($class, $method); } - $name = $globals['name'].$name; + $name = $globals['name'] . $name; $defaults = array_replace($globals['defaults'], $annot->getDefaults()); foreach ($method->getParameters() as $param) { - if (false !== strpos($globals['path'].$annot->getPath(), sprintf('{%s}', $param->getName())) && !isset($defaults[$param->getName()]) && $param->isDefaultValueAvailable()) { + if (FALSE !== strpos($globals['path'] . $annot->getPath(), sprintf('{%s}', $param->getName())) && !isset($defaults[$param->getName()]) && $param->isDefaultValueAvailable()) { $defaults[$param->getName()] = $param->getDefaultValue(); } } @@ -148,16 +144,16 @@ abstract class AnnotationClassLoader implements LoaderInterface $methods = array_merge($globals['methods'], $annot->getMethods()); $host = $annot->getHost(); - if (null === $host) { + if (NULL === $host) { $host = $globals['host']; } $condition = $annot->getCondition(); - if (null === $condition) { + if (NULL === $condition) { $condition = $globals['condition']; } - $route = $this->createRoute($globals['path'].$annot->getPath(), $defaults, $requirements, $options, $host, $schemes, $methods, $condition); + $route = $this->createRoute($globals['path'] . $annot->getPath(), $defaults, $requirements, $options, $host, $schemes, $methods, $condition); $this->configureRoute($route, $class, $method, $annot); @@ -167,46 +163,41 @@ abstract class AnnotationClassLoader implements LoaderInterface /** * {@inheritdoc} */ - public function supports($resource, $type = null) - { + public function supports($resource, $type = NULL) { return is_string($resource) && preg_match('/^(?:\\\\?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)+$/', $resource) && (!$type || 'annotation' === $type); } /** * {@inheritdoc} */ - public function setResolver(LoaderResolverInterface $resolver) - { + public function setResolver(LoaderResolverInterface $resolver) { } /** * {@inheritdoc} */ - public function getResolver() - { + public function getResolver() { } /** * Gets the default route name for a class method. * - * @param \ReflectionClass $class + * @param \ReflectionClass $class * @param \ReflectionMethod $method * * @return string */ - protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method) - { - $name = strtolower(str_replace('\\', '_', $class->name).'_'.$method->name); + protected function getDefaultRouteName(\ReflectionClass $class, \ReflectionMethod $method) { + $name = strtolower(str_replace('\\', '_', $class->name) . '_' . $method->name); if ($this->defaultRouteIndex > 0) { - $name .= '_'.$this->defaultRouteIndex; + $name .= '_' . $this->defaultRouteIndex; } ++$this->defaultRouteIndex; return $name; } - protected function getGlobals(\ReflectionClass $class) - { + protected function getGlobals(\ReflectionClass $class) { $globals = array( 'path' => '', 'requirements' => array(), @@ -220,39 +211,39 @@ abstract class AnnotationClassLoader implements LoaderInterface ); if ($annot = $this->reader->getClassAnnotation($class, $this->routeAnnotationClass)) { - if (null !== $annot->getName()) { + if (NULL !== $annot->getName()) { $globals['name'] = $annot->getName(); } - if (null !== $annot->getPath()) { + if (NULL !== $annot->getPath()) { $globals['path'] = $annot->getPath(); } - if (null !== $annot->getRequirements()) { + if (NULL !== $annot->getRequirements()) { $globals['requirements'] = $annot->getRequirements(); } - if (null !== $annot->getOptions()) { + if (NULL !== $annot->getOptions()) { $globals['options'] = $annot->getOptions(); } - if (null !== $annot->getDefaults()) { + if (NULL !== $annot->getDefaults()) { $globals['defaults'] = $annot->getDefaults(); } - if (null !== $annot->getSchemes()) { + if (NULL !== $annot->getSchemes()) { $globals['schemes'] = $annot->getSchemes(); } - if (null !== $annot->getMethods()) { + if (NULL !== $annot->getMethods()) { $globals['methods'] = $annot->getMethods(); } - if (null !== $annot->getHost()) { + if (NULL !== $annot->getHost()) { $globals['host'] = $annot->getHost(); } - if (null !== $annot->getCondition()) { + if (NULL !== $annot->getCondition()) { $globals['condition'] = $annot->getCondition(); } } @@ -260,8 +251,7 @@ abstract class AnnotationClassLoader implements LoaderInterface return $globals; } - protected function createRoute($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition) - { + protected function createRoute($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition) { return new Route($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/AnnotationDirectoryLoader.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/AnnotationDirectoryLoader.php index 4574a02..b6d8694 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/AnnotationDirectoryLoader.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/AnnotationDirectoryLoader.php @@ -25,15 +25,14 @@ class AnnotationDirectoryLoader extends AnnotationFileLoader /** * Loads from annotations from a directory. * - * @param string $path A directory path + * @param string $path A directory path * @param string|null $type The resource type * * @return RouteCollection A RouteCollection instance * * @throws \InvalidArgumentException When the directory does not exist or its routes cannot be parsed */ - public function load($path, $type = null) - { + public function load($path, $type = NULL) { if (!is_dir($dir = $this->locator->locate($path))) { return parent::supports($path, $type) ? parent::load($path, $type) : new RouteCollection(); } @@ -50,7 +49,7 @@ class AnnotationDirectoryLoader extends AnnotationFileLoader \RecursiveIteratorIterator::LEAVES_ONLY )); usort($files, function (\SplFileInfo $a, \SplFileInfo $b) { - return (string) $a > (string) $b ? 1 : -1; + return (string)$a > (string)$b ? 1 : -1; }); foreach ($files as $file) { @@ -74,20 +73,19 @@ class AnnotationDirectoryLoader extends AnnotationFileLoader /** * {@inheritdoc} */ - public function supports($resource, $type = null) - { + public function supports($resource, $type = NULL) { if ('annotation' === $type) { - return true; + return TRUE; } if ($type || !is_string($resource)) { - return false; + return FALSE; } try { return is_dir($this->locator->locate($resource)); } catch (\Exception $e) { - return false; + return FALSE; } } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/AnnotationFileLoader.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/AnnotationFileLoader.php index cf9f070..fc56549 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/AnnotationFileLoader.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/AnnotationFileLoader.php @@ -29,8 +29,7 @@ class AnnotationFileLoader extends FileLoader /** * @throws \RuntimeException */ - public function __construct(FileLocatorInterface $locator, AnnotationClassLoader $loader) - { + public function __construct(FileLocatorInterface $locator, AnnotationClassLoader $loader) { if (!function_exists('token_get_all')) { throw new \RuntimeException('The Tokenizer extension is required for the routing annotation loaders.'); } @@ -43,15 +42,14 @@ class AnnotationFileLoader extends FileLoader /** * Loads from annotations from a file. * - * @param string $file A PHP file path + * @param string $file A PHP file path * @param string|null $type The resource type * * @return RouteCollection A RouteCollection instance * * @throws \InvalidArgumentException When the file does not exist or its routes cannot be parsed */ - public function load($file, $type = null) - { + public function load($file, $type = NULL) { $path = $this->locator->locate($file); $collection = new RouteCollection(); @@ -70,8 +68,7 @@ class AnnotationFileLoader extends FileLoader /** * {@inheritdoc} */ - public function supports($resource, $type = null) - { + public function supports($resource, $type = NULL) { return is_string($resource) && 'php' === pathinfo($resource, PATHINFO_EXTENSION) && (!$type || 'annotation' === $type); } @@ -82,10 +79,9 @@ class AnnotationFileLoader extends FileLoader * * @return string|false Full class name if found, false otherwise */ - protected function findClass($file) - { - $class = false; - $namespace = false; + protected function findClass($file) { + $class = FALSE; + $namespace = FALSE; $tokens = token_get_all(file_get_contents($file)); if (1 === count($tokens) && T_INLINE_HTML === $tokens[0][0]) { @@ -99,11 +95,11 @@ class AnnotationFileLoader extends FileLoader continue; } - if (true === $class && T_STRING === $token[0]) { - return $namespace.'\\'.$token[1]; + if (TRUE === $class && T_STRING === $token[0]) { + return $namespace . '\\' . $token[1]; } - if (true === $namespace && T_STRING === $token[0]) { + if (TRUE === $namespace && T_STRING === $token[0]) { $namespace = $token[1]; while (isset($tokens[++$i][1]) && in_array($tokens[$i][0], array(T_NS_SEPARATOR, T_STRING))) { $namespace .= $tokens[$i][1]; @@ -113,30 +109,30 @@ class AnnotationFileLoader extends FileLoader if (T_CLASS === $token[0]) { // Skip usage of ::class constant and anonymous classes - $skipClassToken = false; + $skipClassToken = FALSE; for ($j = $i - 1; $j > 0; --$j) { if (!isset($tokens[$j][1])) { break; } if (T_DOUBLE_COLON === $tokens[$j][0] || T_NEW === $tokens[$j][0]) { - $skipClassToken = true; + $skipClassToken = TRUE; break; - } elseif (!in_array($tokens[$j][0], array(T_WHITESPACE, T_DOC_COMMENT, T_COMMENT))) { + } else if (!in_array($tokens[$j][0], array(T_WHITESPACE, T_DOC_COMMENT, T_COMMENT))) { break; } } if (!$skipClassToken) { - $class = true; + $class = TRUE; } } if (T_NAMESPACE === $token[0]) { - $namespace = true; + $namespace = TRUE; } } - return false; + return FALSE; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/ClosureLoader.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/ClosureLoader.php index 5df9f6a..6729060 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/ClosureLoader.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/ClosureLoader.php @@ -26,21 +26,19 @@ class ClosureLoader extends Loader /** * Loads a Closure. * - * @param \Closure $closure A Closure - * @param string|null $type The resource type + * @param \Closure $closure A Closure + * @param string|null $type The resource type * * @return RouteCollection A RouteCollection instance */ - public function load($closure, $type = null) - { + public function load($closure, $type = NULL) { return $closure(); } /** * {@inheritdoc} */ - public function supports($resource, $type = null) - { + public function supports($resource, $type = NULL) { return $resource instanceof \Closure && (!$type || 'closure' === $type); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/CollectionConfigurator.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/CollectionConfigurator.php index 8baefdd..91b7fa4 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/CollectionConfigurator.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/CollectionConfigurator.php @@ -25,8 +25,7 @@ class CollectionConfigurator private $parent; private $parentConfigurator; - public function __construct(RouteCollection $parent, $name, self $parentConfigurator = null) - { + public function __construct(RouteCollection $parent, $name, self $parentConfigurator = NULL) { $this->parent = $parent; $this->name = $name; $this->collection = new RouteCollection(); @@ -34,8 +33,7 @@ class CollectionConfigurator $this->parentConfigurator = $parentConfigurator; // for GC control } - public function __destruct() - { + public function __destruct() { $this->collection->addPrefix(rtrim($this->route->getPath(), '/')); $this->parent->addCollection($this->collection); } @@ -48,9 +46,8 @@ class CollectionConfigurator * * @return RouteConfigurator */ - final public function add($name, $path) - { - $this->collection->add($this->name.$name, $route = clone $this->route); + final public function add($name, $path) { + $this->collection->add($this->name . $name, $route = clone $this->route); return new RouteConfigurator($this->collection, $route->setPath($path), $this->name, $this); } @@ -60,9 +57,8 @@ class CollectionConfigurator * * @return self */ - final public function collection($name = '') - { - return new self($this->collection, $this->name.$name, $this); + final public function collection($name = '') { + return new self($this->collection, $this->name . $name, $this); } /** @@ -72,8 +68,7 @@ class CollectionConfigurator * * @return $this */ - final public function prefix($prefix) - { + final public function prefix($prefix) { $this->route->setPath($prefix); return $this; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/ImportConfigurator.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/ImportConfigurator.php index d0a3c37..72755e9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/ImportConfigurator.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/ImportConfigurator.php @@ -22,14 +22,12 @@ class ImportConfigurator private $parent; - public function __construct(RouteCollection $parent, RouteCollection $route) - { + public function __construct(RouteCollection $parent, RouteCollection $route) { $this->parent = $parent; $this->route = $route; } - public function __destruct() - { + public function __destruct() { $this->parent->addCollection($this->route); } @@ -40,8 +38,7 @@ class ImportConfigurator * * @return $this */ - final public function prefix($prefix) - { + final public function prefix($prefix) { $this->route->addPrefix($prefix); return $this; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/RouteConfigurator.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/RouteConfigurator.php index 6422bbf..e28b65c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/RouteConfigurator.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/RouteConfigurator.php @@ -24,8 +24,7 @@ class RouteConfigurator private $parentConfigurator; - public function __construct(RouteCollection $collection, Route $route, $name = '', CollectionConfigurator $parentConfigurator = null) - { + public function __construct(RouteCollection $collection, Route $route, $name = '', CollectionConfigurator $parentConfigurator = NULL) { $this->collection = $collection; $this->route = $route; $this->name = $name; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/RoutingConfigurator.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/RoutingConfigurator.php index d992cef..ef61377 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/RoutingConfigurator.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/RoutingConfigurator.php @@ -25,8 +25,7 @@ class RoutingConfigurator private $path; private $file; - public function __construct(RouteCollection $collection, PhpFileLoader $loader, $path, $file) - { + public function __construct(RouteCollection $collection, PhpFileLoader $loader, $path, $file) { $this->collection = $collection; $this->loader = $loader; $this->path = $path; @@ -36,8 +35,7 @@ class RoutingConfigurator /** * @return ImportConfigurator */ - final public function import($resource, $type = null, $ignoreErrors = false) - { + final public function import($resource, $type = NULL, $ignoreErrors = FALSE) { $this->loader->setCurrentDir(dirname($this->path)); $imported = $this->loader->import($resource, $type, $ignoreErrors, $this->file); if (!is_array($imported)) { @@ -55,8 +53,7 @@ class RoutingConfigurator /** * @return CollectionConfigurator */ - final public function collection($name = '') - { + final public function collection($name = '') { return new CollectionConfigurator($this->collection, $name); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/Traits/AddTrait.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/Traits/AddTrait.php index e8b8fa2..cab6155 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/Traits/AddTrait.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/Traits/AddTrait.php @@ -32,10 +32,9 @@ trait AddTrait * * @return RouteConfigurator */ - final public function add($name, $path) - { - $parentConfigurator = $this instanceof RouteConfigurator ? $this->parentConfigurator : null; - $this->collection->add($this->name.$name, $route = new Route($path)); + final public function add($name, $path) { + $parentConfigurator = $this instanceof RouteConfigurator ? $this->parentConfigurator : NULL; + $this->collection->add($this->name . $name, $route = new Route($path)); return new RouteConfigurator($this->collection, $route, '', $parentConfigurator); } @@ -48,8 +47,7 @@ trait AddTrait * * @return RouteConfigurator */ - final public function __invoke($name, $path) - { + final public function __invoke($name, $path) { return $this->add($name, $path); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/Traits/RouteTrait.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/Traits/RouteTrait.php index 4d2e255..b1d8047 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/Traits/RouteTrait.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/Configurator/Traits/RouteTrait.php @@ -26,8 +26,7 @@ trait RouteTrait * * @return $this */ - final public function defaults(array $defaults) - { + final public function defaults(array $defaults) { $this->route->addDefaults($defaults); return $this; @@ -38,8 +37,7 @@ trait RouteTrait * * @return $this */ - final public function requirements(array $requirements) - { + final public function requirements(array $requirements) { $this->route->addRequirements($requirements); return $this; @@ -50,8 +48,7 @@ trait RouteTrait * * @return $this */ - final public function options(array $options) - { + final public function options(array $options) { $this->route->addOptions($options); return $this; @@ -64,8 +61,7 @@ trait RouteTrait * * @return $this */ - final public function condition($condition) - { + final public function condition($condition) { $this->route->setCondition($condition); return $this; @@ -78,8 +74,7 @@ trait RouteTrait * * @return $this */ - final public function host($pattern) - { + final public function host($pattern) { $this->route->setHost($pattern); return $this; @@ -93,8 +88,7 @@ trait RouteTrait * * @return $this */ - final public function schemes(array $schemes) - { + final public function schemes(array $schemes) { $this->route->setSchemes($schemes); return $this; @@ -108,8 +102,7 @@ trait RouteTrait * * @return $this */ - final public function methods(array $methods) - { + final public function methods(array $methods) { $this->route->setMethods($methods); return $this; @@ -122,8 +115,7 @@ trait RouteTrait * * @return $this */ - final public function controller($controller) - { + final public function controller($controller) { $this->route->addDefaults(array('_controller' => $controller)); return $this; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/DependencyInjection/ServiceRouterLoader.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/DependencyInjection/ServiceRouterLoader.php index 6c16216..cd39205 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/DependencyInjection/ServiceRouterLoader.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/DependencyInjection/ServiceRouterLoader.php @@ -28,13 +28,11 @@ class ServiceRouterLoader extends ObjectRouteLoader */ private $container; - public function __construct(ContainerInterface $container) - { + public function __construct(ContainerInterface $container) { $this->container = $container; } - protected function getServiceObject($id) - { + protected function getServiceObject($id) { return $this->container->get($id); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/DirectoryLoader.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/DirectoryLoader.php index 4bb5b31..c0338b1 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/DirectoryLoader.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/DirectoryLoader.php @@ -20,8 +20,7 @@ class DirectoryLoader extends FileLoader /** * {@inheritdoc} */ - public function load($file, $type = null) - { + public function load($file, $type = NULL) { $path = $this->locator->locate($file); $collection = new RouteCollection(); @@ -30,15 +29,15 @@ class DirectoryLoader extends FileLoader foreach (scandir($path) as $dir) { if ('.' !== $dir[0]) { $this->setCurrentDir($path); - $subPath = $path.'/'.$dir; - $subType = null; + $subPath = $path . '/' . $dir; + $subType = NULL; if (is_dir($subPath)) { $subPath .= '/'; $subType = 'directory'; } - $subCollection = $this->import($subPath, $subType, false, $path); + $subCollection = $this->import($subPath, $subType, FALSE, $path); $collection->addCollection($subCollection); } } @@ -49,8 +48,7 @@ class DirectoryLoader extends FileLoader /** * {@inheritdoc} */ - public function supports($resource, $type = null) - { + public function supports($resource, $type = NULL) { // only when type is forced to directory, not to conflict with AnnotationLoader return 'directory' === $type; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/GlobFileLoader.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/GlobFileLoader.php index 03ee341..00f24c5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/GlobFileLoader.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/GlobFileLoader.php @@ -24,11 +24,10 @@ class GlobFileLoader extends FileLoader /** * {@inheritdoc} */ - public function load($resource, $type = null) - { + public function load($resource, $type = NULL) { $collection = new RouteCollection(); - foreach ($this->glob($resource, false, $globResource) as $path => $info) { + foreach ($this->glob($resource, FALSE, $globResource) as $path => $info) { $collection->addCollection($this->import($path)); } @@ -40,8 +39,7 @@ class GlobFileLoader extends FileLoader /** * {@inheritdoc} */ - public function supports($resource, $type = null) - { + public function supports($resource, $type = NULL) { return 'glob' === $type; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/ObjectRouteLoader.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/ObjectRouteLoader.php index 0899a81..86bd2b4 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/ObjectRouteLoader.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/ObjectRouteLoader.php @@ -37,13 +37,12 @@ abstract class ObjectRouteLoader extends Loader /** * Calls the service that will load the routes. * - * @param mixed $resource Some value that will resolve to a callable - * @param string|null $type The resource type + * @param mixed $resource Some value that will resolve to a callable + * @param string|null $type The resource type * * @return RouteCollection */ - public function load($resource, $type = null) - { + public function load($resource, $type = NULL) { $parts = explode(':', $resource); if (2 != count($parts)) { throw new \InvalidArgumentException(sprintf('Invalid resource "%s" passed to the "service" route loader: use the format "service_name:methodName"', $resource)); @@ -79,13 +78,11 @@ abstract class ObjectRouteLoader extends Loader /** * {@inheritdoc} */ - public function supports($resource, $type = null) - { + public function supports($resource, $type = NULL) { return 'service' === $type; } - private function addClassResource(\ReflectionClass $class, RouteCollection $collection) - { + private function addClassResource(\ReflectionClass $class, RouteCollection $collection) { do { if (is_file($class->getFileName())) { $collection->addResource(new FileResource($class->getFileName())); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/PhpFileLoader.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/PhpFileLoader.php index 3fcd692..fabda03 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/PhpFileLoader.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/PhpFileLoader.php @@ -28,13 +28,12 @@ class PhpFileLoader extends FileLoader /** * Loads a PHP file. * - * @param string $file A PHP file path + * @param string $file A PHP file path * @param string|null $type The resource type * * @return RouteCollection A RouteCollection instance */ - public function load($file, $type = null) - { + public function load($file, $type = NULL) { $path = $this->locator->locate($file); $this->setCurrentDir(dirname($path)); @@ -42,7 +41,7 @@ class PhpFileLoader extends FileLoader $loader = $this; $load = \Closure::bind(function ($file) use ($loader) { return include $file; - }, null, ProtectedPhpFileLoader::class); + }, NULL, ProtectedPhpFileLoader::class); $result = $load($path); @@ -61,8 +60,7 @@ class PhpFileLoader extends FileLoader /** * {@inheritdoc} */ - public function supports($resource, $type = null) - { + public function supports($resource, $type = NULL) { return is_string($resource) && 'php' === pathinfo($resource, PATHINFO_EXTENSION) && (!$type || 'php' === $type); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/XmlFileLoader.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/XmlFileLoader.php index f3f6605..bf5d98b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/XmlFileLoader.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/XmlFileLoader.php @@ -31,7 +31,7 @@ class XmlFileLoader extends FileLoader /** * Loads an XML file. * - * @param string $file An XML file path + * @param string $file An XML file path * @param string|null $type The resource type * * @return RouteCollection A RouteCollection instance @@ -39,8 +39,7 @@ class XmlFileLoader extends FileLoader * @throws \InvalidArgumentException when the file cannot be loaded or when the XML cannot be * parsed because it does not validate against the scheme */ - public function load($file, $type = null) - { + public function load($file, $type = NULL) { $path = $this->locator->locate($file); $xml = $this->loadFile($path); @@ -64,14 +63,13 @@ class XmlFileLoader extends FileLoader * Parses a node from a loaded XML file. * * @param RouteCollection $collection Collection to associate with the node - * @param \DOMElement $node Element to parse - * @param string $path Full path of the XML file being processed - * @param string $file Loaded file name + * @param \DOMElement $node Element to parse + * @param string $path Full path of the XML file being processed + * @param string $file Loaded file name * * @throws \InvalidArgumentException When the XML is invalid */ - protected function parseNode(RouteCollection $collection, \DOMElement $node, $path, $file) - { + protected function parseNode(RouteCollection $collection, \DOMElement $node, $path, $file) { if (self::NAMESPACE_URI !== $node->namespaceURI) { return; } @@ -91,8 +89,7 @@ class XmlFileLoader extends FileLoader /** * {@inheritdoc} */ - public function supports($resource, $type = null) - { + public function supports($resource, $type = NULL) { return is_string($resource) && 'xml' === pathinfo($resource, PATHINFO_EXTENSION) && (!$type || 'xml' === $type); } @@ -100,13 +97,12 @@ class XmlFileLoader extends FileLoader * Parses a route and adds it to the RouteCollection. * * @param RouteCollection $collection RouteCollection instance - * @param \DOMElement $node Element to parse that represents a Route - * @param string $path Full path of the XML file being processed + * @param \DOMElement $node Element to parse that represents a Route + * @param string $path Full path of the XML file being processed * * @throws \InvalidArgumentException When the XML is invalid */ - protected function parseRoute(RouteCollection $collection, \DOMElement $node, $path) - { + protected function parseRoute(RouteCollection $collection, \DOMElement $node, $path) { if ('' === ($id = $node->getAttribute('id')) || !$node->hasAttribute('path')) { throw new \InvalidArgumentException(sprintf('The element in file "%s" must have an "id" and a "path" attribute.', $path)); } @@ -124,29 +120,28 @@ class XmlFileLoader extends FileLoader * Parses an import and adds the routes in the resource to the RouteCollection. * * @param RouteCollection $collection RouteCollection instance - * @param \DOMElement $node Element to parse that represents a Route - * @param string $path Full path of the XML file being processed - * @param string $file Loaded file name + * @param \DOMElement $node Element to parse that represents a Route + * @param string $path Full path of the XML file being processed + * @param string $file Loaded file name * * @throws \InvalidArgumentException When the XML is invalid */ - protected function parseImport(RouteCollection $collection, \DOMElement $node, $path, $file) - { + protected function parseImport(RouteCollection $collection, \DOMElement $node, $path, $file) { if ('' === $resource = $node->getAttribute('resource')) { throw new \InvalidArgumentException(sprintf('The element in file "%s" must have a "resource" attribute.', $path)); } $type = $node->getAttribute('type'); $prefix = $node->getAttribute('prefix'); - $host = $node->hasAttribute('host') ? $node->getAttribute('host') : null; - $schemes = $node->hasAttribute('schemes') ? preg_split('/[\s,\|]++/', $node->getAttribute('schemes'), -1, PREG_SPLIT_NO_EMPTY) : null; - $methods = $node->hasAttribute('methods') ? preg_split('/[\s,\|]++/', $node->getAttribute('methods'), -1, PREG_SPLIT_NO_EMPTY) : null; + $host = $node->hasAttribute('host') ? $node->getAttribute('host') : NULL; + $schemes = $node->hasAttribute('schemes') ? preg_split('/[\s,\|]++/', $node->getAttribute('schemes'), -1, PREG_SPLIT_NO_EMPTY) : NULL; + $methods = $node->hasAttribute('methods') ? preg_split('/[\s,\|]++/', $node->getAttribute('methods'), -1, PREG_SPLIT_NO_EMPTY) : NULL; list($defaults, $requirements, $options, $condition) = $this->parseConfigs($node, $path); $this->setCurrentDir(dirname($path)); - $imported = $this->import($resource, ('' !== $type ? $type : null), false, $file); + $imported = $this->import($resource, ('' !== $type ? $type : NULL), FALSE, $file); if (!is_array($imported)) { $imported = array($imported); @@ -155,16 +150,16 @@ class XmlFileLoader extends FileLoader foreach ($imported as $subCollection) { /* @var $subCollection RouteCollection */ $subCollection->addPrefix($prefix); - if (null !== $host) { + if (NULL !== $host) { $subCollection->setHost($host); } - if (null !== $condition) { + if (NULL !== $condition) { $subCollection->setCondition($condition); } - if (null !== $schemes) { + if (NULL !== $schemes) { $subCollection->setSchemes($schemes); } - if (null !== $methods) { + if (NULL !== $methods) { $subCollection->setMethods($methods); } $subCollection->addDefaults($defaults); @@ -186,27 +181,25 @@ class XmlFileLoader extends FileLoader * or when the XML structure is not as expected by the scheme - * see validate() */ - protected function loadFile($file) - { - return XmlUtils::loadFile($file, __DIR__.static::SCHEME_PATH); + protected function loadFile($file) { + return XmlUtils::loadFile($file, __DIR__ . static::SCHEME_PATH); } /** * Parses the config elements (default, requirement, option). * * @param \DOMElement $node Element to parse that contains the configs - * @param string $path Full path of the XML file being processed + * @param string $path Full path of the XML file being processed * * @return array An array with the defaults as first item, requirements as second and options as third * * @throws \InvalidArgumentException When the XML is invalid */ - private function parseConfigs(\DOMElement $node, $path) - { + private function parseConfigs(\DOMElement $node, $path) { $defaults = array(); $requirements = array(); $options = array(); - $condition = null; + $condition = NULL; foreach ($node->getElementsByTagNameNS(self::NAMESPACE_URI, '*') as $n) { if ($node !== $n->parentNode) { @@ -216,7 +209,7 @@ class XmlFileLoader extends FileLoader switch ($n->localName) { case 'default': if ($this->isElementValueNull($n)) { - $defaults[$n->getAttribute('key')] = null; + $defaults[$n->getAttribute('key')] = NULL; } else { $defaults[$n->getAttribute('key')] = $this->parseDefaultsConfig($n, $path); } @@ -253,12 +246,11 @@ class XmlFileLoader extends FileLoader * Parses the "default" elements. * * @param \DOMElement $element The "default" element to parse - * @param string $path Full path of the XML file being processed + * @param string $path Full path of the XML file being processed * * @return array|bool|float|int|string|null The parsed value of the "default" element */ - private function parseDefaultsConfig(\DOMElement $element, $path) - { + private function parseDefaultsConfig(\DOMElement $element, $path) { if ($this->isElementValueNull($element)) { return; } @@ -288,14 +280,13 @@ class XmlFileLoader extends FileLoader * Recursively parses the value of a "default" element. * * @param \DOMElement $node The node value - * @param string $path Full path of the XML file being processed + * @param string $path Full path of the XML file being processed * * @return array|bool|float|int|string The parsed value * * @throws \InvalidArgumentException when the XML is invalid */ - private function parseDefaultNode(\DOMElement $node, $path) - { + private function parseDefaultNode(\DOMElement $node, $path) { if ($this->isElementValueNull($node)) { return; } @@ -304,9 +295,9 @@ class XmlFileLoader extends FileLoader case 'bool': return 'true' === trim($node->nodeValue) || '1' === trim($node->nodeValue); case 'int': - return (int) trim($node->nodeValue); + return (int)trim($node->nodeValue); case 'float': - return (float) trim($node->nodeValue); + return (float)trim($node->nodeValue); case 'string': return trim($node->nodeValue); case 'list': @@ -346,12 +337,11 @@ class XmlFileLoader extends FileLoader } } - private function isElementValueNull(\DOMElement $element) - { + private function isElementValueNull(\DOMElement $element) { $namespaceUri = 'http://www.w3.org/2001/XMLSchema-instance'; if (!$element->hasAttributeNS($namespaceUri, 'nil')) { - return false; + return FALSE; } return 'true' === $element->getAttributeNS($namespaceUri, 'nil') || '1' === $element->getAttributeNS($namespaceUri, 'nil'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/YamlFileLoader.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/YamlFileLoader.php index f59f909..39ffb93 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/YamlFileLoader.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/YamlFileLoader.php @@ -34,15 +34,14 @@ class YamlFileLoader extends FileLoader /** * Loads a Yaml file. * - * @param string $file A Yaml file path + * @param string $file A Yaml file path * @param string|null $type The resource type * * @return RouteCollection A RouteCollection instance * * @throws \InvalidArgumentException When a route can't be parsed because YAML is invalid */ - public function load($file, $type = null) - { + public function load($file, $type = NULL) { $path = $this->locator->locate($file); if (!stream_is_local($path)) { @@ -53,14 +52,14 @@ class YamlFileLoader extends FileLoader throw new \InvalidArgumentException(sprintf('File "%s" not found.', $path)); } - if (null === $this->yamlParser) { + if (NULL === $this->yamlParser) { $this->yamlParser = new YamlParser(); } $prevErrorHandler = set_error_handler(function ($level, $message, $script, $line) use ($file, &$prevErrorHandler) { - $message = E_USER_DEPRECATED === $level ? preg_replace('/ on line \d+/', ' in "'.$file.'"$0', $message) : $message; + $message = E_USER_DEPRECATED === $level ? preg_replace('/ on line \d+/', ' in "' . $file . '"$0', $message) : $message; - return $prevErrorHandler ? $prevErrorHandler($level, $message, $script, $line) : false; + return $prevErrorHandler ? $prevErrorHandler($level, $message, $script, $line) : FALSE; }); try { @@ -75,7 +74,7 @@ class YamlFileLoader extends FileLoader $collection->addResource(new FileResource($path)); // empty file - if (null === $parsedConfig) { + if (NULL === $parsedConfig) { return $collection; } @@ -100,28 +99,26 @@ class YamlFileLoader extends FileLoader /** * {@inheritdoc} */ - public function supports($resource, $type = null) - { - return is_string($resource) && in_array(pathinfo($resource, PATHINFO_EXTENSION), array('yml', 'yaml'), true) && (!$type || 'yaml' === $type); + public function supports($resource, $type = NULL) { + return is_string($resource) && in_array(pathinfo($resource, PATHINFO_EXTENSION), array('yml', 'yaml'), TRUE) && (!$type || 'yaml' === $type); } /** * Parses a route and adds it to the RouteCollection. * * @param RouteCollection $collection A RouteCollection instance - * @param string $name Route name - * @param array $config Route definition - * @param string $path Full path of the YAML file being processed + * @param string $name Route name + * @param array $config Route definition + * @param string $path Full path of the YAML file being processed */ - protected function parseRoute(RouteCollection $collection, $name, array $config, $path) - { + protected function parseRoute(RouteCollection $collection, $name, array $config, $path) { $defaults = isset($config['defaults']) ? $config['defaults'] : array(); $requirements = isset($config['requirements']) ? $config['requirements'] : array(); $options = isset($config['options']) ? $config['options'] : array(); $host = isset($config['host']) ? $config['host'] : ''; $schemes = isset($config['schemes']) ? $config['schemes'] : array(); $methods = isset($config['methods']) ? $config['methods'] : array(); - $condition = isset($config['condition']) ? $config['condition'] : null; + $condition = isset($config['condition']) ? $config['condition'] : NULL; if (isset($config['controller'])) { $defaults['_controller'] = $config['controller']; @@ -136,21 +133,20 @@ class YamlFileLoader extends FileLoader * Parses an import and adds the routes in the resource to the RouteCollection. * * @param RouteCollection $collection A RouteCollection instance - * @param array $config Route definition - * @param string $path Full path of the YAML file being processed - * @param string $file Loaded file name + * @param array $config Route definition + * @param string $path Full path of the YAML file being processed + * @param string $file Loaded file name */ - protected function parseImport(RouteCollection $collection, array $config, $path, $file) - { - $type = isset($config['type']) ? $config['type'] : null; + protected function parseImport(RouteCollection $collection, array $config, $path, $file) { + $type = isset($config['type']) ? $config['type'] : NULL; $prefix = isset($config['prefix']) ? $config['prefix'] : ''; $defaults = isset($config['defaults']) ? $config['defaults'] : array(); $requirements = isset($config['requirements']) ? $config['requirements'] : array(); $options = isset($config['options']) ? $config['options'] : array(); - $host = isset($config['host']) ? $config['host'] : null; - $condition = isset($config['condition']) ? $config['condition'] : null; - $schemes = isset($config['schemes']) ? $config['schemes'] : null; - $methods = isset($config['methods']) ? $config['methods'] : null; + $host = isset($config['host']) ? $config['host'] : NULL; + $condition = isset($config['condition']) ? $config['condition'] : NULL; + $schemes = isset($config['schemes']) ? $config['schemes'] : NULL; + $methods = isset($config['methods']) ? $config['methods'] : NULL; if (isset($config['controller'])) { $defaults['_controller'] = $config['controller']; @@ -158,7 +154,7 @@ class YamlFileLoader extends FileLoader $this->setCurrentDir(dirname($path)); - $imported = $this->import($config['resource'], $type, false, $file); + $imported = $this->import($config['resource'], $type, FALSE, $file); if (!is_array($imported)) { $imported = array($imported); @@ -167,16 +163,16 @@ class YamlFileLoader extends FileLoader foreach ($imported as $subCollection) { /* @var $subCollection RouteCollection */ $subCollection->addPrefix($prefix); - if (null !== $host) { + if (NULL !== $host) { $subCollection->setHost($host); } - if (null !== $condition) { + if (NULL !== $condition) { $subCollection->setCondition($condition); } - if (null !== $schemes) { + if (NULL !== $schemes) { $subCollection->setSchemes($schemes); } - if (null !== $methods) { + if (NULL !== $methods) { $subCollection->setMethods($methods); } $subCollection->addDefaults($defaults); @@ -190,15 +186,14 @@ class YamlFileLoader extends FileLoader /** * Validates the route configuration. * - * @param array $config A resource config - * @param string $name The config key - * @param string $path The loaded file path + * @param array $config A resource config + * @param string $name The config key + * @param string $path The loaded file path * * @throws \InvalidArgumentException If one of the provided config keys is not supported, * something is missing or the combination is nonsense */ - protected function validate($config, $name, $path) - { + protected function validate($config, $name, $path) { if (!is_array($config)) { throw new \InvalidArgumentException(sprintf('The definition of "%s" in "%s" must be a YAML array.', $name, $path)); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/schema/routing/routing-1.0.xsd b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/schema/routing/routing-1.0.xsd index a97111a..d592413 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/schema/routing/routing-1.0.xsd +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Loader/schema/routing/routing-1.0.xsd @@ -1,148 +1,148 @@ + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + targetNamespace="http://symfony.com/schema/routing" + elementFormDefault="qualified"> - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/DumperCollection.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/DumperCollection.php index 6916297..cfe0194 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/DumperCollection.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/DumperCollection.php @@ -40,8 +40,7 @@ class DumperCollection implements \IteratorAggregate * * @return self[]|DumperRoute[] */ - public function all() - { + public function all() { return $this->children; } @@ -50,8 +49,7 @@ class DumperCollection implements \IteratorAggregate * * @param DumperRoute|DumperCollection The route or collection */ - public function add($child) - { + public function add($child) { if ($child instanceof self) { $child->setParent($this); } @@ -63,8 +61,7 @@ class DumperCollection implements \IteratorAggregate * * @param array $children The children */ - public function setAll(array $children) - { + public function setAll(array $children) { foreach ($children as $child) { if ($child instanceof self) { $child->setParent($this); @@ -78,8 +75,7 @@ class DumperCollection implements \IteratorAggregate * * @return \Iterator|DumperCollection[]|DumperRoute[] The iterator */ - public function getIterator() - { + public function getIterator() { return new \ArrayIterator($this->children); } @@ -88,9 +84,8 @@ class DumperCollection implements \IteratorAggregate * * @return self The root collection */ - public function getRoot() - { - return (null !== $this->parent) ? $this->parent->getRoot() : $this; + public function getRoot() { + return (NULL !== $this->parent) ? $this->parent->getRoot() : $this; } /** @@ -98,16 +93,14 @@ class DumperCollection implements \IteratorAggregate * * @return self|null The parent collection or null if the collection has no parent */ - protected function getParent() - { + protected function getParent() { return $this->parent; } /** * Sets the parent collection. */ - protected function setParent(DumperCollection $parent) - { + protected function setParent(DumperCollection $parent) { $this->parent = $parent; } @@ -118,32 +111,29 @@ class DumperCollection implements \IteratorAggregate * * @return bool true if the attribute is defined, false otherwise */ - public function hasAttribute($name) - { + public function hasAttribute($name) { return array_key_exists($name, $this->attributes); } /** * Returns an attribute by name. * - * @param string $name The attribute name - * @param mixed $default Default value is the attribute doesn't exist + * @param string $name The attribute name + * @param mixed $default Default value is the attribute doesn't exist * * @return mixed The attribute value */ - public function getAttribute($name, $default = null) - { + public function getAttribute($name, $default = NULL) { return $this->hasAttribute($name) ? $this->attributes[$name] : $default; } /** * Sets an attribute by name. * - * @param string $name The attribute name - * @param mixed $value The attribute value + * @param string $name The attribute name + * @param mixed $value The attribute value */ - public function setAttribute($name, $value) - { + public function setAttribute($name, $value) { $this->attributes[$name] = $value; } @@ -152,8 +142,7 @@ class DumperCollection implements \IteratorAggregate * * @param array $attributes The attributes */ - public function setAttributes($attributes) - { + public function setAttributes($attributes) { $this->attributes = $attributes; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/DumperRoute.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/DumperRoute.php index c71989a..18fead3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/DumperRoute.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/DumperRoute.php @@ -26,11 +26,10 @@ class DumperRoute private $route; /** - * @param string $name The route name - * @param Route $route The route + * @param string $name The route name + * @param Route $route The route */ - public function __construct($name, Route $route) - { + public function __construct($name, Route $route) { $this->name = $name; $this->route = $route; } @@ -40,8 +39,7 @@ class DumperRoute * * @return string The route name */ - public function getName() - { + public function getName() { return $this->name; } @@ -50,8 +48,7 @@ class DumperRoute * * @return Route The route */ - public function getRoute() - { + public function getRoute() { return $this->route; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/MatcherDumper.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/MatcherDumper.php index ea51ab4..20e3bbf 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/MatcherDumper.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/MatcherDumper.php @@ -22,16 +22,14 @@ abstract class MatcherDumper implements MatcherDumperInterface { private $routes; - public function __construct(RouteCollection $routes) - { + public function __construct(RouteCollection $routes) { $this->routes = $routes; } /** * {@inheritdoc} */ - public function getRoutes() - { + public function getRoutes() { return $this->routes; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/PhpMatcherDumper.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/PhpMatcherDumper.php index 40d8df6..e36a8ed 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/PhpMatcherDumper.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/PhpMatcherDumper.php @@ -44,8 +44,7 @@ class PhpMatcherDumper extends MatcherDumper * * @return string A PHP class representing the matcher class */ - public function dump(array $options = array()) - { + public function dump(array $options = array()) { $options = array_replace(array( 'class' => 'ProjectUrlMatcher', 'base_class' => 'Symfony\\Component\\Routing\\Matcher\\UrlMatcher', @@ -79,8 +78,7 @@ class {$options['class']} extends {$options['base_class']} EOF; } - public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider) - { + public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider) { $this->expressionLanguageProviders[] = $provider; } @@ -91,8 +89,7 @@ EOF; * * @return string Match method as PHP code */ - private function generateMatchMethod($supportsRedirections) - { + private function generateMatchMethod($supportsRedirections) { $code = rtrim($this->compileRoutes($this->getRoutes(), $supportsRedirections), "\n"); return <<groupRoutesByHostRegex($routes); $code = ''; foreach ($groups as $collection) { - if (null !== $regex = $collection->getAttribute('host_regex')) { + if (NULL !== $regex = $collection->getAttribute('host_regex')) { if (!$fetchedHost) { $code .= " \$host = \$context->getHost();\n\n"; - $fetchedHost = true; + $fetchedHost = TRUE; } - $code .= sprintf(" if (preg_match(%s, \$host, \$hostMatches)) {\n", var_export($regex, true)); + $code .= sprintf(" if (preg_match(%s, \$host, \$hostMatches)) {\n", var_export($regex, TRUE)); } $tree = $this->buildStaticPrefixCollection($collection); $groupCode = $this->compileStaticPrefixRoutes($tree, $supportsRedirections); - if (null !== $regex) { + if (NULL !== $regex) { // apply extra indention at each line (except empty ones) $groupCode = preg_replace('/^.{2,}$/m', ' $0', $groupCode); $code .= $groupCode; @@ -161,8 +157,7 @@ EOF; return $code; } - private function buildStaticPrefixCollection(DumperCollection $collection) - { + private function buildStaticPrefixCollection(DumperCollection $collection) { $prefixCollection = new StaticPrefixCollection(); foreach ($collection as $dumperRoute) { @@ -178,19 +173,18 @@ EOF; /** * Generates PHP code to match a tree of routes. * - * @param StaticPrefixCollection $collection A StaticPrefixCollection instance - * @param bool $supportsRedirections Whether redirections are supported by the base class - * @param string $ifOrElseIf either "if" or "elseif" to influence chaining + * @param StaticPrefixCollection $collection A StaticPrefixCollection instance + * @param bool $supportsRedirections Whether redirections are supported by the base class + * @param string $ifOrElseIf either "if" or "elseif" to influence chaining * * @return string PHP code */ - private function compileStaticPrefixRoutes(StaticPrefixCollection $collection, $supportsRedirections, $ifOrElseIf = 'if') - { + private function compileStaticPrefixRoutes(StaticPrefixCollection $collection, $supportsRedirections, $ifOrElseIf = 'if') { $code = ''; $prefix = $collection->getPrefix(); if (!empty($prefix) && '/' !== $prefix) { - $code .= sprintf(" %s (0 === strpos(\$pathinfo, %s)) {\n", $ifOrElseIf, var_export($prefix, true)); + $code .= sprintf(" %s (0 === strpos(\$pathinfo, %s)) {\n", $ifOrElseIf, var_export($prefix, TRUE)); } $ifOrElseIf = 'if'; @@ -200,7 +194,7 @@ EOF; $code .= $this->compileStaticPrefixRoutes($route, $supportsRedirections, $ifOrElseIf); $ifOrElseIf = 'elseif'; } else { - $code .= $this->compileRoute($route[1]->getRoute(), $route[1]->getName(), $supportsRedirections, $prefix)."\n"; + $code .= $this->compileRoute($route[1]->getRoute(), $route[1]->getName(), $supportsRedirections, $prefix) . "\n"; $ifOrElseIf = 'if'; } } @@ -217,51 +211,50 @@ EOF; /** * Compiles a single Route to PHP code used to match it against the path info. * - * @param Route $route A Route instance - * @param string $name The name of the Route - * @param bool $supportsRedirections Whether redirections are supported by the base class - * @param string|null $parentPrefix The prefix of the parent collection used to optimize the code + * @param Route $route A Route instance + * @param string $name The name of the Route + * @param bool $supportsRedirections Whether redirections are supported by the base class + * @param string|null $parentPrefix The prefix of the parent collection used to optimize the code * * @return string PHP code * * @throws \LogicException */ - private function compileRoute(Route $route, $name, $supportsRedirections, $parentPrefix = null) - { + private function compileRoute(Route $route, $name, $supportsRedirections, $parentPrefix = NULL) { $code = ''; $compiledRoute = $route->compile(); $conditions = array(); - $hasTrailingSlash = false; - $matches = false; - $hostMatches = false; + $hasTrailingSlash = FALSE; + $matches = FALSE; + $hostMatches = FALSE; $methods = $route->getMethods(); $supportsTrailingSlash = $supportsRedirections && (!$methods || in_array('GET', $methods)); $regex = $compiledRoute->getRegex(); - if (!count($compiledRoute->getPathVariables()) && false !== preg_match('#^(.)\^(?P.*?)\$\1#'.('u' === substr($regex, -1) ? 'u' : ''), $regex, $m)) { + if (!count($compiledRoute->getPathVariables()) && FALSE !== preg_match('#^(.)\^(?P.*?)\$\1#' . ('u' === substr($regex, -1) ? 'u' : ''), $regex, $m)) { if ($supportsTrailingSlash && '/' === substr($m['url'], -1)) { - $conditions[] = sprintf('%s === $trimmedPathinfo', var_export(rtrim(str_replace('\\', '', $m['url']), '/'), true)); - $hasTrailingSlash = true; + $conditions[] = sprintf('%s === $trimmedPathinfo', var_export(rtrim(str_replace('\\', '', $m['url']), '/'), TRUE)); + $hasTrailingSlash = TRUE; } else { - $conditions[] = sprintf('%s === $pathinfo', var_export(str_replace('\\', '', $m['url']), true)); + $conditions[] = sprintf('%s === $pathinfo', var_export(str_replace('\\', '', $m['url']), TRUE)); } } else { if ($compiledRoute->getStaticPrefix() && $compiledRoute->getStaticPrefix() !== $parentPrefix) { - $conditions[] = sprintf('0 === strpos($pathinfo, %s)', var_export($compiledRoute->getStaticPrefix(), true)); + $conditions[] = sprintf('0 === strpos($pathinfo, %s)', var_export($compiledRoute->getStaticPrefix(), TRUE)); } if ($supportsTrailingSlash && $pos = strpos($regex, '/$')) { - $regex = substr($regex, 0, $pos).'/?$'.substr($regex, $pos + 2); - $hasTrailingSlash = true; + $regex = substr($regex, 0, $pos) . '/?$' . substr($regex, $pos + 2); + $hasTrailingSlash = TRUE; } - $conditions[] = sprintf('preg_match(%s, $pathinfo, $matches)', var_export($regex, true)); + $conditions[] = sprintf('preg_match(%s, $pathinfo, $matches)', var_export($regex, TRUE)); - $matches = true; + $matches = TRUE; } if ($compiledRoute->getHostVariables()) { - $hostMatches = true; + $hostMatches = TRUE; } if ($route->getCondition()) { @@ -276,7 +269,7 @@ EOF; EOF; - $gotoname = 'not_'.preg_replace('/[^A-Za-z0-9_]/', '', $name); + $gotoname = 'not_' . preg_replace('/[^A-Za-z0-9_]/', '', $name); // the offset where the return value is appended below, with indendation $retOffset = 12 + strlen($code); @@ -295,10 +288,10 @@ EOF; $code .= sprintf( " \$ret = \$this->mergeDefaults(array_replace(%s), %s);\n", implode(', ', $vars), - str_replace("\n", '', var_export($route->getDefaults(), true)) + str_replace("\n", '', var_export($route->getDefaults(), TRUE)) ); - } elseif ($route->getDefaults()) { - $code .= sprintf(" \$ret = %s;\n", str_replace("\n", '', var_export(array_replace($route->getDefaults(), array('_route' => $name)), true))); + } else if ($route->getDefaults()) { + $code .= sprintf(" \$ret = %s;\n", str_replace("\n", '', var_export(array_replace($route->getDefaults(), array('_route' => $name)), TRUE))); } else { $code .= sprintf(" \$ret = array('_route' => '%s');\n", $name); } @@ -326,7 +319,7 @@ EOF; if (!$supportsRedirections) { throw new \LogicException('The "schemes" requirement is only supported for URL matchers that implement RedirectableUrlMatcherInterface.'); } - $schemes = str_replace("\n", '', var_export(array_flip($schemes), true)); + $schemes = str_replace("\n", '', var_export(array_flip($schemes), TRUE)); if ($methods) { $code .= <<setAttribute('host_regex', null); + $currentGroup->setAttribute('host_regex', NULL); $groups->add($currentGroup); foreach ($routes as $name => $route) { @@ -415,13 +407,12 @@ EOF; return $groups; } - private function getExpressionLanguage() - { - if (null === $this->expressionLanguage) { + private function getExpressionLanguage() { + if (NULL === $this->expressionLanguage) { if (!class_exists('Symfony\Component\ExpressionLanguage\ExpressionLanguage')) { throw new \RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.'); } - $this->expressionLanguage = new ExpressionLanguage(null, $this->expressionLanguageProviders); + $this->expressionLanguage = new ExpressionLanguage(NULL, $this->expressionLanguageProviders); } return $this->expressionLanguage; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/StaticPrefixCollection.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/StaticPrefixCollection.php index 7365808..192a9f8 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/StaticPrefixCollection.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/Dumper/StaticPrefixCollection.php @@ -35,21 +35,18 @@ class StaticPrefixCollection */ private $matchStart = 0; - public function __construct($prefix = '') - { + public function __construct($prefix = '') { $this->prefix = $prefix; } - public function getPrefix() - { + public function getPrefix() { return $this->prefix; } /** * @return mixed[]|StaticPrefixCollection[] */ - public function getItems() - { + public function getItems() { return $this->items; } @@ -57,10 +54,9 @@ class StaticPrefixCollection * Adds a route to a group. * * @param string $prefix - * @param mixed $route + * @param mixed $route */ - public function addRoute($prefix, $route) - { + public function addRoute($prefix, $route) { $prefix = '/' === $prefix ? $prefix : rtrim($prefix, '/'); $this->guardAgainstAddingNotAcceptedRoutes($prefix); @@ -103,13 +99,12 @@ class StaticPrefixCollection * Tries to combine a route with another route or group. * * @param StaticPrefixCollection|array $item - * @param string $prefix - * @param mixed $route + * @param string $prefix + * @param mixed $route * * @return null|StaticPrefixCollection */ - private function groupWithItem($item, $prefix, $route) - { + private function groupWithItem($item, $prefix, $route) { $itemPrefix = $item instanceof self ? $item->prefix : $item[0]; $commonPrefix = $this->detectCommonPrefix($prefix, $itemPrefix); @@ -137,8 +132,7 @@ class StaticPrefixCollection * * @return bool Whether a prefix could belong in a given group */ - private function accepts($prefix) - { + private function accepts($prefix) { return '' === $this->prefix || 0 === strpos($prefix, $this->prefix); } @@ -150,8 +144,7 @@ class StaticPrefixCollection * * @return false|string A common prefix, longer than the base/group prefix, or false when none available */ - private function detectCommonPrefix($prefix, $anotherPrefix) - { + private function detectCommonPrefix($prefix, $anotherPrefix) { $baseLength = strlen($this->prefix); $commonLength = $baseLength; $end = min(strlen($prefix), strlen($anotherPrefix)); @@ -170,14 +163,13 @@ class StaticPrefixCollection return $commonPrefix; } - return false; + return FALSE; } /** * Optimizes the tree by inlining items from groups with less than 3 items. */ - public function optimizeGroups() - { + public function optimizeGroups() { $index = -1; while (isset($this->items[++$index])) { @@ -199,25 +191,24 @@ class StaticPrefixCollection } } - private function shouldBeInlined() - { + private function shouldBeInlined() { if (count($this->items) >= 3) { - return false; + return FALSE; } foreach ($this->items as $item) { if ($item instanceof self) { - return true; + return TRUE; } } foreach ($this->items as $item) { if (is_array($item) && $item[0] === $this->prefix) { - return false; + return FALSE; } } - return true; + return TRUE; } /** @@ -227,8 +218,7 @@ class StaticPrefixCollection * * @throws \LogicException when a prefix does not belong in a group */ - private function guardAgainstAddingNotAcceptedRoutes($prefix) - { + private function guardAgainstAddingNotAcceptedRoutes($prefix) { if (!$this->accepts($prefix)) { $message = sprintf('Could not add route with prefix %s to collection with prefix %s', $prefix, $this->prefix); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/RedirectableUrlMatcher.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/RedirectableUrlMatcher.php index 3770a9c..298bae0 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/RedirectableUrlMatcher.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/RedirectableUrlMatcher.php @@ -22,8 +22,7 @@ abstract class RedirectableUrlMatcher extends UrlMatcher implements Redirectable /** * {@inheritdoc} */ - public function match($pathinfo) - { + public function match($pathinfo) { try { $parameters = parent::match($pathinfo); } catch (ResourceNotFoundException $e) { @@ -32,9 +31,9 @@ abstract class RedirectableUrlMatcher extends UrlMatcher implements Redirectable } try { - $parameters = parent::match($pathinfo.'/'); + $parameters = parent::match($pathinfo . '/'); - return array_replace($parameters, $this->redirect($pathinfo.'/', isset($parameters['_route']) ? $parameters['_route'] : null)); + return array_replace($parameters, $this->redirect($pathinfo . '/', isset($parameters['_route']) ? $parameters['_route'] : NULL)); } catch (ResourceNotFoundException $e2) { throw $e; } @@ -46,11 +45,10 @@ abstract class RedirectableUrlMatcher extends UrlMatcher implements Redirectable /** * {@inheritdoc} */ - protected function handleRouteRequirements($pathinfo, $name, Route $route) - { + protected function handleRouteRequirements($pathinfo, $name, Route $route) { // expression condition if ($route->getCondition() && !$this->getExpressionLanguage()->evaluate($route->getCondition(), array('context' => $this->context, 'request' => $this->request ?: $this->createRequest($pathinfo)))) { - return array(self::REQUIREMENT_MISMATCH, null); + return array(self::REQUIREMENT_MISMATCH, NULL); } // check HTTP scheme requirement @@ -60,6 +58,6 @@ abstract class RedirectableUrlMatcher extends UrlMatcher implements Redirectable return array(self::ROUTE_MATCH, $this->redirect($pathinfo, $name, current($schemes))); } - return array(self::REQUIREMENT_MATCH, null); + return array(self::REQUIREMENT_MATCH, NULL); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/RedirectableUrlMatcherInterface.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/RedirectableUrlMatcherInterface.php index 7c27bc8..f2612fc 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/RedirectableUrlMatcherInterface.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/RedirectableUrlMatcherInterface.php @@ -21,11 +21,11 @@ interface RedirectableUrlMatcherInterface /** * Redirects the user to another URL. * - * @param string $path The path info to redirect to - * @param string $route The route name that matched + * @param string $path The path info to redirect to + * @param string $route The route name that matched * @param string|null $scheme The URL scheme (null to keep the current one) * * @return array An array of parameters */ - public function redirect($path, $route, $scheme = null); + public function redirect($path, $route, $scheme = NULL); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php index 9085be0..e3a468f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/TraceableUrlMatcher.php @@ -29,8 +29,7 @@ class TraceableUrlMatcher extends UrlMatcher protected $traces; - public function getTraces($pathinfo) - { + public function getTraces($pathinfo) { $this->traces = array(); try { @@ -41,17 +40,15 @@ class TraceableUrlMatcher extends UrlMatcher return $this->traces; } - public function getTracesForRequest(Request $request) - { + public function getTracesForRequest(Request $request) { $this->request = $request; $traces = $this->getTraces($request->getPathInfo()); - $this->request = null; + $this->request = NULL; return $traces; } - protected function matchCollection($pathinfo, RouteCollection $routes) - { + protected function matchCollection($pathinfo, RouteCollection $routes) { foreach ($routes as $name => $route) { $compiledRoute = $route->compile(); @@ -119,23 +116,22 @@ class TraceableUrlMatcher extends UrlMatcher if (!$route->hasScheme($scheme)) { $this->addTrace(sprintf('Scheme "%s" does not match any of the required schemes (%s); the user will be redirected to first required scheme', $scheme, implode(', ', $requiredSchemes)), self::ROUTE_ALMOST_MATCHES, $name, $route); - return true; + return TRUE; } } $this->addTrace('Route matches!', self::ROUTE_MATCHES, $name, $route); - return true; + return TRUE; } } - private function addTrace($log, $level = self::ROUTE_DOES_NOT_MATCH, $name = null, $route = null) - { + private function addTrace($log, $level = self::ROUTE_DOES_NOT_MATCH, $name = NULL, $route = NULL) { $this->traces[] = array( 'log' => $log, 'name' => $name, 'level' => $level, - 'path' => null !== $route ? $route->getPath() : null, + 'path' => NULL !== $route ? $route->getPath() : NULL, ); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/UrlMatcher.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/UrlMatcher.php index 445cfc4..4cd9644 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/UrlMatcher.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Matcher/UrlMatcher.php @@ -43,8 +43,7 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface */ protected $expressionLanguageProviders = array(); - public function __construct(RouteCollection $routes, RequestContext $context) - { + public function __construct(RouteCollection $routes, RequestContext $context) { $this->routes = $routes; $this->context = $context; } @@ -52,24 +51,21 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface /** * {@inheritdoc} */ - public function setContext(RequestContext $context) - { + public function setContext(RequestContext $context) { $this->context = $context; } /** * {@inheritdoc} */ - public function getContext() - { + public function getContext() { return $this->context; } /** * {@inheritdoc} */ - public function match($pathinfo) - { + public function match($pathinfo) { $this->allow = array(); if ($ret = $this->matchCollection(rawurldecode($pathinfo), $this->routes)) { @@ -88,27 +84,25 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface /** * {@inheritdoc} */ - public function matchRequest(Request $request) - { + public function matchRequest(Request $request) { $this->request = $request; $ret = $this->match($request->getPathInfo()); - $this->request = null; + $this->request = NULL; return $ret; } - public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider) - { + public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider) { $this->expressionLanguageProviders[] = $provider; } /** * Tries to match a URL with a set of routes. * - * @param string $pathinfo The path info to be parsed - * @param RouteCollection $routes The set of routes + * @param string $pathinfo The path info to be parsed + * @param RouteCollection $routes The set of routes * * @return array An array of parameters * @@ -116,8 +110,7 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface * @throws ResourceNotFoundException If the resource could not be found * @throws MethodNotAllowedException If the resource was found but the request method is not allowed */ - protected function matchCollection($pathinfo, RouteCollection $routes) - { + protected function matchCollection($pathinfo, RouteCollection $routes) { foreach ($routes as $name => $route) { $compiledRoute = $route->compile(); @@ -168,14 +161,13 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface * in matchers that do not have access to the matched Route instance * (like the PHP and Apache matcher dumpers). * - * @param Route $route The route we are matching against - * @param string $name The name of the route - * @param array $attributes An array of attributes from the matcher + * @param Route $route The route we are matching against + * @param string $name The name of the route + * @param array $attributes An array of attributes from the matcher * * @return array An array of parameters */ - protected function getAttributes(Route $route, $name, array $attributes) - { + protected function getAttributes(Route $route, $name, array $attributes) { $attributes['_route'] = $name; return $this->mergeDefaults($attributes, $route->getDefaults()); @@ -185,35 +177,33 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface * Handles specific route requirements. * * @param string $pathinfo The path - * @param string $name The route name - * @param Route $route The route + * @param string $name The route name + * @param Route $route The route * * @return array The first element represents the status, the second contains additional information */ - protected function handleRouteRequirements($pathinfo, $name, Route $route) - { + protected function handleRouteRequirements($pathinfo, $name, Route $route) { // expression condition if ($route->getCondition() && !$this->getExpressionLanguage()->evaluate($route->getCondition(), array('context' => $this->context, 'request' => $this->request ?: $this->createRequest($pathinfo)))) { - return array(self::REQUIREMENT_MISMATCH, null); + return array(self::REQUIREMENT_MISMATCH, NULL); } // check HTTP scheme requirement $scheme = $this->context->getScheme(); $status = $route->getSchemes() && !$route->hasScheme($scheme) ? self::REQUIREMENT_MISMATCH : self::REQUIREMENT_MATCH; - return array($status, null); + return array($status, NULL); } /** * Get merged default parameters. * - * @param array $params The parameters + * @param array $params The parameters * @param array $defaults The defaults * * @return array Merged default parameters */ - protected function mergeDefaults($params, $defaults) - { + protected function mergeDefaults($params, $defaults) { foreach ($params as $key => $value) { if (!is_int($key)) { $defaults[$key] = $value; @@ -223,13 +213,12 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface return $defaults; } - protected function getExpressionLanguage() - { - if (null === $this->expressionLanguage) { + protected function getExpressionLanguage() { + if (NULL === $this->expressionLanguage) { if (!class_exists('Symfony\Component\ExpressionLanguage\ExpressionLanguage')) { throw new \RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.'); } - $this->expressionLanguage = new ExpressionLanguage(null, $this->expressionLanguageProviders); + $this->expressionLanguage = new ExpressionLanguage(NULL, $this->expressionLanguageProviders); } return $this->expressionLanguage; @@ -238,13 +227,12 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface /** * @internal */ - protected function createRequest($pathinfo) - { + protected function createRequest($pathinfo) { if (!class_exists('Symfony\Component\HttpFoundation\Request')) { - return null; + return NULL; } - return Request::create($this->context->getScheme().'://'.$this->context->getHost().$this->context->getBaseUrl().$pathinfo, $this->context->getMethod(), $this->context->getParameters(), array(), array(), array( + return Request::create($this->context->getScheme() . '://' . $this->context->getHost() . $this->context->getBaseUrl() . $pathinfo, $this->context->getMethod(), $this->context->getParameters(), array(), array(), array( 'SCRIPT_FILENAME' => $this->context->getBaseUrl(), 'SCRIPT_NAME' => $this->context->getBaseUrl(), )); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/RequestContext.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/RequestContext.php index d62a776..b8de551 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/RequestContext.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/RequestContext.php @@ -34,17 +34,16 @@ class RequestContext private $parameters = array(); /** - * @param string $baseUrl The base URL - * @param string $method The HTTP method - * @param string $host The HTTP host name - * @param string $scheme The HTTP scheme - * @param int $httpPort The HTTP port - * @param int $httpsPort The HTTPS port - * @param string $path The path + * @param string $baseUrl The base URL + * @param string $method The HTTP method + * @param string $host The HTTP host name + * @param string $scheme The HTTP scheme + * @param int $httpPort The HTTP port + * @param int $httpsPort The HTTPS port + * @param string $path The path * @param string $queryString The query string */ - public function __construct($baseUrl = '', $method = 'GET', $host = 'localhost', $scheme = 'http', $httpPort = 80, $httpsPort = 443, $path = '/', $queryString = '') - { + public function __construct($baseUrl = '', $method = 'GET', $host = 'localhost', $scheme = 'http', $httpPort = 80, $httpsPort = 443, $path = '/', $queryString = '') { $this->setBaseUrl($baseUrl); $this->setMethod($method); $this->setHost($host); @@ -60,8 +59,7 @@ class RequestContext * * @return $this */ - public function fromRequest(Request $request) - { + public function fromRequest(Request $request) { $this->setBaseUrl($request->getBaseUrl()); $this->setPathInfo($request->getPathInfo()); $this->setMethod($request->getMethod()); @@ -79,8 +77,7 @@ class RequestContext * * @return string The base URL */ - public function getBaseUrl() - { + public function getBaseUrl() { return $this->baseUrl; } @@ -91,8 +88,7 @@ class RequestContext * * @return $this */ - public function setBaseUrl($baseUrl) - { + public function setBaseUrl($baseUrl) { $this->baseUrl = $baseUrl; return $this; @@ -103,8 +99,7 @@ class RequestContext * * @return string The path info */ - public function getPathInfo() - { + public function getPathInfo() { return $this->pathInfo; } @@ -115,8 +110,7 @@ class RequestContext * * @return $this */ - public function setPathInfo($pathInfo) - { + public function setPathInfo($pathInfo) { $this->pathInfo = $pathInfo; return $this; @@ -129,8 +123,7 @@ class RequestContext * * @return string The HTTP method */ - public function getMethod() - { + public function getMethod() { return $this->method; } @@ -141,8 +134,7 @@ class RequestContext * * @return $this */ - public function setMethod($method) - { + public function setMethod($method) { $this->method = strtoupper($method); return $this; @@ -155,8 +147,7 @@ class RequestContext * * @return string The HTTP host */ - public function getHost() - { + public function getHost() { return $this->host; } @@ -167,8 +158,7 @@ class RequestContext * * @return $this */ - public function setHost($host) - { + public function setHost($host) { $this->host = strtolower($host); return $this; @@ -179,8 +169,7 @@ class RequestContext * * @return string The HTTP scheme */ - public function getScheme() - { + public function getScheme() { return $this->scheme; } @@ -191,8 +180,7 @@ class RequestContext * * @return $this */ - public function setScheme($scheme) - { + public function setScheme($scheme) { $this->scheme = strtolower($scheme); return $this; @@ -203,8 +191,7 @@ class RequestContext * * @return int The HTTP port */ - public function getHttpPort() - { + public function getHttpPort() { return $this->httpPort; } @@ -215,9 +202,8 @@ class RequestContext * * @return $this */ - public function setHttpPort($httpPort) - { - $this->httpPort = (int) $httpPort; + public function setHttpPort($httpPort) { + $this->httpPort = (int)$httpPort; return $this; } @@ -227,8 +213,7 @@ class RequestContext * * @return int The HTTPS port */ - public function getHttpsPort() - { + public function getHttpsPort() { return $this->httpsPort; } @@ -239,9 +224,8 @@ class RequestContext * * @return $this */ - public function setHttpsPort($httpsPort) - { - $this->httpsPort = (int) $httpsPort; + public function setHttpsPort($httpsPort) { + $this->httpsPort = (int)$httpsPort; return $this; } @@ -251,8 +235,7 @@ class RequestContext * * @return string The query string without the "?" */ - public function getQueryString() - { + public function getQueryString() { return $this->queryString; } @@ -263,10 +246,9 @@ class RequestContext * * @return $this */ - public function setQueryString($queryString) - { + public function setQueryString($queryString) { // string cast to be fault-tolerant, accepting null - $this->queryString = (string) $queryString; + $this->queryString = (string)$queryString; return $this; } @@ -276,8 +258,7 @@ class RequestContext * * @return array The parameters */ - public function getParameters() - { + public function getParameters() { return $this->parameters; } @@ -288,8 +269,7 @@ class RequestContext * * @return $this */ - public function setParameters(array $parameters) - { + public function setParameters(array $parameters) { $this->parameters = $parameters; return $this; @@ -302,9 +282,8 @@ class RequestContext * * @return mixed The parameter value or null if nonexistent */ - public function getParameter($name) - { - return isset($this->parameters[$name]) ? $this->parameters[$name] : null; + public function getParameter($name) { + return isset($this->parameters[$name]) ? $this->parameters[$name] : NULL; } /** @@ -314,21 +293,19 @@ class RequestContext * * @return bool True if the parameter value is set, false otherwise */ - public function hasParameter($name) - { + public function hasParameter($name) { return array_key_exists($name, $this->parameters); } /** * Sets a parameter value. * - * @param string $name A parameter name - * @param mixed $parameter The parameter value + * @param string $name A parameter name + * @param mixed $parameter The parameter value * * @return $this */ - public function setParameter($name, $parameter) - { + public function setParameter($name, $parameter) { $this->parameters[$name] = $parameter; return $this; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Route.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Route.php index cd50ac8..c99fcf7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Route.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Route.php @@ -41,17 +41,16 @@ class Route implements \Serializable * * compiler_class: A class name able to compile this route instance (RouteCompiler by default) * * utf8: Whether UTF-8 matching is enforced ot not * - * @param string $path The path pattern to match - * @param array $defaults An array of default parameter values - * @param array $requirements An array of requirements for parameters (regexes) - * @param array $options An array of options - * @param string $host The host pattern to match - * @param string|string[] $schemes A required URI scheme or an array of restricted schemes - * @param string|string[] $methods A required HTTP method or an array of restricted methods - * @param string $condition A condition that should evaluate to true for the route to match - */ - public function __construct($path, array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array(), $condition = '') - { + * @param string $path The path pattern to match + * @param array $defaults An array of default parameter values + * @param array $requirements An array of requirements for parameters (regexes) + * @param array $options An array of options + * @param string $host The host pattern to match + * @param string|string[] $schemes A required URI scheme or an array of restricted schemes + * @param string|string[] $methods A required HTTP method or an array of restricted methods + * @param string $condition A condition that should evaluate to true for the route to match + */ + public function __construct($path, array $defaults = array(), array $requirements = array(), array $options = array(), $host = '', $schemes = array(), $methods = array(), $condition = '') { $this->setPath($path); $this->setDefaults($defaults); $this->setRequirements($requirements); @@ -65,8 +64,7 @@ class Route implements \Serializable /** * {@inheritdoc} */ - public function serialize() - { + public function serialize() { return serialize(array( 'path' => $this->path, 'host' => $this->host, @@ -83,8 +81,7 @@ class Route implements \Serializable /** * {@inheritdoc} */ - public function unserialize($serialized) - { + public function unserialize($serialized) { $data = unserialize($serialized); $this->path = $data['path']; $this->host = $data['host']; @@ -107,8 +104,7 @@ class Route implements \Serializable * * @return string The path pattern */ - public function getPath() - { + public function getPath() { return $this->path; } @@ -121,12 +117,11 @@ class Route implements \Serializable * * @return $this */ - public function setPath($pattern) - { + public function setPath($pattern) { // A pattern must start with a slash and must not have multiple slashes at the beginning because the // generated path for this route would be confused with a network path, e.g. '//domain.com/path'. - $this->path = '/'.ltrim(trim($pattern), '/'); - $this->compiled = null; + $this->path = '/' . ltrim(trim($pattern), '/'); + $this->compiled = NULL; return $this; } @@ -136,8 +131,7 @@ class Route implements \Serializable * * @return string The host pattern */ - public function getHost() - { + public function getHost() { return $this->host; } @@ -150,10 +144,9 @@ class Route implements \Serializable * * @return $this */ - public function setHost($pattern) - { - $this->host = (string) $pattern; - $this->compiled = null; + public function setHost($pattern) { + $this->host = (string)$pattern; + $this->compiled = NULL; return $this; } @@ -164,8 +157,7 @@ class Route implements \Serializable * * @return string[] The schemes */ - public function getSchemes() - { + public function getSchemes() { return $this->schemes; } @@ -179,10 +171,9 @@ class Route implements \Serializable * * @return $this */ - public function setSchemes($schemes) - { - $this->schemes = array_map('strtolower', (array) $schemes); - $this->compiled = null; + public function setSchemes($schemes) { + $this->schemes = array_map('strtolower', (array)$schemes); + $this->compiled = NULL; return $this; } @@ -194,9 +185,8 @@ class Route implements \Serializable * * @return bool true if the scheme requirement exists, otherwise false */ - public function hasScheme($scheme) - { - return in_array(strtolower($scheme), $this->schemes, true); + public function hasScheme($scheme) { + return in_array(strtolower($scheme), $this->schemes, TRUE); } /** @@ -205,8 +195,7 @@ class Route implements \Serializable * * @return string[] The methods */ - public function getMethods() - { + public function getMethods() { return $this->methods; } @@ -220,10 +209,9 @@ class Route implements \Serializable * * @return $this */ - public function setMethods($methods) - { - $this->methods = array_map('strtoupper', (array) $methods); - $this->compiled = null; + public function setMethods($methods) { + $this->methods = array_map('strtoupper', (array)$methods); + $this->compiled = NULL; return $this; } @@ -233,8 +221,7 @@ class Route implements \Serializable * * @return array The options */ - public function getOptions() - { + public function getOptions() { return $this->options; } @@ -247,8 +234,7 @@ class Route implements \Serializable * * @return $this */ - public function setOptions(array $options) - { + public function setOptions(array $options) { $this->options = array( 'compiler_class' => 'Symfony\\Component\\Routing\\RouteCompiler', ); @@ -265,12 +251,11 @@ class Route implements \Serializable * * @return $this */ - public function addOptions(array $options) - { + public function addOptions(array $options) { foreach ($options as $name => $option) { $this->options[$name] = $option; } - $this->compiled = null; + $this->compiled = NULL; return $this; } @@ -280,15 +265,14 @@ class Route implements \Serializable * * This method implements a fluent interface. * - * @param string $name An option name - * @param mixed $value The option value + * @param string $name An option name + * @param mixed $value The option value * * @return $this */ - public function setOption($name, $value) - { + public function setOption($name, $value) { $this->options[$name] = $value; - $this->compiled = null; + $this->compiled = NULL; return $this; } @@ -300,9 +284,8 @@ class Route implements \Serializable * * @return mixed The option value or null when not given */ - public function getOption($name) - { - return isset($this->options[$name]) ? $this->options[$name] : null; + public function getOption($name) { + return isset($this->options[$name]) ? $this->options[$name] : NULL; } /** @@ -312,8 +295,7 @@ class Route implements \Serializable * * @return bool true if the option is set, false otherwise */ - public function hasOption($name) - { + public function hasOption($name) { return array_key_exists($name, $this->options); } @@ -322,8 +304,7 @@ class Route implements \Serializable * * @return array The defaults */ - public function getDefaults() - { + public function getDefaults() { return $this->defaults; } @@ -336,8 +317,7 @@ class Route implements \Serializable * * @return $this */ - public function setDefaults(array $defaults) - { + public function setDefaults(array $defaults) { $this->defaults = array(); return $this->addDefaults($defaults); @@ -352,12 +332,11 @@ class Route implements \Serializable * * @return $this */ - public function addDefaults(array $defaults) - { + public function addDefaults(array $defaults) { foreach ($defaults as $name => $default) { $this->defaults[$name] = $default; } - $this->compiled = null; + $this->compiled = NULL; return $this; } @@ -369,9 +348,8 @@ class Route implements \Serializable * * @return mixed The default value or null when not given */ - public function getDefault($name) - { - return isset($this->defaults[$name]) ? $this->defaults[$name] : null; + public function getDefault($name) { + return isset($this->defaults[$name]) ? $this->defaults[$name] : NULL; } /** @@ -381,23 +359,21 @@ class Route implements \Serializable * * @return bool true if the default value is set, false otherwise */ - public function hasDefault($name) - { + public function hasDefault($name) { return array_key_exists($name, $this->defaults); } /** * Sets a default value. * - * @param string $name A variable name - * @param mixed $default The default value + * @param string $name A variable name + * @param mixed $default The default value * * @return $this */ - public function setDefault($name, $default) - { + public function setDefault($name, $default) { $this->defaults[$name] = $default; - $this->compiled = null; + $this->compiled = NULL; return $this; } @@ -407,8 +383,7 @@ class Route implements \Serializable * * @return array The requirements */ - public function getRequirements() - { + public function getRequirements() { return $this->requirements; } @@ -421,8 +396,7 @@ class Route implements \Serializable * * @return $this */ - public function setRequirements(array $requirements) - { + public function setRequirements(array $requirements) { $this->requirements = array(); return $this->addRequirements($requirements); @@ -437,12 +411,11 @@ class Route implements \Serializable * * @return $this */ - public function addRequirements(array $requirements) - { + public function addRequirements(array $requirements) { foreach ($requirements as $key => $regex) { $this->requirements[$key] = $this->sanitizeRequirement($key, $regex); } - $this->compiled = null; + $this->compiled = NULL; return $this; } @@ -454,9 +427,8 @@ class Route implements \Serializable * * @return string|null The regex or null when not given */ - public function getRequirement($key) - { - return isset($this->requirements[$key]) ? $this->requirements[$key] : null; + public function getRequirement($key) { + return isset($this->requirements[$key]) ? $this->requirements[$key] : NULL; } /** @@ -466,23 +438,21 @@ class Route implements \Serializable * * @return bool true if a requirement is specified, false otherwise */ - public function hasRequirement($key) - { + public function hasRequirement($key) { return array_key_exists($key, $this->requirements); } /** * Sets a requirement for the given key. * - * @param string $key The key + * @param string $key The key * @param string $regex The regex * * @return $this */ - public function setRequirement($key, $regex) - { + public function setRequirement($key, $regex) { $this->requirements[$key] = $this->sanitizeRequirement($key, $regex); - $this->compiled = null; + $this->compiled = NULL; return $this; } @@ -492,8 +462,7 @@ class Route implements \Serializable * * @return string The condition */ - public function getCondition() - { + public function getCondition() { return $this->condition; } @@ -506,10 +475,9 @@ class Route implements \Serializable * * @return $this */ - public function setCondition($condition) - { - $this->condition = (string) $condition; - $this->compiled = null; + public function setCondition($condition) { + $this->condition = (string)$condition; + $this->compiled = NULL; return $this; } @@ -524,9 +492,8 @@ class Route implements \Serializable * * @see RouteCompiler which is responsible for the compilation process */ - public function compile() - { - if (null !== $this->compiled) { + public function compile() { + if (NULL !== $this->compiled) { return $this->compiled; } @@ -535,14 +502,13 @@ class Route implements \Serializable return $this->compiled = $class::compile($this); } - private function sanitizeRequirement($key, $regex) - { + private function sanitizeRequirement($key, $regex) { if (!is_string($regex)) { throw new \InvalidArgumentException(sprintf('Routing requirement for "%s" must be a string.', $key)); } if ('' !== $regex && '^' === $regex[0]) { - $regex = (string) substr($regex, 1); // returns false for a single character + $regex = (string)substr($regex, 1); // returns false for a single character } if ('$' === substr($regex, -1)) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/RouteCollection.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/RouteCollection.php index e22cbc5..009793a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/RouteCollection.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/RouteCollection.php @@ -35,8 +35,7 @@ class RouteCollection implements \IteratorAggregate, \Countable */ private $resources = array(); - public function __clone() - { + public function __clone() { foreach ($this->routes as $name => $route) { $this->routes[$name] = clone $route; } @@ -51,8 +50,7 @@ class RouteCollection implements \IteratorAggregate, \Countable * * @return \ArrayIterator|Route[] An \ArrayIterator object for iterating over routes */ - public function getIterator() - { + public function getIterator() { return new \ArrayIterator($this->routes); } @@ -61,19 +59,17 @@ class RouteCollection implements \IteratorAggregate, \Countable * * @return int The number of routes */ - public function count() - { + public function count() { return count($this->routes); } /** * Adds a route. * - * @param string $name The route name - * @param Route $route A Route instance + * @param string $name The route name + * @param Route $route A Route instance */ - public function add($name, Route $route) - { + public function add($name, Route $route) { unset($this->routes[$name]); $this->routes[$name] = $route; @@ -84,8 +80,7 @@ class RouteCollection implements \IteratorAggregate, \Countable * * @return Route[] An array of routes */ - public function all() - { + public function all() { return $this->routes; } @@ -96,9 +91,8 @@ class RouteCollection implements \IteratorAggregate, \Countable * * @return Route|null A Route instance or null when not found */ - public function get($name) - { - return isset($this->routes[$name]) ? $this->routes[$name] : null; + public function get($name) { + return isset($this->routes[$name]) ? $this->routes[$name] : NULL; } /** @@ -106,9 +100,8 @@ class RouteCollection implements \IteratorAggregate, \Countable * * @param string|string[] $name The route name or an array of route names */ - public function remove($name) - { - foreach ((array) $name as $n) { + public function remove($name) { + foreach ((array)$name as $n) { unset($this->routes[$n]); } } @@ -117,8 +110,7 @@ class RouteCollection implements \IteratorAggregate, \Countable * Adds a route collection at the end of the current set by appending all * routes of the added collection. */ - public function addCollection(self $collection) - { + public function addCollection(self $collection) { // we need to remove all routes with the same names first because just replacing them // would not place the new route at the end of the merged array foreach ($collection->all() as $name => $route) { @@ -134,12 +126,11 @@ class RouteCollection implements \IteratorAggregate, \Countable /** * Adds a prefix to the path of all child routes. * - * @param string $prefix An optional prefix to add before each pattern of the route collection - * @param array $defaults An array of default values - * @param array $requirements An array of requirements + * @param string $prefix An optional prefix to add before each pattern of the route collection + * @param array $defaults An array of default values + * @param array $requirements An array of requirements */ - public function addPrefix($prefix, array $defaults = array(), array $requirements = array()) - { + public function addPrefix($prefix, array $defaults = array(), array $requirements = array()) { $prefix = trim(trim($prefix), '/'); if ('' === $prefix) { @@ -147,7 +138,7 @@ class RouteCollection implements \IteratorAggregate, \Countable } foreach ($this->routes as $route) { - $route->setPath('/'.$prefix.$route->getPath()); + $route->setPath('/' . $prefix . $route->getPath()); $route->addDefaults($defaults); $route->addRequirements($requirements); } @@ -156,12 +147,11 @@ class RouteCollection implements \IteratorAggregate, \Countable /** * Sets the host pattern on all routes. * - * @param string $pattern The pattern - * @param array $defaults An array of default values - * @param array $requirements An array of requirements + * @param string $pattern The pattern + * @param array $defaults An array of default values + * @param array $requirements An array of requirements */ - public function setHost($pattern, array $defaults = array(), array $requirements = array()) - { + public function setHost($pattern, array $defaults = array(), array $requirements = array()) { foreach ($this->routes as $route) { $route->setHost($pattern); $route->addDefaults($defaults); @@ -176,8 +166,7 @@ class RouteCollection implements \IteratorAggregate, \Countable * * @param string $condition The condition */ - public function setCondition($condition) - { + public function setCondition($condition) { foreach ($this->routes as $route) { $route->setCondition($condition); } @@ -190,8 +179,7 @@ class RouteCollection implements \IteratorAggregate, \Countable * * @param array $defaults An array of default values */ - public function addDefaults(array $defaults) - { + public function addDefaults(array $defaults) { if ($defaults) { foreach ($this->routes as $route) { $route->addDefaults($defaults); @@ -206,8 +194,7 @@ class RouteCollection implements \IteratorAggregate, \Countable * * @param array $requirements An array of requirements */ - public function addRequirements(array $requirements) - { + public function addRequirements(array $requirements) { if ($requirements) { foreach ($this->routes as $route) { $route->addRequirements($requirements); @@ -222,8 +209,7 @@ class RouteCollection implements \IteratorAggregate, \Countable * * @param array $options An array of options */ - public function addOptions(array $options) - { + public function addOptions(array $options) { if ($options) { foreach ($this->routes as $route) { $route->addOptions($options); @@ -236,8 +222,7 @@ class RouteCollection implements \IteratorAggregate, \Countable * * @param string|string[] $schemes The scheme or an array of schemes */ - public function setSchemes($schemes) - { + public function setSchemes($schemes) { foreach ($this->routes as $route) { $route->setSchemes($schemes); } @@ -248,8 +233,7 @@ class RouteCollection implements \IteratorAggregate, \Countable * * @param string|string[] $methods The method or an array of methods */ - public function setMethods($methods) - { + public function setMethods($methods) { foreach ($this->routes as $route) { $route->setMethods($methods); } @@ -260,8 +244,7 @@ class RouteCollection implements \IteratorAggregate, \Countable * * @return ResourceInterface[] An array of resources */ - public function getResources() - { + public function getResources() { return array_values($this->resources); } @@ -269,9 +252,8 @@ class RouteCollection implements \IteratorAggregate, \Countable * Adds a resource for this collection. If the resource already exists * it is not added. */ - public function addResource(ResourceInterface $resource) - { - $key = (string) $resource; + public function addResource(ResourceInterface $resource) { + $key = (string)$resource; if (!isset($this->resources[$key])) { $this->resources[$key] = $resource; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/RouteCollectionBuilder.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/RouteCollectionBuilder.php index e8a9a16..e469e90 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/RouteCollectionBuilder.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/RouteCollectionBuilder.php @@ -38,8 +38,7 @@ class RouteCollectionBuilder private $methods; private $resources = array(); - public function __construct(LoaderInterface $loader = null) - { + public function __construct(LoaderInterface $loader = NULL) { $this->loader = $loader; } @@ -48,16 +47,15 @@ class RouteCollectionBuilder * * $routes->import('blog.yml', '/blog'); * - * @param mixed $resource + * @param mixed $resource * @param string|null $prefix - * @param string $type + * @param string $type * * @return self * * @throws FileLoaderLoadException */ - public function import($resource, $prefix = '/', $type = null) - { + public function import($resource, $prefix = '/', $type = NULL) { /** @var RouteCollection[] $collection */ $collections = $this->load($resource, $type); @@ -65,7 +63,7 @@ class RouteCollectionBuilder $builder = $this->createBuilder(); foreach ($collections as $collection) { - if (null === $collection) { + if (NULL === $collection) { continue; } @@ -87,14 +85,13 @@ class RouteCollectionBuilder /** * Adds a route and returns it for future modification. * - * @param string $path The route path - * @param string $controller The route's controller - * @param string|null $name The name to give this route + * @param string $path The route path + * @param string $controller The route's controller + * @param string|null $name The name to give this route * * @return Route */ - public function add($path, $controller, $name = null) - { + public function add($path, $controller, $name = NULL) { $route = new Route($path); $route->setDefault('_controller', $controller); $this->addRoute($route, $name); @@ -107,19 +104,17 @@ class RouteCollectionBuilder * * @return self */ - public function createBuilder() - { + public function createBuilder() { return new self($this->loader); } /** * Add a RouteCollectionBuilder. * - * @param string $prefix + * @param string $prefix * @param RouteCollectionBuilder $builder */ - public function mount($prefix, RouteCollectionBuilder $builder) - { + public function mount($prefix, RouteCollectionBuilder $builder) { $builder->prefix = trim(trim($prefix), '/'); $this->routes[] = $builder; } @@ -127,16 +122,15 @@ class RouteCollectionBuilder /** * Adds a Route object to the builder. * - * @param Route $route + * @param Route $route * @param string|null $name * * @return $this */ - public function addRoute(Route $route, $name = null) - { - if (null === $name) { + public function addRoute(Route $route, $name = NULL) { + if (NULL === $name) { // used as a flag to know which routes will need a name later - $name = '_unnamed_route_'.spl_object_hash($route); + $name = '_unnamed_route_' . spl_object_hash($route); } $this->routes[$name] = $route; @@ -151,8 +145,7 @@ class RouteCollectionBuilder * * @return $this */ - public function setHost($pattern) - { + public function setHost($pattern) { $this->host = $pattern; return $this; @@ -165,8 +158,7 @@ class RouteCollectionBuilder * * @return $this */ - public function setCondition($condition) - { + public function setCondition($condition) { $this->condition = $condition; return $this; @@ -177,12 +169,11 @@ class RouteCollectionBuilder * default value is already set). * * @param string $key - * @param mixed $value + * @param mixed $value * * @return $this */ - public function setDefault($key, $value) - { + public function setDefault($key, $value) { $this->defaults[$key] = $value; return $this; @@ -193,12 +184,11 @@ class RouteCollectionBuilder * requirement is already set). * * @param string $key - * @param mixed $regex + * @param mixed $regex * * @return $this */ - public function setRequirement($key, $regex) - { + public function setRequirement($key, $regex) { $this->requirements[$key] = $regex; return $this; @@ -209,12 +199,11 @@ class RouteCollectionBuilder * option is already set). * * @param string $key - * @param mixed $value + * @param mixed $value * * @return $this */ - public function setOption($key, $value) - { + public function setOption($key, $value) { $this->options[$key] = $value; return $this; @@ -227,8 +216,7 @@ class RouteCollectionBuilder * * @return $this */ - public function setSchemes($schemes) - { + public function setSchemes($schemes) { $this->schemes = $schemes; return $this; @@ -241,8 +229,7 @@ class RouteCollectionBuilder * * @return $this */ - public function setMethods($methods) - { + public function setMethods($methods) { $this->methods = $methods; return $this; @@ -255,8 +242,7 @@ class RouteCollectionBuilder * * @return $this */ - private function addResource(ResourceInterface $resource) - { + private function addResource(ResourceInterface $resource) { $this->resources[] = $resource; return $this; @@ -267,8 +253,7 @@ class RouteCollectionBuilder * * @return RouteCollection */ - public function build() - { + public function build() { $routeCollection = new RouteCollection(); foreach ($this->routes as $name => $route) { @@ -282,8 +267,8 @@ class RouteCollectionBuilder } } - if (null !== $this->prefix) { - $route->setPath('/'.$this->prefix.$route->getPath()); + if (NULL !== $this->prefix) { + $route->setPath('/' . $this->prefix . $route->getPath()); } if (!$route->getHost()) { @@ -329,11 +314,10 @@ class RouteCollectionBuilder * * @return string */ - private function generateRouteName(Route $route) - { - $methods = implode('_', $route->getMethods()).'_'; + private function generateRouteName(Route $route) { + $methods = implode('_', $route->getMethods()) . '_'; - $routeName = $methods.$route->getPath(); + $routeName = $methods . $route->getPath(); $routeName = str_replace(array('/', ':', '|', '-'), '_', $routeName); $routeName = preg_replace('/[^a-z0-9A-Z_.]+/', '', $routeName); @@ -346,16 +330,15 @@ class RouteCollectionBuilder /** * Finds a loader able to load an imported resource and loads it. * - * @param mixed $resource A resource - * @param string|null $type The resource type or null if unknown + * @param mixed $resource A resource + * @param string|null $type The resource type or null if unknown * * @return RouteCollection[] * * @throws FileLoaderLoadException If no loader is found */ - private function load($resource, $type = null) - { - if (null === $this->loader) { + private function load($resource, $type = NULL) { + if (NULL === $this->loader) { throw new \BadMethodCallException('Cannot import other routing resources: you must pass a LoaderInterface when constructing RouteCollectionBuilder.'); } @@ -365,12 +348,12 @@ class RouteCollectionBuilder return is_array($collections) ? $collections : array($collections); } - if (null === $resolver = $this->loader->getResolver()) { - throw new FileLoaderLoadException($resource, null, null, null, $type); + if (NULL === $resolver = $this->loader->getResolver()) { + throw new FileLoaderLoadException($resource, NULL, NULL, NULL, $type); } - if (false === $loader = $resolver->resolve($resource, $type)) { - throw new FileLoaderLoadException($resource, null, null, null, $type); + if (FALSE === $loader = $resolver->resolve($resource, $type)) { + throw new FileLoaderLoadException($resource, NULL, NULL, NULL, $type); } $collections = $loader->load($resource, $type); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/RouteCompiler.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/RouteCompiler.php index dc4e4f8..b41157f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/RouteCompiler.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/RouteCompiler.php @@ -44,15 +44,14 @@ class RouteCompiler implements RouteCompilerInterface * @throws \DomainException if a variable name starts with a digit or if it is too long to be successfully used as * a PCRE subpattern */ - public static function compile(Route $route) - { + public static function compile(Route $route) { $hostVariables = array(); $variables = array(); - $hostRegex = null; + $hostRegex = NULL; $hostTokens = array(); if ('' !== $host = $route->getHost()) { - $result = self::compilePattern($route, $host, true); + $result = self::compilePattern($route, $host, TRUE); $hostVariables = $result['variables']; $variables = $hostVariables; @@ -63,7 +62,7 @@ class RouteCompiler implements RouteCompilerInterface $path = $route->getPath(); - $result = self::compilePattern($route, $path, false); + $result = self::compilePattern($route, $path, FALSE); $staticPrefix = $result['staticPrefix']; @@ -92,8 +91,7 @@ class RouteCompiler implements RouteCompilerInterface ); } - private static function compilePattern(Route $route, $pattern, $isHost) - { + private static function compilePattern(Route $route, $pattern, $isHost) { $tokens = array(); $variables = array(); $matches = array(); @@ -103,7 +101,7 @@ class RouteCompiler implements RouteCompilerInterface $needsUtf8 = $route->getOption('utf8'); if (!$needsUtf8 && $useUtf8 && preg_match('/[\x80-\xFF]/', $pattern)) { - $needsUtf8 = true; + $needsUtf8 = TRUE; @trigger_error(sprintf('Using UTF-8 route patterns without setting the "utf8" option is deprecated since Symfony 3.2 and will throw a LogicException in 4.0. Turn on the "utf8" route option for pattern "%s".', $pattern), E_USER_DEPRECATED); } if (!$useUtf8 && $needsUtf8) { @@ -121,13 +119,13 @@ class RouteCompiler implements RouteCompilerInterface if (!strlen($precedingText)) { $precedingChar = ''; - } elseif ($useUtf8) { + } else if ($useUtf8) { preg_match('/.$/u', $precedingText, $precedingChar); $precedingChar = $precedingChar[0]; } else { $precedingChar = substr($precedingText, -1); } - $isSeparator = '' !== $precedingChar && false !== strpos(static::SEPARATORS, $precedingChar); + $isSeparator = '' !== $precedingChar && FALSE !== strpos(static::SEPARATORS, $precedingChar); // A PCRE subpattern name must start with a non-digit. Also a PHP variable cannot start with a digit so the // variable would not be usable as a Controller action argument. @@ -144,13 +142,13 @@ class RouteCompiler implements RouteCompilerInterface if ($isSeparator && $precedingText !== $precedingChar) { $tokens[] = array('text', substr($precedingText, 0, -strlen($precedingChar))); - } elseif (!$isSeparator && strlen($precedingText) > 0) { + } else if (!$isSeparator && strlen($precedingText) > 0) { $tokens[] = array('text', $precedingText); } $regexp = $route->getRequirement($varName); - if (null === $regexp) { - $followingPattern = (string) substr($pattern, $pos); + if (NULL === $regexp) { + $followingPattern = (string)substr($pattern, $pos); // Find the next static character after the variable that functions as a separator. By default, this separator and '/' // are disallowed for the variable. This default requirement makes sure that optional variables can be matched at all // and that the generating-matching-combination of URLs unambiguous, i.e. the params used for generating the URL are @@ -174,9 +172,9 @@ class RouteCompiler implements RouteCompilerInterface } } else { if (!preg_match('//u', $regexp)) { - $useUtf8 = false; - } elseif (!$needsUtf8 && preg_match('/[\x80-\xFF]|(?hasDefault($tokens[0][3]) || '/' === $tokens[0][1]) ? '' : $tokens[0][1]; } $prefix = $tokens[0][1]; - if (isset($tokens[1][1]) && '/' !== $tokens[1][1] && false === $route->hasDefault($tokens[1][3])) { + if (isset($tokens[1][1]) && '/' !== $tokens[1][1] && FALSE === $route->hasDefault($tokens[1][3])) { $prefix .= $tokens[1][1]; } @@ -254,12 +251,11 @@ class RouteCompiler implements RouteCompilerInterface * Returns the next static character in the Route pattern that will serve as a separator. * * @param string $pattern The route pattern - * @param bool $useUtf8 Whether the character is encoded in UTF-8 or not + * @param bool $useUtf8 Whether the character is encoded in UTF-8 or not * * @return string The next static character that functions as separator (or empty string when none available) */ - private static function findNextSeparator($pattern, $useUtf8) - { + private static function findNextSeparator($pattern, $useUtf8) { if ('' == $pattern) { // return empty string if pattern is empty or false (false which can be returned by substr) return ''; @@ -272,20 +268,19 @@ class RouteCompiler implements RouteCompilerInterface preg_match('/^./u', $pattern, $pattern); } - return false !== strpos(static::SEPARATORS, $pattern[0]) ? $pattern[0] : ''; + return FALSE !== strpos(static::SEPARATORS, $pattern[0]) ? $pattern[0] : ''; } /** * Computes the regexp used to match a specific token. It can be static text or a subpattern. * - * @param array $tokens The route tokens - * @param int $index The index of the current token - * @param int $firstOptional The index of the first optional token + * @param array $tokens The route tokens + * @param int $index The index of the current token + * @param int $firstOptional The index of the first optional token * * @return string The regexp pattern for a single token */ - private static function computeRegexp(array $tokens, $index, $firstOptional) - { + private static function computeRegexp(array $tokens, $index, $firstOptional) { $token = $tokens[$index]; if ('text' === $token[0]) { // Text tokens diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Router.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Router.php index ed56332..14345e4 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Router.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Router.php @@ -84,14 +84,13 @@ class Router implements RouterInterface, RequestMatcherInterface private $expressionLanguageProviders = array(); /** - * @param LoaderInterface $loader A LoaderInterface instance - * @param mixed $resource The main resource to load - * @param array $options An array of options - * @param RequestContext $context The context - * @param LoggerInterface $logger A logger instance + * @param LoaderInterface $loader A LoaderInterface instance + * @param mixed $resource The main resource to load + * @param array $options An array of options + * @param RequestContext $context The context + * @param LoggerInterface $logger A logger instance */ - public function __construct(LoaderInterface $loader, $resource, array $options = array(), RequestContext $context = null, LoggerInterface $logger = null) - { + public function __construct(LoaderInterface $loader, $resource, array $options = array(), RequestContext $context = NULL, LoggerInterface $logger = NULL) { $this->loader = $loader; $this->resource = $resource; $this->logger = $logger; @@ -122,11 +121,10 @@ class Router implements RouterInterface, RequestMatcherInterface * * @throws \InvalidArgumentException When unsupported option is provided */ - public function setOptions(array $options) - { + public function setOptions(array $options) { $this->options = array( - 'cache_dir' => null, - 'debug' => false, + 'cache_dir' => NULL, + 'debug' => FALSE, 'generator_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', 'generator_base_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator', 'generator_dumper_class' => 'Symfony\\Component\\Routing\\Generator\\Dumper\\PhpGeneratorDumper', @@ -135,8 +133,8 @@ class Router implements RouterInterface, RequestMatcherInterface 'matcher_base_class' => 'Symfony\\Component\\Routing\\Matcher\\UrlMatcher', 'matcher_dumper_class' => 'Symfony\\Component\\Routing\\Matcher\\Dumper\\PhpMatcherDumper', 'matcher_cache_class' => 'ProjectUrlMatcher', - 'resource_type' => null, - 'strict_requirements' => true, + 'resource_type' => NULL, + 'strict_requirements' => TRUE, ); // check option names and live merge, if errors are encountered Exception will be thrown @@ -157,13 +155,12 @@ class Router implements RouterInterface, RequestMatcherInterface /** * Sets an option. * - * @param string $key The key - * @param mixed $value The value + * @param string $key The key + * @param mixed $value The value * * @throws \InvalidArgumentException */ - public function setOption($key, $value) - { + public function setOption($key, $value) { if (!array_key_exists($key, $this->options)) { throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key)); } @@ -180,8 +177,7 @@ class Router implements RouterInterface, RequestMatcherInterface * * @throws \InvalidArgumentException */ - public function getOption($key) - { + public function getOption($key) { if (!array_key_exists($key, $this->options)) { throw new \InvalidArgumentException(sprintf('The Router does not support the "%s" option.', $key)); } @@ -192,9 +188,8 @@ class Router implements RouterInterface, RequestMatcherInterface /** * {@inheritdoc} */ - public function getRouteCollection() - { - if (null === $this->collection) { + public function getRouteCollection() { + if (NULL === $this->collection) { $this->collection = $this->loader->load($this->resource, $this->options['resource_type']); } @@ -204,14 +199,13 @@ class Router implements RouterInterface, RequestMatcherInterface /** * {@inheritdoc} */ - public function setContext(RequestContext $context) - { + public function setContext(RequestContext $context) { $this->context = $context; - if (null !== $this->matcher) { + if (NULL !== $this->matcher) { $this->getMatcher()->setContext($context); } - if (null !== $this->generator) { + if (NULL !== $this->generator) { $this->getGenerator()->setContext($context); } } @@ -219,40 +213,35 @@ class Router implements RouterInterface, RequestMatcherInterface /** * {@inheritdoc} */ - public function getContext() - { + public function getContext() { return $this->context; } /** * Sets the ConfigCache factory to use. */ - public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory) - { + public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory) { $this->configCacheFactory = $configCacheFactory; } /** * {@inheritdoc} */ - public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH) - { + public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH) { return $this->getGenerator()->generate($name, $parameters, $referenceType); } /** * {@inheritdoc} */ - public function match($pathinfo) - { + public function match($pathinfo) { return $this->getMatcher()->match($pathinfo); } /** * {@inheritdoc} */ - public function matchRequest(Request $request) - { + public function matchRequest(Request $request) { $matcher = $this->getMatcher(); if (!$matcher instanceof RequestMatcherInterface) { // fallback to the default UrlMatcherInterface @@ -267,13 +256,12 @@ class Router implements RouterInterface, RequestMatcherInterface * * @return UrlMatcherInterface A UrlMatcherInterface instance */ - public function getMatcher() - { - if (null !== $this->matcher) { + public function getMatcher() { + if (NULL !== $this->matcher) { return $this->matcher; } - if (null === $this->options['cache_dir'] || null === $this->options['matcher_cache_class']) { + if (NULL === $this->options['cache_dir'] || NULL === $this->options['matcher_cache_class']) { $this->matcher = new $this->options['matcher_class']($this->getRouteCollection(), $this->context); if (method_exists($this->matcher, 'addExpressionLanguageProvider')) { foreach ($this->expressionLanguageProviders as $provider) { @@ -284,7 +272,7 @@ class Router implements RouterInterface, RequestMatcherInterface return $this->matcher; } - $cache = $this->getConfigCacheFactory()->cache($this->options['cache_dir'].'/'.$this->options['matcher_cache_class'].'.php', + $cache = $this->getConfigCacheFactory()->cache($this->options['cache_dir'] . '/' . $this->options['matcher_cache_class'] . '.php', function (ConfigCacheInterface $cache) { $dumper = $this->getMatcherDumperInstance(); if (method_exists($dumper, 'addExpressionLanguageProvider')) { @@ -302,7 +290,7 @@ class Router implements RouterInterface, RequestMatcherInterface } ); - if (!class_exists($this->options['matcher_cache_class'], false)) { + if (!class_exists($this->options['matcher_cache_class'], FALSE)) { require_once $cache->getPath(); } @@ -314,16 +302,15 @@ class Router implements RouterInterface, RequestMatcherInterface * * @return UrlGeneratorInterface A UrlGeneratorInterface instance */ - public function getGenerator() - { - if (null !== $this->generator) { + public function getGenerator() { + if (NULL !== $this->generator) { return $this->generator; } - if (null === $this->options['cache_dir'] || null === $this->options['generator_cache_class']) { + if (NULL === $this->options['cache_dir'] || NULL === $this->options['generator_cache_class']) { $this->generator = new $this->options['generator_class']($this->getRouteCollection(), $this->context, $this->logger); } else { - $cache = $this->getConfigCacheFactory()->cache($this->options['cache_dir'].'/'.$this->options['generator_cache_class'].'.php', + $cache = $this->getConfigCacheFactory()->cache($this->options['cache_dir'] . '/' . $this->options['generator_cache_class'] . '.php', function (ConfigCacheInterface $cache) { $dumper = $this->getGeneratorDumperInstance(); @@ -336,7 +323,7 @@ class Router implements RouterInterface, RequestMatcherInterface } ); - if (!class_exists($this->options['generator_cache_class'], false)) { + if (!class_exists($this->options['generator_cache_class'], FALSE)) { require_once $cache->getPath(); } @@ -350,24 +337,21 @@ class Router implements RouterInterface, RequestMatcherInterface return $this->generator; } - public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider) - { + public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider) { $this->expressionLanguageProviders[] = $provider; } /** * @return GeneratorDumperInterface */ - protected function getGeneratorDumperInstance() - { + protected function getGeneratorDumperInstance() { return new $this->options['generator_dumper_class']($this->getRouteCollection()); } /** * @return MatcherDumperInterface */ - protected function getMatcherDumperInstance() - { + protected function getMatcherDumperInstance() { return new $this->options['matcher_dumper_class']($this->getRouteCollection()); } @@ -377,9 +361,8 @@ class Router implements RouterInterface, RequestMatcherInterface * * @return ConfigCacheFactoryInterface $configCacheFactory */ - private function getConfigCacheFactory() - { - if (null === $this->configCacheFactory) { + private function getConfigCacheFactory() { + if (NULL === $this->configCacheFactory) { $this->configCacheFactory = new ConfigCacheFactory($this->options['debug']); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Annotation/RouteTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Annotation/RouteTest.php index 9af22f2..7cca854 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Annotation/RouteTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Annotation/RouteTest.php @@ -19,22 +19,19 @@ class RouteTest extends TestCase /** * @expectedException \BadMethodCallException */ - public function testInvalidRouteParameter() - { + public function testInvalidRouteParameter() { $route = new Route(array('foo' => 'bar')); } /** * @dataProvider getValidParameters */ - public function testRouteParameters($parameter, $value, $getter) - { + public function testRouteParameters($parameter, $value, $getter) { $route = new Route(array($parameter => $value)); $this->assertEquals($route->$getter(), $value); } - public function getValidParameters() - { + public function getValidParameters() { return array( array('value', '/Blog', 'getPath'), array('requirements', array('locale' => 'en'), 'getRequirements'), diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/CompiledRouteTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/CompiledRouteTest.php index 5bec7bb..beefda8 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/CompiledRouteTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/CompiledRouteTest.php @@ -16,9 +16,8 @@ use Symfony\Component\Routing\CompiledRoute; class CompiledRouteTest extends TestCase { - public function testAccessors() - { - $compiled = new CompiledRoute('prefix', 'regex', array('tokens'), array(), null, array(), array(), array('variables')); + public function testAccessors() { + $compiled = new CompiledRoute('prefix', 'regex', array('tokens'), array(), NULL, array(), array(), array('variables')); $this->assertEquals('prefix', $compiled->getStaticPrefix(), '__construct() takes a static prefix as its second argument'); $this->assertEquals('regex', $compiled->getRegex(), '__construct() takes a regexp as its third argument'); $this->assertEquals(array('tokens'), $compiled->getTokens(), '__construct() takes an array of tokens as its fourth argument'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/DependencyInjection/RoutingResolverPassTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/DependencyInjection/RoutingResolverPassTest.php index 97a34c9..fd45ef8 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/DependencyInjection/RoutingResolverPassTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/DependencyInjection/RoutingResolverPassTest.php @@ -19,8 +19,7 @@ use Symfony\Component\Routing\DependencyInjection\RoutingResolverPass; class RoutingResolverPassTest extends TestCase { - public function testProcess() - { + public function testProcess() { $container = new ContainerBuilder(); $container->register('routing.resolver', LoaderResolver::class); $container->register('loader1')->addTag('routing.loader'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/BarClass.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/BarClass.php index a388277..083f824 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/BarClass.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/BarClass.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses; class BarClass { - public function routeAction($arg1, $arg2 = 'defaultValue2', $arg3 = 'defaultValue3') - { + public function routeAction($arg1, $arg2 = 'defaultValue2', $arg3 = 'defaultValue3') { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/BazClass.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/BazClass.php index 471968b..d38f605 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/BazClass.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/BazClass.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses; class BazClass { - public function __invoke() - { + public function __invoke() { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/FooTrait.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/FooTrait.php index ee8f4b0..a65ed5d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/FooTrait.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/AnnotatedClasses/FooTrait.php @@ -4,10 +4,9 @@ namespace Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses; trait FooTrait { - public function doBar() - { + public function doBar() { $baz = self::class; - if (true) { + if (TRUE) { } } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/CustomRouteCompiler.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/CustomRouteCompiler.php index c2e2afd..6bd0590 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/CustomRouteCompiler.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/CustomRouteCompiler.php @@ -19,8 +19,7 @@ class CustomRouteCompiler extends RouteCompiler /** * {@inheritdoc} */ - public static function compile(Route $route) - { + public static function compile(Route $route) { return new CustomCompiledRoute('', '', array(), array()); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/CustomXmlFileLoader.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/CustomXmlFileLoader.php index 9fd5754..0fc3d9b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/CustomXmlFileLoader.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/CustomXmlFileLoader.php @@ -19,8 +19,9 @@ use Symfony\Component\Config\Util\XmlUtils; */ class CustomXmlFileLoader extends XmlFileLoader { - protected function loadFile($file) - { - return XmlUtils::loadFile($file, function () { return true; }); + protected function loadFile($file) { + return XmlUtils::loadFile($file, function () { + return TRUE; + }); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/OtherAnnotatedClasses/AnonymousClassInTrait.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/OtherAnnotatedClasses/AnonymousClassInTrait.php index de87895..f69d2e7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/OtherAnnotatedClasses/AnonymousClassInTrait.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/OtherAnnotatedClasses/AnonymousClassInTrait.php @@ -13,11 +13,10 @@ namespace Symfony\Component\Routing\Tests\Fixtures\OtherAnnotatedClasses; trait AnonymousClassInTrait { - public function test() - { - return new class() { - public function foo() - { + public function test() { + return new class() + { + public function foo() { } }; } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/OtherAnnotatedClasses/VariadicClass.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/OtherAnnotatedClasses/VariadicClass.php index 729c9b4..75f2466 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/OtherAnnotatedClasses/VariadicClass.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/OtherAnnotatedClasses/VariadicClass.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Routing\Tests\Fixtures\OtherAnnotatedClasses; class VariadicClass { - public function routeAction(...$params) - { + public function routeAction(...$params) { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/RedirectableUrlMatcher.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/RedirectableUrlMatcher.php index 15937bc..99410a8 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/RedirectableUrlMatcher.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/RedirectableUrlMatcher.php @@ -19,8 +19,7 @@ use Symfony\Component\Routing\Matcher\RedirectableUrlMatcherInterface; */ class RedirectableUrlMatcher extends UrlMatcher implements RedirectableUrlMatcherInterface { - public function redirect($path, $route, $scheme = null) - { + public function redirect($path, $route, $scheme = NULL) { return array( '_controller' => 'Some controller reference...', 'path' => $path, diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/import__controller.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/import__controller.xml index bbe727d..2266680 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/import__controller.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/import__controller.xml @@ -1,7 +1,7 @@ diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/import_controller.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/import_controller.xml index 378b9ca..b5cbad5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/import_controller.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/import_controller.xml @@ -1,8 +1,8 @@ - + diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/import_override_defaults.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/import_override_defaults.xml index e3c755a..9a82d6f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/import_override_defaults.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/import_override_defaults.xml @@ -1,7 +1,7 @@ diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/override_defaults.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/override_defaults.xml index f47c57b..f582954 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/override_defaults.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/override_defaults.xml @@ -1,7 +1,7 @@ diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/routing.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/routing.xml index 6420138..3dbfab8 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/routing.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/controller/routing.xml @@ -1,14 +1,14 @@ - + AppBundle:Blog:list - + diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher0.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher0.php index 9e9b910..edcf3ad 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher0.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher0.php @@ -10,13 +10,11 @@ use Symfony\Component\Routing\RequestContext; */ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher { - public function __construct(RequestContext $context) - { + public function __construct(RequestContext $context) { $this->context = $context; } - public function match($rawPathinfo) - { + public function match($rawPathinfo) { $allow = array(); $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher1.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher1.php index 23a93c1..6464a4e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher1.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher1.php @@ -10,13 +10,11 @@ use Symfony\Component\Routing\RequestContext; */ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher { - public function __construct(RequestContext $context) - { + public function __construct(RequestContext $context) { $this->context = $context; } - public function match($rawPathinfo) - { + public function match($rawPathinfo) { $allow = array(); $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); @@ -31,20 +29,18 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher if (0 === strpos($pathinfo, '/foo')) { // foo if (preg_match('#^/foo/(?Pbaz|symfony)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo')), array ( 'def' => 'test',)); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo')), array('def' => 'test',)); } // foofoo if ('/foofoo' === $pathinfo) { - return array ( 'def' => 'test', '_route' => 'foofoo',); + return array('def' => 'test', '_route' => 'foofoo',); } - } - - elseif (0 === strpos($pathinfo, '/bar')) { + } else if (0 === strpos($pathinfo, '/bar')) { // bar if (preg_match('#^/bar/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array()); if (!in_array($canonicalMethod, array('GET', 'HEAD'))) { $allow = array_merge($allow, array('GET', 'HEAD')); goto not_bar; @@ -56,7 +52,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // barhead if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array()); if (!in_array($canonicalMethod, array('GET'))) { $allow = array_merge($allow, array('GET')); goto not_barhead; @@ -66,9 +62,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher } not_barhead: - } - - elseif (0 === strpos($pathinfo, '/test')) { + } else if (0 === strpos($pathinfo, '/test')) { if (0 === strpos($pathinfo, '/test/baz')) { // baz if ('/test/baz' === $pathinfo) { @@ -89,12 +83,12 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // baz4 if (preg_match('#^/test/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array()); } // baz5 if (preg_match('#^/test/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array()); if (!in_array($requestMethod, array('POST'))) { $allow = array_merge($allow, array('POST')); goto not_baz5; @@ -106,7 +100,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // baz.baz6 if (preg_match('#^/test/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array()); if (!in_array($requestMethod, array('PUT'))) { $allow = array_merge($allow, array('PUT')); goto not_bazbaz6; @@ -120,7 +114,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // quoter if (preg_match('#^/(?P[\']+)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array()); } // space @@ -132,40 +126,38 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher if (0 === strpos($pathinfo, '/a/b\'b')) { // foo1 if (preg_match('#^/a/b\'b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array()); } // bar1 if (preg_match('#^/a/b\'b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array()); } } // overridden if (preg_match('#^/a/(?P.*)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'overridden')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'overridden')), array()); } if (0 === strpos($pathinfo, '/a/b\'b')) { // foo2 if (preg_match('#^/a/b\'b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array()); } // bar2 if (preg_match('#^/a/b\'b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array()); } } - } - - elseif (0 === strpos($pathinfo, '/multi')) { + } else if (0 === strpos($pathinfo, '/multi')) { // helloWorld if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?P[^/]++))?$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'helloWorld')), array ( 'who' => 'World!',)); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'helloWorld')), array('who' => 'World!',)); } // hey @@ -182,12 +174,12 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // foo3 if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array()); } // bar3 if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar3')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar3')), array()); } if (0 === strpos($pathinfo, '/aba')) { @@ -198,7 +190,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // foo4 if (preg_match('#^/aba/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array()); } } @@ -251,22 +243,22 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher if (0 === strpos($pathinfo, '/route1')) { // route11 if ('/route11' === $pathinfo) { - return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array ()); + return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array()); } // route12 if ('/route12' === $pathinfo) { - return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array ( 'var1' => 'val',)); + return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array('var1' => 'val',)); } // route13 if (0 === strpos($pathinfo, '/route13') && preg_match('#^/route13/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route13')), array ()); + return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route13')), array()); } // route14 if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array ( 'var1' => 'val',)); + return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array('var1' => 'val',)); } } @@ -276,14 +268,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher if (preg_match('#^c\\.example\\.com$#sDi', $host, $hostMatches)) { // route15 if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array()); } } // route16 if (0 === strpos($pathinfo, '/route16') && preg_match('#^/route16/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'route16')), array ( 'var1' => 'val',)); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'route16')), array('var1' => 'val',)); } // route17 @@ -299,12 +291,12 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher if (0 === strpos($pathinfo, '/a/b')) { // b if (preg_match('#^/a/b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array()); } // c if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array()); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher2.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher2.php index e430adb..41e089c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher2.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher2.php @@ -10,13 +10,11 @@ use Symfony\Component\Routing\RequestContext; */ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\RedirectableUrlMatcher { - public function __construct(RequestContext $context) - { + public function __construct(RequestContext $context) { $this->context = $context; } - public function match($rawPathinfo) - { + public function match($rawPathinfo) { $allow = array(); $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); @@ -31,20 +29,18 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec if (0 === strpos($pathinfo, '/foo')) { // foo if (preg_match('#^/foo/(?Pbaz|symfony)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo')), array ( 'def' => 'test',)); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo')), array('def' => 'test',)); } // foofoo if ('/foofoo' === $pathinfo) { - return array ( 'def' => 'test', '_route' => 'foofoo',); + return array('def' => 'test', '_route' => 'foofoo',); } - } - - elseif (0 === strpos($pathinfo, '/bar')) { + } else if (0 === strpos($pathinfo, '/bar')) { // bar if (preg_match('#^/bar/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array()); if (!in_array($canonicalMethod, array('GET', 'HEAD'))) { $allow = array_merge($allow, array('GET', 'HEAD')); goto not_bar; @@ -56,7 +52,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // barhead if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array()); if (!in_array($canonicalMethod, array('GET'))) { $allow = array_merge($allow, array('GET')); goto not_barhead; @@ -66,9 +62,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec } not_barhead: - } - - elseif (0 === strpos($pathinfo, '/test')) { + } else if (0 === strpos($pathinfo, '/test')) { if (0 === strpos($pathinfo, '/test/baz')) { // baz if ('/test/baz' === $pathinfo) { @@ -85,10 +79,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $ret = array('_route' => 'baz3'); if ('/' === substr($pathinfo, -1)) { // no-op - } elseif ('GET' !== $canonicalMethod) { + } else if ('GET' !== $canonicalMethod) { goto not_baz3; } else { - return array_replace($ret, $this->redirect($rawPathinfo.'/', 'baz3')); + return array_replace($ret, $this->redirect($rawPathinfo . '/', 'baz3')); } return $ret; @@ -99,13 +93,13 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // baz4 if (preg_match('#^/test/(?P[^/]++)/?$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array()); if ('/' === substr($pathinfo, -1)) { // no-op - } elseif ('GET' !== $canonicalMethod) { + } else if ('GET' !== $canonicalMethod) { goto not_baz4; } else { - return array_replace($ret, $this->redirect($rawPathinfo.'/', 'baz4')); + return array_replace($ret, $this->redirect($rawPathinfo . '/', 'baz4')); } return $ret; @@ -114,7 +108,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // baz5 if (preg_match('#^/test/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array()); if (!in_array($requestMethod, array('POST'))) { $allow = array_merge($allow, array('POST')); goto not_baz5; @@ -126,7 +120,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // baz.baz6 if (preg_match('#^/test/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array()); if (!in_array($requestMethod, array('PUT'))) { $allow = array_merge($allow, array('PUT')); goto not_bazbaz6; @@ -140,7 +134,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // quoter if (preg_match('#^/(?P[\']+)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array()); } // space @@ -152,40 +146,38 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec if (0 === strpos($pathinfo, '/a/b\'b')) { // foo1 if (preg_match('#^/a/b\'b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array()); } // bar1 if (preg_match('#^/a/b\'b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array()); } } // overridden if (preg_match('#^/a/(?P.*)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'overridden')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'overridden')), array()); } if (0 === strpos($pathinfo, '/a/b\'b')) { // foo2 if (preg_match('#^/a/b\'b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array()); } // bar2 if (preg_match('#^/a/b\'b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array()); } } - } - - elseif (0 === strpos($pathinfo, '/multi')) { + } else if (0 === strpos($pathinfo, '/multi')) { // helloWorld if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?P[^/]++))?$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'helloWorld')), array ( 'who' => 'World!',)); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'helloWorld')), array('who' => 'World!',)); } // hey @@ -193,10 +185,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $ret = array('_route' => 'hey'); if ('/' === substr($pathinfo, -1)) { // no-op - } elseif ('GET' !== $canonicalMethod) { + } else if ('GET' !== $canonicalMethod) { goto not_hey; } else { - return array_replace($ret, $this->redirect($rawPathinfo.'/', 'hey')); + return array_replace($ret, $this->redirect($rawPathinfo . '/', 'hey')); } return $ret; @@ -212,12 +204,12 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // foo3 if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array()); } // bar3 if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar3')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar3')), array()); } if (0 === strpos($pathinfo, '/aba')) { @@ -228,7 +220,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // foo4 if (preg_match('#^/aba/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array()); } } @@ -281,22 +273,22 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec if (0 === strpos($pathinfo, '/route1')) { // route11 if ('/route11' === $pathinfo) { - return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array ()); + return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array()); } // route12 if ('/route12' === $pathinfo) { - return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array ( 'var1' => 'val',)); + return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array('var1' => 'val',)); } // route13 if (0 === strpos($pathinfo, '/route13') && preg_match('#^/route13/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route13')), array ()); + return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route13')), array()); } // route14 if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array ( 'var1' => 'val',)); + return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array('var1' => 'val',)); } } @@ -306,14 +298,14 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec if (preg_match('#^c\\.example\\.com$#sDi', $host, $hostMatches)) { // route15 if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array()); } } // route16 if (0 === strpos($pathinfo, '/route16') && preg_match('#^/route16/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'route16')), array ( 'var1' => 'val',)); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'route16')), array('var1' => 'val',)); } // route17 @@ -329,12 +321,12 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec if (0 === strpos($pathinfo, '/a/b')) { // b if (preg_match('#^/a/b/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array()); } // c if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array()); } } @@ -342,7 +334,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // secure if ('/secure' === $pathinfo) { $ret = array('_route' => 'secure'); - $requiredSchemes = array ( 'https' => 0,); + $requiredSchemes = array('https' => 0,); if (!isset($requiredSchemes[$context->getScheme()])) { if ('GET' !== $canonicalMethod) { goto not_secure; @@ -358,7 +350,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // nonsecure if ('/nonsecure' === $pathinfo) { $ret = array('_route' => 'nonsecure'); - $requiredSchemes = array ( 'http' => 0,); + $requiredSchemes = array('http' => 0,); if (!isset($requiredSchemes[$context->getScheme()])) { if ('GET' !== $canonicalMethod) { goto not_nonsecure; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher3.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher3.php index 67c4667..4b1f5ff 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher3.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher3.php @@ -10,13 +10,11 @@ use Symfony\Component\Routing\RequestContext; */ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher { - public function __construct(RequestContext $context) - { + public function __construct(RequestContext $context) { $this->context = $context; } - public function match($rawPathinfo) - { + public function match($rawPathinfo) { $allow = array(); $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); @@ -36,7 +34,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // dynamic if (preg_match('#^/rootprefix/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'dynamic')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'dynamic')), array()); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher4.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher4.php index ed07194..79c0b8a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher4.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher4.php @@ -10,13 +10,11 @@ use Symfony\Component\Routing\RequestContext; */ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher { - public function __construct(RequestContext $context) - { + public function __construct(RequestContext $context) { $this->context = $context; } - public function match($rawPathinfo) - { + public function match($rawPathinfo) { $allow = array(); $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher5.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher5.php index 2b22513..347a797 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher5.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher5.php @@ -10,13 +10,11 @@ use Symfony\Component\Routing\RequestContext; */ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\RedirectableUrlMatcher { - public function __construct(RequestContext $context) - { + public function __construct(RequestContext $context) { $this->context = $context; } - public function match($rawPathinfo) - { + public function match($rawPathinfo) { $allow = array(); $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); @@ -48,7 +46,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // a_wildcard if (preg_match('#^/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'a_wildcard')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'a_wildcard')), array()); } if (0 === strpos($pathinfo, '/a')) { @@ -57,10 +55,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $ret = array('_route' => 'a_fourth'); if ('/' === substr($pathinfo, -1)) { // no-op - } elseif ('GET' !== $canonicalMethod) { + } else if ('GET' !== $canonicalMethod) { goto not_a_fourth; } else { - return array_replace($ret, $this->redirect($rawPathinfo.'/', 'a_fourth')); + return array_replace($ret, $this->redirect($rawPathinfo . '/', 'a_fourth')); } return $ret; @@ -72,10 +70,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $ret = array('_route' => 'a_fifth'); if ('/' === substr($pathinfo, -1)) { // no-op - } elseif ('GET' !== $canonicalMethod) { + } else if ('GET' !== $canonicalMethod) { goto not_a_fifth; } else { - return array_replace($ret, $this->redirect($rawPathinfo.'/', 'a_fifth')); + return array_replace($ret, $this->redirect($rawPathinfo . '/', 'a_fifth')); } return $ret; @@ -87,10 +85,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $ret = array('_route' => 'a_sixth'); if ('/' === substr($pathinfo, -1)) { // no-op - } elseif ('GET' !== $canonicalMethod) { + } else if ('GET' !== $canonicalMethod) { goto not_a_sixth; } else { - return array_replace($ret, $this->redirect($rawPathinfo.'/', 'a_sixth')); + return array_replace($ret, $this->redirect($rawPathinfo . '/', 'a_sixth')); } return $ret; @@ -101,7 +99,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // nested_wildcard if (0 === strpos($pathinfo, '/nested') && preg_match('#^/nested/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'nested_wildcard')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'nested_wildcard')), array()); } if (0 === strpos($pathinfo, '/nested/group')) { @@ -110,10 +108,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $ret = array('_route' => 'nested_a'); if ('/' === substr($pathinfo, -1)) { // no-op - } elseif ('GET' !== $canonicalMethod) { + } else if ('GET' !== $canonicalMethod) { goto not_nested_a; } else { - return array_replace($ret, $this->redirect($rawPathinfo.'/', 'nested_a')); + return array_replace($ret, $this->redirect($rawPathinfo . '/', 'nested_a')); } return $ret; @@ -125,10 +123,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $ret = array('_route' => 'nested_b'); if ('/' === substr($pathinfo, -1)) { // no-op - } elseif ('GET' !== $canonicalMethod) { + } else if ('GET' !== $canonicalMethod) { goto not_nested_b; } else { - return array_replace($ret, $this->redirect($rawPathinfo.'/', 'nested_b')); + return array_replace($ret, $this->redirect($rawPathinfo . '/', 'nested_b')); } return $ret; @@ -140,28 +138,26 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $ret = array('_route' => 'nested_c'); if ('/' === substr($pathinfo, -1)) { // no-op - } elseif ('GET' !== $canonicalMethod) { + } else if ('GET' !== $canonicalMethod) { goto not_nested_c; } else { - return array_replace($ret, $this->redirect($rawPathinfo.'/', 'nested_c')); + return array_replace($ret, $this->redirect($rawPathinfo . '/', 'nested_c')); } return $ret; } not_nested_c: - } - - elseif (0 === strpos($pathinfo, '/slashed/group')) { + } else if (0 === strpos($pathinfo, '/slashed/group')) { // slashed_a if ('/slashed/group' === $trimmedPathinfo) { $ret = array('_route' => 'slashed_a'); if ('/' === substr($pathinfo, -1)) { // no-op - } elseif ('GET' !== $canonicalMethod) { + } else if ('GET' !== $canonicalMethod) { goto not_slashed_a; } else { - return array_replace($ret, $this->redirect($rawPathinfo.'/', 'slashed_a')); + return array_replace($ret, $this->redirect($rawPathinfo . '/', 'slashed_a')); } return $ret; @@ -173,10 +169,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $ret = array('_route' => 'slashed_b'); if ('/' === substr($pathinfo, -1)) { // no-op - } elseif ('GET' !== $canonicalMethod) { + } else if ('GET' !== $canonicalMethod) { goto not_slashed_b; } else { - return array_replace($ret, $this->redirect($rawPathinfo.'/', 'slashed_b')); + return array_replace($ret, $this->redirect($rawPathinfo . '/', 'slashed_b')); } return $ret; @@ -188,10 +184,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $ret = array('_route' => 'slashed_c'); if ('/' === substr($pathinfo, -1)) { // no-op - } elseif ('GET' !== $canonicalMethod) { + } else if ('GET' !== $canonicalMethod) { goto not_slashed_c; } else { - return array_replace($ret, $this->redirect($rawPathinfo.'/', 'slashed_c')); + return array_replace($ret, $this->redirect($rawPathinfo . '/', 'slashed_c')); } return $ret; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher6.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher6.php index 48ecdf8..aa0a50c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher6.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher6.php @@ -10,13 +10,11 @@ use Symfony\Component\Routing\RequestContext; */ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher { - public function __construct(RequestContext $context) - { + public function __construct(RequestContext $context) { $this->context = $context; } - public function match($rawPathinfo) - { + public function match($rawPathinfo) { $allow = array(); $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); @@ -70,17 +68,15 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher } not_simple_trailing_slash_POST_method: - } - - elseif (0 === strpos($pathinfo, '/trailing/regex')) { + } else if (0 === strpos($pathinfo, '/trailing/regex')) { // regex_trailing_slash_no_methods if (0 === strpos($pathinfo, '/trailing/regex/no-methods') && preg_match('#^/trailing/regex/no\\-methods/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_no_methods')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_no_methods')), array()); } // regex_trailing_slash_GET_method if (0 === strpos($pathinfo, '/trailing/regex/get-method') && preg_match('#^/trailing/regex/get\\-method/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_GET_method')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_GET_method')), array()); if (!in_array($canonicalMethod, array('GET'))) { $allow = array_merge($allow, array('GET')); goto not_regex_trailing_slash_GET_method; @@ -92,7 +88,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // regex_trailing_slash_HEAD_method if (0 === strpos($pathinfo, '/trailing/regex/head-method') && preg_match('#^/trailing/regex/head\\-method/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_HEAD_method')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_HEAD_method')), array()); if (!in_array($requestMethod, array('HEAD'))) { $allow = array_merge($allow, array('HEAD')); goto not_regex_trailing_slash_HEAD_method; @@ -104,7 +100,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // regex_trailing_slash_POST_method if (0 === strpos($pathinfo, '/trailing/regex/post-method') && preg_match('#^/trailing/regex/post\\-method/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_POST_method')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_POST_method')), array()); if (!in_array($requestMethod, array('POST'))) { $allow = array_merge($allow, array('POST')); goto not_regex_trailing_slash_POST_method; @@ -114,9 +110,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher } not_regex_trailing_slash_POST_method: - } - - elseif (0 === strpos($pathinfo, '/not-trailing/simple')) { + } else if (0 === strpos($pathinfo, '/not-trailing/simple')) { // simple_not_trailing_slash_no_methods if ('/not-trailing/simple/no-methods' === $pathinfo) { return array('_route' => 'simple_not_trailing_slash_no_methods'); @@ -158,17 +152,15 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher } not_simple_not_trailing_slash_POST_method: - } - - elseif (0 === strpos($pathinfo, '/not-trailing/regex')) { + } else if (0 === strpos($pathinfo, '/not-trailing/regex')) { // regex_not_trailing_slash_no_methods if (0 === strpos($pathinfo, '/not-trailing/regex/no-methods') && preg_match('#^/not\\-trailing/regex/no\\-methods/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_no_methods')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_no_methods')), array()); } // regex_not_trailing_slash_GET_method if (0 === strpos($pathinfo, '/not-trailing/regex/get-method') && preg_match('#^/not\\-trailing/regex/get\\-method/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_GET_method')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_GET_method')), array()); if (!in_array($canonicalMethod, array('GET'))) { $allow = array_merge($allow, array('GET')); goto not_regex_not_trailing_slash_GET_method; @@ -180,7 +172,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // regex_not_trailing_slash_HEAD_method if (0 === strpos($pathinfo, '/not-trailing/regex/head-method') && preg_match('#^/not\\-trailing/regex/head\\-method/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_HEAD_method')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_HEAD_method')), array()); if (!in_array($requestMethod, array('HEAD'))) { $allow = array_merge($allow, array('HEAD')); goto not_regex_not_trailing_slash_HEAD_method; @@ -192,7 +184,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher // regex_not_trailing_slash_POST_method if (0 === strpos($pathinfo, '/not-trailing/regex/post-method') && preg_match('#^/not\\-trailing/regex/post\\-method/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_POST_method')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_POST_method')), array()); if (!in_array($requestMethod, array('POST'))) { $allow = array_merge($allow, array('POST')); goto not_regex_not_trailing_slash_POST_method; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher7.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher7.php index 81d76ea..0b2ddfd 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher7.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/dumper/url_matcher7.php @@ -10,13 +10,11 @@ use Symfony\Component\Routing\RequestContext; */ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\RedirectableUrlMatcher { - public function __construct(RequestContext $context) - { + public function __construct(RequestContext $context) { $this->context = $context; } - public function match($rawPathinfo) - { + public function match($rawPathinfo) { $allow = array(); $pathinfo = rawurldecode($rawPathinfo); $trimmedPathinfo = rtrim($pathinfo, '/'); @@ -34,10 +32,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $ret = array('_route' => 'simple_trailing_slash_no_methods'); if ('/' === substr($pathinfo, -1)) { // no-op - } elseif ('GET' !== $canonicalMethod) { + } else if ('GET' !== $canonicalMethod) { goto not_simple_trailing_slash_no_methods; } else { - return array_replace($ret, $this->redirect($rawPathinfo.'/', 'simple_trailing_slash_no_methods')); + return array_replace($ret, $this->redirect($rawPathinfo . '/', 'simple_trailing_slash_no_methods')); } return $ret; @@ -49,10 +47,10 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec $ret = array('_route' => 'simple_trailing_slash_GET_method'); if ('/' === substr($pathinfo, -1)) { // no-op - } elseif ('GET' !== $canonicalMethod) { + } else if ('GET' !== $canonicalMethod) { goto not_simple_trailing_slash_GET_method; } else { - return array_replace($ret, $this->redirect($rawPathinfo.'/', 'simple_trailing_slash_GET_method')); + return array_replace($ret, $this->redirect($rawPathinfo . '/', 'simple_trailing_slash_GET_method')); } if (!in_array($canonicalMethod, array('GET'))) { @@ -88,18 +86,16 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec } not_simple_trailing_slash_POST_method: - } - - elseif (0 === strpos($pathinfo, '/trailing/regex')) { + } else if (0 === strpos($pathinfo, '/trailing/regex')) { // regex_trailing_slash_no_methods if (0 === strpos($pathinfo, '/trailing/regex/no-methods') && preg_match('#^/trailing/regex/no\\-methods/(?P[^/]++)/?$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_no_methods')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_no_methods')), array()); if ('/' === substr($pathinfo, -1)) { // no-op - } elseif ('GET' !== $canonicalMethod) { + } else if ('GET' !== $canonicalMethod) { goto not_regex_trailing_slash_no_methods; } else { - return array_replace($ret, $this->redirect($rawPathinfo.'/', 'regex_trailing_slash_no_methods')); + return array_replace($ret, $this->redirect($rawPathinfo . '/', 'regex_trailing_slash_no_methods')); } return $ret; @@ -108,13 +104,13 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // regex_trailing_slash_GET_method if (0 === strpos($pathinfo, '/trailing/regex/get-method') && preg_match('#^/trailing/regex/get\\-method/(?P[^/]++)/?$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_GET_method')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_GET_method')), array()); if ('/' === substr($pathinfo, -1)) { // no-op - } elseif ('GET' !== $canonicalMethod) { + } else if ('GET' !== $canonicalMethod) { goto not_regex_trailing_slash_GET_method; } else { - return array_replace($ret, $this->redirect($rawPathinfo.'/', 'regex_trailing_slash_GET_method')); + return array_replace($ret, $this->redirect($rawPathinfo . '/', 'regex_trailing_slash_GET_method')); } if (!in_array($canonicalMethod, array('GET'))) { @@ -128,7 +124,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // regex_trailing_slash_HEAD_method if (0 === strpos($pathinfo, '/trailing/regex/head-method') && preg_match('#^/trailing/regex/head\\-method/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_HEAD_method')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_HEAD_method')), array()); if (!in_array($requestMethod, array('HEAD'))) { $allow = array_merge($allow, array('HEAD')); goto not_regex_trailing_slash_HEAD_method; @@ -140,7 +136,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // regex_trailing_slash_POST_method if (0 === strpos($pathinfo, '/trailing/regex/post-method') && preg_match('#^/trailing/regex/post\\-method/(?P[^/]++)/$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_POST_method')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_trailing_slash_POST_method')), array()); if (!in_array($requestMethod, array('POST'))) { $allow = array_merge($allow, array('POST')); goto not_regex_trailing_slash_POST_method; @@ -150,9 +146,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec } not_regex_trailing_slash_POST_method: - } - - elseif (0 === strpos($pathinfo, '/not-trailing/simple')) { + } else if (0 === strpos($pathinfo, '/not-trailing/simple')) { // simple_not_trailing_slash_no_methods if ('/not-trailing/simple/no-methods' === $pathinfo) { return array('_route' => 'simple_not_trailing_slash_no_methods'); @@ -194,17 +188,15 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec } not_simple_not_trailing_slash_POST_method: - } - - elseif (0 === strpos($pathinfo, '/not-trailing/regex')) { + } else if (0 === strpos($pathinfo, '/not-trailing/regex')) { // regex_not_trailing_slash_no_methods if (0 === strpos($pathinfo, '/not-trailing/regex/no-methods') && preg_match('#^/not\\-trailing/regex/no\\-methods/(?P[^/]++)$#sD', $pathinfo, $matches)) { - return $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_no_methods')), array ()); + return $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_no_methods')), array()); } // regex_not_trailing_slash_GET_method if (0 === strpos($pathinfo, '/not-trailing/regex/get-method') && preg_match('#^/not\\-trailing/regex/get\\-method/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_GET_method')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_GET_method')), array()); if (!in_array($canonicalMethod, array('GET'))) { $allow = array_merge($allow, array('GET')); goto not_regex_not_trailing_slash_GET_method; @@ -216,7 +208,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // regex_not_trailing_slash_HEAD_method if (0 === strpos($pathinfo, '/not-trailing/regex/head-method') && preg_match('#^/not\\-trailing/regex/head\\-method/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_HEAD_method')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_HEAD_method')), array()); if (!in_array($requestMethod, array('HEAD'))) { $allow = array_merge($allow, array('HEAD')); goto not_regex_not_trailing_slash_HEAD_method; @@ -228,7 +220,7 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec // regex_not_trailing_slash_POST_method if (0 === strpos($pathinfo, '/not-trailing/regex/post-method') && preg_match('#^/not\\-trailing/regex/post\\-method/(?P[^/]++)$#sD', $pathinfo, $matches)) { - $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_POST_method')), array ()); + $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'regex_not_trailing_slash_POST_method')), array()); if (!in_array($requestMethod, array('POST'))) { $allow = array_merge($allow, array('POST')); goto not_regex_not_trailing_slash_POST_method; diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/glob/bar.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/glob/bar.xml index 0d31eeb..144d398 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/glob/bar.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/glob/bar.xml @@ -4,5 +4,5 @@ xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> - + diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/glob/baz.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/glob/baz.xml index 3abba1a..e83573f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/glob/baz.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/glob/baz.xml @@ -4,5 +4,5 @@ xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> - + diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/glob/import_multiple.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/glob/import_multiple.xml index ca6b1b5..987841a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/glob/import_multiple.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/glob/import_multiple.xml @@ -4,5 +4,5 @@ xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> - + diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/glob/import_single.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/glob/import_single.xml index 15f5698..ee6c37a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/glob/import_single.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/glob/import_single.xml @@ -4,5 +4,5 @@ xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> - + diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/list_defaults.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/list_defaults.xml index f93bf9c..ba3ee03 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/list_defaults.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/list_defaults.xml @@ -1,7 +1,7 @@ diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/list_in_list_defaults.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/list_in_list_defaults.xml index 987086d..81613ca 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/list_in_list_defaults.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/list_in_list_defaults.xml @@ -1,7 +1,7 @@ diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/list_in_map_defaults.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/list_in_map_defaults.xml index 32d393c..de8ce5c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/list_in_map_defaults.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/list_in_map_defaults.xml @@ -1,7 +1,7 @@ diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/list_null_values.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/list_null_values.xml index c70e03c..18508a0 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/list_null_values.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/list_null_values.xml @@ -1,7 +1,7 @@ @@ -10,12 +10,12 @@ - - - - - - + + + + + + diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/map_defaults.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/map_defaults.xml index 47feb29..f673247 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/map_defaults.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/map_defaults.xml @@ -1,7 +1,7 @@ diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/map_in_list_defaults.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/map_in_list_defaults.xml index 6d77065..2382e60 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/map_in_list_defaults.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/map_in_list_defaults.xml @@ -1,7 +1,7 @@ diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/map_in_map_defaults.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/map_in_map_defaults.xml index 2beee61..d35e72a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/map_in_map_defaults.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/map_in_map_defaults.xml @@ -1,7 +1,7 @@ diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/map_null_values.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/map_null_values.xml index 8fd8954..6e817d1 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/map_null_values.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/map_null_values.xml @@ -10,12 +10,12 @@ - - - - - - + + + + + + diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/missing_id.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/missing_id.xml index 4ea4115..a9a6ae3 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/missing_id.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/missing_id.xml @@ -1,8 +1,8 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/missing_path.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/missing_path.xml index ef5bc08..a4beb87 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/missing_path.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/missing_path.xml @@ -1,8 +1,8 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/namespaceprefix.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/namespaceprefix.xml index e33955a..0c9433f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/namespaceprefix.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/namespaceprefix.xml @@ -1,8 +1,8 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> MyBundle:Blog:show diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/nonvalid.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/nonvalid.xml index dc147d2..e3f9edc 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/nonvalid.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/nonvalid.xml @@ -1,10 +1,10 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> - MyBundle:Blog:show + MyBundle:Blog:show diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/nonvalidnode.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/nonvalidnode.xml index 863ef03..a6e9694 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/nonvalidnode.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/nonvalidnode.xml @@ -1,8 +1,8 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> bar diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/nonvalidroute.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/nonvalidroute.xml index 908958c..0a35e6d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/nonvalidroute.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/nonvalidroute.xml @@ -1,8 +1,8 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> MyBundle:Blog:show diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/null_values.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/null_values.xml index f9e2aa2..5ea1599 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/null_values.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/null_values.xml @@ -1,11 +1,11 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> - - + + foo bar diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/php_dsl.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/php_dsl.php index 0780c9f..ad87d4e 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/php_dsl.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/php_dsl.php @@ -6,10 +6,10 @@ return function (RoutingConfigurator $routes) { $routes ->collection() ->add('foo', '/foo') - ->condition('abc') - ->options(array('utf8' => true)) + ->condition('abc') + ->options(array('utf8' => TRUE)) ->add('buz', 'zub') - ->controller('foo:act'); + ->controller('foo:act'); $routes->import('php_dsl_sub.php') ->prefix('/sub') diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/scalar_defaults.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/scalar_defaults.xml index ecfde28..3dcbd69 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/scalar_defaults.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/scalar_defaults.xml @@ -1,14 +1,14 @@ AcmeBlogBundle:Blog:index - + true @@ -27,7 +27,7 @@ 0 - - + + diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/validpattern.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/validpattern.xml index dbc72e4..683b07c 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/validpattern.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/validpattern.xml @@ -1,15 +1,16 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> - + MyBundle:Blog:show \w+ context.getMethod() == "GET" - + diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/validresource.xml b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/validresource.xml index b7a15dd..8e716bd 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/validresource.xml +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Fixtures/validresource.xml @@ -1,8 +1,8 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> 123 diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php index f84802b..9732c38 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Generator/Dumper/PhpGeneratorDumperTest.php @@ -40,31 +40,28 @@ class PhpGeneratorDumperTest extends TestCase */ private $largeTestTmpFilepath; - protected function setUp() - { + protected function setUp() { parent::setUp(); $this->routeCollection = new RouteCollection(); $this->generatorDumper = new PhpGeneratorDumper($this->routeCollection); - $this->testTmpFilepath = sys_get_temp_dir().DIRECTORY_SEPARATOR.'php_generator.'.$this->getName().'.php'; - $this->largeTestTmpFilepath = sys_get_temp_dir().DIRECTORY_SEPARATOR.'php_generator.'.$this->getName().'.large.php'; + $this->testTmpFilepath = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'php_generator.' . $this->getName() . '.php'; + $this->largeTestTmpFilepath = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'php_generator.' . $this->getName() . '.large.php'; @unlink($this->testTmpFilepath); @unlink($this->largeTestTmpFilepath); } - protected function tearDown() - { + protected function tearDown() { parent::tearDown(); @unlink($this->testTmpFilepath); - $this->routeCollection = null; - $this->generatorDumper = null; - $this->testTmpFilepath = null; + $this->routeCollection = NULL; + $this->generatorDumper = NULL; + $this->testTmpFilepath = NULL; } - public function testDumpWithRoutes() - { + public function testDumpWithRoutes() { $this->routeCollection->add('Test', new Route('/testing/{foo}')); $this->routeCollection->add('Test2', new Route('/testing2')); @@ -84,22 +81,21 @@ class PhpGeneratorDumperTest extends TestCase $this->assertEquals('/app.php/testing2', $relativeUrlWithoutParameter); } - public function testDumpWithTooManyRoutes() - { + public function testDumpWithTooManyRoutes() { if (defined('HHVM_VERSION_ID')) { $this->markTestSkipped('HHVM consumes too much memory on this test.'); } $this->routeCollection->add('Test', new Route('/testing/{foo}')); for ($i = 0; $i < 32769; ++$i) { - $this->routeCollection->add('route_'.$i, new Route('/route_'.$i)); + $this->routeCollection->add('route_' . $i, new Route('/route_' . $i)); } $this->routeCollection->add('Test2', new Route('/testing2')); file_put_contents($this->largeTestTmpFilepath, $this->generatorDumper->dump(array( 'class' => 'ProjectLargeUrlGenerator', ))); - $this->routeCollection = $this->generatorDumper = null; + $this->routeCollection = $this->generatorDumper = NULL; include $this->largeTestTmpFilepath; $projectUrlGenerator = new \ProjectLargeUrlGenerator(new RequestContext('/app.php')); @@ -118,8 +114,7 @@ class PhpGeneratorDumperTest extends TestCase /** * @expectedException \InvalidArgumentException */ - public function testDumpWithoutRoutes() - { + public function testDumpWithoutRoutes() { file_put_contents($this->testTmpFilepath, $this->generatorDumper->dump(array('class' => 'WithoutRoutesUrlGenerator'))); include $this->testTmpFilepath; @@ -131,8 +126,7 @@ class PhpGeneratorDumperTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException */ - public function testGenerateNonExistingRoute() - { + public function testGenerateNonExistingRoute() { $this->routeCollection->add('Test', new Route('/test')); file_put_contents($this->testTmpFilepath, $this->generatorDumper->dump(array('class' => 'NonExistingRoutesUrlGenerator'))); @@ -142,8 +136,7 @@ class PhpGeneratorDumperTest extends TestCase $url = $projectUrlGenerator->generate('NonExisting', array()); } - public function testDumpForRouteWithDefaults() - { + public function testDumpForRouteWithDefaults() { $this->routeCollection->add('Test', new Route('/testing/{foo}', array('foo' => 'bar'))); file_put_contents($this->testTmpFilepath, $this->generatorDumper->dump(array('class' => 'DefaultRoutesUrlGenerator'))); @@ -155,8 +148,7 @@ class PhpGeneratorDumperTest extends TestCase $this->assertEquals('/testing', $url); } - public function testDumpWithSchemeRequirement() - { + public function testDumpWithSchemeRequirement() { $this->routeCollection->add('Test1', new Route('/testing', array(), array(), array(), '', array('ftp', 'https'))); file_put_contents($this->testTmpFilepath, $this->generatorDumper->dump(array('class' => 'SchemeUrlGenerator'))); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Generator/UrlGeneratorTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Generator/UrlGeneratorTest.php index 68add77..6b0bdca 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Generator/UrlGeneratorTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Generator/UrlGeneratorTest.php @@ -20,57 +20,50 @@ use Symfony\Component\Routing\RequestContext; class UrlGeneratorTest extends TestCase { - public function testAbsoluteUrlWithPort80() - { + public function testAbsoluteUrlWithPort80() { $routes = $this->getRoutes('test', new Route('/testing')); $url = $this->getGenerator($routes)->generate('test', array(), UrlGeneratorInterface::ABSOLUTE_URL); $this->assertEquals('http://localhost/app.php/testing', $url); } - public function testAbsoluteSecureUrlWithPort443() - { + public function testAbsoluteSecureUrlWithPort443() { $routes = $this->getRoutes('test', new Route('/testing')); $url = $this->getGenerator($routes, array('scheme' => 'https'))->generate('test', array(), UrlGeneratorInterface::ABSOLUTE_URL); $this->assertEquals('https://localhost/app.php/testing', $url); } - public function testAbsoluteUrlWithNonStandardPort() - { + public function testAbsoluteUrlWithNonStandardPort() { $routes = $this->getRoutes('test', new Route('/testing')); $url = $this->getGenerator($routes, array('httpPort' => 8080))->generate('test', array(), UrlGeneratorInterface::ABSOLUTE_URL); $this->assertEquals('http://localhost:8080/app.php/testing', $url); } - public function testAbsoluteSecureUrlWithNonStandardPort() - { + public function testAbsoluteSecureUrlWithNonStandardPort() { $routes = $this->getRoutes('test', new Route('/testing')); $url = $this->getGenerator($routes, array('httpsPort' => 8080, 'scheme' => 'https'))->generate('test', array(), UrlGeneratorInterface::ABSOLUTE_URL); $this->assertEquals('https://localhost:8080/app.php/testing', $url); } - public function testRelativeUrlWithoutParameters() - { + public function testRelativeUrlWithoutParameters() { $routes = $this->getRoutes('test', new Route('/testing')); $url = $this->getGenerator($routes)->generate('test', array(), UrlGeneratorInterface::ABSOLUTE_PATH); $this->assertEquals('/app.php/testing', $url); } - public function testRelativeUrlWithParameter() - { + public function testRelativeUrlWithParameter() { $routes = $this->getRoutes('test', new Route('/testing/{foo}')); $url = $this->getGenerator($routes)->generate('test', array('foo' => 'bar'), UrlGeneratorInterface::ABSOLUTE_PATH); $this->assertEquals('/app.php/testing/bar', $url); } - public function testRelativeUrlWithNullParameter() - { - $routes = $this->getRoutes('test', new Route('/testing.{format}', array('format' => null))); + public function testRelativeUrlWithNullParameter() { + $routes = $this->getRoutes('test', new Route('/testing.{format}', array('format' => NULL))); $url = $this->getGenerator($routes)->generate('test', array(), UrlGeneratorInterface::ABSOLUTE_PATH); $this->assertEquals('/app.php/testing', $url); @@ -79,55 +72,48 @@ class UrlGeneratorTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException */ - public function testRelativeUrlWithNullParameterButNotOptional() - { - $routes = $this->getRoutes('test', new Route('/testing/{foo}/bar', array('foo' => null))); + public function testRelativeUrlWithNullParameterButNotOptional() { + $routes = $this->getRoutes('test', new Route('/testing/{foo}/bar', array('foo' => NULL))); // This must raise an exception because the default requirement for "foo" is "[^/]+" which is not met with these params. // Generating path "/testing//bar" would be wrong as matching this route would fail. $this->getGenerator($routes)->generate('test', array(), UrlGeneratorInterface::ABSOLUTE_PATH); } - public function testRelativeUrlWithOptionalZeroParameter() - { + public function testRelativeUrlWithOptionalZeroParameter() { $routes = $this->getRoutes('test', new Route('/testing/{page}')); $url = $this->getGenerator($routes)->generate('test', array('page' => 0), UrlGeneratorInterface::ABSOLUTE_PATH); $this->assertEquals('/app.php/testing/0', $url); } - public function testNotPassedOptionalParameterInBetween() - { + public function testNotPassedOptionalParameterInBetween() { $routes = $this->getRoutes('test', new Route('/{slug}/{page}', array('slug' => 'index', 'page' => 0))); $this->assertSame('/app.php/index/1', $this->getGenerator($routes)->generate('test', array('page' => 1))); $this->assertSame('/app.php/', $this->getGenerator($routes)->generate('test')); } - public function testRelativeUrlWithExtraParameters() - { + public function testRelativeUrlWithExtraParameters() { $routes = $this->getRoutes('test', new Route('/testing')); $url = $this->getGenerator($routes)->generate('test', array('foo' => 'bar'), UrlGeneratorInterface::ABSOLUTE_PATH); $this->assertEquals('/app.php/testing?foo=bar', $url); } - public function testAbsoluteUrlWithExtraParameters() - { + public function testAbsoluteUrlWithExtraParameters() { $routes = $this->getRoutes('test', new Route('/testing')); $url = $this->getGenerator($routes)->generate('test', array('foo' => 'bar'), UrlGeneratorInterface::ABSOLUTE_URL); $this->assertEquals('http://localhost/app.php/testing?foo=bar', $url); } - public function testUrlWithNullExtraParameters() - { + public function testUrlWithNullExtraParameters() { $routes = $this->getRoutes('test', new Route('/testing')); - $url = $this->getGenerator($routes)->generate('test', array('foo' => null), UrlGeneratorInterface::ABSOLUTE_URL); + $url = $this->getGenerator($routes)->generate('test', array('foo' => NULL), UrlGeneratorInterface::ABSOLUTE_URL); $this->assertEquals('http://localhost/app.php/testing', $url); } - public function testUrlWithExtraParametersFromGlobals() - { + public function testUrlWithExtraParametersFromGlobals() { $routes = $this->getRoutes('test', new Route('/testing')); $generator = $this->getGenerator($routes); $context = new RequestContext('/app.php'); @@ -138,8 +124,7 @@ class UrlGeneratorTest extends TestCase $this->assertEquals('/app.php/testing?foo=bar', $url); } - public function testUrlWithGlobalParameter() - { + public function testUrlWithGlobalParameter() { $routes = $this->getRoutes('test', new Route('/testing/{foo}')); $generator = $this->getGenerator($routes); $context = new RequestContext('/app.php'); @@ -150,8 +135,7 @@ class UrlGeneratorTest extends TestCase $this->assertEquals('/app.php/testing/bar', $url); } - public function testGlobalParameterHasHigherPriorityThanDefault() - { + public function testGlobalParameterHasHigherPriorityThanDefault() { $routes = $this->getRoutes('test', new Route('/{_locale}', array('_locale' => 'en'))); $generator = $this->getGenerator($routes); $context = new RequestContext('/app.php'); @@ -165,8 +149,7 @@ class UrlGeneratorTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\RouteNotFoundException */ - public function testGenerateWithoutRoutes() - { + public function testGenerateWithoutRoutes() { $routes = $this->getRoutes('foo', new Route('/testing/{foo}')); $this->getGenerator($routes)->generate('test', array(), UrlGeneratorInterface::ABSOLUTE_URL); } @@ -174,8 +157,7 @@ class UrlGeneratorTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\MissingMandatoryParametersException */ - public function testGenerateForRouteWithoutMandatoryParameter() - { + public function testGenerateForRouteWithoutMandatoryParameter() { $routes = $this->getRoutes('test', new Route('/testing/{foo}')); $this->getGenerator($routes)->generate('test', array(), UrlGeneratorInterface::ABSOLUTE_URL); } @@ -183,8 +165,7 @@ class UrlGeneratorTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException */ - public function testGenerateForRouteWithInvalidOptionalParameter() - { + public function testGenerateForRouteWithInvalidOptionalParameter() { $routes = $this->getRoutes('test', new Route('/testing/{foo}', array('foo' => '1'), array('foo' => 'd+'))); $this->getGenerator($routes)->generate('test', array('foo' => 'bar'), UrlGeneratorInterface::ABSOLUTE_URL); } @@ -192,44 +173,39 @@ class UrlGeneratorTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException */ - public function testGenerateForRouteWithInvalidParameter() - { + public function testGenerateForRouteWithInvalidParameter() { $routes = $this->getRoutes('test', new Route('/testing/{foo}', array(), array('foo' => '1|2'))); $this->getGenerator($routes)->generate('test', array('foo' => '0'), UrlGeneratorInterface::ABSOLUTE_URL); } - public function testGenerateForRouteWithInvalidOptionalParameterNonStrict() - { + public function testGenerateForRouteWithInvalidOptionalParameterNonStrict() { $routes = $this->getRoutes('test', new Route('/testing/{foo}', array('foo' => '1'), array('foo' => 'd+'))); $generator = $this->getGenerator($routes); - $generator->setStrictRequirements(false); + $generator->setStrictRequirements(FALSE); $this->assertNull($generator->generate('test', array('foo' => 'bar'), UrlGeneratorInterface::ABSOLUTE_URL)); } - public function testGenerateForRouteWithInvalidOptionalParameterNonStrictWithLogger() - { + public function testGenerateForRouteWithInvalidOptionalParameterNonStrictWithLogger() { $routes = $this->getRoutes('test', new Route('/testing/{foo}', array('foo' => '1'), array('foo' => 'd+'))); $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); $logger->expects($this->once()) ->method('error'); $generator = $this->getGenerator($routes, array(), $logger); - $generator->setStrictRequirements(false); + $generator->setStrictRequirements(FALSE); $this->assertNull($generator->generate('test', array('foo' => 'bar'), UrlGeneratorInterface::ABSOLUTE_URL)); } - public function testGenerateForRouteWithInvalidParameterButDisabledRequirementsCheck() - { + public function testGenerateForRouteWithInvalidParameterButDisabledRequirementsCheck() { $routes = $this->getRoutes('test', new Route('/testing/{foo}', array('foo' => '1'), array('foo' => 'd+'))); $generator = $this->getGenerator($routes); - $generator->setStrictRequirements(null); + $generator->setStrictRequirements(NULL); $this->assertSame('/app.php/testing/bar', $generator->generate('test', array('foo' => 'bar'))); } /** * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException */ - public function testGenerateForRouteWithInvalidMandatoryParameter() - { + public function testGenerateForRouteWithInvalidMandatoryParameter() { $routes = $this->getRoutes('test', new Route('/testing/{foo}', array(), array('foo' => 'd+'))); $this->getGenerator($routes)->generate('test', array('foo' => 'bar'), UrlGeneratorInterface::ABSOLUTE_URL); } @@ -237,23 +213,20 @@ class UrlGeneratorTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException */ - public function testGenerateForRouteWithInvalidUtf8Parameter() - { - $routes = $this->getRoutes('test', new Route('/testing/{foo}', array(), array('foo' => '\pL+'), array('utf8' => true))); + public function testGenerateForRouteWithInvalidUtf8Parameter() { + $routes = $this->getRoutes('test', new Route('/testing/{foo}', array(), array('foo' => '\pL+'), array('utf8' => TRUE))); $this->getGenerator($routes)->generate('test', array('foo' => 'abc123'), UrlGeneratorInterface::ABSOLUTE_URL); } /** * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException */ - public function testRequiredParamAndEmptyPassed() - { + public function testRequiredParamAndEmptyPassed() { $routes = $this->getRoutes('test', new Route('/{slug}', array(), array('slug' => '.+'))); $this->getGenerator($routes)->generate('test', array('slug' => '')); } - public function testSchemeRequirementDoesNothingIfSameCurrentScheme() - { + public function testSchemeRequirementDoesNothingIfSameCurrentScheme() { $routes = $this->getRoutes('test', new Route('/', array(), array(), array(), '', array('http'))); $this->assertEquals('/app.php/', $this->getGenerator($routes)->generate('test')); @@ -261,8 +234,7 @@ class UrlGeneratorTest extends TestCase $this->assertEquals('/app.php/', $this->getGenerator($routes, array('scheme' => 'https'))->generate('test')); } - public function testSchemeRequirementForcesAbsoluteUrl() - { + public function testSchemeRequirementForcesAbsoluteUrl() { $routes = $this->getRoutes('test', new Route('/', array(), array(), array(), '', array('https'))); $this->assertEquals('https://localhost/app.php/', $this->getGenerator($routes)->generate('test')); @@ -270,43 +242,37 @@ class UrlGeneratorTest extends TestCase $this->assertEquals('http://localhost/app.php/', $this->getGenerator($routes, array('scheme' => 'https'))->generate('test')); } - public function testSchemeRequirementCreatesUrlForFirstRequiredScheme() - { + public function testSchemeRequirementCreatesUrlForFirstRequiredScheme() { $routes = $this->getRoutes('test', new Route('/', array(), array(), array(), '', array('Ftp', 'https'))); $this->assertEquals('ftp://localhost/app.php/', $this->getGenerator($routes)->generate('test')); } - public function testPathWithTwoStartingSlashes() - { + public function testPathWithTwoStartingSlashes() { $routes = $this->getRoutes('test', new Route('//path-and-not-domain')); // this must not generate '//path-and-not-domain' because that would be a network path $this->assertSame('/path-and-not-domain', $this->getGenerator($routes, array('BaseUrl' => ''))->generate('test')); } - public function testNoTrailingSlashForMultipleOptionalParameters() - { - $routes = $this->getRoutes('test', new Route('/category/{slug1}/{slug2}/{slug3}', array('slug2' => null, 'slug3' => null))); + public function testNoTrailingSlashForMultipleOptionalParameters() { + $routes = $this->getRoutes('test', new Route('/category/{slug1}/{slug2}/{slug3}', array('slug2' => NULL, 'slug3' => NULL))); $this->assertEquals('/app.php/category/foo', $this->getGenerator($routes)->generate('test', array('slug1' => 'foo'))); } - public function testWithAnIntegerAsADefaultValue() - { + public function testWithAnIntegerAsADefaultValue() { $routes = $this->getRoutes('test', new Route('/{default}', array('default' => 0))); $this->assertEquals('/app.php/foo', $this->getGenerator($routes)->generate('test', array('default' => 'foo'))); } - public function testNullForOptionalParameterIsIgnored() - { + public function testNullForOptionalParameterIsIgnored() { $routes = $this->getRoutes('test', new Route('/test/{default}', array('default' => 0))); - $this->assertEquals('/app.php/test', $this->getGenerator($routes)->generate('test', array('default' => null))); + $this->assertEquals('/app.php/test', $this->getGenerator($routes)->generate('test', array('default' => NULL))); } - public function testQueryParamSameAsDefault() - { + public function testQueryParamSameAsDefault() { $routes = $this->getRoutes('test', new Route('/test', array('page' => 1))); $this->assertSame('/app.php/test?page=2', $this->getGenerator($routes)->generate('test', array('page' => 2))); @@ -315,8 +281,7 @@ class UrlGeneratorTest extends TestCase $this->assertSame('/app.php/test', $this->getGenerator($routes)->generate('test')); } - public function testArrayQueryParamSameAsDefault() - { + public function testArrayQueryParamSameAsDefault() { $routes = $this->getRoutes('test', new Route('/test', array('array' => array('foo', 'bar')))); $this->assertSame('/app.php/test?array%5B0%5D=bar&array%5B1%5D=foo', $this->getGenerator($routes)->generate('test', array('array' => array('bar', 'foo')))); @@ -326,18 +291,16 @@ class UrlGeneratorTest extends TestCase $this->assertSame('/app.php/test', $this->getGenerator($routes)->generate('test')); } - public function testGenerateWithSpecialRouteName() - { + public function testGenerateWithSpecialRouteName() { $routes = $this->getRoutes('$péß^a|', new Route('/bar')); $this->assertSame('/app.php/bar', $this->getGenerator($routes)->generate('$péß^a|')); } - public function testUrlEncoding() - { + public function testUrlEncoding() { $expectedPath = '/app.php/@:%5B%5D/%28%29*%27%22%20+,;-._~%26%24%3C%3E|%7B%7D%25%5C%5E%60!%3Ffoo=bar%23id' - .'/@:%5B%5D/%28%29*%27%22%20+,;-._~%26%24%3C%3E|%7B%7D%25%5C%5E%60!%3Ffoo=bar%23id' - .'?query=%40%3A%5B%5D/%28%29%2A%27%22%20%2B%2C%3B-._~%26%24%3C%3E%7C%7B%7D%25%5C%5E%60%21%3Ffoo%3Dbar%23id'; + . '/@:%5B%5D/%28%29*%27%22%20+,;-._~%26%24%3C%3E|%7B%7D%25%5C%5E%60!%3Ffoo=bar%23id' + . '?query=%40%3A%5B%5D/%28%29%2A%27%22%20%2B%2C%3B-._~%26%24%3C%3E%7C%7B%7D%25%5C%5E%60%21%3Ffoo%3Dbar%23id'; // This tests the encoding of reserved characters that are used for delimiting of URI components (defined in RFC 3986) // and other special ASCII chars. These chars are tested as static text path, variable path and query param. @@ -349,8 +312,7 @@ class UrlGeneratorTest extends TestCase ))); } - public function testEncodingOfRelativePathSegments() - { + public function testEncodingOfRelativePathSegments() { $routes = $this->getRoutes('test', new Route('/dir/../dir/..')); $this->assertSame('/app.php/dir/%2E%2E/dir/%2E%2E', $this->getGenerator($routes)->generate('test')); $routes = $this->getRoutes('test', new Route('/dir/./dir/.')); @@ -359,8 +321,7 @@ class UrlGeneratorTest extends TestCase $this->assertSame('/app.php/a./.a/a../..a/...', $this->getGenerator($routes)->generate('test')); } - public function testAdjacentVariables() - { + public function testAdjacentVariables() { $routes = $this->getRoutes('test', new Route('/{x}{y}{z}.{_format}', array('z' => 'default-z', '_format' => 'html'), array('y' => '\d+'))); $generator = $this->getGenerator($routes); $this->assertSame('/app.php/foo123', $generator->generate('test', array('x' => 'foo', 'y' => '123'))); @@ -372,8 +333,7 @@ class UrlGeneratorTest extends TestCase $generator->generate('test', array('x' => 'do.t', 'y' => '123', 'z' => 'bar', '_format' => 'xml')); } - public function testOptionalVariableWithNoRealSeparator() - { + public function testOptionalVariableWithNoRealSeparator() { $routes = $this->getRoutes('test', new Route('/get{what}', array('what' => 'All'))); $generator = $this->getGenerator($routes); @@ -381,16 +341,14 @@ class UrlGeneratorTest extends TestCase $this->assertSame('/app.php/getSites', $generator->generate('test', array('what' => 'Sites'))); } - public function testRequiredVariableWithNoRealSeparator() - { + public function testRequiredVariableWithNoRealSeparator() { $routes = $this->getRoutes('test', new Route('/get{what}Suffix')); $generator = $this->getGenerator($routes); $this->assertSame('/app.php/getSitesSuffix', $generator->generate('test', array('what' => 'Sites'))); } - public function testDefaultRequirementOfVariable() - { + public function testDefaultRequirementOfVariable() { $routes = $this->getRoutes('test', new Route('/{page}.{_format}')); $generator = $this->getGenerator($routes); @@ -400,8 +358,7 @@ class UrlGeneratorTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException */ - public function testDefaultRequirementOfVariableDisallowsSlash() - { + public function testDefaultRequirementOfVariableDisallowsSlash() { $routes = $this->getRoutes('test', new Route('/{page}.{_format}')); $this->getGenerator($routes)->generate('test', array('page' => 'index', '_format' => 'sl/ash')); } @@ -409,28 +366,24 @@ class UrlGeneratorTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException */ - public function testDefaultRequirementOfVariableDisallowsNextSeparator() - { + public function testDefaultRequirementOfVariableDisallowsNextSeparator() { $routes = $this->getRoutes('test', new Route('/{page}.{_format}')); $this->getGenerator($routes)->generate('test', array('page' => 'do.t', '_format' => 'html')); } - public function testWithHostDifferentFromContext() - { + public function testWithHostDifferentFromContext() { $routes = $this->getRoutes('test', new Route('/{name}', array(), array(), array(), '{locale}.example.com')); $this->assertEquals('//fr.example.com/app.php/Fabien', $this->getGenerator($routes)->generate('test', array('name' => 'Fabien', 'locale' => 'fr'))); } - public function testWithHostSameAsContext() - { + public function testWithHostSameAsContext() { $routes = $this->getRoutes('test', new Route('/{name}', array(), array(), array(), '{locale}.example.com')); $this->assertEquals('/app.php/Fabien', $this->getGenerator($routes, array('host' => 'fr.example.com'))->generate('test', array('name' => 'Fabien', 'locale' => 'fr'))); } - public function testWithHostSameAsContextAndAbsolute() - { + public function testWithHostSameAsContextAndAbsolute() { $routes = $this->getRoutes('test', new Route('/{name}', array(), array(), array(), '{locale}.example.com')); $this->assertEquals('http://fr.example.com/app.php/Fabien', $this->getGenerator($routes, array('host' => 'fr.example.com'))->generate('test', array('name' => 'Fabien', 'locale' => 'fr'), UrlGeneratorInterface::ABSOLUTE_URL)); @@ -439,8 +392,7 @@ class UrlGeneratorTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException */ - public function testUrlWithInvalidParameterInHost() - { + public function testUrlWithInvalidParameterInHost() { $routes = $this->getRoutes('test', new Route('/', array(), array('foo' => 'bar'), array(), '{foo}.example.com')); $this->getGenerator($routes)->generate('test', array('foo' => 'baz'), UrlGeneratorInterface::ABSOLUTE_PATH); } @@ -448,8 +400,7 @@ class UrlGeneratorTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException */ - public function testUrlWithInvalidParameterInHostWhenParamHasADefaultValue() - { + public function testUrlWithInvalidParameterInHostWhenParamHasADefaultValue() { $routes = $this->getRoutes('test', new Route('/', array('foo' => 'bar'), array('foo' => 'bar'), array(), '{foo}.example.com')); $this->getGenerator($routes)->generate('test', array('foo' => 'baz'), UrlGeneratorInterface::ABSOLUTE_PATH); } @@ -457,29 +408,25 @@ class UrlGeneratorTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\InvalidParameterException */ - public function testUrlWithInvalidParameterEqualsDefaultValueInHost() - { + public function testUrlWithInvalidParameterEqualsDefaultValueInHost() { $routes = $this->getRoutes('test', new Route('/', array('foo' => 'baz'), array('foo' => 'bar'), array(), '{foo}.example.com')); $this->getGenerator($routes)->generate('test', array('foo' => 'baz'), UrlGeneratorInterface::ABSOLUTE_PATH); } - public function testUrlWithInvalidParameterInHostInNonStrictMode() - { + public function testUrlWithInvalidParameterInHostInNonStrictMode() { $routes = $this->getRoutes('test', new Route('/', array(), array('foo' => 'bar'), array(), '{foo}.example.com')); $generator = $this->getGenerator($routes); - $generator->setStrictRequirements(false); + $generator->setStrictRequirements(FALSE); $this->assertNull($generator->generate('test', array('foo' => 'baz'), UrlGeneratorInterface::ABSOLUTE_PATH)); } - public function testHostIsCaseInsensitive() - { + public function testHostIsCaseInsensitive() { $routes = $this->getRoutes('test', new Route('/', array(), array('locale' => 'en|de|fr'), array(), '{locale}.FooBar.com')); $generator = $this->getGenerator($routes); $this->assertSame('//EN.FooBar.com/app.php/', $generator->generate('test', array('locale' => 'EN'), UrlGeneratorInterface::NETWORK_PATH)); } - public function testDefaultHostIsUsedWhenContextHostIsEmpty() - { + public function testDefaultHostIsUsedWhenContextHostIsEmpty() { $routes = $this->getRoutes('test', new Route('/route', array('domain' => 'my.fallback.host'), array('domain' => '.+'), array(), '{domain}', array('http'))); $generator = $this->getGenerator($routes); @@ -488,8 +435,7 @@ class UrlGeneratorTest extends TestCase $this->assertSame('http://my.fallback.host/app.php/route', $generator->generate('test', array(), UrlGeneratorInterface::ABSOLUTE_URL)); } - public function testDefaultHostIsUsedWhenContextHostIsEmptyAndSchemeIsNot() - { + public function testDefaultHostIsUsedWhenContextHostIsEmptyAndSchemeIsNot() { $routes = $this->getRoutes('test', new Route('/route', array('domain' => 'my.fallback.host'), array('domain' => '.+'), array(), '{domain}', array('http', 'https'))); $generator = $this->getGenerator($routes); @@ -499,8 +445,7 @@ class UrlGeneratorTest extends TestCase $this->assertSame('https://my.fallback.host/app.php/route', $generator->generate('test', array(), UrlGeneratorInterface::ABSOLUTE_URL)); } - public function testAbsoluteUrlFallbackToRelativeIfHostIsEmptyAndSchemeIsNot() - { + public function testAbsoluteUrlFallbackToRelativeIfHostIsEmptyAndSchemeIsNot() { $routes = $this->getRoutes('test', new Route('/route', array(), array(), array(), '', array('http', 'https'))); $generator = $this->getGenerator($routes); @@ -510,8 +455,7 @@ class UrlGeneratorTest extends TestCase $this->assertSame('/app.php/route', $generator->generate('test', array(), UrlGeneratorInterface::ABSOLUTE_URL)); } - public function testGenerateNetworkPath() - { + public function testGenerateNetworkPath() { $routes = $this->getRoutes('test', new Route('/{name}', array(), array(), array(), '{locale}.example.com', array('http'))); $this->assertSame('//fr.example.com/app.php/Fabien', $this->getGenerator($routes)->generate('test', @@ -528,8 +472,7 @@ class UrlGeneratorTest extends TestCase ); } - public function testGenerateRelativePath() - { + public function testGenerateRelativePath() { $routes = new RouteCollection(); $routes->add('article', new Route('/{author}/{article}/')); $routes->add('comments', new Route('/{author}/{article}/comments')); @@ -555,7 +498,7 @@ class UrlGeneratorTest extends TestCase array('author' => 'bernhard', 'article' => 'forms-are-great'), UrlGeneratorInterface::RELATIVE_PATH) ); $this->assertSame('https://example.com/app.php/bernhard/blog', $generator->generate('scheme', - array('author' => 'bernhard'), UrlGeneratorInterface::RELATIVE_PATH) + array('author' => 'bernhard'), UrlGeneratorInterface::RELATIVE_PATH) ); $this->assertSame('../../about', $generator->generate('unrelated', array(), UrlGeneratorInterface::RELATIVE_PATH) @@ -565,13 +508,11 @@ class UrlGeneratorTest extends TestCase /** * @dataProvider provideRelativePaths */ - public function testGetRelativePath($sourcePath, $targetPath, $expectedPath) - { + public function testGetRelativePath($sourcePath, $targetPath, $expectedPath) { $this->assertSame($expectedPath, UrlGenerator::getRelativePath($sourcePath, $targetPath)); } - public function provideRelativePaths() - { + public function provideRelativePaths() { return array( array( '/same/dir/', @@ -676,8 +617,7 @@ class UrlGeneratorTest extends TestCase ); } - public function testFragmentsCanBeAppendedToUrls() - { + public function testFragmentsCanBeAppendedToUrls() { $routes = $this->getRoutes('test', new Route('/testing')); $url = $this->getGenerator($routes)->generate('test', array('_fragment' => 'frag ment'), UrlGeneratorInterface::ABSOLUTE_PATH); @@ -687,35 +627,31 @@ class UrlGeneratorTest extends TestCase $this->assertEquals('/app.php/testing#0', $url); } - public function testFragmentsDoNotEscapeValidCharacters() - { + public function testFragmentsDoNotEscapeValidCharacters() { $routes = $this->getRoutes('test', new Route('/testing')); $url = $this->getGenerator($routes)->generate('test', array('_fragment' => '?/'), UrlGeneratorInterface::ABSOLUTE_PATH); $this->assertEquals('/app.php/testing#?/', $url); } - public function testFragmentsCanBeDefinedAsDefaults() - { + public function testFragmentsCanBeDefinedAsDefaults() { $routes = $this->getRoutes('test', new Route('/testing', array('_fragment' => 'fragment'))); $url = $this->getGenerator($routes)->generate('test', array(), UrlGeneratorInterface::ABSOLUTE_PATH); $this->assertEquals('/app.php/testing#fragment', $url); } - protected function getGenerator(RouteCollection $routes, array $parameters = array(), $logger = null) - { + protected function getGenerator(RouteCollection $routes, array $parameters = array(), $logger = NULL) { $context = new RequestContext('/app.php'); foreach ($parameters as $key => $value) { - $method = 'set'.$key; + $method = 'set' . $key; $context->$method($value); } return new UrlGenerator($routes, $context, $logger); } - protected function getRoutes($name, Route $route) - { + protected function getRoutes($name, Route $route) { $routes = new RouteCollection(); $routes->add($name, $route); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/AbstractAnnotationLoaderTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/AbstractAnnotationLoaderTest.php index e8bbe8f..cb66c3f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/AbstractAnnotationLoaderTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/AbstractAnnotationLoaderTest.php @@ -15,19 +15,15 @@ use PHPUnit\Framework\TestCase; abstract class AbstractAnnotationLoaderTest extends TestCase { - public function getReader() - { + public function getReader() { return $this->getMockBuilder('Doctrine\Common\Annotations\Reader') ->disableOriginalConstructor() - ->getMock() - ; + ->getMock(); } - public function getClassLoader($reader) - { + public function getClassLoader($reader) { return $this->getMockBuilder('Symfony\Component\Routing\Loader\AnnotationClassLoader') ->setConstructorArgs(array($reader)) - ->getMockForAbstractClass() - ; + ->getMockForAbstractClass(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/AnnotationClassLoaderTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/AnnotationClassLoaderTest.php index 70db1cc..9f302bb 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/AnnotationClassLoaderTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/AnnotationClassLoaderTest.php @@ -18,8 +18,7 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest protected $loader; private $reader; - protected function setUp() - { + protected function setUp() { parent::setUp(); $this->reader = $this->getReader(); @@ -29,48 +28,42 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest /** * @expectedException \InvalidArgumentException */ - public function testLoadMissingClass() - { + public function testLoadMissingClass() { $this->loader->load('MissingClass'); } /** * @expectedException \InvalidArgumentException */ - public function testLoadAbstractClass() - { + public function testLoadAbstractClass() { $this->loader->load('Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\AbstractClass'); } /** * @dataProvider provideTestSupportsChecksResource */ - public function testSupportsChecksResource($resource, $expectedSupports) - { + public function testSupportsChecksResource($resource, $expectedSupports) { $this->assertSame($expectedSupports, $this->loader->supports($resource), '->supports() returns true if the resource is loadable'); } - public function provideTestSupportsChecksResource() - { + public function provideTestSupportsChecksResource() { return array( - array('class', true), - array('\fully\qualified\class\name', true), - array('namespaced\class\without\leading\slash', true), - array('ÿClassWithLegalSpecialCharacters', true), - array('5', false), - array('foo.foo', false), - array(null, false), + array('class', TRUE), + array('\fully\qualified\class\name', TRUE), + array('namespaced\class\without\leading\slash', TRUE), + array('ÿClassWithLegalSpecialCharacters', TRUE), + array('5', FALSE), + array('foo.foo', FALSE), + array(NULL, FALSE), ); } - public function testSupportsChecksTypeIfSpecified() - { + public function testSupportsChecksTypeIfSpecified() { $this->assertTrue($this->loader->supports('class', 'annotation'), '->supports() checks the resource type if specified'); $this->assertFalse($this->loader->supports('class', 'foo'), '->supports() checks the resource type if specified'); } - public function getLoadTests() - { + public function getLoadTests() { return array( array( 'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BarClass', @@ -103,8 +96,7 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest /** * @dataProvider getLoadTests */ - public function testLoad($className, $routeData = array(), $methodArgs = array()) - { + public function testLoad($className, $routeData = array(), $methodArgs = array()) { $routeData = array_replace(array( 'name' => 'route', 'path' => '/', @@ -119,8 +111,7 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest $this->reader ->expects($this->once()) ->method('getMethodAnnotations') - ->will($this->returnValue(array($this->getAnnotatedRoute($routeData)))) - ; + ->will($this->returnValue(array($this->getAnnotatedRoute($routeData)))); $routeCollection = $this->loader->load($className); $route = $routeCollection->get($routeData['name']); @@ -146,8 +137,7 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest $this->assertSame($routeData['condition'], $route->getCondition(), '->load preserves condition annotation'); } - public function testClassRouteLoad() - { + public function testClassRouteLoad() { $classRouteData = array( 'name' => 'prefix_', 'path' => '/prefix', @@ -165,24 +155,21 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest $this->reader ->expects($this->once()) ->method('getClassAnnotation') - ->will($this->returnValue($this->getAnnotatedRoute($classRouteData))) - ; + ->will($this->returnValue($this->getAnnotatedRoute($classRouteData))); $this->reader ->expects($this->once()) ->method('getMethodAnnotations') - ->will($this->returnValue(array($this->getAnnotatedRoute($methodRouteData)))) - ; + ->will($this->returnValue(array($this->getAnnotatedRoute($methodRouteData)))); $routeCollection = $this->loader->load('Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BarClass'); - $route = $routeCollection->get($classRouteData['name'].$methodRouteData['name']); + $route = $routeCollection->get($classRouteData['name'] . $methodRouteData['name']); - $this->assertSame($classRouteData['path'].$methodRouteData['path'], $route->getPath(), '->load concatenates class and method route path'); + $this->assertSame($classRouteData['path'] . $methodRouteData['path'], $route->getPath(), '->load concatenates class and method route path'); $this->assertEquals(array_merge($classRouteData['schemes'], $methodRouteData['schemes']), $route->getSchemes(), '->load merges class and method route schemes'); $this->assertEquals(array_merge($classRouteData['methods'], $methodRouteData['methods']), $route->getMethods(), '->load merges class and method route methods'); } - public function testInvokableClassRouteLoad() - { + public function testInvokableClassRouteLoad() { $classRouteData = array( 'name' => 'route1', 'path' => '/', @@ -193,13 +180,11 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest $this->reader ->expects($this->exactly(2)) ->method('getClassAnnotation') - ->will($this->returnValue($this->getAnnotatedRoute($classRouteData))) - ; + ->will($this->returnValue($this->getAnnotatedRoute($classRouteData))); $this->reader ->expects($this->once()) ->method('getMethodAnnotations') - ->will($this->returnValue(array())) - ; + ->will($this->returnValue(array())); $routeCollection = $this->loader->load('Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BazClass'); $route = $routeCollection->get($classRouteData['name']); @@ -209,8 +194,7 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest $this->assertEquals(array_merge($classRouteData['methods'], $classRouteData['methods']), $route->getMethods(), '->load preserves class route methods'); } - public function testInvokableClassWithMethodRouteLoad() - { + public function testInvokableClassWithMethodRouteLoad() { $classRouteData = array( 'name' => 'route1', 'path' => '/prefix', @@ -228,28 +212,25 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest $this->reader ->expects($this->once()) ->method('getClassAnnotation') - ->will($this->returnValue($this->getAnnotatedRoute($classRouteData))) - ; + ->will($this->returnValue($this->getAnnotatedRoute($classRouteData))); $this->reader ->expects($this->once()) ->method('getMethodAnnotations') - ->will($this->returnValue(array($this->getAnnotatedRoute($methodRouteData)))) - ; + ->will($this->returnValue(array($this->getAnnotatedRoute($methodRouteData)))); $routeCollection = $this->loader->load('Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BazClass'); $route = $routeCollection->get($classRouteData['name']); $this->assertNull($route, '->load ignores class route'); - $route = $routeCollection->get($classRouteData['name'].$methodRouteData['name']); + $route = $routeCollection->get($classRouteData['name'] . $methodRouteData['name']); - $this->assertSame($classRouteData['path'].$methodRouteData['path'], $route->getPath(), '->load concatenates class and method route path'); + $this->assertSame($classRouteData['path'] . $methodRouteData['path'], $route->getPath(), '->load concatenates class and method route path'); $this->assertEquals(array_merge($classRouteData['schemes'], $methodRouteData['schemes']), $route->getSchemes(), '->load merges class and method route schemes'); $this->assertEquals(array_merge($classRouteData['methods'], $methodRouteData['methods']), $route->getMethods(), '->load merges class and method route methods'); } - private function getAnnotatedRoute($data) - { + private function getAnnotatedRoute($data) { return new Route($data); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/AnnotationDirectoryLoaderTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/AnnotationDirectoryLoaderTest.php index 1e8ee39..c4c4dae 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/AnnotationDirectoryLoaderTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/AnnotationDirectoryLoaderTest.php @@ -19,29 +19,25 @@ class AnnotationDirectoryLoaderTest extends AbstractAnnotationLoaderTest protected $loader; protected $reader; - protected function setUp() - { + protected function setUp() { parent::setUp(); $this->reader = $this->getReader(); $this->loader = new AnnotationDirectoryLoader(new FileLocator(), $this->getClassLoader($this->reader)); } - public function testLoad() - { + public function testLoad() { $this->reader->expects($this->exactly(4))->method('getClassAnnotation'); $this->reader ->expects($this->any()) ->method('getMethodAnnotations') - ->will($this->returnValue(array())) - ; + ->will($this->returnValue(array())); - $this->loader->load(__DIR__.'/../Fixtures/AnnotatedClasses'); + $this->loader->load(__DIR__ . '/../Fixtures/AnnotatedClasses'); } - public function testLoadIgnoresHiddenDirectories() - { + public function testLoadIgnoresHiddenDirectories() { $this->expectAnnotationsToBeReadFrom(array( 'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BarClass', 'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BazClass', @@ -52,15 +48,13 @@ class AnnotationDirectoryLoaderTest extends AbstractAnnotationLoaderTest $this->reader ->expects($this->any()) ->method('getMethodAnnotations') - ->will($this->returnValue(array())) - ; + ->will($this->returnValue(array())); - $this->loader->load(__DIR__.'/../Fixtures/AnnotatedClasses'); + $this->loader->load(__DIR__ . '/../Fixtures/AnnotatedClasses'); } - public function testSupports() - { - $fixturesDir = __DIR__.'/../Fixtures'; + public function testSupports() { + $fixturesDir = __DIR__ . '/../Fixtures'; $this->assertTrue($this->loader->supports($fixturesDir), '->supports() returns true if the resource is loadable'); $this->assertFalse($this->loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); @@ -69,26 +63,22 @@ class AnnotationDirectoryLoaderTest extends AbstractAnnotationLoaderTest $this->assertFalse($this->loader->supports($fixturesDir, 'foo'), '->supports() checks the resource type if specified'); } - public function testItSupportsAnyAnnotation() - { - $this->assertTrue($this->loader->supports(__DIR__.'/../Fixtures/even-with-not-existing-folder', 'annotation')); + public function testItSupportsAnyAnnotation() { + $this->assertTrue($this->loader->supports(__DIR__ . '/../Fixtures/even-with-not-existing-folder', 'annotation')); } - public function testLoadFileIfLocatedResourceIsFile() - { + public function testLoadFileIfLocatedResourceIsFile() { $this->reader->expects($this->exactly(1))->method('getClassAnnotation'); $this->reader ->expects($this->any()) ->method('getMethodAnnotations') - ->will($this->returnValue(array())) - ; + ->will($this->returnValue(array())); - $this->loader->load(__DIR__.'/../Fixtures/AnnotatedClasses/FooClass.php'); + $this->loader->load(__DIR__ . '/../Fixtures/AnnotatedClasses/FooClass.php'); } - private function expectAnnotationsToBeReadFrom(array $classes) - { + private function expectAnnotationsToBeReadFrom(array $classes) { $this->reader->expects($this->exactly(count($classes))) ->method('getClassAnnotation') ->with($this->callback(function (\ReflectionClass $class) use ($classes) { diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/AnnotationFileLoaderTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/AnnotationFileLoaderTest.php index 7f1d576..aad3919 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/AnnotationFileLoaderTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/AnnotationFileLoaderTest.php @@ -20,67 +20,60 @@ class AnnotationFileLoaderTest extends AbstractAnnotationLoaderTest protected $loader; protected $reader; - protected function setUp() - { + protected function setUp() { parent::setUp(); $this->reader = $this->getReader(); $this->loader = new AnnotationFileLoader(new FileLocator(), $this->getClassLoader($this->reader)); } - public function testLoad() - { + public function testLoad() { $this->reader->expects($this->once())->method('getClassAnnotation'); - $this->loader->load(__DIR__.'/../Fixtures/AnnotatedClasses/FooClass.php'); + $this->loader->load(__DIR__ . '/../Fixtures/AnnotatedClasses/FooClass.php'); } /** * @requires PHP 5.4 */ - public function testLoadTraitWithClassConstant() - { + public function testLoadTraitWithClassConstant() { $this->reader->expects($this->never())->method('getClassAnnotation'); - $this->loader->load(__DIR__.'/../Fixtures/AnnotatedClasses/FooTrait.php'); + $this->loader->load(__DIR__ . '/../Fixtures/AnnotatedClasses/FooTrait.php'); } /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Did you forgot to add the "loader->load(__DIR__.'/../Fixtures/OtherAnnotatedClasses/NoStartTagClass.php'); + public function testLoadFileWithoutStartTag() { + $this->loader->load(__DIR__ . '/../Fixtures/OtherAnnotatedClasses/NoStartTagClass.php'); } /** * @requires PHP 5.6 */ - public function testLoadVariadic() - { + public function testLoadVariadic() { $route = new Route(array('path' => '/path/to/{id}')); $this->reader->expects($this->once())->method('getClassAnnotation'); $this->reader->expects($this->once())->method('getMethodAnnotations') ->will($this->returnValue(array($route))); - $this->loader->load(__DIR__.'/../Fixtures/OtherAnnotatedClasses/VariadicClass.php'); + $this->loader->load(__DIR__ . '/../Fixtures/OtherAnnotatedClasses/VariadicClass.php'); } /** * @requires PHP 7.0 */ - public function testLoadAnonymousClass() - { + public function testLoadAnonymousClass() { $this->reader->expects($this->never())->method('getClassAnnotation'); $this->reader->expects($this->never())->method('getMethodAnnotations'); - $this->loader->load(__DIR__.'/../Fixtures/OtherAnnotatedClasses/AnonymousClassInTrait.php'); + $this->loader->load(__DIR__ . '/../Fixtures/OtherAnnotatedClasses/AnonymousClassInTrait.php'); } - public function testSupports() - { - $fixture = __DIR__.'/../Fixtures/annotated.php'; + public function testSupports() { + $fixture = __DIR__ . '/../Fixtures/annotated.php'; $this->assertTrue($this->loader->supports($fixture), '->supports() returns true if the resource is loadable'); $this->assertFalse($this->loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/ClosureLoaderTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/ClosureLoaderTest.php index 5d963f8..af728ea 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/ClosureLoaderTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/ClosureLoaderTest.php @@ -18,11 +18,11 @@ use Symfony\Component\Routing\RouteCollection; class ClosureLoaderTest extends TestCase { - public function testSupports() - { + public function testSupports() { $loader = new ClosureLoader(); - $closure = function () {}; + $closure = function () { + }; $this->assertTrue($loader->supports($closure), '->supports() returns true if the resource is loadable'); $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); @@ -31,8 +31,7 @@ class ClosureLoaderTest extends TestCase $this->assertFalse($loader->supports($closure, 'foo'), '->supports() checks the resource type if specified'); } - public function testLoad() - { + public function testLoad() { $loader = new ClosureLoader(); $route = new Route('/'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/DirectoryLoaderTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/DirectoryLoaderTest.php index fc29d37..3bd75a0 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/DirectoryLoaderTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/DirectoryLoaderTest.php @@ -23,8 +23,7 @@ class DirectoryLoaderTest extends AbstractAnnotationLoaderTest private $loader; private $reader; - protected function setUp() - { + protected function setUp() { parent::setUp(); $locator = new FileLocator(); @@ -38,33 +37,29 @@ class DirectoryLoaderTest extends AbstractAnnotationLoaderTest $this->loader->setResolver($resolver); } - public function testLoadDirectory() - { - $collection = $this->loader->load(__DIR__.'/../Fixtures/directory', 'directory'); + public function testLoadDirectory() { + $collection = $this->loader->load(__DIR__ . '/../Fixtures/directory', 'directory'); $this->verifyCollection($collection); } - public function testImportDirectory() - { - $collection = $this->loader->load(__DIR__.'/../Fixtures/directory_import', 'directory'); + public function testImportDirectory() { + $collection = $this->loader->load(__DIR__ . '/../Fixtures/directory_import', 'directory'); $this->verifyCollection($collection); } - private function verifyCollection(RouteCollection $collection) - { + private function verifyCollection(RouteCollection $collection) { $routes = $collection->all(); $this->assertCount(3, $routes, 'Three routes are loaded'); $this->assertContainsOnly('Symfony\Component\Routing\Route', $routes); for ($i = 1; $i <= 3; ++$i) { - $this->assertSame('/route/'.$i, $routes['route'.$i]->getPath()); + $this->assertSame('/route/' . $i, $routes['route' . $i]->getPath()); } } - public function testSupports() - { - $fixturesDir = __DIR__.'/../Fixtures'; + public function testSupports() { + $fixturesDir = __DIR__ . '/../Fixtures'; $this->assertFalse($this->loader->supports($fixturesDir), '->supports(*) returns false'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/GlobFileLoaderTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/GlobFileLoaderTest.php index 08d806a..a2dab5d 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/GlobFileLoaderTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/GlobFileLoaderTest.php @@ -19,27 +19,24 @@ use Symfony\Component\Routing\RouteCollection; class GlobFileLoaderTest extends TestCase { - public function testSupports() - { + public function testSupports() { $loader = new GlobFileLoader(new FileLocator()); $this->assertTrue($loader->supports('any-path', 'glob'), '->supports() returns true if the resource has the glob type'); $this->assertFalse($loader->supports('any-path'), '->supports() returns false if the resource is not of glob type'); } - public function testLoadAddsTheGlobResourceToTheContainer() - { + public function testLoadAddsTheGlobResourceToTheContainer() { $loader = new GlobFileLoaderWithoutImport(new FileLocator()); - $collection = $loader->load(__DIR__.'/../Fixtures/directory/*.yml'); + $collection = $loader->load(__DIR__ . '/../Fixtures/directory/*.yml'); - $this->assertEquals(new GlobResource(__DIR__.'/../Fixtures/directory', '/*.yml', false), $collection->getResources()[0]); + $this->assertEquals(new GlobResource(__DIR__ . '/../Fixtures/directory', '/*.yml', FALSE), $collection->getResources()[0]); } } class GlobFileLoaderWithoutImport extends GlobFileLoader { - public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null) - { + public function import($resource, $type = NULL, $ignoreErrors = FALSE, $sourceResource = NULL) { return new RouteCollection(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/ObjectRouteLoaderTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/ObjectRouteLoaderTest.php index 408fa0b..514589f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/ObjectRouteLoaderTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/ObjectRouteLoaderTest.php @@ -18,8 +18,7 @@ use Symfony\Component\Routing\RouteCollection; class ObjectRouteLoaderTest extends TestCase { - public function testLoadCallsServiceAndReturnsCollection() - { + public function testLoadCallsServiceAndReturnsCollection() { $loader = new ObjectRouteLoaderForTest(); // create a basic collection that will be returned @@ -44,14 +43,12 @@ class ObjectRouteLoaderTest extends TestCase * @expectedException \InvalidArgumentException * @dataProvider getBadResourceStrings */ - public function testExceptionWithoutSyntax($resourceString) - { + public function testExceptionWithoutSyntax($resourceString) { $loader = new ObjectRouteLoaderForTest(); $loader->load($resourceString); } - public function getBadResourceStrings() - { + public function getBadResourceStrings() { return array( array('Foo'), array('Bar::baz'), @@ -62,8 +59,7 @@ class ObjectRouteLoaderTest extends TestCase /** * @expectedException \LogicException */ - public function testExceptionOnNoObjectReturned() - { + public function testExceptionOnNoObjectReturned() { $loader = new ObjectRouteLoaderForTest(); $loader->loaderMap = array('my_service' => 'NOT_AN_OBJECT'); $loader->load('my_service:method'); @@ -72,8 +68,7 @@ class ObjectRouteLoaderTest extends TestCase /** * @expectedException \BadMethodCallException */ - public function testExceptionOnBadMethod() - { + public function testExceptionOnBadMethod() { $loader = new ObjectRouteLoaderForTest(); $loader->loaderMap = array('my_service' => new \stdClass()); $loader->load('my_service:method'); @@ -82,8 +77,7 @@ class ObjectRouteLoaderTest extends TestCase /** * @expectedException \LogicException */ - public function testExceptionOnMethodNotReturningCollection() - { + public function testExceptionOnMethodNotReturningCollection() { $service = $this->getMockBuilder('stdClass') ->setMethods(array('loadRoutes')) ->getMock(); @@ -101,9 +95,8 @@ class ObjectRouteLoaderForTest extends ObjectRouteLoader { public $loaderMap = array(); - protected function getServiceObject($id) - { - return isset($this->loaderMap[$id]) ? $this->loaderMap[$id] : null; + protected function getServiceObject($id) { + return isset($this->loaderMap[$id]) ? $this->loaderMap[$id] : NULL; } } @@ -111,13 +104,11 @@ class RouteService { private $collection; - public function __construct($collection) - { + public function __construct($collection) { $this->collection = $collection; } - public function loadRoutes() - { + public function loadRoutes() { return $this->collection; } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/PhpFileLoaderTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/PhpFileLoaderTest.php index 0dcf5d4..2f5df5b 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/PhpFileLoaderTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/PhpFileLoaderTest.php @@ -20,8 +20,7 @@ use Symfony\Component\Routing\RouteCollection; class PhpFileLoaderTest extends TestCase { - public function testSupports() - { + public function testSupports() { $loader = new PhpFileLoader($this->getMockBuilder('Symfony\Component\Config\FileLocator')->getMock()); $this->assertTrue($loader->supports('foo.php'), '->supports() returns true if the resource is loadable'); @@ -31,9 +30,8 @@ class PhpFileLoaderTest extends TestCase $this->assertFalse($loader->supports('foo.php', 'foo'), '->supports() checks the resource type if specified'); } - public function testLoadWithRoute() - { - $loader = new PhpFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testLoadWithRoute() { + $loader = new PhpFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('validpattern.php'); $routes = $routeCollection->all(); @@ -50,9 +48,8 @@ class PhpFileLoaderTest extends TestCase } } - public function testLoadWithImport() - { - $loader = new PhpFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testLoadWithImport() { + $loader = new PhpFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('validresource.php'); $routes = $routeCollection->all(); @@ -69,9 +66,8 @@ class PhpFileLoaderTest extends TestCase } } - public function testThatDefiningVariableInConfigFileHasNoSideEffects() - { - $locator = new FileLocator(array(__DIR__.'/../Fixtures')); + public function testThatDefiningVariableInConfigFileHasNoSideEffects() { + $locator = new FileLocator(array(__DIR__ . '/../Fixtures')); $loader = new PhpFileLoader($locator); $routeCollection = $loader->load('with_define_path_variable.php'); $resources = $routeCollection->getResources(); @@ -80,20 +76,19 @@ class PhpFileLoaderTest extends TestCase $fileResource = reset($resources); $this->assertSame( realpath($locator->locate('with_define_path_variable.php')), - (string) $fileResource + (string)$fileResource ); } - public function testRoutingConfigurator() - { - $locator = new FileLocator(array(__DIR__.'/../Fixtures')); + public function testRoutingConfigurator() { + $locator = new FileLocator(array(__DIR__ . '/../Fixtures')); $loader = new PhpFileLoader($locator); $routeCollection = $loader->load('php_dsl.php'); $expectedCollection = new RouteCollection(); $expectedCollection->add('foo', (new Route('/foo')) - ->setOptions(array('utf8' => true)) + ->setOptions(array('utf8' => TRUE)) ->setCondition('abc') ); $expectedCollection->add('buz', (new Route('/zub')) @@ -112,15 +107,14 @@ class PhpFileLoaderTest extends TestCase ->setDefaults(array('id' => 0)) ); - $expectedCollection->addResource(new FileResource(realpath(__DIR__.'/../Fixtures/php_dsl_sub.php'))); - $expectedCollection->addResource(new FileResource(realpath(__DIR__.'/../Fixtures/php_dsl.php'))); + $expectedCollection->addResource(new FileResource(realpath(__DIR__ . '/../Fixtures/php_dsl_sub.php'))); + $expectedCollection->addResource(new FileResource(realpath(__DIR__ . '/../Fixtures/php_dsl.php'))); $this->assertEquals($expectedCollection, $routeCollection); } - public function testRoutingConfiguratorCanImportGlobPatterns() - { - $locator = new FileLocator(array(__DIR__.'/../Fixtures/glob')); + public function testRoutingConfiguratorCanImportGlobPatterns() { + $locator = new FileLocator(array(__DIR__ . '/../Fixtures/glob')); $loader = new PhpFileLoader($locator); $routeCollection = $loader->load('php_dsl.php'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/XmlFileLoaderTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/XmlFileLoaderTest.php index 21fc340..62852de 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/XmlFileLoaderTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/XmlFileLoaderTest.php @@ -18,8 +18,7 @@ use Symfony\Component\Routing\Tests\Fixtures\CustomXmlFileLoader; class XmlFileLoaderTest extends TestCase { - public function testSupports() - { + public function testSupports() { $loader = new XmlFileLoader($this->getMockBuilder('Symfony\Component\Config\FileLocator')->getMock()); $this->assertTrue($loader->supports('foo.xml'), '->supports() returns true if the resource is loadable'); @@ -29,9 +28,8 @@ class XmlFileLoaderTest extends TestCase $this->assertFalse($loader->supports('foo.xml', 'foo'), '->supports() checks the resource type if specified'); } - public function testLoadWithRoute() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testLoadWithRoute() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('validpattern.xml'); $route = $routeCollection->get('blog_show'); @@ -46,9 +44,8 @@ class XmlFileLoaderTest extends TestCase $this->assertEquals('context.getMethod() == "GET"', $route->getCondition()); } - public function testLoadWithNamespacePrefix() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testLoadWithNamespacePrefix() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('namespaceprefix.xml'); $this->assertCount(1, $routeCollection->all(), 'One route is loaded'); @@ -64,9 +61,8 @@ class XmlFileLoaderTest extends TestCase $this->assertSame(1, $route->getDefault('page')); } - public function testLoadWithImport() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testLoadWithImport() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('validresource.xml'); $routes = $routeCollection->all(); @@ -87,9 +83,8 @@ class XmlFileLoaderTest extends TestCase * @expectedException \InvalidArgumentException * @dataProvider getPathsToInvalidFiles */ - public function testLoadThrowsExceptionWithInvalidFile($filePath) - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testLoadThrowsExceptionWithInvalidFile($filePath) { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $loader->load($filePath); } @@ -97,14 +92,12 @@ class XmlFileLoaderTest extends TestCase * @expectedException \InvalidArgumentException * @dataProvider getPathsToInvalidFiles */ - public function testLoadThrowsExceptionWithInvalidFileEvenWithoutSchemaValidation($filePath) - { - $loader = new CustomXmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testLoadThrowsExceptionWithInvalidFileEvenWithoutSchemaValidation($filePath) { + $loader = new CustomXmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $loader->load($filePath); } - public function getPathsToInvalidFiles() - { + public function getPathsToInvalidFiles() { return array(array('nonvalidnode.xml'), array('nonvalidroute.xml'), array('nonvalid.xml'), array('missing_id.xml'), array('missing_path.xml')); } @@ -112,15 +105,13 @@ class XmlFileLoaderTest extends TestCase * @expectedException \InvalidArgumentException * @expectedExceptionMessage Document types are not allowed. */ - public function testDocTypeIsNotAllowed() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testDocTypeIsNotAllowed() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $loader->load('withdoctype.xml'); } - public function testNullValues() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testNullValues() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('null_values.xml'); $route = $routeCollection->get('blog_show'); @@ -132,77 +123,72 @@ class XmlFileLoaderTest extends TestCase $this->assertEquals('bar', $route->getDefault('baz')); } - public function testScalarDataTypeDefaults() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testScalarDataTypeDefaults() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('scalar_defaults.xml'); $route = $routeCollection->get('blog'); $this->assertSame( array( '_controller' => 'AcmeBlogBundle:Blog:index', - 'slug' => null, - 'published' => true, + 'slug' => NULL, + 'published' => TRUE, 'page' => 1, 'price' => 3.5, - 'archived' => false, - 'free' => true, - 'locked' => false, - 'foo' => null, - 'bar' => null, + 'archived' => FALSE, + 'free' => TRUE, + 'locked' => FALSE, + 'foo' => NULL, + 'bar' => NULL, ), $route->getDefaults() ); } - public function testListDefaults() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testListDefaults() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('list_defaults.xml'); $route = $routeCollection->get('blog'); $this->assertSame( array( '_controller' => 'AcmeBlogBundle:Blog:index', - 'values' => array(true, 1, 3.5, 'foo'), + 'values' => array(TRUE, 1, 3.5, 'foo'), ), $route->getDefaults() ); } - public function testListInListDefaults() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testListInListDefaults() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('list_in_list_defaults.xml'); $route = $routeCollection->get('blog'); $this->assertSame( array( '_controller' => 'AcmeBlogBundle:Blog:index', - 'values' => array(array(true, 1, 3.5, 'foo')), + 'values' => array(array(TRUE, 1, 3.5, 'foo')), ), $route->getDefaults() ); } - public function testListInMapDefaults() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testListInMapDefaults() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('list_in_map_defaults.xml'); $route = $routeCollection->get('blog'); $this->assertSame( array( '_controller' => 'AcmeBlogBundle:Blog:index', - 'values' => array('list' => array(true, 1, 3.5, 'foo')), + 'values' => array('list' => array(TRUE, 1, 3.5, 'foo')), ), $route->getDefaults() ); } - public function testMapDefaults() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testMapDefaults() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('map_defaults.xml'); $route = $routeCollection->get('blog'); @@ -210,7 +196,7 @@ class XmlFileLoaderTest extends TestCase array( '_controller' => 'AcmeBlogBundle:Blog:index', 'values' => array( - 'public' => true, + 'public' => TRUE, 'page' => 1, 'price' => 3.5, 'title' => 'foo', @@ -220,9 +206,8 @@ class XmlFileLoaderTest extends TestCase ); } - public function testMapInListDefaults() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testMapInListDefaults() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('map_in_list_defaults.xml'); $route = $routeCollection->get('blog'); @@ -230,7 +215,7 @@ class XmlFileLoaderTest extends TestCase array( '_controller' => 'AcmeBlogBundle:Blog:index', 'values' => array(array( - 'public' => true, + 'public' => TRUE, 'page' => 1, 'price' => 3.5, 'title' => 'foo', @@ -240,9 +225,8 @@ class XmlFileLoaderTest extends TestCase ); } - public function testMapInMapDefaults() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testMapInMapDefaults() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('map_in_map_defaults.xml'); $route = $routeCollection->get('blog'); @@ -250,7 +234,7 @@ class XmlFileLoaderTest extends TestCase array( '_controller' => 'AcmeBlogBundle:Blog:index', 'values' => array('map' => array( - 'public' => true, + 'public' => TRUE, 'page' => 1, 'price' => 3.5, 'title' => 'foo', @@ -260,37 +244,34 @@ class XmlFileLoaderTest extends TestCase ); } - public function testNullValuesInList() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testNullValuesInList() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('list_null_values.xml'); $route = $routeCollection->get('blog'); - $this->assertSame(array(null, null, null, null, null, null), $route->getDefault('list')); + $this->assertSame(array(NULL, NULL, NULL, NULL, NULL, NULL), $route->getDefault('list')); } - public function testNullValuesInMap() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testNullValuesInMap() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('map_null_values.xml'); $route = $routeCollection->get('blog'); $this->assertSame( array( - 'boolean' => null, - 'integer' => null, - 'float' => null, - 'string' => null, - 'list' => null, - 'map' => null, + 'boolean' => NULL, + 'integer' => NULL, + 'float' => NULL, + 'string' => NULL, + 'list' => NULL, + 'map' => NULL, ), $route->getDefault('map') ); } - public function testLoadRouteWithControllerAttribute() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/controller'))); + public function testLoadRouteWithControllerAttribute() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures/controller'))); $routeCollection = $loader->load('routing.xml'); $route = $routeCollection->get('app_homepage'); @@ -298,9 +279,8 @@ class XmlFileLoaderTest extends TestCase $this->assertSame('AppBundle:Homepage:show', $route->getDefault('_controller')); } - public function testLoadRouteWithoutControllerAttribute() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/controller'))); + public function testLoadRouteWithoutControllerAttribute() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures/controller'))); $routeCollection = $loader->load('routing.xml'); $route = $routeCollection->get('app_logout'); @@ -308,9 +288,8 @@ class XmlFileLoaderTest extends TestCase $this->assertNull($route->getDefault('_controller')); } - public function testLoadRouteWithControllerSetInDefaults() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/controller'))); + public function testLoadRouteWithControllerSetInDefaults() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures/controller'))); $routeCollection = $loader->load('routing.xml'); $route = $routeCollection->get('app_blog'); @@ -322,18 +301,16 @@ class XmlFileLoaderTest extends TestCase * @expectedException \InvalidArgumentException * @expectedExceptionMessageRegExp /The routing file "[^"]*" must not specify both the "controller" attribute and the defaults key "_controller" for "app_blog"/ */ - public function testOverrideControllerInDefaults() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/controller'))); + public function testOverrideControllerInDefaults() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures/controller'))); $loader->load('override_defaults.xml'); } /** * @dataProvider provideFilesImportingRoutesWithControllers */ - public function testImportRouteWithController($file) - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/controller'))); + public function testImportRouteWithController($file) { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures/controller'))); $routeCollection = $loader->load($file); $route = $routeCollection->get('app_homepage'); @@ -346,8 +323,7 @@ class XmlFileLoaderTest extends TestCase $this->assertSame('FrameworkBundle:Template:template', $route->getDefault('_controller')); } - public function provideFilesImportingRoutesWithControllers() - { + public function provideFilesImportingRoutesWithControllers() { yield array('import_controller.xml'); yield array('import__controller.xml'); } @@ -356,24 +332,21 @@ class XmlFileLoaderTest extends TestCase * @expectedException \InvalidArgumentException * @expectedExceptionMessageRegExp /The routing file "[^"]*" must not specify both the "controller" attribute and the defaults key "_controller" for the "import" tag/ */ - public function testImportWithOverriddenController() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/controller'))); + public function testImportWithOverriddenController() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures/controller'))); $loader->load('import_override_defaults.xml'); } - public function testImportRouteWithGlobMatchingSingleFile() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/glob'))); + public function testImportRouteWithGlobMatchingSingleFile() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures/glob'))); $routeCollection = $loader->load('import_single.xml'); $route = $routeCollection->get('bar_route'); $this->assertSame('AppBundle:Bar:view', $route->getDefault('_controller')); } - public function testImportRouteWithGlobMatchingMultipleFiles() - { - $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/glob'))); + public function testImportRouteWithGlobMatchingMultipleFiles() { + $loader = new XmlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures/glob'))); $routeCollection = $loader->load('import_multiple.xml'); $route = $routeCollection->get('bar_route'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/YamlFileLoaderTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/YamlFileLoaderTest.php index 822bddf..ab8e868 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/YamlFileLoaderTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Loader/YamlFileLoaderTest.php @@ -18,8 +18,7 @@ use Symfony\Component\Config\Resource\FileResource; class YamlFileLoaderTest extends TestCase { - public function testSupports() - { + public function testSupports() { $loader = new YamlFileLoader($this->getMockBuilder('Symfony\Component\Config\FileLocator')->getMock()); $this->assertTrue($loader->supports('foo.yml'), '->supports() returns true if the resource is loadable'); @@ -31,27 +30,24 @@ class YamlFileLoaderTest extends TestCase $this->assertFalse($loader->supports('foo.yml', 'foo'), '->supports() checks the resource type if specified'); } - public function testLoadDoesNothingIfEmpty() - { - $loader = new YamlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testLoadDoesNothingIfEmpty() { + $loader = new YamlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $collection = $loader->load('empty.yml'); $this->assertEquals(array(), $collection->all()); - $this->assertEquals(array(new FileResource(realpath(__DIR__.'/../Fixtures/empty.yml'))), $collection->getResources()); + $this->assertEquals(array(new FileResource(realpath(__DIR__ . '/../Fixtures/empty.yml'))), $collection->getResources()); } /** * @expectedException \InvalidArgumentException * @dataProvider getPathsToInvalidFiles */ - public function testLoadThrowsExceptionWithInvalidFile($filePath) - { - $loader = new YamlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testLoadThrowsExceptionWithInvalidFile($filePath) { + $loader = new YamlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $loader->load($filePath); } - public function getPathsToInvalidFiles() - { + public function getPathsToInvalidFiles() { return array( array('nonvalid.yml'), array('nonvalid2.yml'), @@ -63,9 +59,8 @@ class YamlFileLoaderTest extends TestCase ); } - public function testLoadSpecialRouteName() - { - $loader = new YamlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testLoadSpecialRouteName() { + $loader = new YamlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('special_route_name.yml'); $route = $routeCollection->get('#$péß^a|'); @@ -73,9 +68,8 @@ class YamlFileLoaderTest extends TestCase $this->assertSame('/true', $route->getPath()); } - public function testLoadWithRoute() - { - $loader = new YamlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testLoadWithRoute() { + $loader = new YamlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('validpattern.yml'); $route = $routeCollection->get('blog_show'); @@ -90,9 +84,8 @@ class YamlFileLoaderTest extends TestCase $this->assertEquals('context.getMethod() == "GET"', $route->getCondition()); } - public function testLoadWithResource() - { - $loader = new YamlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures'))); + public function testLoadWithResource() { + $loader = new YamlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures'))); $routeCollection = $loader->load('validresource.yml'); $routes = $routeCollection->all(); @@ -109,9 +102,8 @@ class YamlFileLoaderTest extends TestCase } } - public function testLoadRouteWithControllerAttribute() - { - $loader = new YamlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/controller'))); + public function testLoadRouteWithControllerAttribute() { + $loader = new YamlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures/controller'))); $routeCollection = $loader->load('routing.yml'); $route = $routeCollection->get('app_homepage'); @@ -119,9 +111,8 @@ class YamlFileLoaderTest extends TestCase $this->assertSame('AppBundle:Homepage:show', $route->getDefault('_controller')); } - public function testLoadRouteWithoutControllerAttribute() - { - $loader = new YamlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/controller'))); + public function testLoadRouteWithoutControllerAttribute() { + $loader = new YamlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures/controller'))); $routeCollection = $loader->load('routing.yml'); $route = $routeCollection->get('app_logout'); @@ -129,9 +120,8 @@ class YamlFileLoaderTest extends TestCase $this->assertNull($route->getDefault('_controller')); } - public function testLoadRouteWithControllerSetInDefaults() - { - $loader = new YamlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/controller'))); + public function testLoadRouteWithControllerSetInDefaults() { + $loader = new YamlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures/controller'))); $routeCollection = $loader->load('routing.yml'); $route = $routeCollection->get('app_blog'); @@ -143,18 +133,16 @@ class YamlFileLoaderTest extends TestCase * @expectedException \InvalidArgumentException * @expectedExceptionMessageRegExp /The routing file "[^"]*" must not specify both the "controller" key and the defaults key "_controller" for "app_blog"/ */ - public function testOverrideControllerInDefaults() - { - $loader = new YamlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/controller'))); + public function testOverrideControllerInDefaults() { + $loader = new YamlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures/controller'))); $loader->load('override_defaults.yml'); } /** * @dataProvider provideFilesImportingRoutesWithControllers */ - public function testImportRouteWithController($file) - { - $loader = new YamlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/controller'))); + public function testImportRouteWithController($file) { + $loader = new YamlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures/controller'))); $routeCollection = $loader->load($file); $route = $routeCollection->get('app_homepage'); @@ -167,8 +155,7 @@ class YamlFileLoaderTest extends TestCase $this->assertSame('FrameworkBundle:Template:template', $route->getDefault('_controller')); } - public function provideFilesImportingRoutesWithControllers() - { + public function provideFilesImportingRoutesWithControllers() { yield array('import_controller.yml'); yield array('import__controller.yml'); } @@ -177,24 +164,21 @@ class YamlFileLoaderTest extends TestCase * @expectedException \InvalidArgumentException * @expectedExceptionMessageRegExp /The routing file "[^"]*" must not specify both the "controller" key and the defaults key "_controller" for "_static"/ */ - public function testImportWithOverriddenController() - { - $loader = new YamlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/controller'))); + public function testImportWithOverriddenController() { + $loader = new YamlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures/controller'))); $loader->load('import_override_defaults.yml'); } - public function testImportRouteWithGlobMatchingSingleFile() - { - $loader = new YamlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/glob'))); + public function testImportRouteWithGlobMatchingSingleFile() { + $loader = new YamlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures/glob'))); $routeCollection = $loader->load('import_single.yml'); $route = $routeCollection->get('bar_route'); $this->assertSame('AppBundle:Bar:view', $route->getDefault('_controller')); } - public function testImportRouteWithGlobMatchingMultipleFiles() - { - $loader = new YamlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures/glob'))); + public function testImportRouteWithGlobMatchingMultipleFiles() { + $loader = new YamlFileLoader(new FileLocator(array(__DIR__ . '/../Fixtures/glob'))); $routeCollection = $loader->load('import_multiple.yml'); $route = $routeCollection->get('bar_route'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/DumpedRedirectableUrlMatcherTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/DumpedRedirectableUrlMatcherTest.php index cfbb524..a7eb9a5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/DumpedRedirectableUrlMatcherTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/DumpedRedirectableUrlMatcherTest.php @@ -19,13 +19,12 @@ use Symfony\Component\Routing\RequestContext; class DumpedRedirectableUrlMatcherTest extends RedirectableUrlMatcherTest { - protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = null) - { + protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = NULL) { static $i = 0; - $class = 'DumpedRedirectableUrlMatcher'.++$i; + $class = 'DumpedRedirectableUrlMatcher' . ++$i; $dumper = new PhpMatcherDumper($routes); - eval('?>'.$dumper->dump(array('class' => $class, 'base_class' => 'Symfony\Component\Routing\Tests\Matcher\TestDumpedRedirectableUrlMatcher'))); + eval('?>' . $dumper->dump(array('class' => $class, 'base_class' => 'Symfony\Component\Routing\Tests\Matcher\TestDumpedRedirectableUrlMatcher'))); return $this->getMockBuilder($class) ->setConstructorArgs(array($context ?: new RequestContext())) @@ -36,8 +35,7 @@ class DumpedRedirectableUrlMatcherTest extends RedirectableUrlMatcherTest class TestDumpedRedirectableUrlMatcher extends UrlMatcher implements RedirectableUrlMatcherInterface { - public function redirect($path, $route, $scheme = null) - { + public function redirect($path, $route, $scheme = NULL) { return array(); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/DumpedUrlMatcherTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/DumpedUrlMatcherTest.php index 880b2b1..26fe381 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/DumpedUrlMatcherTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/DumpedUrlMatcherTest.php @@ -21,8 +21,7 @@ class DumpedUrlMatcherTest extends UrlMatcherTest * @expectedException \LogicException * @expectedExceptionMessage The "schemes" requirement is only supported for URL matchers that implement RedirectableUrlMatcherInterface. */ - public function testSchemeRequirement() - { + public function testSchemeRequirement() { parent::testSchemeRequirement(); } @@ -30,18 +29,16 @@ class DumpedUrlMatcherTest extends UrlMatcherTest * @expectedException \LogicException * @expectedExceptionMessage The "schemes" requirement is only supported for URL matchers that implement RedirectableUrlMatcherInterface. */ - public function testSchemeAndMethodMismatch() - { + public function testSchemeAndMethodMismatch() { parent::testSchemeRequirement(); } - protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = null) - { + protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = NULL) { static $i = 0; - $class = 'DumpedUrlMatcher'.++$i; + $class = 'DumpedUrlMatcher' . ++$i; $dumper = new PhpMatcherDumper($routes); - eval('?>'.$dumper->dump(array('class' => $class))); + eval('?>' . $dumper->dump(array('class' => $class))); return new $class($context ?: new RequestContext()); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/Dumper/DumperCollectionTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/Dumper/DumperCollectionTest.php index 823efdb..b0a99f9 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/Dumper/DumperCollectionTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/Dumper/DumperCollectionTest.php @@ -16,8 +16,7 @@ use Symfony\Component\Routing\Matcher\Dumper\DumperCollection; class DumperCollectionTest extends TestCase { - public function testGetRoot() - { + public function testGetRoot() { $a = new DumperCollection(); $b = new DumperCollection(); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php index f29a6d6..e1573c7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php @@ -31,16 +31,14 @@ class PhpMatcherDumperTest extends TestCase */ private $dumpPath; - protected function setUp() - { + protected function setUp() { parent::setUp(); $this->matcherClass = uniqid('ProjectUrlMatcher'); - $this->dumpPath = sys_get_temp_dir().DIRECTORY_SEPARATOR.'php_matcher.'.$this->matcherClass.'.php'; + $this->dumpPath = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'php_matcher.' . $this->matcherClass . '.php'; } - protected function tearDown() - { + protected function tearDown() { parent::tearDown(); @unlink($this->dumpPath); @@ -49,8 +47,7 @@ class PhpMatcherDumperTest extends TestCase /** * @expectedException \LogicException */ - public function testDumpWhenSchemeIsUsedWithoutAProperDumper() - { + public function testDumpWhenSchemeIsUsedWithoutAProperDumper() { $collection = new RouteCollection(); $collection->add('secure', new Route( '/secure', @@ -64,17 +61,16 @@ class PhpMatcherDumperTest extends TestCase $dumper->dump(); } - public function testRedirectPreservesUrlEncoding() - { + public function testRedirectPreservesUrlEncoding() { $collection = new RouteCollection(); $collection->add('foo', new Route('/foo:bar/')); - $class = $this->generateDumpedMatcher($collection, true); + $class = $this->generateDumpedMatcher($collection, TRUE); $matcher = $this->getMockBuilder($class) - ->setMethods(array('redirect')) - ->setConstructorArgs(array(new RequestContext())) - ->getMock(); + ->setMethods(array('redirect')) + ->setConstructorArgs(array(new RequestContext())) + ->getMock(); $matcher->expects($this->once())->method('redirect')->with('/foo%3Abar/', 'foo')->willReturn(array()); @@ -84,16 +80,14 @@ class PhpMatcherDumperTest extends TestCase /** * @dataProvider getRouteCollections */ - public function testDump(RouteCollection $collection, $fixture, $options = array()) - { - $basePath = __DIR__.'/../../Fixtures/dumper/'; + public function testDump(RouteCollection $collection, $fixture, $options = array()) { + $basePath = __DIR__ . '/../../Fixtures/dumper/'; $dumper = new PhpMatcherDumper($collection); - $this->assertStringEqualsFile($basePath.$fixture, $dumper->dump($options), '->dump() correctly dumps routes as optimized PHP code.'); + $this->assertStringEqualsFile($basePath . $fixture, $dumper->dump($options), '->dump() correctly dumps routes as optimized PHP code.'); } - public function getRouteCollections() - { + public function getRouteCollections() { /* test case 1 */ $collection = new RouteCollection(); @@ -244,7 +238,7 @@ class PhpMatcherDumperTest extends TestCase $route5 = new Route('/route5', array(), array(), array(), 'c.example.com'); $collection1->add('route5', $route5); - $route6 = new Route('/route6', array(), array(), array(), null); + $route6 = new Route('/route6', array(), array(), array(), NULL); $collection1->add('route6', $route6); $collection->addCollection($collection1); @@ -268,10 +262,10 @@ class PhpMatcherDumperTest extends TestCase $route15 = new Route('/route15/{name}', array(), array(), array(), 'c.example.com'); $collection1->add('route15', $route15); - $route16 = new Route('/route16/{name}', array('var1' => 'val'), array(), array(), null); + $route16 = new Route('/route16/{name}', array('var1' => 'val'), array(), array(), NULL); $collection1->add('route16', $route16); - $route17 = new Route('/route17', array(), array(), array(), null); + $route17 = new Route('/route17', array(), array(), array(), NULL); $collection1->add('route17', $route17); $collection->addCollection($collection1); @@ -419,22 +413,21 @@ class PhpMatcherDumperTest extends TestCase $trailingSlashCollection->add('regex_not_trailing_slash_POST_method', new Route('/not-trailing/regex/post-method/{param}', array(), array(), array(), '', array(), array('POST'))); return array( - array(new RouteCollection(), 'url_matcher0.php', array()), - array($collection, 'url_matcher1.php', array()), - array($redirectCollection, 'url_matcher2.php', array('base_class' => 'Symfony\Component\Routing\Tests\Fixtures\RedirectableUrlMatcher')), - array($rootprefixCollection, 'url_matcher3.php', array()), - array($headMatchCasesCollection, 'url_matcher4.php', array()), - array($groupOptimisedCollection, 'url_matcher5.php', array('base_class' => 'Symfony\Component\Routing\Tests\Fixtures\RedirectableUrlMatcher')), - array($trailingSlashCollection, 'url_matcher6.php', array()), - array($trailingSlashCollection, 'url_matcher7.php', array('base_class' => 'Symfony\Component\Routing\Tests\Fixtures\RedirectableUrlMatcher')), + array(new RouteCollection(), 'url_matcher0.php', array()), + array($collection, 'url_matcher1.php', array()), + array($redirectCollection, 'url_matcher2.php', array('base_class' => 'Symfony\Component\Routing\Tests\Fixtures\RedirectableUrlMatcher')), + array($rootprefixCollection, 'url_matcher3.php', array()), + array($headMatchCasesCollection, 'url_matcher4.php', array()), + array($groupOptimisedCollection, 'url_matcher5.php', array('base_class' => 'Symfony\Component\Routing\Tests\Fixtures\RedirectableUrlMatcher')), + array($trailingSlashCollection, 'url_matcher6.php', array()), + array($trailingSlashCollection, 'url_matcher7.php', array('base_class' => 'Symfony\Component\Routing\Tests\Fixtures\RedirectableUrlMatcher')), ); } /** * @param $dumper */ - private function generateDumpedMatcher(RouteCollection $collection, $redirectableStub = false) - { + private function generateDumpedMatcher(RouteCollection $collection, $redirectableStub = FALSE) { $options = array('class' => $this->matcherClass); if ($redirectableStub) { @@ -453,7 +446,6 @@ class PhpMatcherDumperTest extends TestCase abstract class RedirectableUrlMatcherStub extends UrlMatcher implements RedirectableUrlMatcherInterface { - public function redirect($path, $route, $scheme = null) - { + public function redirect($path, $route, $scheme = NULL) { } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/Dumper/StaticPrefixCollectionTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/Dumper/StaticPrefixCollectionTest.php index 37419e7..68f514f 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/Dumper/StaticPrefixCollectionTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/Dumper/StaticPrefixCollectionTest.php @@ -11,8 +11,7 @@ class StaticPrefixCollectionTest extends TestCase /** * @dataProvider routeProvider */ - public function testGrouping(array $routes, $expected) - { + public function testGrouping(array $routes, $expected) { $collection = new StaticPrefixCollection('/'); foreach ($routes as $route) { @@ -26,8 +25,7 @@ class StaticPrefixCollectionTest extends TestCase $this->assertEquals($expected, $dumped); } - public function routeProvider() - { + public function routeProvider() { return array( 'Simple - not nested' => array( array( @@ -157,16 +155,15 @@ EOF ); } - private function dumpCollection(StaticPrefixCollection $collection, $prefix = '') - { + private function dumpCollection(StaticPrefixCollection $collection, $prefix = '') { $lines = array(); foreach ($collection->getItems() as $item) { if ($item instanceof StaticPrefixCollection) { - $lines[] = $prefix.$item->getPrefix(); - $lines[] = $this->dumpCollection($item, $prefix.'-> '); + $lines[] = $prefix . $item->getPrefix(); + $lines[] = $this->dumpCollection($item, $prefix . '-> '); } else { - $lines[] = $prefix.implode(' ', $item); + $lines[] = $prefix . implode(' ', $item); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/RedirectableUrlMatcherTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/RedirectableUrlMatcherTest.php index 7984391..9ec5a2a 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/RedirectableUrlMatcherTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/RedirectableUrlMatcherTest.php @@ -17,8 +17,7 @@ use Symfony\Component\Routing\RequestContext; class RedirectableUrlMatcherTest extends UrlMatcherTest { - public function testMissingTrailingSlash() - { + public function testMissingTrailingSlash() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo/')); @@ -30,8 +29,7 @@ class RedirectableUrlMatcherTest extends UrlMatcherTest /** * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException */ - public function testRedirectWhenNoSlashForNonSafeMethod() - { + public function testRedirectWhenNoSlashForNonSafeMethod() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo/')); @@ -41,8 +39,7 @@ class RedirectableUrlMatcherTest extends UrlMatcherTest $matcher->match('/foo'); } - public function testSchemeRedirectRedirectsToFirstScheme() - { + public function testSchemeRedirectRedirectsToFirstScheme() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo', array(), array(), array(), '', array('FTP', 'HTTPS'))); @@ -51,13 +48,11 @@ class RedirectableUrlMatcherTest extends UrlMatcherTest ->expects($this->once()) ->method('redirect') ->with('/foo', 'foo', 'ftp') - ->will($this->returnValue(array('_route' => 'foo'))) - ; + ->will($this->returnValue(array('_route' => 'foo'))); $matcher->match('/foo'); } - public function testNoSchemaRedirectIfOneOfMultipleSchemesMatches() - { + public function testNoSchemaRedirectIfOneOfMultipleSchemesMatches() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo', array(), array(), array(), '', array('https', 'http'))); @@ -68,8 +63,7 @@ class RedirectableUrlMatcherTest extends UrlMatcherTest $matcher->match('/foo'); } - public function testSchemeRedirectWithParams() - { + public function testSchemeRedirectWithParams() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo/{bar}', array(), array(), array(), '', array('https'))); @@ -78,13 +72,11 @@ class RedirectableUrlMatcherTest extends UrlMatcherTest ->expects($this->once()) ->method('redirect') ->with('/foo/baz', 'foo', 'https') - ->will($this->returnValue(array('redirect' => 'value'))) - ; + ->will($this->returnValue(array('redirect' => 'value'))); $this->assertEquals(array('_route' => 'foo', 'bar' => 'baz', 'redirect' => 'value'), $matcher->match('/foo/baz')); } - public function testSlashRedirectWithParams() - { + public function testSlashRedirectWithParams() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo/{bar}/')); @@ -92,14 +84,12 @@ class RedirectableUrlMatcherTest extends UrlMatcherTest $matcher ->expects($this->once()) ->method('redirect') - ->with('/foo/baz/', 'foo', null) - ->will($this->returnValue(array('redirect' => 'value'))) - ; + ->with('/foo/baz/', 'foo', NULL) + ->will($this->returnValue(array('redirect' => 'value'))); $this->assertEquals(array('_route' => 'foo', 'bar' => 'baz', 'redirect' => 'value'), $matcher->match('/foo/baz')); } - public function testRedirectPreservesUrlEncoding() - { + public function testRedirectPreservesUrlEncoding() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo:bar/')); @@ -108,8 +98,7 @@ class RedirectableUrlMatcherTest extends UrlMatcherTest $matcher->match('/foo%3Abar'); } - public function testSchemeRequirement() - { + public function testSchemeRequirement() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo', array(), array(), array(), '', array('https'))); $matcher = $this->getUrlMatcher($coll, new RequestContext()); @@ -117,8 +106,7 @@ class RedirectableUrlMatcherTest extends UrlMatcherTest $this->assertSame(array('_route' => 'foo'), $matcher->match('/foo')); } - protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = null) - { + protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = NULL) { return $this->getMockForAbstractClass('Symfony\Component\Routing\Matcher\RedirectableUrlMatcher', array($routes, $context ?: new RequestContext())); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/TraceableUrlMatcherTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/TraceableUrlMatcherTest.php index 9f0529e..94fd2f6 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/TraceableUrlMatcherTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/TraceableUrlMatcherTest.php @@ -20,8 +20,7 @@ use Symfony\Component\Routing\Matcher\TraceableUrlMatcher; class TraceableUrlMatcherTest extends TestCase { - public function test() - { + public function test() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo', array(), array(), array(), '', array(), array('POST'))); $coll->add('bar', new Route('/bar/{id}', array(), array('id' => '\d+'))); @@ -60,8 +59,7 @@ class TraceableUrlMatcherTest extends TestCase $this->assertSame(array(0, 0, 0, 0, 0, 1), $this->getLevels($traces)); } - public function testMatchRouteOnMultipleHosts() - { + public function testMatchRouteOnMultipleHosts() { $routes = new RouteCollection(); $routes->add('first', new Route( '/mypath/', @@ -91,8 +89,7 @@ class TraceableUrlMatcherTest extends TestCase ); } - public function getLevels($traces) - { + public function getLevels($traces) { $levels = array(); foreach ($traces as $trace) { $levels[] = $trace['level']; @@ -101,8 +98,7 @@ class TraceableUrlMatcherTest extends TestCase return $levels; } - public function testRoutesWithConditions() - { + public function testRoutesWithConditions() { $routes = new RouteCollection(); $routes->add('foo', new Route('/foo', array(), array(), array(), 'baz', array(), array(), "request.headers.get('User-Agent') matches '/firefox/i'")); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/UrlMatcherTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/UrlMatcherTest.php index e8d31e2..32a9956 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/UrlMatcherTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/Matcher/UrlMatcherTest.php @@ -21,8 +21,7 @@ use Symfony\Component\Routing\RequestContext; class UrlMatcherTest extends TestCase { - public function testNoMethodSoAllowed() - { + public function testNoMethodSoAllowed() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo')); @@ -30,8 +29,7 @@ class UrlMatcherTest extends TestCase $this->assertInternalType('array', $matcher->match('/foo')); } - public function testMethodNotAllowed() - { + public function testMethodNotAllowed() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo', array(), array(), array(), '', array(), array('post'))); @@ -45,8 +43,7 @@ class UrlMatcherTest extends TestCase } } - public function testMethodNotAllowedOnRoot() - { + public function testMethodNotAllowedOnRoot() { $coll = new RouteCollection(); $coll->add('foo', new Route('/', array(), array(), array(), '', array(), array('GET'))); @@ -60,8 +57,7 @@ class UrlMatcherTest extends TestCase } } - public function testHeadAllowedWhenRequirementContainsGet() - { + public function testHeadAllowedWhenRequirementContainsGet() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo', array(), array(), array(), '', array(), array('get'))); @@ -69,8 +65,7 @@ class UrlMatcherTest extends TestCase $this->assertInternalType('array', $matcher->match('/foo')); } - public function testMethodNotAllowedAggregatesAllowedMethods() - { + public function testMethodNotAllowedAggregatesAllowedMethods() { $coll = new RouteCollection(); $coll->add('foo1', new Route('/foo', array(), array(), array(), '', array(), array('post'))); $coll->add('foo2', new Route('/foo', array(), array(), array(), '', array(), array('put', 'delete'))); @@ -85,8 +80,7 @@ class UrlMatcherTest extends TestCase } } - public function testMatch() - { + public function testMatch() { // test the patterns are matched and parameters are returned $collection = new RouteCollection(); $collection->add('foo', new Route('/foo/{bar}')); @@ -146,8 +140,7 @@ class UrlMatcherTest extends TestCase $this->assertEquals(array('_route' => 'bar', 'foo' => 'a', 'bar' => 'b'), $matcher->match('/a/b')); } - public function testMatchWithPrefixes() - { + public function testMatchWithPrefixes() { $collection = new RouteCollection(); $collection->add('foo', new Route('/{foo}')); $collection->addPrefix('/b'); @@ -157,8 +150,7 @@ class UrlMatcherTest extends TestCase $this->assertEquals(array('_route' => 'foo', 'foo' => 'foo'), $matcher->match('/a/b/foo')); } - public function testMatchWithDynamicPrefix() - { + public function testMatchWithDynamicPrefix() { $collection = new RouteCollection(); $collection->add('foo', new Route('/{foo}')); $collection->addPrefix('/b'); @@ -168,8 +160,7 @@ class UrlMatcherTest extends TestCase $this->assertEquals(array('_locale' => 'fr', '_route' => 'foo', 'foo' => 'foo'), $matcher->match('/fr/b/foo')); } - public function testMatchSpecialRouteName() - { + public function testMatchSpecialRouteName() { $collection = new RouteCollection(); $collection->add('$péß^a|', new Route('/bar')); @@ -180,8 +171,7 @@ class UrlMatcherTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException */ - public function testTrailingEncodedNewlineIsNotOverlooked() - { + public function testTrailingEncodedNewlineIsNotOverlooked() { $collection = new RouteCollection(); $collection->add('foo', new Route('/foo')); @@ -189,28 +179,25 @@ class UrlMatcherTest extends TestCase $matcher->match('/foo%0a'); } - public function testMatchNonAlpha() - { + public function testMatchNonAlpha() { $collection = new RouteCollection(); $chars = '!"$%éà &\'()*+,./:;<=>@ABCDEFGHIJKLMNOPQRSTUVWXYZ\\[]^_`abcdefghijklmnopqrstuvwxyz{|}~-'; - $collection->add('foo', new Route('/{foo}/bar', array(), array('foo' => '['.preg_quote($chars).']+'), array('utf8' => true))); + $collection->add('foo', new Route('/{foo}/bar', array(), array('foo' => '[' . preg_quote($chars) . ']+'), array('utf8' => TRUE))); $matcher = $this->getUrlMatcher($collection); - $this->assertEquals(array('_route' => 'foo', 'foo' => $chars), $matcher->match('/'.rawurlencode($chars).'/bar')); - $this->assertEquals(array('_route' => 'foo', 'foo' => $chars), $matcher->match('/'.strtr($chars, array('%' => '%25')).'/bar')); + $this->assertEquals(array('_route' => 'foo', 'foo' => $chars), $matcher->match('/' . rawurlencode($chars) . '/bar')); + $this->assertEquals(array('_route' => 'foo', 'foo' => $chars), $matcher->match('/' . strtr($chars, array('%' => '%25')) . '/bar')); } - public function testMatchWithDotMetacharacterInRequirements() - { + public function testMatchWithDotMetacharacterInRequirements() { $collection = new RouteCollection(); $collection->add('foo', new Route('/{foo}/bar', array(), array('foo' => '.+'))); $matcher = $this->getUrlMatcher($collection); - $this->assertEquals(array('_route' => 'foo', 'foo' => "\n"), $matcher->match('/'.urlencode("\n").'/bar'), 'linefeed character is matched'); + $this->assertEquals(array('_route' => 'foo', 'foo' => "\n"), $matcher->match('/' . urlencode("\n") . '/bar'), 'linefeed character is matched'); } - public function testMatchOverriddenRoute() - { + public function testMatchOverriddenRoute() { $collection = new RouteCollection(); $collection->add('foo', new Route('/foo')); @@ -226,8 +213,7 @@ class UrlMatcherTest extends TestCase $this->assertEquals(array(), $matcher->match('/foo')); } - public function testMatchRegression() - { + public function testMatchRegression() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo/{foo}')); $coll->add('bar', new Route('/foo/bar/{foo}')); @@ -245,8 +231,7 @@ class UrlMatcherTest extends TestCase } } - public function testDefaultRequirementForOptionalVariables() - { + public function testDefaultRequirementForOptionalVariables() { $coll = new RouteCollection(); $coll->add('test', new Route('/{page}.{_format}', array('page' => 'index', '_format' => 'html'))); @@ -254,8 +239,7 @@ class UrlMatcherTest extends TestCase $this->assertEquals(array('page' => 'my-page', '_format' => 'xml', '_route' => 'test'), $matcher->match('/my-page.xml')); } - public function testMatchingIsEager() - { + public function testMatchingIsEager() { $coll = new RouteCollection(); $coll->add('test', new Route('/{foo}-{bar}-', array(), array('foo' => '.+', 'bar' => '.+'))); @@ -263,8 +247,7 @@ class UrlMatcherTest extends TestCase $this->assertEquals(array('foo' => 'text1-text2-text3', 'bar' => 'text4', '_route' => 'test'), $matcher->match('/text1-text2-text3-text4-')); } - public function testAdjacentVariables() - { + public function testAdjacentVariables() { $coll = new RouteCollection(); $coll->add('test', new Route('/{w}{x}{y}{z}.{_format}', array('z' => 'default-z', '_format' => 'html'), array('y' => 'y|Y'))); @@ -283,8 +266,7 @@ class UrlMatcherTest extends TestCase $matcher->match('/wxy.html'); } - public function testOptionalVariableWithNoRealSeparator() - { + public function testOptionalVariableWithNoRealSeparator() { $coll = new RouteCollection(); $coll->add('test', new Route('/get{what}', array('what' => 'All'))); $matcher = $this->getUrlMatcher($coll); @@ -298,8 +280,7 @@ class UrlMatcherTest extends TestCase $matcher->match('/ge'); } - public function testRequiredVariableWithNoRealSeparator() - { + public function testRequiredVariableWithNoRealSeparator() { $coll = new RouteCollection(); $coll->add('test', new Route('/get{what}Suffix')); $matcher = $this->getUrlMatcher($coll); @@ -307,8 +288,7 @@ class UrlMatcherTest extends TestCase $this->assertEquals(array('what' => 'Sites', '_route' => 'test'), $matcher->match('/getSitesSuffix')); } - public function testDefaultRequirementOfVariable() - { + public function testDefaultRequirementOfVariable() { $coll = new RouteCollection(); $coll->add('test', new Route('/{page}.{_format}')); $matcher = $this->getUrlMatcher($coll); @@ -319,8 +299,7 @@ class UrlMatcherTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException */ - public function testDefaultRequirementOfVariableDisallowsSlash() - { + public function testDefaultRequirementOfVariableDisallowsSlash() { $coll = new RouteCollection(); $coll->add('test', new Route('/{page}.{_format}')); $matcher = $this->getUrlMatcher($coll); @@ -331,8 +310,7 @@ class UrlMatcherTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException */ - public function testDefaultRequirementOfVariableDisallowsNextSeparator() - { + public function testDefaultRequirementOfVariableDisallowsNextSeparator() { $coll = new RouteCollection(); $coll->add('test', new Route('/{page}.{_format}', array(), array('_format' => 'html|xml'))); $matcher = $this->getUrlMatcher($coll); @@ -343,8 +321,7 @@ class UrlMatcherTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException */ - public function testSchemeRequirement() - { + public function testSchemeRequirement() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo', array(), array(), array(), '', array('https'))); $matcher = $this->getUrlMatcher($coll); @@ -354,8 +331,7 @@ class UrlMatcherTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException */ - public function testCondition() - { + public function testCondition() { $coll = new RouteCollection(); $route = new Route('/foo'); $route->setCondition('context.getMethod() == "POST"'); @@ -364,8 +340,7 @@ class UrlMatcherTest extends TestCase $matcher->match('/foo'); } - public function testRequestCondition() - { + public function testRequestCondition() { $coll = new RouteCollection(); $route = new Route('/foo/{bar}'); $route->setCondition('request.getBaseUrl() == "/sub/front.php" and request.getPathInfo() == "/foo/bar"'); @@ -374,8 +349,7 @@ class UrlMatcherTest extends TestCase $this->assertEquals(array('bar' => 'bar', '_route' => 'foo'), $matcher->match('/foo/bar')); } - public function testDecodeOnce() - { + public function testDecodeOnce() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo/{foo}')); @@ -383,8 +357,7 @@ class UrlMatcherTest extends TestCase $this->assertEquals(array('foo' => 'bar%23', '_route' => 'foo'), $matcher->match('/foo/bar%2523')); } - public function testCannotRelyOnPrefix() - { + public function testCannotRelyOnPrefix() { $coll = new RouteCollection(); $subColl = new RouteCollection(); @@ -399,8 +372,7 @@ class UrlMatcherTest extends TestCase $this->assertEquals(array('_route' => 'bar'), $matcher->match('/new')); } - public function testWithHost() - { + public function testWithHost() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo/{foo}', array(), array(), array(), '{locale}.example.com')); @@ -408,8 +380,7 @@ class UrlMatcherTest extends TestCase $this->assertEquals(array('foo' => 'bar', '_route' => 'foo', 'locale' => 'en'), $matcher->match('/foo/bar')); } - public function testWithHostOnRouteCollection() - { + public function testWithHostOnRouteCollection() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo/{foo}')); $coll->add('bar', new Route('/bar/{foo}', array(), array(), array(), '{locale}.example.net')); @@ -425,8 +396,7 @@ class UrlMatcherTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException */ - public function testWithOutHostHostDoesNotMatch() - { + public function testWithOutHostHostDoesNotMatch() { $coll = new RouteCollection(); $coll->add('foo', new Route('/foo/{foo}', array(), array(), array(), '{locale}.example.com')); @@ -437,8 +407,7 @@ class UrlMatcherTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException */ - public function testPathIsCaseSensitive() - { + public function testPathIsCaseSensitive() { $coll = new RouteCollection(); $coll->add('foo', new Route('/locale', array(), array('locale' => 'EN|FR|DE'))); @@ -446,8 +415,7 @@ class UrlMatcherTest extends TestCase $matcher->match('/en'); } - public function testHostIsCaseInsensitive() - { + public function testHostIsCaseInsensitive() { $coll = new RouteCollection(); $coll->add('foo', new Route('/', array(), array('locale' => 'EN|FR|DE'), array(), '{locale}.example.com')); @@ -458,16 +426,14 @@ class UrlMatcherTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\NoConfigurationException */ - public function testNoConfiguration() - { + public function testNoConfiguration() { $coll = new RouteCollection(); $matcher = $this->getUrlMatcher($coll); $matcher->match('/'); } - public function testNestedCollections() - { + public function testNestedCollections() { $coll = new RouteCollection(); $subColl = new RouteCollection(); @@ -493,17 +459,15 @@ class UrlMatcherTest extends TestCase /** * @expectedException \Symfony\Component\Routing\Exception\ResourceNotFoundException */ - public function testSchemeAndMethodMismatch() - { + public function testSchemeAndMethodMismatch() { $coll = new RouteCollection(); - $coll->add('foo', new Route('/', array(), array(), array(), null, array('https'), array('POST'))); + $coll->add('foo', new Route('/', array(), array(), array(), NULL, array('https'), array('POST'))); $matcher = $this->getUrlMatcher($coll); $matcher->match('/'); } - protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = null) - { + protected function getUrlMatcher(RouteCollection $routes, RequestContext $context = NULL) { return new UrlMatcher($routes, $context ?: new RequestContext()); } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RequestContextTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RequestContextTest.php index ffe29d1..9debf77 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RequestContextTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RequestContextTest.php @@ -17,8 +17,7 @@ use Symfony\Component\Routing\RequestContext; class RequestContextTest extends TestCase { - public function testConstruct() - { + public function testConstruct() { $requestContext = new RequestContext( 'foo', 'post', @@ -40,8 +39,7 @@ class RequestContextTest extends TestCase $this->assertEquals('bar=foobar', $requestContext->getQueryString()); } - public function testFromRequest() - { + public function testFromRequest() { $request = Request::create('https://test.com:444/foo?bar=baz'); $requestContext = new RequestContext(); $requestContext->setHttpPort(123); @@ -65,8 +63,7 @@ class RequestContextTest extends TestCase $this->assertSame(567, $requestContext->getHttpsPort()); } - public function testGetParameters() - { + public function testGetParameters() { $requestContext = new RequestContext(); $this->assertEquals(array(), $requestContext->getParameters()); @@ -74,8 +71,7 @@ class RequestContextTest extends TestCase $this->assertEquals(array('foo' => 'bar'), $requestContext->getParameters()); } - public function testHasParameter() - { + public function testHasParameter() { $requestContext = new RequestContext(); $requestContext->setParameters(array('foo' => 'bar')); @@ -83,8 +79,7 @@ class RequestContextTest extends TestCase $this->assertFalse($requestContext->hasParameter('baz')); } - public function testGetParameter() - { + public function testGetParameter() { $requestContext = new RequestContext(); $requestContext->setParameters(array('foo' => 'bar')); @@ -92,48 +87,42 @@ class RequestContextTest extends TestCase $this->assertNull($requestContext->getParameter('baz')); } - public function testSetParameter() - { + public function testSetParameter() { $requestContext = new RequestContext(); $requestContext->setParameter('foo', 'bar'); $this->assertEquals('bar', $requestContext->getParameter('foo')); } - public function testMethod() - { + public function testMethod() { $requestContext = new RequestContext(); $requestContext->setMethod('post'); $this->assertSame('POST', $requestContext->getMethod()); } - public function testScheme() - { + public function testScheme() { $requestContext = new RequestContext(); $requestContext->setScheme('HTTPS'); $this->assertSame('https', $requestContext->getScheme()); } - public function testHost() - { + public function testHost() { $requestContext = new RequestContext(); $requestContext->setHost('eXampLe.com'); $this->assertSame('example.com', $requestContext->getHost()); } - public function testQueryString() - { + public function testQueryString() { $requestContext = new RequestContext(); - $requestContext->setQueryString(null); + $requestContext->setQueryString(NULL); $this->assertSame('', $requestContext->getQueryString()); } - public function testPort() - { + public function testPort() { $requestContext = new RequestContext(); $requestContext->setHttpPort('123'); $requestContext->setHttpsPort('456'); @@ -142,8 +131,7 @@ class RequestContextTest extends TestCase $this->assertSame(456, $requestContext->getHttpsPort()); } - public function testFluentInterface() - { + public function testFluentInterface() { $requestContext = new RequestContext(); $this->assertSame($requestContext, $requestContext->setBaseUrl('/app.php')); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouteCollectionBuilderTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouteCollectionBuilderTest.php index 76a042d..0eea0e5 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouteCollectionBuilderTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouteCollectionBuilderTest.php @@ -21,8 +21,7 @@ use Symfony\Component\Routing\RouteCollectionBuilder; class RouteCollectionBuilderTest extends TestCase { - public function testImport() - { + public function testImport() { $resolvedLoader = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock(); $resolver = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderResolverInterface')->getMock(); $resolver->expects($this->once()) @@ -33,7 +32,7 @@ class RouteCollectionBuilderTest extends TestCase $originalRoute = new Route('/foo/path'); $expectedCollection = new RouteCollection(); $expectedCollection->add('one_test_route', $originalRoute); - $expectedCollection->addResource(new FileResource(__DIR__.'/Fixtures/file_resource.yml')); + $expectedCollection->addResource(new FileResource(__DIR__ . '/Fixtures/file_resource.yml')); $resolvedLoader ->expects($this->once()) @@ -66,9 +65,8 @@ class RouteCollectionBuilderTest extends TestCase $this->assertCount(1, $routeCollection->getResources()); } - public function testImportAddResources() - { - $routeCollectionBuilder = new RouteCollectionBuilder(new YamlFileLoader(new FileLocator(array(__DIR__.'/Fixtures/')))); + public function testImportAddResources() { + $routeCollectionBuilder = new RouteCollectionBuilder(new YamlFileLoader(new FileLocator(array(__DIR__ . '/Fixtures/')))); $routeCollectionBuilder->import('file_resource.yml'); $routeCollection = $routeCollectionBuilder->build(); @@ -78,14 +76,12 @@ class RouteCollectionBuilderTest extends TestCase /** * @expectedException \BadMethodCallException */ - public function testImportWithoutLoaderThrowsException() - { + public function testImportWithoutLoaderThrowsException() { $collectionBuilder = new RouteCollectionBuilder(); $collectionBuilder->import('routing.yml'); } - public function testAdd() - { + public function testAdd() { $collectionBuilder = new RouteCollectionBuilder(); $addedRoute = $collectionBuilder->add('/checkout', 'AppBundle:Order:checkout'); @@ -97,8 +93,7 @@ class RouteCollectionBuilderTest extends TestCase $this->assertSame($addedRoute2, $finalCollection->get('blog_list')); } - public function testFlushOrdering() - { + public function testFlushOrdering() { $importedCollection = new RouteCollection(); $importedCollection->add('imported_route1', new Route('/imported/foo1')); $importedCollection->add('imported_route2', new Route('/imported/foo2')); @@ -107,7 +102,7 @@ class RouteCollectionBuilderTest extends TestCase // make this loader able to do the import - keeps mocking simple $loader->expects($this->any()) ->method('supports') - ->will($this->returnValue(true)); + ->will($this->returnValue(TRUE)); $loader ->expects($this->once()) ->method('load') @@ -146,8 +141,7 @@ class RouteCollectionBuilderTest extends TestCase $this->assertEquals('fr', $defaults['_locale']); } - public function testFlushSetsRouteNames() - { + public function testFlushSetsRouteNames() { $collectionBuilder = new RouteCollectionBuilder(); // add a "named" route @@ -168,19 +162,18 @@ class RouteCollectionBuilderTest extends TestCase ), $actualRouteNames); } - public function testFlushSetsDetailsOnChildrenRoutes() - { + public function testFlushSetsDetailsOnChildrenRoutes() { $routes = new RouteCollectionBuilder(); $routes->add('/blogs/{page}', 'listAction', 'blog_list') // unique things for the route ->setDefault('page', 1) ->setRequirement('id', '\d+') - ->setOption('expose', true) + ->setOption('expose', TRUE) // things that the collection will try to override (but won't) ->setDefault('_format', 'html') ->setRequirement('_format', 'json|xml') - ->setOption('fooBar', true) + ->setOption('fooBar', TRUE) ->setHost('example.com') ->setCondition('request.isSecure()') ->setSchemes(array('https')) @@ -194,13 +187,13 @@ class RouteCollectionBuilderTest extends TestCase // things that will not override the child route ->setDefault('_format', 'json') ->setRequirement('_format', 'xml') - ->setOption('fooBar', false) + ->setOption('fooBar', FALSE) ->setHost('symfony.com') ->setCondition('request.query.get("page")==1') // some unique things that should be set on the child ->setDefault('_locale', 'fr') ->setRequirement('_locale', 'fr|en') - ->setOption('niceRoute', true) + ->setOption('niceRoute', TRUE) ->setSchemes(array('http')) ->setMethods(array('GET', 'POST')); @@ -234,8 +227,7 @@ class RouteCollectionBuilderTest extends TestCase /** * @dataProvider providePrefixTests */ - public function testFlushPrefixesPaths($collectionPrefix, $routePath, $expectedPath) - { + public function testFlushPrefixesPaths($collectionPrefix, $routePath, $expectedPath) { $routes = new RouteCollectionBuilder(); $routes->add($routePath, 'someController', 'test_route'); @@ -248,8 +240,7 @@ class RouteCollectionBuilderTest extends TestCase $this->assertEquals($expectedPath, $collection->get('test_route')->getPath()); } - public function providePrefixTests() - { + public function providePrefixTests() { $tests = array(); // empty prefix is of course ok $tests[] = array('', '/foo', '/foo'); @@ -264,8 +255,7 @@ class RouteCollectionBuilderTest extends TestCase return $tests; } - public function testFlushSetsPrefixedWithMultipleLevels() - { + public function testFlushSetsPrefixedWithMultipleLevels() { $loader = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock(); $routes = new RouteCollectionBuilder($loader); @@ -296,7 +286,7 @@ class RouteCollectionBuilderTest extends TestCase // make this loader able to do the import - keeps mocking simple $loader->expects($this->any()) ->method('supports') - ->will($this->returnValue(true)); + ->will($this->returnValue(TRUE)); $loader ->expects($this->any()) ->method('load') @@ -312,8 +302,7 @@ class RouteCollectionBuilderTest extends TestCase $this->assertEquals('/admin/imported/foo', $collection->get('imported_route')->getPath(), 'Normal RouteCollections are also prefixed properly'); } - public function testAutomaticRouteNamesDoNotConflict() - { + public function testAutomaticRouteNamesDoNotConflict() { $routes = new RouteCollectionBuilder(); $adminRoutes = $routes->createBuilder(); @@ -336,8 +325,7 @@ class RouteCollectionBuilderTest extends TestCase $this->assertCount(3, $collection->all()); } - public function testAddsThePrefixOnlyOnceWhenLoadingMultipleCollections() - { + public function testAddsThePrefixOnlyOnceWhenLoadingMultipleCollections() { $firstCollection = new RouteCollection(); $firstCollection->add('a', new Route('/a')); @@ -347,7 +335,7 @@ class RouteCollectionBuilderTest extends TestCase $loader = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock(); $loader->expects($this->any()) ->method('supports') - ->will($this->returnValue(true)); + ->will($this->returnValue(TRUE)); $loader ->expects($this->any()) ->method('load') diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouteCollectionTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouteCollectionTest.php index 83457ff..6ff28b7 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouteCollectionTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouteCollectionTest.php @@ -18,8 +18,7 @@ use Symfony\Component\Config\Resource\FileResource; class RouteCollectionTest extends TestCase { - public function testRoute() - { + public function testRoute() { $collection = new RouteCollection(); $route = new Route('/foo'); $collection->add('foo', $route); @@ -28,8 +27,7 @@ class RouteCollectionTest extends TestCase $this->assertNull($collection->get('bar'), '->get() returns null if a route does not exist'); } - public function testOverriddenRoute() - { + public function testOverriddenRoute() { $collection = new RouteCollection(); $collection->add('foo', new Route('/foo')); $collection->add('foo', new Route('/foo1')); @@ -37,8 +35,7 @@ class RouteCollectionTest extends TestCase $this->assertEquals('/foo1', $collection->get('foo')->getPath()); } - public function testDeepOverriddenRoute() - { + public function testDeepOverriddenRoute() { $collection = new RouteCollection(); $collection->add('foo', new Route('/foo')); @@ -55,8 +52,7 @@ class RouteCollectionTest extends TestCase $this->assertEquals('/foo2', $collection->get('foo')->getPath()); } - public function testIterator() - { + public function testIterator() { $collection = new RouteCollection(); $collection->add('foo', new Route('/foo')); @@ -70,8 +66,7 @@ class RouteCollectionTest extends TestCase $this->assertSame(array('bar' => $bar, 'foo' => $foo, 'last' => $last), $collection->getIterator()->getArrayCopy()); } - public function testCount() - { + public function testCount() { $collection = new RouteCollection(); $collection->add('foo', new Route('/foo')); @@ -82,8 +77,7 @@ class RouteCollectionTest extends TestCase $this->assertCount(2, $collection); } - public function testAddCollection() - { + public function testAddCollection() { $collection = new RouteCollection(); $collection->add('foo', new Route('/foo')); @@ -102,23 +96,21 @@ class RouteCollectionTest extends TestCase '->addCollection() imports routes of another collection, overrides if necessary and adds them at the end'); } - public function testAddCollectionWithResources() - { + public function testAddCollectionWithResources() { $collection = new RouteCollection(); - $collection->addResource($foo = new FileResource(__DIR__.'/Fixtures/foo.xml')); + $collection->addResource($foo = new FileResource(__DIR__ . '/Fixtures/foo.xml')); $collection1 = new RouteCollection(); - $collection1->addResource($foo1 = new FileResource(__DIR__.'/Fixtures/foo1.xml')); + $collection1->addResource($foo1 = new FileResource(__DIR__ . '/Fixtures/foo1.xml')); $collection->addCollection($collection1); $this->assertEquals(array($foo, $foo1), $collection->getResources(), '->addCollection() merges resources'); } - public function testAddDefaultsAndRequirementsAndOptions() - { + public function testAddDefaultsAndRequirementsAndOptions() { $collection = new RouteCollection(); $collection->add('foo', new Route('/{placeholder}')); $collection1 = new RouteCollection(); $collection1->add('bar', new Route('/{placeholder}', - array('_controller' => 'fixed', 'placeholder' => 'default'), array('placeholder' => '.+'), array('option' => 'value')) + array('_controller' => 'fixed', 'placeholder' => 'default'), array('placeholder' => '.+'), array('option' => 'value')) ); $collection->addCollection($collection1); @@ -139,8 +131,7 @@ class RouteCollectionTest extends TestCase ); } - public function testAddPrefix() - { + public function testAddPrefix() { $collection = new RouteCollection(); $collection->add('foo', $foo = new Route('/foo')); $collection2 = new RouteCollection(); @@ -162,8 +153,7 @@ class RouteCollectionTest extends TestCase $this->assertSame('/ /0/{admin}/bar', $collection->get('bar')->getPath(), 'the route pattern of an added collection is in synch with the added prefix'); } - public function testAddPrefixOverridesDefaultsAndRequirements() - { + public function testAddPrefixOverridesDefaultsAndRequirements() { $collection = new RouteCollection(); $collection->add('foo', $foo = new Route('/foo.{_format}')); $collection->add('bar', $bar = new Route('/bar.{_format}', array(), array('_format' => 'json'))); @@ -173,19 +163,17 @@ class RouteCollectionTest extends TestCase $this->assertEquals('html', $collection->get('bar')->getRequirement('_format'), '->addPrefix() overrides existing requirements'); } - public function testResource() - { + public function testResource() { $collection = new RouteCollection(); - $collection->addResource($foo = new FileResource(__DIR__.'/Fixtures/foo.xml')); - $collection->addResource($bar = new FileResource(__DIR__.'/Fixtures/bar.xml')); - $collection->addResource(new FileResource(__DIR__.'/Fixtures/foo.xml')); + $collection->addResource($foo = new FileResource(__DIR__ . '/Fixtures/foo.xml')); + $collection->addResource($bar = new FileResource(__DIR__ . '/Fixtures/bar.xml')); + $collection->addResource(new FileResource(__DIR__ . '/Fixtures/foo.xml')); $this->assertEquals(array($foo, $bar), $collection->getResources(), '->addResource() adds a resource and getResources() only returns unique ones by comparing the string representation'); } - public function testUniqueRouteWithGivenName() - { + public function testUniqueRouteWithGivenName() { $collection1 = new RouteCollection(); $collection1->add('foo', new Route('/old')); $collection2 = new RouteCollection(); @@ -200,8 +188,7 @@ class RouteCollectionTest extends TestCase $this->assertCount(1, $collection1->getIterator(), '->addCollection() removes previous routes when adding new routes with the same name'); } - public function testGet() - { + public function testGet() { $collection1 = new RouteCollection(); $collection1->add('a', $a = new Route('/a')); $collection2 = new RouteCollection(); @@ -216,8 +203,7 @@ class RouteCollectionTest extends TestCase $this->assertNull($collection1->get(0), '->get() does not disclose internal child RouteCollection'); } - public function testRemove() - { + public function testRemove() { $collection = new RouteCollection(); $collection->add('foo', $foo = new Route('/foo')); @@ -232,8 +218,7 @@ class RouteCollectionTest extends TestCase $this->assertSame(array(), $collection->all(), '->remove() accepts an array and can remove multiple routes at once'); } - public function testSetHost() - { + public function testSetHost() { $collection = new RouteCollection(); $routea = new Route('/a'); $routeb = new Route('/b', array(), array(), array(), '{locale}.example.net'); @@ -246,8 +231,7 @@ class RouteCollectionTest extends TestCase $this->assertEquals('{locale}.example.com', $routeb->getHost()); } - public function testSetCondition() - { + public function testSetCondition() { $collection = new RouteCollection(); $routea = new Route('/a'); $routeb = new Route('/b', array(), array(), array(), '{locale}.example.net', array(), array(), 'context.getMethod() == "GET"'); @@ -260,8 +244,7 @@ class RouteCollectionTest extends TestCase $this->assertEquals('context.getMethod() == "POST"', $routeb->getCondition()); } - public function testClone() - { + public function testClone() { $collection = new RouteCollection(); $collection->add('a', new Route('/a')); $collection->add('b', new Route('/b', array('placeholder' => 'default'), array('placeholder' => '.+'))); @@ -275,8 +258,7 @@ class RouteCollectionTest extends TestCase $this->assertNotSame($collection->get('b'), $clonedCollection->get('b')); } - public function testSetSchemes() - { + public function testSetSchemes() { $collection = new RouteCollection(); $routea = new Route('/a', array(), array(), array(), '', 'http'); $routeb = new Route('/b'); @@ -289,8 +271,7 @@ class RouteCollectionTest extends TestCase $this->assertEquals(array('http', 'https'), $routeb->getSchemes()); } - public function testSetMethods() - { + public function testSetMethods() { $collection = new RouteCollection(); $routea = new Route('/a', array(), array(), array(), '', array(), array('GET', 'POST')); $routeb = new Route('/b'); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouteCompilerTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouteCompilerTest.php index dc304e3..cd1d080 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouteCompilerTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouteCompilerTest.php @@ -20,165 +20,163 @@ class RouteCompilerTest extends TestCase /** * @dataProvider provideCompileData */ - public function testCompile($name, $arguments, $prefix, $regex, $variables, $tokens) - { + public function testCompile($name, $arguments, $prefix, $regex, $variables, $tokens) { $r = new \ReflectionClass('Symfony\\Component\\Routing\\Route'); $route = $r->newInstanceArgs($arguments); $compiled = $route->compile(); - $this->assertEquals($prefix, $compiled->getStaticPrefix(), $name.' (static prefix)'); - $this->assertEquals($regex, $compiled->getRegex(), $name.' (regex)'); - $this->assertEquals($variables, $compiled->getVariables(), $name.' (variables)'); - $this->assertEquals($tokens, $compiled->getTokens(), $name.' (tokens)'); + $this->assertEquals($prefix, $compiled->getStaticPrefix(), $name . ' (static prefix)'); + $this->assertEquals($regex, $compiled->getRegex(), $name . ' (regex)'); + $this->assertEquals($variables, $compiled->getVariables(), $name . ' (variables)'); + $this->assertEquals($tokens, $compiled->getTokens(), $name . ' (tokens)'); } - public function provideCompileData() - { + public function provideCompileData() { return array( array( 'Static route', array('/foo'), '/foo', '#^/foo$#sD', array(), array( - array('text', '/foo'), - ), + array('text', '/foo'), + ), ), array( 'Route with a variable', array('/foo/{bar}'), '/foo', '#^/foo/(?P[^/]++)$#sD', array('bar'), array( - array('variable', '/', '[^/]++', 'bar'), - array('text', '/foo'), - ), + array('variable', '/', '[^/]++', 'bar'), + array('text', '/foo'), + ), ), array( 'Route with a variable that has a default value', array('/foo/{bar}', array('bar' => 'bar')), '/foo', '#^/foo(?:/(?P[^/]++))?$#sD', array('bar'), array( - array('variable', '/', '[^/]++', 'bar'), - array('text', '/foo'), - ), + array('variable', '/', '[^/]++', 'bar'), + array('text', '/foo'), + ), ), array( 'Route with several variables', array('/foo/{bar}/{foobar}'), '/foo', '#^/foo/(?P[^/]++)/(?P[^/]++)$#sD', array('bar', 'foobar'), array( - array('variable', '/', '[^/]++', 'foobar'), - array('variable', '/', '[^/]++', 'bar'), - array('text', '/foo'), - ), + array('variable', '/', '[^/]++', 'foobar'), + array('variable', '/', '[^/]++', 'bar'), + array('text', '/foo'), + ), ), array( 'Route with several variables that have default values', array('/foo/{bar}/{foobar}', array('bar' => 'bar', 'foobar' => '')), '/foo', '#^/foo(?:/(?P[^/]++)(?:/(?P[^/]++))?)?$#sD', array('bar', 'foobar'), array( - array('variable', '/', '[^/]++', 'foobar'), - array('variable', '/', '[^/]++', 'bar'), - array('text', '/foo'), - ), + array('variable', '/', '[^/]++', 'foobar'), + array('variable', '/', '[^/]++', 'bar'), + array('text', '/foo'), + ), ), array( 'Route with several variables but some of them have no default values', array('/foo/{bar}/{foobar}', array('bar' => 'bar')), '/foo', '#^/foo/(?P[^/]++)/(?P[^/]++)$#sD', array('bar', 'foobar'), array( - array('variable', '/', '[^/]++', 'foobar'), - array('variable', '/', '[^/]++', 'bar'), - array('text', '/foo'), - ), + array('variable', '/', '[^/]++', 'foobar'), + array('variable', '/', '[^/]++', 'bar'), + array('text', '/foo'), + ), ), array( 'Route with an optional variable as the first segment', array('/{bar}', array('bar' => 'bar')), '', '#^/(?P[^/]++)?$#sD', array('bar'), array( - array('variable', '/', '[^/]++', 'bar'), - ), + array('variable', '/', '[^/]++', 'bar'), + ), ), array( 'Route with a requirement of 0', - array('/{bar}', array('bar' => null), array('bar' => '0')), + array('/{bar}', array('bar' => NULL), array('bar' => '0')), '', '#^/(?P0)?$#sD', array('bar'), array( - array('variable', '/', '0', 'bar'), - ), + array('variable', '/', '0', 'bar'), + ), ), array( 'Route with an optional variable as the first segment with requirements', array('/{bar}', array('bar' => 'bar'), array('bar' => '(foo|bar)')), '', '#^/(?P(foo|bar))?$#sD', array('bar'), array( - array('variable', '/', '(foo|bar)', 'bar'), - ), + array('variable', '/', '(foo|bar)', 'bar'), + ), ), array( 'Route with only optional variables', array('/{foo}/{bar}', array('foo' => 'foo', 'bar' => 'bar')), '', '#^/(?P[^/]++)?(?:/(?P[^/]++))?$#sD', array('foo', 'bar'), array( - array('variable', '/', '[^/]++', 'bar'), - array('variable', '/', '[^/]++', 'foo'), - ), + array('variable', '/', '[^/]++', 'bar'), + array('variable', '/', '[^/]++', 'foo'), + ), ), array( 'Route with a variable in last position', array('/foo-{bar}'), '/foo-', '#^/foo\-(?P[^/]++)$#sD', array('bar'), array( - array('variable', '-', '[^/]++', 'bar'), - array('text', '/foo'), - ), + array('variable', '-', '[^/]++', 'bar'), + array('text', '/foo'), + ), ), array( 'Route with nested placeholders', array('/{static{var}static}'), '/{static', '#^/\{static(?P[^/]+)static\}$#sD', array('var'), array( - array('text', 'static}'), - array('variable', '', '[^/]+', 'var'), - array('text', '/{static'), - ), + array('text', 'static}'), + array('variable', '', '[^/]+', 'var'), + array('text', '/{static'), + ), ), array( 'Route without separator between variables', array('/{w}{x}{y}{z}.{_format}', array('z' => 'default-z', '_format' => 'html'), array('y' => '(y|Y)')), '', '#^/(?P[^/\.]+)(?P[^/\.]+)(?P(y|Y))(?:(?P[^/\.]++)(?:\.(?P<_format>[^/]++))?)?$#sD', array('w', 'x', 'y', 'z', '_format'), array( - array('variable', '.', '[^/]++', '_format'), - array('variable', '', '[^/\.]++', 'z'), - array('variable', '', '(y|Y)', 'y'), - array('variable', '', '[^/\.]+', 'x'), - array('variable', '/', '[^/\.]+', 'w'), - ), + array('variable', '.', '[^/]++', '_format'), + array('variable', '', '[^/\.]++', 'z'), + array('variable', '', '(y|Y)', 'y'), + array('variable', '', '[^/\.]+', 'x'), + array('variable', '/', '[^/\.]+', 'w'), + ), ), array( 'Route with a format', array('/foo/{bar}.{_format}'), '/foo', '#^/foo/(?P[^/\.]++)\.(?P<_format>[^/]++)$#sD', array('bar', '_format'), array( - array('variable', '.', '[^/]++', '_format'), - array('variable', '/', '[^/\.]++', 'bar'), - array('text', '/foo'), - ), + array('variable', '.', '[^/]++', '_format'), + array('variable', '/', '[^/\.]++', 'bar'), + array('text', '/foo'), + ), ), array( 'Static non UTF-8 route', array("/fo\xE9"), "/fo\xE9", "#^/fo\xE9$#sD", array(), array( - array('text', "/fo\xE9"), - ), + array('text', "/fo\xE9"), + ), ), array( 'Route with an explicit UTF-8 requirement', - array('/{bar}', array('bar' => null), array('bar' => '.'), array('utf8' => true)), + array('/{bar}', array('bar' => NULL), array('bar' => '.'), array('utf8' => TRUE)), '', '#^/(?P.)?$#sDu', array('bar'), array( - array('variable', '/', '.', 'bar', true), - ), + array('variable', '/', '.', 'bar', TRUE), + ), ), ); } @@ -188,45 +186,43 @@ class RouteCompilerTest extends TestCase * @dataProvider provideCompileImplicitUtf8Data * @expectedDeprecation Using UTF-8 route %s without setting the "utf8" option is deprecated %s. */ - public function testCompileImplicitUtf8Data($name, $arguments, $prefix, $regex, $variables, $tokens, $deprecationType) - { + public function testCompileImplicitUtf8Data($name, $arguments, $prefix, $regex, $variables, $tokens, $deprecationType) { $r = new \ReflectionClass('Symfony\\Component\\Routing\\Route'); $route = $r->newInstanceArgs($arguments); $compiled = $route->compile(); - $this->assertEquals($prefix, $compiled->getStaticPrefix(), $name.' (static prefix)'); - $this->assertEquals($regex, $compiled->getRegex(), $name.' (regex)'); - $this->assertEquals($variables, $compiled->getVariables(), $name.' (variables)'); - $this->assertEquals($tokens, $compiled->getTokens(), $name.' (tokens)'); + $this->assertEquals($prefix, $compiled->getStaticPrefix(), $name . ' (static prefix)'); + $this->assertEquals($regex, $compiled->getRegex(), $name . ' (regex)'); + $this->assertEquals($variables, $compiled->getVariables(), $name . ' (variables)'); + $this->assertEquals($tokens, $compiled->getTokens(), $name . ' (tokens)'); } - public function provideCompileImplicitUtf8Data() - { + public function provideCompileImplicitUtf8Data() { return array( array( 'Static UTF-8 route', array('/foé'), '/foé', '#^/foé$#sDu', array(), array( - array('text', '/foé'), - ), + array('text', '/foé'), + ), 'patterns', ), array( 'Route with an implicit UTF-8 requirement', - array('/{bar}', array('bar' => null), array('bar' => 'é')), + array('/{bar}', array('bar' => NULL), array('bar' => 'é')), '', '#^/(?Pé)?$#sDu', array('bar'), array( - array('variable', '/', 'é', 'bar', true), - ), + array('variable', '/', 'é', 'bar', TRUE), + ), 'requirements', ), array( 'Route with a UTF-8 class requirement', - array('/{bar}', array('bar' => null), array('bar' => '\pM')), + array('/{bar}', array('bar' => NULL), array('bar' => '\pM')), '', '#^/(?P\pM)?$#sDu', array('bar'), array( - array('variable', '/', '\pM', 'bar', true), - ), + array('variable', '/', '\pM', 'bar', TRUE), + ), 'requirements', ), @@ -234,10 +230,10 @@ class RouteCompilerTest extends TestCase 'Route with a UTF-8 separator', array('/foo/{bar}§{_format}', array(), array(), array('compiler_class' => Utf8RouteCompiler::class)), '/foo', '#^/foo/(?P[^/§]++)§(?P<_format>[^/]++)$#sDu', array('bar', '_format'), array( - array('variable', '§', '[^/]++', '_format', true), - array('variable', '/', '[^/§]++', 'bar', true), - array('text', '/foo'), - ), + array('variable', '§', '[^/]++', '_format', TRUE), + array('variable', '/', '[^/§]++', 'bar', TRUE), + array('text', '/foo'), + ), 'patterns', ), ); @@ -246,8 +242,7 @@ class RouteCompilerTest extends TestCase /** * @expectedException \LogicException */ - public function testRouteWithSameVariableTwice() - { + public function testRouteWithSameVariableTwice() { $route = new Route('/{name}/{name}'); $compiled = $route->compile(); @@ -256,9 +251,8 @@ class RouteCompilerTest extends TestCase /** * @expectedException \LogicException */ - public function testRouteCharsetMismatch() - { - $route = new Route("/\xE9/{bar}", array(), array('bar' => '.'), array('utf8' => true)); + public function testRouteCharsetMismatch() { + $route = new Route("/\xE9/{bar}", array(), array('bar' => '.'), array('utf8' => TRUE)); $compiled = $route->compile(); } @@ -266,9 +260,8 @@ class RouteCompilerTest extends TestCase /** * @expectedException \LogicException */ - public function testRequirementCharsetMismatch() - { - $route = new Route('/foo/{bar}', array(), array('bar' => "\xE9"), array('utf8' => true)); + public function testRequirementCharsetMismatch() { + $route = new Route('/foo/{bar}', array(), array('bar' => "\xE9"), array('utf8' => TRUE)); $compiled = $route->compile(); } @@ -276,8 +269,7 @@ class RouteCompilerTest extends TestCase /** * @expectedException \InvalidArgumentException */ - public function testRouteWithFragmentAsPathParameter() - { + public function testRouteWithFragmentAsPathParameter() { $route = new Route('/{_fragment}'); $compiled = $route->compile(); @@ -287,88 +279,84 @@ class RouteCompilerTest extends TestCase * @dataProvider getVariableNamesStartingWithADigit * @expectedException \DomainException */ - public function testRouteWithVariableNameStartingWithADigit($name) - { - $route = new Route('/{'.$name.'}'); + public function testRouteWithVariableNameStartingWithADigit($name) { + $route = new Route('/{' . $name . '}'); $route->compile(); } - public function getVariableNamesStartingWithADigit() - { + public function getVariableNamesStartingWithADigit() { return array( - array('09'), - array('123'), - array('1e2'), + array('09'), + array('123'), + array('1e2'), ); } /** * @dataProvider provideCompileWithHostData */ - public function testCompileWithHost($name, $arguments, $prefix, $regex, $variables, $pathVariables, $tokens, $hostRegex, $hostVariables, $hostTokens) - { + public function testCompileWithHost($name, $arguments, $prefix, $regex, $variables, $pathVariables, $tokens, $hostRegex, $hostVariables, $hostTokens) { $r = new \ReflectionClass('Symfony\\Component\\Routing\\Route'); $route = $r->newInstanceArgs($arguments); $compiled = $route->compile(); - $this->assertEquals($prefix, $compiled->getStaticPrefix(), $name.' (static prefix)'); - $this->assertEquals($regex, str_replace(array("\n", ' '), '', $compiled->getRegex()), $name.' (regex)'); - $this->assertEquals($variables, $compiled->getVariables(), $name.' (variables)'); - $this->assertEquals($pathVariables, $compiled->getPathVariables(), $name.' (path variables)'); - $this->assertEquals($tokens, $compiled->getTokens(), $name.' (tokens)'); - $this->assertEquals($hostRegex, str_replace(array("\n", ' '), '', $compiled->getHostRegex()), $name.' (host regex)'); - $this->assertEquals($hostVariables, $compiled->getHostVariables(), $name.' (host variables)'); - $this->assertEquals($hostTokens, $compiled->getHostTokens(), $name.' (host tokens)'); + $this->assertEquals($prefix, $compiled->getStaticPrefix(), $name . ' (static prefix)'); + $this->assertEquals($regex, str_replace(array("\n", ' '), '', $compiled->getRegex()), $name . ' (regex)'); + $this->assertEquals($variables, $compiled->getVariables(), $name . ' (variables)'); + $this->assertEquals($pathVariables, $compiled->getPathVariables(), $name . ' (path variables)'); + $this->assertEquals($tokens, $compiled->getTokens(), $name . ' (tokens)'); + $this->assertEquals($hostRegex, str_replace(array("\n", ' '), '', $compiled->getHostRegex()), $name . ' (host regex)'); + $this->assertEquals($hostVariables, $compiled->getHostVariables(), $name . ' (host variables)'); + $this->assertEquals($hostTokens, $compiled->getHostTokens(), $name . ' (host tokens)'); } - public function provideCompileWithHostData() - { + public function provideCompileWithHostData() { return array( array( 'Route with host pattern', array('/hello', array(), array(), array(), 'www.example.com'), '/hello', '#^/hello$#sD', array(), array(), array( - array('text', '/hello'), - ), + array('text', '/hello'), + ), '#^www\.example\.com$#sDi', array(), array( - array('text', 'www.example.com'), - ), + array('text', 'www.example.com'), + ), ), array( 'Route with host pattern and some variables', array('/hello/{name}', array(), array(), array(), 'www.example.{tld}'), '/hello', '#^/hello/(?P[^/]++)$#sD', array('tld', 'name'), array('name'), array( - array('variable', '/', '[^/]++', 'name'), - array('text', '/hello'), - ), + array('variable', '/', '[^/]++', 'name'), + array('text', '/hello'), + ), '#^www\.example\.(?P[^\.]++)$#sDi', array('tld'), array( - array('variable', '.', '[^\.]++', 'tld'), - array('text', 'www.example'), - ), + array('variable', '.', '[^\.]++', 'tld'), + array('text', 'www.example'), + ), ), array( 'Route with variable at beginning of host', array('/hello', array(), array(), array(), '{locale}.example.{tld}'), '/hello', '#^/hello$#sD', array('locale', 'tld'), array(), array( - array('text', '/hello'), - ), + array('text', '/hello'), + ), '#^(?P[^\.]++)\.example\.(?P[^\.]++)$#sDi', array('locale', 'tld'), array( - array('variable', '.', '[^\.]++', 'tld'), - array('text', '.example'), - array('variable', '', '[^\.]++', 'locale'), - ), + array('variable', '.', '[^\.]++', 'tld'), + array('text', '.example'), + array('variable', '', '[^\.]++', 'locale'), + ), ), array( 'Route with host variables that has a default value', array('/hello', array('locale' => 'a', 'tld' => 'b'), array(), array(), '{locale}.example.{tld}'), '/hello', '#^/hello$#sD', array('locale', 'tld'), array(), array( - array('text', '/hello'), - ), + array('text', '/hello'), + ), '#^(?P[^\.]++)\.example\.(?P[^\.]++)$#sDi', array('locale', 'tld'), array( - array('variable', '.', '[^\.]++', 'tld'), - array('text', '.example'), - array('variable', '', '[^\.]++', 'locale'), - ), + array('variable', '.', '[^\.]++', 'tld'), + array('text', '.example'), + array('variable', '', '[^\.]++', 'locale'), + ), ), ); } @@ -376,8 +364,7 @@ class RouteCompilerTest extends TestCase /** * @expectedException \DomainException */ - public function testRouteWithTooLongVariableName() - { + public function testRouteWithTooLongVariableName() { $route = new Route(sprintf('/{%s}', str_repeat('a', RouteCompiler::VARIABLE_MAXIMUM_LENGTH + 1))); $route->compile(); } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouteTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouteTest.php index c7af058..0c58c90 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouteTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouteTest.php @@ -16,8 +16,7 @@ use Symfony\Component\Routing\Route; class RouteTest extends TestCase { - public function testConstructor() - { + public function testConstructor() { $route = new Route('/{foo}', array('foo' => 'bar'), array('foo' => '\d+'), array('foo' => 'bar'), '{locale}.example.com'); $this->assertEquals('/{foo}', $route->getPath(), '__construct() takes a path as its first argument'); $this->assertEquals(array('foo' => 'bar'), $route->getDefaults(), '__construct() takes defaults as its second argument'); @@ -35,8 +34,7 @@ class RouteTest extends TestCase $this->assertEquals(array('POST'), $route->getMethods(), '__construct() takes a single method as its seventh argument'); } - public function testPath() - { + public function testPath() { $route = new Route('/{foo}'); $route->setPath('/{bar}'); $this->assertEquals('/{bar}', $route->getPath(), '->setPath() sets the path'); @@ -49,12 +47,11 @@ class RouteTest extends TestCase $this->assertEquals('/path', $route->getPath(), '->setPath() does not allow two slashes "//" at the beginning of the path as it would be confused with a network path when generating the path from the route'); } - public function testOptions() - { + public function testOptions() { $route = new Route('/{foo}'); $route->setOptions(array('foo' => 'bar')); $this->assertEquals(array_merge(array( - 'compiler_class' => 'Symfony\\Component\\Routing\\RouteCompiler', + 'compiler_class' => 'Symfony\\Component\\Routing\\RouteCompiler', ), array('foo' => 'bar')), $route->getOptions(), '->setOptions() sets the options'); $this->assertEquals($route, $route->setOptions(array()), '->setOptions() implements a fluent interface'); @@ -64,8 +61,7 @@ class RouteTest extends TestCase $this->assertEquals(array('foo' => 'foo', 'bar' => 'bar', 'compiler_class' => 'Symfony\\Component\\Routing\\RouteCompiler'), $route->getOptions(), '->addDefaults() keep previous defaults'); } - public function testOption() - { + public function testOption() { $route = new Route('/{foo}'); $this->assertFalse($route->hasOption('foo'), '->hasOption() return false if option is not set'); $this->assertEquals($route, $route->setOption('foo', 'bar'), '->setOption() implements a fluent interface'); @@ -73,8 +69,7 @@ class RouteTest extends TestCase $this->assertTrue($route->hasOption('foo'), '->hasOption() return true if option is set'); } - public function testDefaults() - { + public function testDefaults() { $route = new Route('/{foo}'); $route->setDefaults(array('foo' => 'bar')); $this->assertEquals(array('foo' => 'bar'), $route->getDefaults(), '->setDefaults() sets the defaults'); @@ -87,7 +82,9 @@ class RouteTest extends TestCase $this->assertEquals('bar2', $route->getDefault('foo2'), '->getDefault() return the default value'); $this->assertNull($route->getDefault('not_defined'), '->getDefault() return null if default value is not set'); - $route->setDefault('_controller', $closure = function () { return 'Hello'; }); + $route->setDefault('_controller', $closure = function () { + return 'Hello'; + }); $this->assertEquals($closure, $route->getDefault('_controller'), '->setDefault() sets a default value'); $route->setDefaults(array('foo' => 'foo')); @@ -96,8 +93,7 @@ class RouteTest extends TestCase $this->assertEquals(array('foo' => 'foo', 'bar' => 'bar'), $route->getDefaults(), '->addDefaults() keep previous defaults'); } - public function testRequirements() - { + public function testRequirements() { $route = new Route('/{foo}'); $route->setRequirements(array('foo' => '\d+')); $this->assertEquals(array('foo' => '\d+'), $route->getRequirements(), '->setRequirements() sets the requirements'); @@ -113,8 +109,7 @@ class RouteTest extends TestCase $this->assertEquals(array('foo' => '\d+', 'bar' => '\d+'), $route->getRequirements(), '->addRequirement() keep previous requirements'); } - public function testRequirement() - { + public function testRequirement() { $route = new Route('/{foo}'); $this->assertFalse($route->hasRequirement('foo'), '->hasRequirement() return false if requirement is not set'); $route->setRequirement('foo', '^\d+$'); @@ -126,32 +121,28 @@ class RouteTest extends TestCase * @dataProvider getInvalidRequirements * @expectedException \InvalidArgumentException */ - public function testSetInvalidRequirement($req) - { + public function testSetInvalidRequirement($req) { $route = new Route('/{foo}'); $route->setRequirement('foo', $req); } - public function getInvalidRequirements() - { + public function getInvalidRequirements() { return array( - array(''), - array(array()), - array('^$'), - array('^'), - array('$'), + array(''), + array(array()), + array('^$'), + array('^'), + array('$'), ); } - public function testHost() - { + public function testHost() { $route = new Route('/'); $route->setHost('{locale}.example.net'); $this->assertEquals('{locale}.example.net', $route->getHost(), '->setHost() sets the host pattern'); } - public function testScheme() - { + public function testScheme() { $route = new Route('/'); $this->assertEquals(array(), $route->getSchemes(), 'schemes is initialized with array()'); $this->assertFalse($route->hasScheme('http')); @@ -165,8 +156,7 @@ class RouteTest extends TestCase $this->assertTrue($route->hasScheme('httpS')); } - public function testMethod() - { + public function testMethod() { $route = new Route('/'); $this->assertEquals(array(), $route->getMethods(), 'methods is initialized with array()'); $route->setMethods('gEt'); @@ -175,16 +165,14 @@ class RouteTest extends TestCase $this->assertEquals(array('GET', 'POST'), $route->getMethods(), '->setMethods() accepts an array of methods and uppercases them'); } - public function testCondition() - { + public function testCondition() { $route = new Route('/'); $this->assertSame('', $route->getCondition()); $route->setCondition('context.getMethod() == "GET"'); $this->assertSame('context.getMethod() == "GET"', $route->getCondition()); } - public function testCompile() - { + public function testCompile() { $route = new Route('/{foo}'); $this->assertInstanceOf('Symfony\Component\Routing\CompiledRoute', $compiled = $route->compile(), '->compile() returns a compiled route'); $this->assertSame($compiled, $route->compile(), '->compile() only compiled the route once if unchanged'); @@ -192,8 +180,7 @@ class RouteTest extends TestCase $this->assertNotSame($compiled, $route->compile(), '->compile() recompiles if the route was modified'); } - public function testSerialize() - { + public function testSerialize() { $route = new Route('/prefix/{foo}', array('foo' => 'default'), array('foo' => '\d+')); $serialized = serialize($route); @@ -207,8 +194,7 @@ class RouteTest extends TestCase * Tests that the compiled version is also serialized to prevent the overhead * of compiling it again after unserialize. */ - public function testSerializeWhenCompiled() - { + public function testSerializeWhenCompiled() { $route = new Route('/prefix/{foo}', array('foo' => 'default'), array('foo' => '\d+')); $route->setHost('{locale}.example.net'); $route->compile(); @@ -224,8 +210,7 @@ class RouteTest extends TestCase * Tests that unserialization does not fail when the compiled Route is of a * class other than CompiledRoute, such as a subclass of it. */ - public function testSerializeWhenCompiledWithClass() - { + public function testSerializeWhenCompiledWithClass() { $route = new Route('/', array(), array(), array('compiler_class' => '\Symfony\Component\Routing\Tests\Fixtures\CustomRouteCompiler')); $this->assertInstanceOf('\Symfony\Component\Routing\Tests\Fixtures\CustomCompiledRoute', $route->compile(), '->compile() returned a proper route'); @@ -243,8 +228,7 @@ class RouteTest extends TestCase * also works in later symfony versions, i.e. the unserialized route is in the * same state as another, semantically equivalent, route. */ - public function testSerializedRepresentationKeepsWorking() - { + public function testSerializedRepresentationKeepsWorking() { $serialized = 'C:31:"Symfony\Component\Routing\Route":936:{a:8:{s:4:"path";s:13:"/prefix/{foo}";s:4:"host";s:20:"{locale}.example.net";s:8:"defaults";a:1:{s:3:"foo";s:7:"default";}s:12:"requirements";a:1:{s:3:"foo";s:3:"\d+";}s:7:"options";a:1:{s:14:"compiler_class";s:39:"Symfony\Component\Routing\RouteCompiler";}s:7:"schemes";a:0:{}s:7:"methods";a:0:{}s:8:"compiled";C:39:"Symfony\Component\Routing\CompiledRoute":571:{a:8:{s:4:"vars";a:2:{i:0;s:6:"locale";i:1;s:3:"foo";}s:11:"path_prefix";s:7:"/prefix";s:10:"path_regex";s:31:"#^/prefix(?:/(?P\d+))?$#sD";s:11:"path_tokens";a:2:{i:0;a:4:{i:0;s:8:"variable";i:1;s:1:"/";i:2;s:3:"\d+";i:3;s:3:"foo";}i:1;a:2:{i:0;s:4:"text";i:1;s:7:"/prefix";}}s:9:"path_vars";a:1:{i:0;s:3:"foo";}s:10:"host_regex";s:40:"#^(?P[^\.]++)\.example\.net$#sDi";s:11:"host_tokens";a:2:{i:0;a:2:{i:0;s:4:"text";i:1;s:12:".example.net";}i:1;a:4:{i:0;s:8:"variable";i:1;s:0:"";i:2;s:7:"[^\.]++";i:3;s:6:"locale";}}s:9:"host_vars";a:1:{i:0;s:6:"locale";}}}}}'; $unserialized = unserialize($serialized); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouterTest.php b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouterTest.php index 3e3d43f..5185abe 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouterTest.php +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/Tests/RouterTest.php @@ -18,21 +18,19 @@ use Symfony\Component\HttpFoundation\Request; class RouterTest extends TestCase { - private $router = null; + private $router = NULL; - private $loader = null; + private $loader = NULL; - protected function setUp() - { + protected function setUp() { $this->loader = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock(); $this->router = new Router($this->loader, 'routing.yml'); } - public function testSetOptionsWithSupportedOptions() - { + public function testSetOptionsWithSupportedOptions() { $this->router->setOptions(array( 'cache_dir' => './cache', - 'debug' => true, + 'debug' => TRUE, 'resource_type' => 'ResourceType', )); @@ -45,18 +43,16 @@ class RouterTest extends TestCase * @expectedException \InvalidArgumentException * @expectedExceptionMessage The Router does not support the following options: "option_foo", "option_bar" */ - public function testSetOptionsWithUnsupportedOptions() - { + public function testSetOptionsWithUnsupportedOptions() { $this->router->setOptions(array( 'cache_dir' => './cache', - 'option_foo' => true, + 'option_foo' => TRUE, 'option_bar' => 'baz', 'resource_type' => 'ResourceType', )); } - public function testSetOptionWithSupportedOption() - { + public function testSetOptionWithSupportedOption() { $this->router->setOption('cache_dir', './cache'); $this->assertSame('./cache', $this->router->getOption('cache_dir')); @@ -66,22 +62,19 @@ class RouterTest extends TestCase * @expectedException \InvalidArgumentException * @expectedExceptionMessage The Router does not support the "option_foo" option */ - public function testSetOptionWithUnsupportedOption() - { - $this->router->setOption('option_foo', true); + public function testSetOptionWithUnsupportedOption() { + $this->router->setOption('option_foo', TRUE); } /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage The Router does not support the "option_foo" option */ - public function testGetOptionWithUnsupportedOption() - { - $this->router->getOption('option_foo', true); + public function testGetOptionWithUnsupportedOption() { + $this->router->getOption('option_foo', TRUE); } - public function testThatRouteCollectionIsLoaded() - { + public function testThatRouteCollectionIsLoaded() { $this->router->setOption('resource_type', 'ResourceType'); $routeCollection = new RouteCollection(); @@ -96,19 +89,17 @@ class RouterTest extends TestCase /** * @dataProvider provideMatcherOptionsPreventingCaching */ - public function testMatcherIsCreatedIfCacheIsNotConfigured($option) - { - $this->router->setOption($option, null); + public function testMatcherIsCreatedIfCacheIsNotConfigured($option) { + $this->router->setOption($option, NULL); $this->loader->expects($this->once()) - ->method('load')->with('routing.yml', null) + ->method('load')->with('routing.yml', NULL) ->will($this->returnValue(new RouteCollection())); $this->assertInstanceOf('Symfony\\Component\\Routing\\Matcher\\UrlMatcher', $this->router->getMatcher()); } - public function provideMatcherOptionsPreventingCaching() - { + public function provideMatcherOptionsPreventingCaching() { return array( array('cache_dir'), array('matcher_cache_class'), @@ -118,44 +109,40 @@ class RouterTest extends TestCase /** * @dataProvider provideGeneratorOptionsPreventingCaching */ - public function testGeneratorIsCreatedIfCacheIsNotConfigured($option) - { - $this->router->setOption($option, null); + public function testGeneratorIsCreatedIfCacheIsNotConfigured($option) { + $this->router->setOption($option, NULL); $this->loader->expects($this->once()) - ->method('load')->with('routing.yml', null) + ->method('load')->with('routing.yml', NULL) ->will($this->returnValue(new RouteCollection())); $this->assertInstanceOf('Symfony\\Component\\Routing\\Generator\\UrlGenerator', $this->router->getGenerator()); } - public function provideGeneratorOptionsPreventingCaching() - { + public function provideGeneratorOptionsPreventingCaching() { return array( array('cache_dir'), array('generator_cache_class'), ); } - public function testMatchRequestWithUrlMatcherInterface() - { + public function testMatchRequestWithUrlMatcherInterface() { $matcher = $this->getMockBuilder('Symfony\Component\Routing\Matcher\UrlMatcherInterface')->getMock(); $matcher->expects($this->once())->method('match'); $p = new \ReflectionProperty($this->router, 'matcher'); - $p->setAccessible(true); + $p->setAccessible(TRUE); $p->setValue($this->router, $matcher); $this->router->matchRequest(Request::create('/')); } - public function testMatchRequestWithRequestMatcherInterface() - { + public function testMatchRequestWithRequestMatcherInterface() { $matcher = $this->getMockBuilder('Symfony\Component\Routing\Matcher\RequestMatcherInterface')->getMock(); $matcher->expects($this->once())->method('matchRequest'); $p = new \ReflectionProperty($this->router, 'matcher'); - $p->setAccessible(true); + $p->setAccessible(TRUE); $p->setValue($this->router, $matcher); $this->router->matchRequest(Request::create('/')); diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/composer.json b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/composer.json index 4d820cc..37aa671 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/composer.json +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/composer.json @@ -1,56 +1,63 @@ { - "name": "symfony/routing", - "type": "library", - "description": "Symfony Routing Component", - "keywords": ["routing", "router", "URL", "URI"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": "^5.5.9|>=7.0.8" + "name": "symfony/routing", + "type": "library", + "description": "Symfony Routing Component", + "keywords": [ + "routing", + "router", + "URL", + "URI" + ], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, - "require-dev": { - "symfony/config": "^3.3.1|~4.0", - "symfony/http-foundation": "~2.8|~3.0|~4.0", - "symfony/yaml": "~3.4|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/dependency-injection": "~3.3|~4.0", - "doctrine/annotations": "~1.0", - "doctrine/common": "~2.2", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/config": "<3.3.1", - "symfony/dependency-injection": "<3.3", - "symfony/yaml": "<3.4" - }, - "suggest": { - "symfony/http-foundation": "For using a Symfony Request object", - "symfony/config": "For using the all-in-one router or any loader", - "symfony/yaml": "For using the YAML loader", - "symfony/expression-language": "For using expression matching", - "doctrine/annotations": "For using the annotation loader", - "symfony/dependency-injection": "For loading routes from a service" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Routing\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": "^5.5.9|>=7.0.8" + }, + "require-dev": { + "symfony/config": "^3.3.1|~4.0", + "symfony/http-foundation": "~2.8|~3.0|~4.0", + "symfony/yaml": "~3.4|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "doctrine/annotations": "~1.0", + "doctrine/common": "~2.2", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/config": "<3.3.1", + "symfony/dependency-injection": "<3.3", + "symfony/yaml": "<3.4" + }, + "suggest": { + "symfony/http-foundation": "For using a Symfony Request object", + "symfony/config": "For using the all-in-one router or any loader", + "symfony/yaml": "For using the YAML loader", + "symfony/expression-language": "For using expression matching", + "doctrine/annotations": "For using the annotation loader", + "symfony/dependency-injection": "For loading routes from a service" + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Routing\\": "" }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "3.4-dev" } + } } diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/phpunit.xml.dist b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/phpunit.xml.dist index bcc0959..9451d26 100644 --- a/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/phpunit.xml.dist +++ b/main/app/sprinkles/core/assets/SiteAssets/php/vendor/symfony/routing/phpunit.xml.dist @@ -9,7 +9,7 @@ failOnWarning="true" > - + diff --git a/main/app/sprinkles/core/assets/font-starcraft/css/font-starcraft.css b/main/app/sprinkles/core/assets/font-starcraft/css/font-starcraft.css index d5d38ef..b984291 100644 --- a/main/app/sprinkles/core/assets/font-starcraft/css/font-starcraft.css +++ b/main/app/sprinkles/core/assets/font-starcraft/css/font-starcraft.css @@ -1,61 +1,72 @@ @font-face { - font-family: 'starcraft'; - src:url('../fonts/font-starcraft.eot?h9vi58'); - src:url('../fonts/font-starcraft.eot?#iefixh9vi58') format('embedded-opentype'), - url('../fonts/font-starcraft.woff?h9vi58') format('woff'), - url('../fonts/font-starcraft.ttf?h9vi58') format('truetype'), - url('../fonts/font-starcraft.svg?h9vi58#starcraft') format('svg'); - font-weight: normal; - font-style: normal; + font-family: 'starcraft'; + src: url('../fonts/font-starcraft.eot?h9vi58'); + src: url('../fonts/font-starcraft.eot?#iefixh9vi58') format('embedded-opentype'), + url('../fonts/font-starcraft.woff?h9vi58') format('woff'), + url('../fonts/font-starcraft.ttf?h9vi58') format('truetype'), + url('../fonts/font-starcraft.svg?h9vi58#starcraft') format('svg'); + font-weight: normal; + font-style: normal; } [class^="sc-"], [class*=" sc-"] { - font-family: 'starcraft'; - speak: none; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; + font-family: 'starcraft'; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; - /* Better Font Rendering =========== */ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; } .sc-terran:before { - content: "\e609"; + content: "\e609"; } + .sc-marine:before { - content: "\e600"; + content: "\e600"; } + .sc-goliath:before { - content: "\e605"; + content: "\e605"; } + .sc-siege-tank:before { - content: "\e604"; + content: "\e604"; } + .sc-zerg:before { - content: "\e60a"; + content: "\e60a"; } + .sc-zergling:before { - content: "\e602"; + content: "\e602"; } + .sc-hydralisk:before { - content: "\e603"; + content: "\e603"; } + .sc-ultralisk:before { - content: "\e601"; + content: "\e601"; } + .sc-protoss:before { - content: "\e60b"; + content: "\e60b"; } + .sc-zealot:before { - content: "\e606"; + content: "\e606"; } + .sc-dragoon:before { - content: "\e607"; + content: "\e607"; } + .sc-reaver:before { - content: "\e608"; + content: "\e608"; } diff --git a/main/app/sprinkles/core/assets/font-starcraft/fonts/font-starcraft.svg b/main/app/sprinkles/core/assets/font-starcraft/fonts/font-starcraft.svg index c4e289d..20a27fe 100644 --- a/main/app/sprinkles/core/assets/font-starcraft/fonts/font-starcraft.svg +++ b/main/app/sprinkles/core/assets/font-starcraft/fonts/font-starcraft.svg @@ -1,22 +1,44 @@ -Generated by IcoMoon - - - - - - - - - - - - - - - - - - \ No newline at end of file + Generated by IcoMoon + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/main/app/sprinkles/core/assets/userfrosting/css/AdminLTE-skins-all.css b/main/app/sprinkles/core/assets/userfrosting/css/AdminLTE-skins-all.css index 53577c4..e487cdb 100644 --- a/main/app/sprinkles/core/assets/userfrosting/css/AdminLTE-skins-all.css +++ b/main/app/sprinkles/core/assets/userfrosting/css/AdminLTE-skins-all.css @@ -3,11 +3,13 @@ * ---------- */ .skin-blue .main-header .navbar { - background-color: #3c8dbc; + background-color: #3c8dbc; } + .skin-blue .main-header .navbar .nav > li > a { - color: #ffffff; + color: #ffffff; } + .skin-blue .main-header .navbar .nav > li > a:hover, .skin-blue .main-header .navbar .nav > li > a:active, .skin-blue .main-header .navbar .nav > li > a:focus, @@ -15,138 +17,170 @@ .skin-blue .main-header .navbar .nav .open > a:hover, .skin-blue .main-header .navbar .nav .open > a:focus, .skin-blue .main-header .navbar .nav > .active > a { - background: rgba(0, 0, 0, 0.1); - color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; } + .skin-blue .main-header .navbar .sidebar-toggle { - color: #ffffff; + color: #ffffff; } + .skin-blue .main-header .navbar .sidebar-toggle:hover { - color: #f6f6f6; - background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); } + .skin-blue .main-header .navbar .sidebar-toggle { - color: #fff; + color: #fff; } + .skin-blue .main-header .navbar .sidebar-toggle:hover { - background-color: #367fa9; + background-color: #367fa9; } + @media (max-width: 767px) { - .skin-blue .main-header .navbar .dropdown-menu li.divider { - background-color: rgba(255, 255, 255, 0.1); - } - .skin-blue .main-header .navbar .dropdown-menu li a { - color: #fff; - } - .skin-blue .main-header .navbar .dropdown-menu li a:hover { - background: #367fa9; - } -} + .skin-blue .main-header .navbar .dropdown-menu li.divider { + background-color: rgba(255, 255, 255, 0.1); + } + + .skin-blue .main-header .navbar .dropdown-menu li a { + color: #fff; + } + + .skin-blue .main-header .navbar .dropdown-menu li a:hover { + background: #367fa9; + } +} + .skin-blue .main-header .logo { - background-color: #367fa9; - color: #ffffff; - border-bottom: 0 solid transparent; + background-color: #367fa9; + color: #ffffff; + border-bottom: 0 solid transparent; } + .skin-blue .main-header .logo:hover { - background-color: #357ca5; + background-color: #357ca5; } + .skin-blue .main-header li.user-header { - background-color: #3c8dbc; + background-color: #3c8dbc; } + .skin-blue .content-header { - background: transparent; + background: transparent; } + .skin-blue .wrapper, .skin-blue .main-sidebar, .skin-blue .left-side { - background-color: #222d32; + background-color: #222d32; } + .skin-blue .user-panel > .info, .skin-blue .user-panel > .info > a { - color: #fff; + color: #fff; } + .skin-blue .sidebar-menu > li.header { - color: #4b646f; - background: #1a2226; + color: #4b646f; + background: #1a2226; } + .skin-blue .sidebar-menu > li > a { - border-left: 3px solid transparent; + border-left: 3px solid transparent; } + .skin-blue .sidebar-menu > li:hover > a, .skin-blue .sidebar-menu > li.active > a { - color: #ffffff; - background: #1e282c; - border-left-color: #3c8dbc; + color: #ffffff; + background: #1e282c; + border-left-color: #3c8dbc; } + .skin-blue .sidebar-menu > li > .treeview-menu { - margin: 0 1px; - background: #2c3b41; + margin: 0 1px; + background: #2c3b41; } + .skin-blue .sidebar a { - color: #b8c7ce; + color: #b8c7ce; } + .skin-blue .sidebar a:hover { - text-decoration: none; + text-decoration: none; } + .skin-blue .treeview-menu > li > a { - color: #8aa4af; + color: #8aa4af; } + .skin-blue .treeview-menu > li.active > a, .skin-blue .treeview-menu > li > a:hover { - color: #ffffff; + color: #ffffff; } + .skin-blue .sidebar-form { - border-radius: 3px; - border: 1px solid #374850; - margin: 10px 10px; + border-radius: 3px; + border: 1px solid #374850; + margin: 10px 10px; } + .skin-blue .sidebar-form input[type="text"], .skin-blue .sidebar-form .btn { - box-shadow: none; - background-color: #374850; - border: 1px solid transparent; - height: 35px; + box-shadow: none; + background-color: #374850; + border: 1px solid transparent; + height: 35px; } + .skin-blue .sidebar-form input[type="text"] { - color: #666; - border-top-left-radius: 2px; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 2px; + color: #666; + border-top-left-radius: 2px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 2px; } + .skin-blue .sidebar-form input[type="text"]:focus, .skin-blue .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - background-color: #fff; - color: #666; + background-color: #fff; + color: #666; } + .skin-blue .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - border-left-color: #fff; + border-left-color: #fff; } + .skin-blue .sidebar-form .btn { - color: #999; - border-top-left-radius: 0; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; - border-bottom-left-radius: 0; + color: #999; + border-top-left-radius: 0; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + border-bottom-left-radius: 0; } + .skin-blue.layout-top-nav .main-header > .logo { - background-color: #3c8dbc; - color: #ffffff; - border-bottom: 0 solid transparent; + background-color: #3c8dbc; + color: #ffffff; + border-bottom: 0 solid transparent; } + .skin-blue.layout-top-nav .main-header > .logo:hover { - background-color: #3b8ab8; + background-color: #3b8ab8; } + /* * Skin: Blue * ---------- */ .skin-blue-light .main-header .navbar { - background-color: #3c8dbc; + background-color: #3c8dbc; } + .skin-blue-light .main-header .navbar .nav > li > a { - color: #ffffff; + color: #ffffff; } + .skin-blue-light .main-header .navbar .nav > li > a:hover, .skin-blue-light .main-header .navbar .nav > li > a:active, .skin-blue-light .main-header .navbar .nav > li > a:focus, @@ -154,175 +188,217 @@ .skin-blue-light .main-header .navbar .nav .open > a:hover, .skin-blue-light .main-header .navbar .nav .open > a:focus, .skin-blue-light .main-header .navbar .nav > .active > a { - background: rgba(0, 0, 0, 0.1); - color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; } + .skin-blue-light .main-header .navbar .sidebar-toggle { - color: #ffffff; + color: #ffffff; } + .skin-blue-light .main-header .navbar .sidebar-toggle:hover { - color: #f6f6f6; - background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); } + .skin-blue-light .main-header .navbar .sidebar-toggle { - color: #fff; + color: #fff; } + .skin-blue-light .main-header .navbar .sidebar-toggle:hover { - background-color: #367fa9; + background-color: #367fa9; } + @media (max-width: 767px) { - .skin-blue-light .main-header .navbar .dropdown-menu li.divider { - background-color: rgba(255, 255, 255, 0.1); - } - .skin-blue-light .main-header .navbar .dropdown-menu li a { - color: #fff; - } - .skin-blue-light .main-header .navbar .dropdown-menu li a:hover { - background: #367fa9; - } -} + .skin-blue-light .main-header .navbar .dropdown-menu li.divider { + background-color: rgba(255, 255, 255, 0.1); + } + + .skin-blue-light .main-header .navbar .dropdown-menu li a { + color: #fff; + } + + .skin-blue-light .main-header .navbar .dropdown-menu li a:hover { + background: #367fa9; + } +} + .skin-blue-light .main-header .logo { - background-color: #3c8dbc; - color: #ffffff; - border-bottom: 0 solid transparent; + background-color: #3c8dbc; + color: #ffffff; + border-bottom: 0 solid transparent; } + .skin-blue-light .main-header .logo:hover { - background-color: #3b8ab8; + background-color: #3b8ab8; } + .skin-blue-light .main-header li.user-header { - background-color: #3c8dbc; + background-color: #3c8dbc; } + .skin-blue-light .content-header { - background: transparent; + background: transparent; } + .skin-blue-light .wrapper, .skin-blue-light .main-sidebar, .skin-blue-light .left-side { - background-color: #f9fafc; + background-color: #f9fafc; } + .skin-blue-light .content-wrapper, .skin-blue-light .main-footer { - border-left: 1px solid #d2d6de; + border-left: 1px solid #d2d6de; } + .skin-blue-light .user-panel > .info, .skin-blue-light .user-panel > .info > a { - color: #444444; + color: #444444; } + .skin-blue-light .sidebar-menu > li { - -webkit-transition: border-left-color 0.3s ease; - -o-transition: border-left-color 0.3s ease; - transition: border-left-color 0.3s ease; + -webkit-transition: border-left-color 0.3s ease; + -o-transition: border-left-color 0.3s ease; + transition: border-left-color 0.3s ease; } + .skin-blue-light .sidebar-menu > li.header { - color: #848484; - background: #f9fafc; + color: #848484; + background: #f9fafc; } + .skin-blue-light .sidebar-menu > li > a { - border-left: 3px solid transparent; - font-weight: 600; + border-left: 3px solid transparent; + font-weight: 600; } + .skin-blue-light .sidebar-menu > li:hover > a, .skin-blue-light .sidebar-menu > li.active > a { - color: #000000; - background: #f4f4f5; + color: #000000; + background: #f4f4f5; } + .skin-blue-light .sidebar-menu > li.active { - border-left-color: #3c8dbc; + border-left-color: #3c8dbc; } + .skin-blue-light .sidebar-menu > li.active > a { - font-weight: 600; + font-weight: 600; } + .skin-blue-light .sidebar-menu > li > .treeview-menu { - background: #f4f4f5; + background: #f4f4f5; } + .skin-blue-light .sidebar a { - color: #444444; + color: #444444; } + .skin-blue-light .sidebar a:hover { - text-decoration: none; + text-decoration: none; } + .skin-blue-light .treeview-menu > li > a { - color: #777777; + color: #777777; } + .skin-blue-light .treeview-menu > li.active > a, .skin-blue-light .treeview-menu > li > a:hover { - color: #000000; + color: #000000; } + .skin-blue-light .treeview-menu > li.active > a { - font-weight: 600; + font-weight: 600; } + .skin-blue-light .sidebar-form { - border-radius: 3px; - border: 1px solid #d2d6de; - margin: 10px 10px; + border-radius: 3px; + border: 1px solid #d2d6de; + margin: 10px 10px; } + .skin-blue-light .sidebar-form input[type="text"], .skin-blue-light .sidebar-form .btn { - box-shadow: none; - background-color: #fff; - border: 1px solid transparent; - height: 35px; + box-shadow: none; + background-color: #fff; + border: 1px solid transparent; + height: 35px; } + .skin-blue-light .sidebar-form input[type="text"] { - color: #666; - border-top-left-radius: 2px; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 2px; + color: #666; + border-top-left-radius: 2px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 2px; } + .skin-blue-light .sidebar-form input[type="text"]:focus, .skin-blue-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - background-color: #fff; - color: #666; + background-color: #fff; + color: #666; } + .skin-blue-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - border-left-color: #fff; + border-left-color: #fff; } + .skin-blue-light .sidebar-form .btn { - color: #999; - border-top-left-radius: 0; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; - border-bottom-left-radius: 0; + color: #999; + border-top-left-radius: 0; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + border-bottom-left-radius: 0; } + @media (min-width: 768px) { - .skin-blue-light.sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu { - border-left: 1px solid #d2d6de; - } + .skin-blue-light.sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu { + border-left: 1px solid #d2d6de; + } } + .skin-blue-light .main-footer { - border-top-color: #d2d6de; + border-top-color: #d2d6de; } + .skin-blue.layout-top-nav .main-header > .logo { - background-color: #3c8dbc; - color: #ffffff; - border-bottom: 0 solid transparent; + background-color: #3c8dbc; + color: #ffffff; + border-bottom: 0 solid transparent; } + .skin-blue.layout-top-nav .main-header > .logo:hover { - background-color: #3b8ab8; + background-color: #3b8ab8; } + /* * Skin: Black * ----------- */ /* skin-black navbar */ .skin-black .main-header { - -webkit-box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05); - box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05); + -webkit-box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05); } + .skin-black .main-header .navbar-toggle { - color: #333; + color: #333; } + .skin-black .main-header .navbar-brand { - color: #333; - border-right: 1px solid #eee; + color: #333; + border-right: 1px solid #eee; } + .skin-black .main-header .navbar { - background-color: #ffffff; + background-color: #ffffff; } + .skin-black .main-header .navbar .nav > li > a { - color: #333333; + color: #333333; } + .skin-black .main-header .navbar .nav > li > a:hover, .skin-black .main-header .navbar .nav > li > a:active, .skin-black .main-header .navbar .nav > li > a:focus, @@ -330,157 +406,192 @@ .skin-black .main-header .navbar .nav .open > a:hover, .skin-black .main-header .navbar .nav .open > a:focus, .skin-black .main-header .navbar .nav > .active > a { - background: #ffffff; - color: #999999; + background: #ffffff; + color: #999999; } + .skin-black .main-header .navbar .sidebar-toggle { - color: #333333; + color: #333333; } + .skin-black .main-header .navbar .sidebar-toggle:hover { - color: #999999; - background: #ffffff; + color: #999999; + background: #ffffff; } + .skin-black .main-header .navbar > .sidebar-toggle { - color: #333; - border-right: 1px solid #eee; + color: #333; + border-right: 1px solid #eee; } + .skin-black .main-header .navbar .navbar-nav > li > a { - border-right: 1px solid #eee; + border-right: 1px solid #eee; } + .skin-black .main-header .navbar .navbar-custom-menu .navbar-nav > li > a, .skin-black .main-header .navbar .navbar-right > li > a { - border-left: 1px solid #eee; - border-right-width: 0; + border-left: 1px solid #eee; + border-right-width: 0; } + .skin-black .main-header > .logo { - background-color: #ffffff; - color: #333333; - border-bottom: 0 solid transparent; - border-right: 1px solid #eee; + background-color: #ffffff; + color: #333333; + border-bottom: 0 solid transparent; + border-right: 1px solid #eee; } + .skin-black .main-header > .logo:hover { - background-color: #fcfcfc; + background-color: #fcfcfc; } + @media (max-width: 767px) { - .skin-black .main-header > .logo { - background-color: #222222; - color: #ffffff; - border-bottom: 0 solid transparent; - border-right: none; - } - .skin-black .main-header > .logo:hover { - background-color: #1f1f1f; - } -} + .skin-black .main-header > .logo { + background-color: #222222; + color: #ffffff; + border-bottom: 0 solid transparent; + border-right: none; + } + + .skin-black .main-header > .logo:hover { + background-color: #1f1f1f; + } +} + .skin-black .main-header li.user-header { - background-color: #222; + background-color: #222; } + .skin-black .content-header { - background: transparent; - box-shadow: none; + background: transparent; + box-shadow: none; } + .skin-black .wrapper, .skin-black .main-sidebar, .skin-black .left-side { - background-color: #222d32; + background-color: #222d32; } + .skin-black .user-panel > .info, .skin-black .user-panel > .info > a { - color: #fff; + color: #fff; } + .skin-black .sidebar-menu > li.header { - color: #4b646f; - background: #1a2226; + color: #4b646f; + background: #1a2226; } + .skin-black .sidebar-menu > li > a { - border-left: 3px solid transparent; + border-left: 3px solid transparent; } + .skin-black .sidebar-menu > li:hover > a, .skin-black .sidebar-menu > li.active > a { - color: #ffffff; - background: #1e282c; - border-left-color: #ffffff; + color: #ffffff; + background: #1e282c; + border-left-color: #ffffff; } + .skin-black .sidebar-menu > li > .treeview-menu { - margin: 0 1px; - background: #2c3b41; + margin: 0 1px; + background: #2c3b41; } + .skin-black .sidebar a { - color: #b8c7ce; + color: #b8c7ce; } + .skin-black .sidebar a:hover { - text-decoration: none; + text-decoration: none; } + .skin-black .treeview-menu > li > a { - color: #8aa4af; + color: #8aa4af; } + .skin-black .treeview-menu > li.active > a, .skin-black .treeview-menu > li > a:hover { - color: #ffffff; + color: #ffffff; } + .skin-black .sidebar-form { - border-radius: 3px; - border: 1px solid #374850; - margin: 10px 10px; + border-radius: 3px; + border: 1px solid #374850; + margin: 10px 10px; } + .skin-black .sidebar-form input[type="text"], .skin-black .sidebar-form .btn { - box-shadow: none; - background-color: #374850; - border: 1px solid transparent; - height: 35px; + box-shadow: none; + background-color: #374850; + border: 1px solid transparent; + height: 35px; } + .skin-black .sidebar-form input[type="text"] { - color: #666; - border-top-left-radius: 2px; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 2px; + color: #666; + border-top-left-radius: 2px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 2px; } + .skin-black .sidebar-form input[type="text"]:focus, .skin-black .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - background-color: #fff; - color: #666; + background-color: #fff; + color: #666; } + .skin-black .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - border-left-color: #fff; + border-left-color: #fff; } + .skin-black .sidebar-form .btn { - color: #999; - border-top-left-radius: 0; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; - border-bottom-left-radius: 0; + color: #999; + border-top-left-radius: 0; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + border-bottom-left-radius: 0; } + .skin-black .pace .pace-progress { - background: #222; + background: #222; } + .skin-black .pace .pace-activity { - border-top-color: #222; - border-left-color: #222; + border-top-color: #222; + border-left-color: #222; } + /* * Skin: Black * ----------- */ /* skin-black navbar */ .skin-black-light .main-header { - -webkit-box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05); - box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05); + -webkit-box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05); } + .skin-black-light .main-header .navbar-toggle { - color: #333; + color: #333; } + .skin-black-light .main-header .navbar-brand { - color: #333; - border-right: 1px solid #eee; + color: #333; + border-right: 1px solid #eee; } + .skin-black-light .main-header .navbar { - background-color: #ffffff; + background-color: #ffffff; } + .skin-black-light .main-header .navbar .nav > li > a { - color: #333333; + color: #333333; } + .skin-black-light .main-header .navbar .nav > li > a:hover, .skin-black-light .main-header .navbar .nav > li > a:active, .skin-black-light .main-header .navbar .nav > li > a:focus, @@ -488,160 +599,196 @@ .skin-black-light .main-header .navbar .nav .open > a:hover, .skin-black-light .main-header .navbar .nav .open > a:focus, .skin-black-light .main-header .navbar .nav > .active > a { - background: #ffffff; - color: #999999; + background: #ffffff; + color: #999999; } + .skin-black-light .main-header .navbar .sidebar-toggle { - color: #333333; + color: #333333; } + .skin-black-light .main-header .navbar .sidebar-toggle:hover { - color: #999999; - background: #ffffff; + color: #999999; + background: #ffffff; } + .skin-black-light .main-header .navbar > .sidebar-toggle { - color: #333; - border-right: 1px solid #eee; + color: #333; + border-right: 1px solid #eee; } + .skin-black-light .main-header .navbar .navbar-nav > li > a { - border-right: 1px solid #eee; + border-right: 1px solid #eee; } + .skin-black-light .main-header .navbar .navbar-custom-menu .navbar-nav > li > a, .skin-black-light .main-header .navbar .navbar-right > li > a { - border-left: 1px solid #eee; - border-right-width: 0; + border-left: 1px solid #eee; + border-right-width: 0; } + .skin-black-light .main-header > .logo { - background-color: #ffffff; - color: #333333; - border-bottom: 0 solid transparent; - border-right: 1px solid #eee; + background-color: #ffffff; + color: #333333; + border-bottom: 0 solid transparent; + border-right: 1px solid #eee; } + .skin-black-light .main-header > .logo:hover { - background-color: #fcfcfc; + background-color: #fcfcfc; } + @media (max-width: 767px) { - .skin-black-light .main-header > .logo { - background-color: #222222; - color: #ffffff; - border-bottom: 0 solid transparent; - border-right: none; - } - .skin-black-light .main-header > .logo:hover { - background-color: #1f1f1f; - } -} + .skin-black-light .main-header > .logo { + background-color: #222222; + color: #ffffff; + border-bottom: 0 solid transparent; + border-right: none; + } + + .skin-black-light .main-header > .logo:hover { + background-color: #1f1f1f; + } +} + .skin-black-light .main-header li.user-header { - background-color: #222; + background-color: #222; } + .skin-black-light .content-header { - background: transparent; - box-shadow: none; + background: transparent; + box-shadow: none; } + .skin-black-light .wrapper, .skin-black-light .main-sidebar, .skin-black-light .left-side { - background-color: #f9fafc; + background-color: #f9fafc; } + .skin-black-light .content-wrapper, .skin-black-light .main-footer { - border-left: 1px solid #d2d6de; + border-left: 1px solid #d2d6de; } + .skin-black-light .user-panel > .info, .skin-black-light .user-panel > .info > a { - color: #444444; + color: #444444; } + .skin-black-light .sidebar-menu > li { - -webkit-transition: border-left-color 0.3s ease; - -o-transition: border-left-color 0.3s ease; - transition: border-left-color 0.3s ease; + -webkit-transition: border-left-color 0.3s ease; + -o-transition: border-left-color 0.3s ease; + transition: border-left-color 0.3s ease; } + .skin-black-light .sidebar-menu > li.header { - color: #848484; - background: #f9fafc; + color: #848484; + background: #f9fafc; } + .skin-black-light .sidebar-menu > li > a { - border-left: 3px solid transparent; - font-weight: 600; + border-left: 3px solid transparent; + font-weight: 600; } + .skin-black-light .sidebar-menu > li:hover > a, .skin-black-light .sidebar-menu > li.active > a { - color: #000000; - background: #f4f4f5; + color: #000000; + background: #f4f4f5; } + .skin-black-light .sidebar-menu > li.active { - border-left-color: #ffffff; + border-left-color: #ffffff; } + .skin-black-light .sidebar-menu > li.active > a { - font-weight: 600; + font-weight: 600; } + .skin-black-light .sidebar-menu > li > .treeview-menu { - background: #f4f4f5; + background: #f4f4f5; } + .skin-black-light .sidebar a { - color: #444444; + color: #444444; } + .skin-black-light .sidebar a:hover { - text-decoration: none; + text-decoration: none; } + .skin-black-light .treeview-menu > li > a { - color: #777777; + color: #777777; } + .skin-black-light .treeview-menu > li.active > a, .skin-black-light .treeview-menu > li > a:hover { - color: #000000; + color: #000000; } + .skin-black-light .treeview-menu > li.active > a { - font-weight: 600; + font-weight: 600; } + .skin-black-light .sidebar-form { - border-radius: 3px; - border: 1px solid #d2d6de; - margin: 10px 10px; + border-radius: 3px; + border: 1px solid #d2d6de; + margin: 10px 10px; } + .skin-black-light .sidebar-form input[type="text"], .skin-black-light .sidebar-form .btn { - box-shadow: none; - background-color: #fff; - border: 1px solid transparent; - height: 35px; + box-shadow: none; + background-color: #fff; + border: 1px solid transparent; + height: 35px; } + .skin-black-light .sidebar-form input[type="text"] { - color: #666; - border-top-left-radius: 2px; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 2px; + color: #666; + border-top-left-radius: 2px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 2px; } + .skin-black-light .sidebar-form input[type="text"]:focus, .skin-black-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - background-color: #fff; - color: #666; + background-color: #fff; + color: #666; } + .skin-black-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - border-left-color: #fff; + border-left-color: #fff; } + .skin-black-light .sidebar-form .btn { - color: #999; - border-top-left-radius: 0; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; - border-bottom-left-radius: 0; + color: #999; + border-top-left-radius: 0; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + border-bottom-left-radius: 0; } + @media (min-width: 768px) { - .skin-black-light.sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu { - border-left: 1px solid #d2d6de; - } + .skin-black-light.sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu { + border-left: 1px solid #d2d6de; + } } + /* * Skin: Green * ----------- */ .skin-green .main-header .navbar { - background-color: #00a65a; + background-color: #00a65a; } + .skin-green .main-header .navbar .nav > li > a { - color: #ffffff; + color: #ffffff; } + .skin-green .main-header .navbar .nav > li > a:hover, .skin-green .main-header .navbar .nav > li > a:active, .skin-green .main-header .navbar .nav > li > a:focus, @@ -649,130 +796,160 @@ .skin-green .main-header .navbar .nav .open > a:hover, .skin-green .main-header .navbar .nav .open > a:focus, .skin-green .main-header .navbar .nav > .active > a { - background: rgba(0, 0, 0, 0.1); - color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; } + .skin-green .main-header .navbar .sidebar-toggle { - color: #ffffff; + color: #ffffff; } + .skin-green .main-header .navbar .sidebar-toggle:hover { - color: #f6f6f6; - background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); } + .skin-green .main-header .navbar .sidebar-toggle { - color: #fff; + color: #fff; } + .skin-green .main-header .navbar .sidebar-toggle:hover { - background-color: #008d4c; + background-color: #008d4c; } + @media (max-width: 767px) { - .skin-green .main-header .navbar .dropdown-menu li.divider { - background-color: rgba(255, 255, 255, 0.1); - } - .skin-green .main-header .navbar .dropdown-menu li a { - color: #fff; - } - .skin-green .main-header .navbar .dropdown-menu li a:hover { - background: #008d4c; - } -} + .skin-green .main-header .navbar .dropdown-menu li.divider { + background-color: rgba(255, 255, 255, 0.1); + } + + .skin-green .main-header .navbar .dropdown-menu li a { + color: #fff; + } + + .skin-green .main-header .navbar .dropdown-menu li a:hover { + background: #008d4c; + } +} + .skin-green .main-header .logo { - background-color: #008d4c; - color: #ffffff; - border-bottom: 0 solid transparent; + background-color: #008d4c; + color: #ffffff; + border-bottom: 0 solid transparent; } + .skin-green .main-header .logo:hover { - background-color: #008749; + background-color: #008749; } + .skin-green .main-header li.user-header { - background-color: #00a65a; + background-color: #00a65a; } + .skin-green .content-header { - background: transparent; + background: transparent; } + .skin-green .wrapper, .skin-green .main-sidebar, .skin-green .left-side { - background-color: #222d32; + background-color: #222d32; } + .skin-green .user-panel > .info, .skin-green .user-panel > .info > a { - color: #fff; + color: #fff; } + .skin-green .sidebar-menu > li.header { - color: #4b646f; - background: #1a2226; + color: #4b646f; + background: #1a2226; } + .skin-green .sidebar-menu > li > a { - border-left: 3px solid transparent; + border-left: 3px solid transparent; } + .skin-green .sidebar-menu > li:hover > a, .skin-green .sidebar-menu > li.active > a { - color: #ffffff; - background: #1e282c; - border-left-color: #00a65a; + color: #ffffff; + background: #1e282c; + border-left-color: #00a65a; } + .skin-green .sidebar-menu > li > .treeview-menu { - margin: 0 1px; - background: #2c3b41; + margin: 0 1px; + background: #2c3b41; } + .skin-green .sidebar a { - color: #b8c7ce; + color: #b8c7ce; } + .skin-green .sidebar a:hover { - text-decoration: none; + text-decoration: none; } + .skin-green .treeview-menu > li > a { - color: #8aa4af; + color: #8aa4af; } + .skin-green .treeview-menu > li.active > a, .skin-green .treeview-menu > li > a:hover { - color: #ffffff; + color: #ffffff; } + .skin-green .sidebar-form { - border-radius: 3px; - border: 1px solid #374850; - margin: 10px 10px; + border-radius: 3px; + border: 1px solid #374850; + margin: 10px 10px; } + .skin-green .sidebar-form input[type="text"], .skin-green .sidebar-form .btn { - box-shadow: none; - background-color: #374850; - border: 1px solid transparent; - height: 35px; + box-shadow: none; + background-color: #374850; + border: 1px solid transparent; + height: 35px; } + .skin-green .sidebar-form input[type="text"] { - color: #666; - border-top-left-radius: 2px; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 2px; + color: #666; + border-top-left-radius: 2px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 2px; } + .skin-green .sidebar-form input[type="text"]:focus, .skin-green .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - background-color: #fff; - color: #666; + background-color: #fff; + color: #666; } + .skin-green .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - border-left-color: #fff; + border-left-color: #fff; } + .skin-green .sidebar-form .btn { - color: #999; - border-top-left-radius: 0; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; - border-bottom-left-radius: 0; + color: #999; + border-top-left-radius: 0; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + border-bottom-left-radius: 0; } + /* * Skin: Green * ----------- */ .skin-green-light .main-header .navbar { - background-color: #00a65a; + background-color: #00a65a; } + .skin-green-light .main-header .navbar .nav > li > a { - color: #ffffff; + color: #ffffff; } + .skin-green-light .main-header .navbar .nav > li > a:hover, .skin-green-light .main-header .navbar .nav > li > a:active, .skin-green-light .main-header .navbar .nav > li > a:focus, @@ -780,152 +957,188 @@ .skin-green-light .main-header .navbar .nav .open > a:hover, .skin-green-light .main-header .navbar .nav .open > a:focus, .skin-green-light .main-header .navbar .nav > .active > a { - background: rgba(0, 0, 0, 0.1); - color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; } + .skin-green-light .main-header .navbar .sidebar-toggle { - color: #ffffff; + color: #ffffff; } + .skin-green-light .main-header .navbar .sidebar-toggle:hover { - color: #f6f6f6; - background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); } + .skin-green-light .main-header .navbar .sidebar-toggle { - color: #fff; + color: #fff; } + .skin-green-light .main-header .navbar .sidebar-toggle:hover { - background-color: #008d4c; + background-color: #008d4c; } + @media (max-width: 767px) { - .skin-green-light .main-header .navbar .dropdown-menu li.divider { - background-color: rgba(255, 255, 255, 0.1); - } - .skin-green-light .main-header .navbar .dropdown-menu li a { - color: #fff; - } - .skin-green-light .main-header .navbar .dropdown-menu li a:hover { - background: #008d4c; - } -} + .skin-green-light .main-header .navbar .dropdown-menu li.divider { + background-color: rgba(255, 255, 255, 0.1); + } + + .skin-green-light .main-header .navbar .dropdown-menu li a { + color: #fff; + } + + .skin-green-light .main-header .navbar .dropdown-menu li a:hover { + background: #008d4c; + } +} + .skin-green-light .main-header .logo { - background-color: #00a65a; - color: #ffffff; - border-bottom: 0 solid transparent; + background-color: #00a65a; + color: #ffffff; + border-bottom: 0 solid transparent; } + .skin-green-light .main-header .logo:hover { - background-color: #00a157; + background-color: #00a157; } + .skin-green-light .main-header li.user-header { - background-color: #00a65a; + background-color: #00a65a; } + .skin-green-light .content-header { - background: transparent; + background: transparent; } + .skin-green-light .wrapper, .skin-green-light .main-sidebar, .skin-green-light .left-side { - background-color: #f9fafc; + background-color: #f9fafc; } + .skin-green-light .content-wrapper, .skin-green-light .main-footer { - border-left: 1px solid #d2d6de; + border-left: 1px solid #d2d6de; } + .skin-green-light .user-panel > .info, .skin-green-light .user-panel > .info > a { - color: #444444; + color: #444444; } + .skin-green-light .sidebar-menu > li { - -webkit-transition: border-left-color 0.3s ease; - -o-transition: border-left-color 0.3s ease; - transition: border-left-color 0.3s ease; + -webkit-transition: border-left-color 0.3s ease; + -o-transition: border-left-color 0.3s ease; + transition: border-left-color 0.3s ease; } + .skin-green-light .sidebar-menu > li.header { - color: #848484; - background: #f9fafc; + color: #848484; + background: #f9fafc; } + .skin-green-light .sidebar-menu > li > a { - border-left: 3px solid transparent; - font-weight: 600; + border-left: 3px solid transparent; + font-weight: 600; } + .skin-green-light .sidebar-menu > li:hover > a, .skin-green-light .sidebar-menu > li.active > a { - color: #000000; - background: #f4f4f5; + color: #000000; + background: #f4f4f5; } + .skin-green-light .sidebar-menu > li.active { - border-left-color: #00a65a; + border-left-color: #00a65a; } + .skin-green-light .sidebar-menu > li.active > a { - font-weight: 600; + font-weight: 600; } + .skin-green-light .sidebar-menu > li > .treeview-menu { - background: #f4f4f5; + background: #f4f4f5; } + .skin-green-light .sidebar a { - color: #444444; + color: #444444; } + .skin-green-light .sidebar a:hover { - text-decoration: none; + text-decoration: none; } + .skin-green-light .treeview-menu > li > a { - color: #777777; + color: #777777; } + .skin-green-light .treeview-menu > li.active > a, .skin-green-light .treeview-menu > li > a:hover { - color: #000000; + color: #000000; } + .skin-green-light .treeview-menu > li.active > a { - font-weight: 600; + font-weight: 600; } + .skin-green-light .sidebar-form { - border-radius: 3px; - border: 1px solid #d2d6de; - margin: 10px 10px; + border-radius: 3px; + border: 1px solid #d2d6de; + margin: 10px 10px; } + .skin-green-light .sidebar-form input[type="text"], .skin-green-light .sidebar-form .btn { - box-shadow: none; - background-color: #fff; - border: 1px solid transparent; - height: 35px; + box-shadow: none; + background-color: #fff; + border: 1px solid transparent; + height: 35px; } + .skin-green-light .sidebar-form input[type="text"] { - color: #666; - border-top-left-radius: 2px; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 2px; + color: #666; + border-top-left-radius: 2px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 2px; } + .skin-green-light .sidebar-form input[type="text"]:focus, .skin-green-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - background-color: #fff; - color: #666; + background-color: #fff; + color: #666; } + .skin-green-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - border-left-color: #fff; + border-left-color: #fff; } + .skin-green-light .sidebar-form .btn { - color: #999; - border-top-left-radius: 0; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; - border-bottom-left-radius: 0; + color: #999; + border-top-left-radius: 0; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + border-bottom-left-radius: 0; } + @media (min-width: 768px) { - .skin-green-light.sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu { - border-left: 1px solid #d2d6de; - } + .skin-green-light.sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu { + border-left: 1px solid #d2d6de; + } } + /* * Skin: Red * --------- */ .skin-red .main-header .navbar { - background-color: #dd4b39; + background-color: #dd4b39; } + .skin-red .main-header .navbar .nav > li > a { - color: #ffffff; + color: #ffffff; } + .skin-red .main-header .navbar .nav > li > a:hover, .skin-red .main-header .navbar .nav > li > a:active, .skin-red .main-header .navbar .nav > li > a:focus, @@ -933,130 +1146,160 @@ .skin-red .main-header .navbar .nav .open > a:hover, .skin-red .main-header .navbar .nav .open > a:focus, .skin-red .main-header .navbar .nav > .active > a { - background: rgba(0, 0, 0, 0.1); - color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; } + .skin-red .main-header .navbar .sidebar-toggle { - color: #ffffff; + color: #ffffff; } + .skin-red .main-header .navbar .sidebar-toggle:hover { - color: #f6f6f6; - background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); } + .skin-red .main-header .navbar .sidebar-toggle { - color: #fff; + color: #fff; } + .skin-red .main-header .navbar .sidebar-toggle:hover { - background-color: #d73925; + background-color: #d73925; } + @media (max-width: 767px) { - .skin-red .main-header .navbar .dropdown-menu li.divider { - background-color: rgba(255, 255, 255, 0.1); - } - .skin-red .main-header .navbar .dropdown-menu li a { - color: #fff; - } - .skin-red .main-header .navbar .dropdown-menu li a:hover { - background: #d73925; - } -} + .skin-red .main-header .navbar .dropdown-menu li.divider { + background-color: rgba(255, 255, 255, 0.1); + } + + .skin-red .main-header .navbar .dropdown-menu li a { + color: #fff; + } + + .skin-red .main-header .navbar .dropdown-menu li a:hover { + background: #d73925; + } +} + .skin-red .main-header .logo { - background-color: #d73925; - color: #ffffff; - border-bottom: 0 solid transparent; + background-color: #d73925; + color: #ffffff; + border-bottom: 0 solid transparent; } + .skin-red .main-header .logo:hover { - background-color: #d33724; + background-color: #d33724; } + .skin-red .main-header li.user-header { - background-color: #dd4b39; + background-color: #dd4b39; } + .skin-red .content-header { - background: transparent; + background: transparent; } + .skin-red .wrapper, .skin-red .main-sidebar, .skin-red .left-side { - background-color: #222d32; + background-color: #222d32; } + .skin-red .user-panel > .info, .skin-red .user-panel > .info > a { - color: #fff; + color: #fff; } + .skin-red .sidebar-menu > li.header { - color: #4b646f; - background: #1a2226; + color: #4b646f; + background: #1a2226; } + .skin-red .sidebar-menu > li > a { - border-left: 3px solid transparent; + border-left: 3px solid transparent; } + .skin-red .sidebar-menu > li:hover > a, .skin-red .sidebar-menu > li.active > a { - color: #ffffff; - background: #1e282c; - border-left-color: #dd4b39; + color: #ffffff; + background: #1e282c; + border-left-color: #dd4b39; } + .skin-red .sidebar-menu > li > .treeview-menu { - margin: 0 1px; - background: #2c3b41; + margin: 0 1px; + background: #2c3b41; } + .skin-red .sidebar a { - color: #b8c7ce; + color: #b8c7ce; } + .skin-red .sidebar a:hover { - text-decoration: none; + text-decoration: none; } + .skin-red .treeview-menu > li > a { - color: #8aa4af; + color: #8aa4af; } + .skin-red .treeview-menu > li.active > a, .skin-red .treeview-menu > li > a:hover { - color: #ffffff; + color: #ffffff; } + .skin-red .sidebar-form { - border-radius: 3px; - border: 1px solid #374850; - margin: 10px 10px; + border-radius: 3px; + border: 1px solid #374850; + margin: 10px 10px; } + .skin-red .sidebar-form input[type="text"], .skin-red .sidebar-form .btn { - box-shadow: none; - background-color: #374850; - border: 1px solid transparent; - height: 35px; + box-shadow: none; + background-color: #374850; + border: 1px solid transparent; + height: 35px; } + .skin-red .sidebar-form input[type="text"] { - color: #666; - border-top-left-radius: 2px; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 2px; + color: #666; + border-top-left-radius: 2px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 2px; } + .skin-red .sidebar-form input[type="text"]:focus, .skin-red .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - background-color: #fff; - color: #666; + background-color: #fff; + color: #666; } + .skin-red .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - border-left-color: #fff; + border-left-color: #fff; } + .skin-red .sidebar-form .btn { - color: #999; - border-top-left-radius: 0; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; - border-bottom-left-radius: 0; + color: #999; + border-top-left-radius: 0; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + border-bottom-left-radius: 0; } + /* * Skin: Red * --------- */ .skin-red-light .main-header .navbar { - background-color: #dd4b39; + background-color: #dd4b39; } + .skin-red-light .main-header .navbar .nav > li > a { - color: #ffffff; + color: #ffffff; } + .skin-red-light .main-header .navbar .nav > li > a:hover, .skin-red-light .main-header .navbar .nav > li > a:active, .skin-red-light .main-header .navbar .nav > li > a:focus, @@ -1064,152 +1307,188 @@ .skin-red-light .main-header .navbar .nav .open > a:hover, .skin-red-light .main-header .navbar .nav .open > a:focus, .skin-red-light .main-header .navbar .nav > .active > a { - background: rgba(0, 0, 0, 0.1); - color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; } + .skin-red-light .main-header .navbar .sidebar-toggle { - color: #ffffff; + color: #ffffff; } + .skin-red-light .main-header .navbar .sidebar-toggle:hover { - color: #f6f6f6; - background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); } + .skin-red-light .main-header .navbar .sidebar-toggle { - color: #fff; + color: #fff; } + .skin-red-light .main-header .navbar .sidebar-toggle:hover { - background-color: #d73925; + background-color: #d73925; } + @media (max-width: 767px) { - .skin-red-light .main-header .navbar .dropdown-menu li.divider { - background-color: rgba(255, 255, 255, 0.1); - } - .skin-red-light .main-header .navbar .dropdown-menu li a { - color: #fff; - } - .skin-red-light .main-header .navbar .dropdown-menu li a:hover { - background: #d73925; - } -} + .skin-red-light .main-header .navbar .dropdown-menu li.divider { + background-color: rgba(255, 255, 255, 0.1); + } + + .skin-red-light .main-header .navbar .dropdown-menu li a { + color: #fff; + } + + .skin-red-light .main-header .navbar .dropdown-menu li a:hover { + background: #d73925; + } +} + .skin-red-light .main-header .logo { - background-color: #dd4b39; - color: #ffffff; - border-bottom: 0 solid transparent; + background-color: #dd4b39; + color: #ffffff; + border-bottom: 0 solid transparent; } + .skin-red-light .main-header .logo:hover { - background-color: #dc4735; + background-color: #dc4735; } + .skin-red-light .main-header li.user-header { - background-color: #dd4b39; + background-color: #dd4b39; } + .skin-red-light .content-header { - background: transparent; + background: transparent; } + .skin-red-light .wrapper, .skin-red-light .main-sidebar, .skin-red-light .left-side { - background-color: #f9fafc; + background-color: #f9fafc; } + .skin-red-light .content-wrapper, .skin-red-light .main-footer { - border-left: 1px solid #d2d6de; + border-left: 1px solid #d2d6de; } + .skin-red-light .user-panel > .info, .skin-red-light .user-panel > .info > a { - color: #444444; + color: #444444; } + .skin-red-light .sidebar-menu > li { - -webkit-transition: border-left-color 0.3s ease; - -o-transition: border-left-color 0.3s ease; - transition: border-left-color 0.3s ease; + -webkit-transition: border-left-color 0.3s ease; + -o-transition: border-left-color 0.3s ease; + transition: border-left-color 0.3s ease; } + .skin-red-light .sidebar-menu > li.header { - color: #848484; - background: #f9fafc; + color: #848484; + background: #f9fafc; } + .skin-red-light .sidebar-menu > li > a { - border-left: 3px solid transparent; - font-weight: 600; + border-left: 3px solid transparent; + font-weight: 600; } + .skin-red-light .sidebar-menu > li:hover > a, .skin-red-light .sidebar-menu > li.active > a { - color: #000000; - background: #f4f4f5; + color: #000000; + background: #f4f4f5; } + .skin-red-light .sidebar-menu > li.active { - border-left-color: #dd4b39; + border-left-color: #dd4b39; } + .skin-red-light .sidebar-menu > li.active > a { - font-weight: 600; + font-weight: 600; } + .skin-red-light .sidebar-menu > li > .treeview-menu { - background: #f4f4f5; + background: #f4f4f5; } + .skin-red-light .sidebar a { - color: #444444; + color: #444444; } + .skin-red-light .sidebar a:hover { - text-decoration: none; + text-decoration: none; } + .skin-red-light .treeview-menu > li > a { - color: #777777; + color: #777777; } + .skin-red-light .treeview-menu > li.active > a, .skin-red-light .treeview-menu > li > a:hover { - color: #000000; + color: #000000; } + .skin-red-light .treeview-menu > li.active > a { - font-weight: 600; + font-weight: 600; } + .skin-red-light .sidebar-form { - border-radius: 3px; - border: 1px solid #d2d6de; - margin: 10px 10px; + border-radius: 3px; + border: 1px solid #d2d6de; + margin: 10px 10px; } + .skin-red-light .sidebar-form input[type="text"], .skin-red-light .sidebar-form .btn { - box-shadow: none; - background-color: #fff; - border: 1px solid transparent; - height: 35px; + box-shadow: none; + background-color: #fff; + border: 1px solid transparent; + height: 35px; } + .skin-red-light .sidebar-form input[type="text"] { - color: #666; - border-top-left-radius: 2px; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 2px; + color: #666; + border-top-left-radius: 2px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 2px; } + .skin-red-light .sidebar-form input[type="text"]:focus, .skin-red-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - background-color: #fff; - color: #666; + background-color: #fff; + color: #666; } + .skin-red-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - border-left-color: #fff; + border-left-color: #fff; } + .skin-red-light .sidebar-form .btn { - color: #999; - border-top-left-radius: 0; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; - border-bottom-left-radius: 0; + color: #999; + border-top-left-radius: 0; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + border-bottom-left-radius: 0; } + @media (min-width: 768px) { - .skin-red-light.sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu { - border-left: 1px solid #d2d6de; - } + .skin-red-light.sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu { + border-left: 1px solid #d2d6de; + } } + /* * Skin: Yellow * ------------ */ .skin-yellow .main-header .navbar { - background-color: #f39c12; + background-color: #f39c12; } + .skin-yellow .main-header .navbar .nav > li > a { - color: #ffffff; + color: #ffffff; } + .skin-yellow .main-header .navbar .nav > li > a:hover, .skin-yellow .main-header .navbar .nav > li > a:active, .skin-yellow .main-header .navbar .nav > li > a:focus, @@ -1217,130 +1496,160 @@ .skin-yellow .main-header .navbar .nav .open > a:hover, .skin-yellow .main-header .navbar .nav .open > a:focus, .skin-yellow .main-header .navbar .nav > .active > a { - background: rgba(0, 0, 0, 0.1); - color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; } + .skin-yellow .main-header .navbar .sidebar-toggle { - color: #ffffff; + color: #ffffff; } + .skin-yellow .main-header .navbar .sidebar-toggle:hover { - color: #f6f6f6; - background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); } + .skin-yellow .main-header .navbar .sidebar-toggle { - color: #fff; + color: #fff; } + .skin-yellow .main-header .navbar .sidebar-toggle:hover { - background-color: #e08e0b; + background-color: #e08e0b; } + @media (max-width: 767px) { - .skin-yellow .main-header .navbar .dropdown-menu li.divider { - background-color: rgba(255, 255, 255, 0.1); - } - .skin-yellow .main-header .navbar .dropdown-menu li a { - color: #fff; - } - .skin-yellow .main-header .navbar .dropdown-menu li a:hover { - background: #e08e0b; - } -} + .skin-yellow .main-header .navbar .dropdown-menu li.divider { + background-color: rgba(255, 255, 255, 0.1); + } + + .skin-yellow .main-header .navbar .dropdown-menu li a { + color: #fff; + } + + .skin-yellow .main-header .navbar .dropdown-menu li a:hover { + background: #e08e0b; + } +} + .skin-yellow .main-header .logo { - background-color: #e08e0b; - color: #ffffff; - border-bottom: 0 solid transparent; + background-color: #e08e0b; + color: #ffffff; + border-bottom: 0 solid transparent; } + .skin-yellow .main-header .logo:hover { - background-color: #db8b0b; + background-color: #db8b0b; } + .skin-yellow .main-header li.user-header { - background-color: #f39c12; + background-color: #f39c12; } + .skin-yellow .content-header { - background: transparent; + background: transparent; } + .skin-yellow .wrapper, .skin-yellow .main-sidebar, .skin-yellow .left-side { - background-color: #222d32; + background-color: #222d32; } + .skin-yellow .user-panel > .info, .skin-yellow .user-panel > .info > a { - color: #fff; + color: #fff; } + .skin-yellow .sidebar-menu > li.header { - color: #4b646f; - background: #1a2226; + color: #4b646f; + background: #1a2226; } + .skin-yellow .sidebar-menu > li > a { - border-left: 3px solid transparent; + border-left: 3px solid transparent; } + .skin-yellow .sidebar-menu > li:hover > a, .skin-yellow .sidebar-menu > li.active > a { - color: #ffffff; - background: #1e282c; - border-left-color: #f39c12; + color: #ffffff; + background: #1e282c; + border-left-color: #f39c12; } + .skin-yellow .sidebar-menu > li > .treeview-menu { - margin: 0 1px; - background: #2c3b41; + margin: 0 1px; + background: #2c3b41; } + .skin-yellow .sidebar a { - color: #b8c7ce; + color: #b8c7ce; } + .skin-yellow .sidebar a:hover { - text-decoration: none; + text-decoration: none; } + .skin-yellow .treeview-menu > li > a { - color: #8aa4af; + color: #8aa4af; } + .skin-yellow .treeview-menu > li.active > a, .skin-yellow .treeview-menu > li > a:hover { - color: #ffffff; + color: #ffffff; } + .skin-yellow .sidebar-form { - border-radius: 3px; - border: 1px solid #374850; - margin: 10px 10px; + border-radius: 3px; + border: 1px solid #374850; + margin: 10px 10px; } + .skin-yellow .sidebar-form input[type="text"], .skin-yellow .sidebar-form .btn { - box-shadow: none; - background-color: #374850; - border: 1px solid transparent; - height: 35px; + box-shadow: none; + background-color: #374850; + border: 1px solid transparent; + height: 35px; } + .skin-yellow .sidebar-form input[type="text"] { - color: #666; - border-top-left-radius: 2px; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 2px; + color: #666; + border-top-left-radius: 2px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 2px; } + .skin-yellow .sidebar-form input[type="text"]:focus, .skin-yellow .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - background-color: #fff; - color: #666; + background-color: #fff; + color: #666; } + .skin-yellow .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - border-left-color: #fff; + border-left-color: #fff; } + .skin-yellow .sidebar-form .btn { - color: #999; - border-top-left-radius: 0; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; - border-bottom-left-radius: 0; + color: #999; + border-top-left-radius: 0; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + border-bottom-left-radius: 0; } + /* * Skin: Yellow * ------------ */ .skin-yellow-light .main-header .navbar { - background-color: #f39c12; + background-color: #f39c12; } + .skin-yellow-light .main-header .navbar .nav > li > a { - color: #ffffff; + color: #ffffff; } + .skin-yellow-light .main-header .navbar .nav > li > a:hover, .skin-yellow-light .main-header .navbar .nav > li > a:active, .skin-yellow-light .main-header .navbar .nav > li > a:focus, @@ -1348,152 +1657,188 @@ .skin-yellow-light .main-header .navbar .nav .open > a:hover, .skin-yellow-light .main-header .navbar .nav .open > a:focus, .skin-yellow-light .main-header .navbar .nav > .active > a { - background: rgba(0, 0, 0, 0.1); - color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; } + .skin-yellow-light .main-header .navbar .sidebar-toggle { - color: #ffffff; + color: #ffffff; } + .skin-yellow-light .main-header .navbar .sidebar-toggle:hover { - color: #f6f6f6; - background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); } + .skin-yellow-light .main-header .navbar .sidebar-toggle { - color: #fff; + color: #fff; } + .skin-yellow-light .main-header .navbar .sidebar-toggle:hover { - background-color: #e08e0b; + background-color: #e08e0b; } + @media (max-width: 767px) { - .skin-yellow-light .main-header .navbar .dropdown-menu li.divider { - background-color: rgba(255, 255, 255, 0.1); - } - .skin-yellow-light .main-header .navbar .dropdown-menu li a { - color: #fff; - } - .skin-yellow-light .main-header .navbar .dropdown-menu li a:hover { - background: #e08e0b; - } -} + .skin-yellow-light .main-header .navbar .dropdown-menu li.divider { + background-color: rgba(255, 255, 255, 0.1); + } + + .skin-yellow-light .main-header .navbar .dropdown-menu li a { + color: #fff; + } + + .skin-yellow-light .main-header .navbar .dropdown-menu li a:hover { + background: #e08e0b; + } +} + .skin-yellow-light .main-header .logo { - background-color: #f39c12; - color: #ffffff; - border-bottom: 0 solid transparent; + background-color: #f39c12; + color: #ffffff; + border-bottom: 0 solid transparent; } + .skin-yellow-light .main-header .logo:hover { - background-color: #f39a0d; + background-color: #f39a0d; } + .skin-yellow-light .main-header li.user-header { - background-color: #f39c12; + background-color: #f39c12; } + .skin-yellow-light .content-header { - background: transparent; + background: transparent; } + .skin-yellow-light .wrapper, .skin-yellow-light .main-sidebar, .skin-yellow-light .left-side { - background-color: #f9fafc; + background-color: #f9fafc; } + .skin-yellow-light .content-wrapper, .skin-yellow-light .main-footer { - border-left: 1px solid #d2d6de; + border-left: 1px solid #d2d6de; } + .skin-yellow-light .user-panel > .info, .skin-yellow-light .user-panel > .info > a { - color: #444444; + color: #444444; } + .skin-yellow-light .sidebar-menu > li { - -webkit-transition: border-left-color 0.3s ease; - -o-transition: border-left-color 0.3s ease; - transition: border-left-color 0.3s ease; + -webkit-transition: border-left-color 0.3s ease; + -o-transition: border-left-color 0.3s ease; + transition: border-left-color 0.3s ease; } + .skin-yellow-light .sidebar-menu > li.header { - color: #848484; - background: #f9fafc; + color: #848484; + background: #f9fafc; } + .skin-yellow-light .sidebar-menu > li > a { - border-left: 3px solid transparent; - font-weight: 600; + border-left: 3px solid transparent; + font-weight: 600; } + .skin-yellow-light .sidebar-menu > li:hover > a, .skin-yellow-light .sidebar-menu > li.active > a { - color: #000000; - background: #f4f4f5; + color: #000000; + background: #f4f4f5; } + .skin-yellow-light .sidebar-menu > li.active { - border-left-color: #f39c12; + border-left-color: #f39c12; } + .skin-yellow-light .sidebar-menu > li.active > a { - font-weight: 600; + font-weight: 600; } + .skin-yellow-light .sidebar-menu > li > .treeview-menu { - background: #f4f4f5; + background: #f4f4f5; } + .skin-yellow-light .sidebar a { - color: #444444; + color: #444444; } + .skin-yellow-light .sidebar a:hover { - text-decoration: none; + text-decoration: none; } + .skin-yellow-light .treeview-menu > li > a { - color: #777777; + color: #777777; } + .skin-yellow-light .treeview-menu > li.active > a, .skin-yellow-light .treeview-menu > li > a:hover { - color: #000000; + color: #000000; } + .skin-yellow-light .treeview-menu > li.active > a { - font-weight: 600; + font-weight: 600; } + .skin-yellow-light .sidebar-form { - border-radius: 3px; - border: 1px solid #d2d6de; - margin: 10px 10px; + border-radius: 3px; + border: 1px solid #d2d6de; + margin: 10px 10px; } + .skin-yellow-light .sidebar-form input[type="text"], .skin-yellow-light .sidebar-form .btn { - box-shadow: none; - background-color: #fff; - border: 1px solid transparent; - height: 35px; + box-shadow: none; + background-color: #fff; + border: 1px solid transparent; + height: 35px; } + .skin-yellow-light .sidebar-form input[type="text"] { - color: #666; - border-top-left-radius: 2px; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 2px; + color: #666; + border-top-left-radius: 2px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 2px; } + .skin-yellow-light .sidebar-form input[type="text"]:focus, .skin-yellow-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - background-color: #fff; - color: #666; + background-color: #fff; + color: #666; } + .skin-yellow-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - border-left-color: #fff; + border-left-color: #fff; } + .skin-yellow-light .sidebar-form .btn { - color: #999; - border-top-left-radius: 0; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; - border-bottom-left-radius: 0; + color: #999; + border-top-left-radius: 0; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + border-bottom-left-radius: 0; } + @media (min-width: 768px) { - .skin-yellow-light.sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu { - border-left: 1px solid #d2d6de; - } + .skin-yellow-light.sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu { + border-left: 1px solid #d2d6de; + } } + /* * Skin: Purple * ------------ */ .skin-purple .main-header .navbar { - background-color: #605ca8; + background-color: #605ca8; } + .skin-purple .main-header .navbar .nav > li > a { - color: #ffffff; + color: #ffffff; } + .skin-purple .main-header .navbar .nav > li > a:hover, .skin-purple .main-header .navbar .nav > li > a:active, .skin-purple .main-header .navbar .nav > li > a:focus, @@ -1501,130 +1846,160 @@ .skin-purple .main-header .navbar .nav .open > a:hover, .skin-purple .main-header .navbar .nav .open > a:focus, .skin-purple .main-header .navbar .nav > .active > a { - background: rgba(0, 0, 0, 0.1); - color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; } + .skin-purple .main-header .navbar .sidebar-toggle { - color: #ffffff; + color: #ffffff; } + .skin-purple .main-header .navbar .sidebar-toggle:hover { - color: #f6f6f6; - background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); } + .skin-purple .main-header .navbar .sidebar-toggle { - color: #fff; + color: #fff; } + .skin-purple .main-header .navbar .sidebar-toggle:hover { - background-color: #555299; + background-color: #555299; } + @media (max-width: 767px) { - .skin-purple .main-header .navbar .dropdown-menu li.divider { - background-color: rgba(255, 255, 255, 0.1); - } - .skin-purple .main-header .navbar .dropdown-menu li a { - color: #fff; - } - .skin-purple .main-header .navbar .dropdown-menu li a:hover { - background: #555299; - } -} + .skin-purple .main-header .navbar .dropdown-menu li.divider { + background-color: rgba(255, 255, 255, 0.1); + } + + .skin-purple .main-header .navbar .dropdown-menu li a { + color: #fff; + } + + .skin-purple .main-header .navbar .dropdown-menu li a:hover { + background: #555299; + } +} + .skin-purple .main-header .logo { - background-color: #555299; - color: #ffffff; - border-bottom: 0 solid transparent; + background-color: #555299; + color: #ffffff; + border-bottom: 0 solid transparent; } + .skin-purple .main-header .logo:hover { - background-color: #545096; + background-color: #545096; } + .skin-purple .main-header li.user-header { - background-color: #605ca8; + background-color: #605ca8; } + .skin-purple .content-header { - background: transparent; + background: transparent; } + .skin-purple .wrapper, .skin-purple .main-sidebar, .skin-purple .left-side { - background-color: #222d32; + background-color: #222d32; } + .skin-purple .user-panel > .info, .skin-purple .user-panel > .info > a { - color: #fff; + color: #fff; } + .skin-purple .sidebar-menu > li.header { - color: #4b646f; - background: #1a2226; + color: #4b646f; + background: #1a2226; } + .skin-purple .sidebar-menu > li > a { - border-left: 3px solid transparent; + border-left: 3px solid transparent; } + .skin-purple .sidebar-menu > li:hover > a, .skin-purple .sidebar-menu > li.active > a { - color: #ffffff; - background: #1e282c; - border-left-color: #605ca8; + color: #ffffff; + background: #1e282c; + border-left-color: #605ca8; } + .skin-purple .sidebar-menu > li > .treeview-menu { - margin: 0 1px; - background: #2c3b41; + margin: 0 1px; + background: #2c3b41; } + .skin-purple .sidebar a { - color: #b8c7ce; + color: #b8c7ce; } + .skin-purple .sidebar a:hover { - text-decoration: none; + text-decoration: none; } + .skin-purple .treeview-menu > li > a { - color: #8aa4af; + color: #8aa4af; } + .skin-purple .treeview-menu > li.active > a, .skin-purple .treeview-menu > li > a:hover { - color: #ffffff; + color: #ffffff; } + .skin-purple .sidebar-form { - border-radius: 3px; - border: 1px solid #374850; - margin: 10px 10px; + border-radius: 3px; + border: 1px solid #374850; + margin: 10px 10px; } + .skin-purple .sidebar-form input[type="text"], .skin-purple .sidebar-form .btn { - box-shadow: none; - background-color: #374850; - border: 1px solid transparent; - height: 35px; + box-shadow: none; + background-color: #374850; + border: 1px solid transparent; + height: 35px; } + .skin-purple .sidebar-form input[type="text"] { - color: #666; - border-top-left-radius: 2px; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 2px; + color: #666; + border-top-left-radius: 2px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 2px; } + .skin-purple .sidebar-form input[type="text"]:focus, .skin-purple .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - background-color: #fff; - color: #666; + background-color: #fff; + color: #666; } + .skin-purple .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - border-left-color: #fff; + border-left-color: #fff; } + .skin-purple .sidebar-form .btn { - color: #999; - border-top-left-radius: 0; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; - border-bottom-left-radius: 0; + color: #999; + border-top-left-radius: 0; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + border-bottom-left-radius: 0; } + /* * Skin: Purple * ------------ */ .skin-purple-light .main-header .navbar { - background-color: #605ca8; + background-color: #605ca8; } + .skin-purple-light .main-header .navbar .nav > li > a { - color: #ffffff; + color: #ffffff; } + .skin-purple-light .main-header .navbar .nav > li > a:hover, .skin-purple-light .main-header .navbar .nav > li > a:active, .skin-purple-light .main-header .navbar .nav > li > a:focus, @@ -1632,139 +2007,172 @@ .skin-purple-light .main-header .navbar .nav .open > a:hover, .skin-purple-light .main-header .navbar .nav .open > a:focus, .skin-purple-light .main-header .navbar .nav > .active > a { - background: rgba(0, 0, 0, 0.1); - color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; } + .skin-purple-light .main-header .navbar .sidebar-toggle { - color: #ffffff; + color: #ffffff; } + .skin-purple-light .main-header .navbar .sidebar-toggle:hover { - color: #f6f6f6; - background: rgba(0, 0, 0, 0.1); + color: #f6f6f6; + background: rgba(0, 0, 0, 0.1); } + .skin-purple-light .main-header .navbar .sidebar-toggle { - color: #fff; + color: #fff; } + .skin-purple-light .main-header .navbar .sidebar-toggle:hover { - background-color: #555299; + background-color: #555299; } + @media (max-width: 767px) { - .skin-purple-light .main-header .navbar .dropdown-menu li.divider { - background-color: rgba(255, 255, 255, 0.1); - } - .skin-purple-light .main-header .navbar .dropdown-menu li a { - color: #fff; - } - .skin-purple-light .main-header .navbar .dropdown-menu li a:hover { - background: #555299; - } -} + .skin-purple-light .main-header .navbar .dropdown-menu li.divider { + background-color: rgba(255, 255, 255, 0.1); + } + + .skin-purple-light .main-header .navbar .dropdown-menu li a { + color: #fff; + } + + .skin-purple-light .main-header .navbar .dropdown-menu li a:hover { + background: #555299; + } +} + .skin-purple-light .main-header .logo { - background-color: #605ca8; - color: #ffffff; - border-bottom: 0 solid transparent; + background-color: #605ca8; + color: #ffffff; + border-bottom: 0 solid transparent; } + .skin-purple-light .main-header .logo:hover { - background-color: #5d59a6; + background-color: #5d59a6; } + .skin-purple-light .main-header li.user-header { - background-color: #605ca8; + background-color: #605ca8; } + .skin-purple-light .content-header { - background: transparent; + background: transparent; } + .skin-purple-light .wrapper, .skin-purple-light .main-sidebar, .skin-purple-light .left-side { - background-color: #f9fafc; + background-color: #f9fafc; } + .skin-purple-light .content-wrapper, .skin-purple-light .main-footer { - border-left: 1px solid #d2d6de; + border-left: 1px solid #d2d6de; } + .skin-purple-light .user-panel > .info, .skin-purple-light .user-panel > .info > a { - color: #444444; + color: #444444; } + .skin-purple-light .sidebar-menu > li { - -webkit-transition: border-left-color 0.3s ease; - -o-transition: border-left-color 0.3s ease; - transition: border-left-color 0.3s ease; + -webkit-transition: border-left-color 0.3s ease; + -o-transition: border-left-color 0.3s ease; + transition: border-left-color 0.3s ease; } + .skin-purple-light .sidebar-menu > li.header { - color: #848484; - background: #f9fafc; + color: #848484; + background: #f9fafc; } + .skin-purple-light .sidebar-menu > li > a { - border-left: 3px solid transparent; - font-weight: 600; + border-left: 3px solid transparent; + font-weight: 600; } + .skin-purple-light .sidebar-menu > li:hover > a, .skin-purple-light .sidebar-menu > li.active > a { - color: #000000; - background: #f4f4f5; + color: #000000; + background: #f4f4f5; } + .skin-purple-light .sidebar-menu > li.active { - border-left-color: #605ca8; + border-left-color: #605ca8; } + .skin-purple-light .sidebar-menu > li.active > a { - font-weight: 600; + font-weight: 600; } + .skin-purple-light .sidebar-menu > li > .treeview-menu { - background: #f4f4f5; + background: #f4f4f5; } + .skin-purple-light .sidebar a { - color: #444444; + color: #444444; } + .skin-purple-light .sidebar a:hover { - text-decoration: none; + text-decoration: none; } + .skin-purple-light .treeview-menu > li > a { - color: #777777; + color: #777777; } + .skin-purple-light .treeview-menu > li.active > a, .skin-purple-light .treeview-menu > li > a:hover { - color: #000000; + color: #000000; } + .skin-purple-light .treeview-menu > li.active > a { - font-weight: 600; + font-weight: 600; } + .skin-purple-light .sidebar-form { - border-radius: 3px; - border: 1px solid #d2d6de; - margin: 10px 10px; + border-radius: 3px; + border: 1px solid #d2d6de; + margin: 10px 10px; } + .skin-purple-light .sidebar-form input[type="text"], .skin-purple-light .sidebar-form .btn { - box-shadow: none; - background-color: #fff; - border: 1px solid transparent; - height: 35px; + box-shadow: none; + background-color: #fff; + border: 1px solid transparent; + height: 35px; } + .skin-purple-light .sidebar-form input[type="text"] { - color: #666; - border-top-left-radius: 2px; - border-top-right-radius: 0; - border-bottom-right-radius: 0; - border-bottom-left-radius: 2px; + color: #666; + border-top-left-radius: 2px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 2px; } + .skin-purple-light .sidebar-form input[type="text"]:focus, .skin-purple-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - background-color: #fff; - color: #666; + background-color: #fff; + color: #666; } + .skin-purple-light .sidebar-form input[type="text"]:focus + .input-group-btn .btn { - border-left-color: #fff; + border-left-color: #fff; } + .skin-purple-light .sidebar-form .btn { - color: #999; - border-top-left-radius: 0; - border-top-right-radius: 2px; - border-bottom-right-radius: 2px; - border-bottom-left-radius: 0; + color: #999; + border-top-left-radius: 0; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; + border-bottom-left-radius: 0; } + @media (min-width: 768px) { - .skin-purple-light.sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu { - border-left: 1px solid #d2d6de; - } + .skin-purple-light.sidebar-mini.sidebar-collapse .sidebar-menu > li > .treeview-menu { + border-left: 1px solid #d2d6de; + } } diff --git a/main/app/sprinkles/core/assets/userfrosting/css/tablesorter-reflow.css b/main/app/sprinkles/core/assets/userfrosting/css/tablesorter-reflow.css index 3a9c14f..e944100 100644 --- a/main/app/sprinkles/core/assets/userfrosting/css/tablesorter-reflow.css +++ b/main/app/sprinkles/core/assets/userfrosting/css/tablesorter-reflow.css @@ -1,61 +1,65 @@ /* REQUIRED CSS: change your reflow breakpoint here (35em below) */ @media ( max-width: 35em ) { - /* uncomment out the line below if you don't want the sortable headers to show */ - table.ui-table-reflow thead { display: none; } - - .uf-table-search { - display: inherit; - } - - /* css for reflow & reflow2 widgets */ - .ui-table-reflow td, - .ui-table-reflow th { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - float: right; - /* if not using the stickyHeaders widget (not the css3 version) - * the "!important" flag, and "height: auto" can be removed */ - width: 100% !important; - height: auto !important; - } - - .tablesorter-bootstrap > thead > tr > th, - .tablesorter-bootstrap > thead > tr > td, - .tablesorter-bootstrap > tfoot > tr > th, - .tablesorter-bootstrap > tfoot > tr > td { - padding: 4px; - margin: 0; - } - - /* reflow widget only */ - .ui-table-reflow tbody td[data-title]:not(:first-child):before { - color: #469; - font-size: 1.5em; - content: attr(data-title); - width: 100%; - white-space: pre; - display: block; - } - - /* reflow2 widget only */ - table.ui-table-reflow .ui-table-cell-label { - display: none; - } - - table.ui-table-reflow .ui-table-cell-label.ui-table-cell-label-top { - display: block; - padding: .4em 0; - margin: .4em 0; - text-transform: uppercase; - font-size: 1.5em; - font-weight: 400; - } - -} /* end media query */ + /* uncomment out the line below if you don't want the sortable headers to show */ + table.ui-table-reflow thead { + display: none; + } + + .uf-table-search { + display: inherit; + } + + /* css for reflow & reflow2 widgets */ + .ui-table-reflow td, + .ui-table-reflow th { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + float: right; + /* if not using the stickyHeaders widget (not the css3 version) + * the "!important" flag, and "height: auto" can be removed */ + width: 100% !important; + height: auto !important; + } + + .tablesorter-bootstrap > thead > tr > th, + .tablesorter-bootstrap > thead > tr > td, + .tablesorter-bootstrap > tfoot > tr > th, + .tablesorter-bootstrap > tfoot > tr > td { + padding: 4px; + margin: 0; + } + + /* reflow widget only */ + .ui-table-reflow tbody td[data-title]:not(:first-child):before { + color: #469; + font-size: 1.5em; + content: attr(data-title); + width: 100%; + white-space: pre; + display: block; + } + + /* reflow2 widget only */ + table.ui-table-reflow .ui-table-cell-label { + display: none; + } + + table.ui-table-reflow .ui-table-cell-label.ui-table-cell-label-top { + display: block; + padding: .4em 0; + margin: .4em 0; + text-transform: uppercase; + font-size: 1.5em; + font-weight: 400; + } + +} + +/* end media query */ /* reflow2 widget */ .ui-table-reflow .ui-table-cell-label { - display: none; + display: none; } diff --git a/main/app/sprinkles/core/assets/userfrosting/css/uf-alerts.css b/main/app/sprinkles/core/assets/userfrosting/css/uf-alerts.css index 7ac5a97..1c6d45c 100644 --- a/main/app/sprinkles/core/assets/userfrosting/css/uf-alerts.css +++ b/main/app/sprinkles/core/assets/userfrosting/css/uf-alerts.css @@ -1,11 +1,9 @@ -.uf-alert -{ +.uf-alert { margin: 10px 0px 0px 0px; } /* Invert margin when inside a modal-body */ -.modal-body .uf-alert -{ +.modal-body .uf-alert { margin: 0px 0px 10px 0px; } diff --git a/main/app/sprinkles/core/assets/userfrosting/css/uf-collection.css b/main/app/sprinkles/core/assets/userfrosting/css/uf-collection.css index 432e1a4..4c5475a 100644 --- a/main/app/sprinkles/core/assets/userfrosting/css/uf-collection.css +++ b/main/app/sprinkles/core/assets/userfrosting/css/uf-collection.css @@ -10,6 +10,6 @@ } .uf-collection span.select2-dropdown.select2-dropdown--below { - position:absolute; + position: absolute; top: -32px; } diff --git a/main/app/sprinkles/core/assets/userfrosting/css/userfrosting.css b/main/app/sprinkles/core/assets/userfrosting/css/userfrosting.css index 38a92e2..b6dfe6f 100644 --- a/main/app/sprinkles/core/assets/userfrosting/css/userfrosting.css +++ b/main/app/sprinkles/core/assets/userfrosting/css/userfrosting.css @@ -10,7 +10,7 @@ label.label-switch { } form textarea { - resize: vertical; /* user can resize vertically, but width is fixed */ + resize: vertical; /* user can resize vertically, but width is fixed */ } /* Custom styling for table tool menus */ @@ -109,42 +109,43 @@ form textarea { /* Styling for AdminLTE form control icons, that doesn't interfere with validation plugin */ .form-control-icon { - position: absolute; - top: 0; - right: 0; - z-index: 2; - display: block; - width: 34px; - height: 34px; - line-height: 34px; - text-align: center; - pointer-events: none; + position: absolute; + top: 0; + right: 0; + z-index: 2; + display: block; + width: 34px; + height: 34px; + line-height: 34px; + text-align: center; + pointer-events: none; } .input-lg ~ .form-control-icon, .input-group-lg ~ .form-control-icon, .form-group-lg .form-control ~ .form-control-icon { - width: 46px; - height: 46px; - line-height: 46px; + width: 46px; + height: 46px; + line-height: 46px; } + .input-sm ~ .form-control-icon, .input-group-sm ~ .form-control-icon, .form-group-sm .form-control ~ .form-control-icon { - width: 30px; - height: 30px; - line-height: 30px; + width: 30px; + height: 30px; + line-height: 30px; } @media (min-width: 768px) { - .form-inline .has-feedback .form-control-icon, - .navbar-form .has-feedback .form-control-icon { - top: 0; - } + .form-inline .has-feedback .form-control-icon, + .navbar-form .has-feedback .form-control-icon { + top: 0; + } } .form-horizontal .has-feedback .form-control-icon { - right: 15px; + right: 15px; } /* Fix for select2 not resizing properly when the page is resized */ @@ -192,11 +193,12 @@ a .info-box { left: auto; } -@media(min-width: 561px) { +@media (min-width: 561px) { .dropdown-menu-right-responsive { right: 0; left: auto; } + .dropdown-menu-left-responsive { right: auto; left: 0; diff --git a/main/app/sprinkles/core/assets/userfrosting/favicons/ieconfig.xml b/main/app/sprinkles/core/assets/userfrosting/favicons/ieconfig.xml index e3e3d05..a008d3d 100644 --- a/main/app/sprinkles/core/assets/userfrosting/favicons/ieconfig.xml +++ b/main/app/sprinkles/core/assets/userfrosting/favicons/ieconfig.xml @@ -1,12 +1,12 @@ - - - - - - - #603cba - - + + + + + + + #603cba + + diff --git a/main/app/sprinkles/core/assets/userfrosting/favicons/manifest.json b/main/app/sprinkles/core/assets/userfrosting/favicons/manifest.json index 328cd7a..51628c7 100644 --- a/main/app/sprinkles/core/assets/userfrosting/favicons/manifest.json +++ b/main/app/sprinkles/core/assets/userfrosting/favicons/manifest.json @@ -1,51 +1,51 @@ { - "name": "UserFrosting", - "icons": [ - { - "src": "\/android-chrome-36x36.png", - "sizes": "36x36", - "type": "image\/png" - }, - { - "src": "\/android-chrome-48x48.png", - "sizes": "48x48", - "type": "image\/png" - }, - { - "src": "\/android-chrome-72x72.png", - "sizes": "72x72", - "type": "image\/png" - }, - { - "src": "\/android-chrome-96x96.png", - "sizes": "96x96", - "type": "image\/png" - }, - { - "src": "\/android-chrome-144x144.png", - "sizes": "144x144", - "type": "image\/png" - }, - { - "src": "\/android-chrome-192x192.png", - "sizes": "192x192", - "type": "image\/png" - }, - { - "src": "\/android-chrome-256x256.png", - "sizes": "256x256", - "type": "image\/png" - }, - { - "src": "\/android-chrome-384x384.png", - "sizes": "384x384", - "type": "image\/png" - }, - { - "src": "\/android-chrome-512x512.png", - "sizes": "512x512", - "type": "image\/png" - } - ], - "theme_color": "#f3f2e4" + "name": "UserFrosting", + "icons": [ + { + "src": "\/android-chrome-36x36.png", + "sizes": "36x36", + "type": "image\/png" + }, + { + "src": "\/android-chrome-48x48.png", + "sizes": "48x48", + "type": "image\/png" + }, + { + "src": "\/android-chrome-72x72.png", + "sizes": "72x72", + "type": "image\/png" + }, + { + "src": "\/android-chrome-96x96.png", + "sizes": "96x96", + "type": "image\/png" + }, + { + "src": "\/android-chrome-144x144.png", + "sizes": "144x144", + "type": "image\/png" + }, + { + "src": "\/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image\/png" + }, + { + "src": "\/android-chrome-256x256.png", + "sizes": "256x256", + "type": "image\/png" + }, + { + "src": "\/android-chrome-384x384.png", + "sizes": "384x384", + "type": "image\/png" + }, + { + "src": "\/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image\/png" + } + ], + "theme_color": "#f3f2e4" } diff --git a/main/app/sprinkles/core/assets/userfrosting/favicons/safari-pinned-tab.svg b/main/app/sprinkles/core/assets/userfrosting/favicons/safari-pinned-tab.svg index 2435014..67d76d2 100644 --- a/main/app/sprinkles/core/assets/userfrosting/favicons/safari-pinned-tab.svg +++ b/main/app/sprinkles/core/assets/userfrosting/favicons/safari-pinned-tab.svg @@ -1,21 +1,21 @@ + "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> - -Created by potrace 1.11, written by Peter Selinger 2001-2013 - - - + + Created by potrace 1.11, written by Peter Selinger 2001-2013 + + + - - - - - - - - - - - + diff --git a/main/app/sprinkles/core/assets/userfrosting/js/AdminLTE-custom.js b/main/app/sprinkles/core/assets/userfrosting/js/AdminLTE-custom.js index 177c845..71f679b 100644 --- a/main/app/sprinkles/core/assets/userfrosting/js/AdminLTE-custom.js +++ b/main/app/sprinkles/core/assets/userfrosting/js/AdminLTE-custom.js @@ -11,7 +11,7 @@ //Make sure jQuery has been loaded before app.js if (typeof jQuery === "undefined") { - throw new Error("AdminLTE requires jQuery"); + throw new Error("AdminLTE requires jQuery"); } /* Tree_UF() @@ -22,52 +22,52 @@ if (typeof jQuery === "undefined") { * @Usage: $.AdminLTE.tree_UF('.sidebar') */ $.AdminLTE.tree_UF = function (menu) { - var _this = this; - var animationSpeed = $.AdminLTE.options.animationSpeed; - $(document).off('click', menu + ' li a').on('click', menu + ' li a', function (e) { + var _this = this; + var animationSpeed = $.AdminLTE.options.animationSpeed; + $(document).off('click', menu + ' li a').on('click', menu + ' li a', function (e) { - //Get the clicked link and the next element - var $this = $(this); - var checkElement = $this.next(); + //Get the clicked link and the next element + var $this = $(this); + var checkElement = $this.next(); - //Check if the next element is a menu and is visible - if ((checkElement.is('.treeview-menu')) && (checkElement.is(':visible')) && (!$('body').hasClass('sidebar-collapse'))) { - //Close the menu - checkElement.slideUp(animationSpeed, function () { - checkElement.removeClass('menu-open'); - //Fix the layout in case the sidebar stretches over the height of the window - //_this.layout.fix(); - }); - checkElement.parent("li").removeClass("active"); - } - //If the menu is not visible - else if ((checkElement.is('.treeview-menu')) && (!checkElement.is(':visible'))) { - //Get the parent menu - var parent = $this.parents('ul').first(); - //Close all open menus within the parent - var ul = parent.find('ul:visible').slideUp(animationSpeed); - //Remove the menu-open class from the parent - ul.removeClass('menu-open'); - //Get the parent li - var parent_li = $this.parent("li"); + //Check if the next element is a menu and is visible + if ((checkElement.is('.treeview-menu')) && (checkElement.is(':visible')) && (!$('body').hasClass('sidebar-collapse'))) { + //Close the menu + checkElement.slideUp(animationSpeed, function () { + checkElement.removeClass('menu-open'); + //Fix the layout in case the sidebar stretches over the height of the window + //_this.layout.fix(); + }); + checkElement.parent("li").removeClass("active"); + } + //If the menu is not visible + else if ((checkElement.is('.treeview-menu')) && (!checkElement.is(':visible'))) { + //Get the parent menu + var parent = $this.parents('ul').first(); + //Close all open menus within the parent + var ul = parent.find('ul:visible').slideUp(animationSpeed); + //Remove the menu-open class from the parent + ul.removeClass('menu-open'); + //Get the parent li + var parent_li = $this.parent("li"); - //Open the target menu and add the menu-open class - checkElement.slideDown(animationSpeed, function () { + //Open the target menu and add the menu-open class + checkElement.slideDown(animationSpeed, function () { - //Add the class active to the parent li - checkElement.addClass('menu-open'); - parent.find('li.treeview.active').removeClass('active'); //<<-- Overwrite here. Otherwise, the menu href based active will be removed - parent_li.addClass('active'); + //Add the class active to the parent li + checkElement.addClass('menu-open'); + parent.find('li.treeview.active').removeClass('active'); //<<-- Overwrite here. Otherwise, the menu href based active will be removed + parent_li.addClass('active'); - //Fix the layout in case the sidebar stretches over the height of the window - _this.layout.fix(); - }); - } - //if this isn't a link, prevent the page from being redirected - if (checkElement.is('.treeview-menu')) { - e.preventDefault(); - } - }); + //Fix the layout in case the sidebar stretches over the height of the window + _this.layout.fix(); + }); + } + //if this isn't a link, prevent the page from being redirected + if (checkElement.is('.treeview-menu')) { + e.preventDefault(); + } + }); }; /* initMenu() @@ -79,7 +79,7 @@ $.AdminLTE.tree_UF = function (menu) { */ $.AdminLTE.initMenu = function (searchElement) { var _this = this; - var element = $(searchElement).filter(function() { + var element = $(searchElement).filter(function () { // Strip out everything after the hash, if present var url_head = window.location.href.split('#', 1)[0]; return this.href == url_head; // || url.href.indexOf(this.href) == 0 // Include this if you want to color all parent URIs as well @@ -89,24 +89,24 @@ $.AdminLTE.initMenu = function (searchElement) { $(element).parents('.treeview-menu').addClass('menu-open'); }; -$(function() { +$(function () { //Init menu and trees $.AdminLTE.initMenu('ul.sidebar-menu a'); $.AdminLTE.tree_UF('.sidebar'); // Apply select2 to all js-select2 elements - $('.js-select2').select2({ minimumResultsForSearch: Infinity }); + $('.js-select2').select2({minimumResultsForSearch: Infinity}); // Apply iCheck to all js-icheck elements $('.js-icheck').iCheck({ - checkboxClass: 'icheckbox_square-blue', - radioClass: 'iradio_square-blue', - increaseArea: '20%' // optional + checkboxClass: 'icheckbox_square-blue', + radioClass: 'iradio_square-blue', + increaseArea: '20%' // optional }); // Remember the sidebar collapse state // See: https://github.com/almasaeed2010/AdminLTE/issues/896#issuecomment-264723101 - $('.sidebar-toggle').click(function(event) { + $('.sidebar-toggle').click(function (event) { event.preventDefault(); if (Boolean(sessionStorage.getItem('sidebar-toggle-collapsed'))) { sessionStorage.setItem('sidebar-toggle-collapsed', ''); diff --git a/main/app/sprinkles/core/assets/userfrosting/js/AdminLTE.js b/main/app/sprinkles/core/assets/userfrosting/js/AdminLTE.js index 54b6055..8f31ca5 100644 --- a/main/app/sprinkles/core/assets/userfrosting/js/AdminLTE.js +++ b/main/app/sprinkles/core/assets/userfrosting/js/AdminLTE.js @@ -13,7 +13,7 @@ //Make sure jQuery has been loaded before app.js if (typeof jQuery === "undefined") { - throw new Error("AdminLTE requires jQuery"); + throw new Error("AdminLTE requires jQuery"); } /* AdminLTE @@ -33,101 +33,101 @@ $.AdminLTE = {}; * Modify these options to suit your implementation */ $.AdminLTE.options = { - //Add slimscroll to navbar menus - //This requires you to load the slimscroll plugin - //in every page before app.js - navbarMenuSlimscroll: true, - navbarMenuSlimscrollWidth: "3px", //The width of the scroll bar - navbarMenuHeight: "200px", //The height of the inner menu - //General animation speed for JS animated elements such as box collapse/expand and - //sidebar treeview slide up/down. This options accepts an integer as milliseconds, - //'fast', 'normal', or 'slow' - animationSpeed: 500, - //Sidebar push menu toggle button selector - sidebarToggleSelector: "[data-toggle='offcanvas']", - //Activate sidebar push menu - sidebarPushMenu: true, - //Activate sidebar slimscroll if the fixed layout is set (requires SlimScroll Plugin) - sidebarSlimScroll: true, - //Enable sidebar expand on hover effect for sidebar mini - //This option is forced to true if both the fixed layout and sidebar mini - //are used together - sidebarExpandOnHover: false, - //BoxRefresh Plugin - enableBoxRefresh: true, - //Bootstrap.js tooltip - enableBSToppltip: true, - BSTooltipSelector: "[data-toggle='tooltip']", - //Enable Fast Click. Fastclick.js creates a more - //native touch experience with touch devices. If you - //choose to enable the plugin, make sure you load the script - //before AdminLTE's app.js - enableFastclick: false, - //Control Sidebar Options - enableControlSidebar: true, - controlSidebarOptions: { - //Which button should trigger the open/close event - toggleBtnSelector: "[data-toggle='control-sidebar']", - //The sidebar selector - selector: ".control-sidebar", - //Enable slide over content - slide: true - }, - //Box Widget Plugin. Enable this plugin - //to allow boxes to be collapsed and/or removed - enableBoxWidget: true, - //Box Widget plugin options - boxWidgetOptions: { - boxWidgetIcons: { - //Collapse icon - collapse: 'fa-minus', - //Open icon - open: 'fa-plus', - //Remove icon - remove: 'fa-times' + //Add slimscroll to navbar menus + //This requires you to load the slimscroll plugin + //in every page before app.js + navbarMenuSlimscroll: true, + navbarMenuSlimscrollWidth: "3px", //The width of the scroll bar + navbarMenuHeight: "200px", //The height of the inner menu + //General animation speed for JS animated elements such as box collapse/expand and + //sidebar treeview slide up/down. This options accepts an integer as milliseconds, + //'fast', 'normal', or 'slow' + animationSpeed: 500, + //Sidebar push menu toggle button selector + sidebarToggleSelector: "[data-toggle='offcanvas']", + //Activate sidebar push menu + sidebarPushMenu: true, + //Activate sidebar slimscroll if the fixed layout is set (requires SlimScroll Plugin) + sidebarSlimScroll: true, + //Enable sidebar expand on hover effect for sidebar mini + //This option is forced to true if both the fixed layout and sidebar mini + //are used together + sidebarExpandOnHover: false, + //BoxRefresh Plugin + enableBoxRefresh: true, + //Bootstrap.js tooltip + enableBSToppltip: true, + BSTooltipSelector: "[data-toggle='tooltip']", + //Enable Fast Click. Fastclick.js creates a more + //native touch experience with touch devices. If you + //choose to enable the plugin, make sure you load the script + //before AdminLTE's app.js + enableFastclick: false, + //Control Sidebar Options + enableControlSidebar: true, + controlSidebarOptions: { + //Which button should trigger the open/close event + toggleBtnSelector: "[data-toggle='control-sidebar']", + //The sidebar selector + selector: ".control-sidebar", + //Enable slide over content + slide: true }, - boxWidgetSelectors: { - //Remove button selector - remove: '[data-widget="remove"]', - //Collapse button selector - collapse: '[data-widget="collapse"]' + //Box Widget Plugin. Enable this plugin + //to allow boxes to be collapsed and/or removed + enableBoxWidget: true, + //Box Widget plugin options + boxWidgetOptions: { + boxWidgetIcons: { + //Collapse icon + collapse: 'fa-minus', + //Open icon + open: 'fa-plus', + //Remove icon + remove: 'fa-times' + }, + boxWidgetSelectors: { + //Remove button selector + remove: '[data-widget="remove"]', + //Collapse button selector + collapse: '[data-widget="collapse"]' + } + }, + //Direct Chat plugin options + directChat: { + //Enable direct chat by default + enable: true, + //The button to open and close the chat contacts pane + contactToggleSelector: '[data-widget="chat-pane-toggle"]' + }, + //Define the set of colors to use globally around the website + colors: { + lightBlue: "#3c8dbc", + red: "#f56954", + green: "#00a65a", + aqua: "#00c0ef", + yellow: "#f39c12", + blue: "#0073b7", + navy: "#001F3F", + teal: "#39CCCC", + olive: "#3D9970", + lime: "#01FF70", + orange: "#FF851B", + fuchsia: "#F012BE", + purple: "#8E24AA", + maroon: "#D81B60", + black: "#222222", + gray: "#d2d6de" + }, + //The standard screen sizes that bootstrap uses. + //If you change these in the variables.less file, change + //them here too. + screenSizes: { + xs: 480, + sm: 768, + md: 992, + lg: 1200 } - }, - //Direct Chat plugin options - directChat: { - //Enable direct chat by default - enable: true, - //The button to open and close the chat contacts pane - contactToggleSelector: '[data-widget="chat-pane-toggle"]' - }, - //Define the set of colors to use globally around the website - colors: { - lightBlue: "#3c8dbc", - red: "#f56954", - green: "#00a65a", - aqua: "#00c0ef", - yellow: "#f39c12", - blue: "#0073b7", - navy: "#001F3F", - teal: "#39CCCC", - olive: "#3D9970", - lime: "#01FF70", - orange: "#FF851B", - fuchsia: "#F012BE", - purple: "#8E24AA", - maroon: "#D81B60", - black: "#222222", - gray: "#d2d6de" - }, - //The standard screen sizes that bootstrap uses. - //If you change these in the variables.less file, change - //them here too. - screenSizes: { - xs: 480, - sm: 768, - md: 992, - lg: 1200 - } }; /* ------------------ @@ -138,87 +138,87 @@ $.AdminLTE.options = { * options above. */ $(function () { - "use strict"; - - //Fix for IE page transitions - $("body").removeClass("hold-transition"); - - //Extend options if external options exist - if (typeof AdminLTEOptions !== "undefined") { - $.extend(true, - $.AdminLTE.options, - AdminLTEOptions); - } - - //Easy access to options - var o = $.AdminLTE.options; - - //Set up the object - _init(); - - //Activate the layout maker - $.AdminLTE.layout.activate(); - - //Enable sidebar tree view controls - $.AdminLTE.tree('.sidebar'); - - //Enable control sidebar - if (o.enableControlSidebar) { - $.AdminLTE.controlSidebar.activate(); - } - - //Add slimscroll to navbar dropdown - if (o.navbarMenuSlimscroll && typeof $.fn.slimscroll != 'undefined') { - $(".navbar .menu").slimscroll({ - height: o.navbarMenuHeight, - alwaysVisible: false, - size: o.navbarMenuSlimscrollWidth - }).css("width", "100%"); - } - - //Activate sidebar push menu - if (o.sidebarPushMenu) { - $.AdminLTE.pushMenu.activate(o.sidebarToggleSelector); - } - - //Activate Bootstrap tooltip - if (o.enableBSToppltip) { - $('body').tooltip({ - selector: o.BSTooltipSelector - }); - } - - //Activate box widget - if (o.enableBoxWidget) { - $.AdminLTE.boxWidget.activate(); - } - - //Activate fast click - if (o.enableFastclick && typeof FastClick != 'undefined') { - FastClick.attach(document.body); - } - - //Activate direct chat widget - if (o.directChat.enable) { - $(document).on('click', o.directChat.contactToggleSelector, function () { - var box = $(this).parents('.direct-chat').first(); - box.toggleClass('direct-chat-contacts-open'); - }); - } - - /* - * INITIALIZE BUTTON TOGGLE - * ------------------------ - */ - $('.btn-group[data-toggle="btn-toggle"]').each(function () { - var group = $(this); - $(this).find(".btn").on('click', function (e) { - group.find(".btn.active").removeClass("active"); - $(this).addClass("active"); - e.preventDefault(); - }); + "use strict"; + + //Fix for IE page transitions + $("body").removeClass("hold-transition"); + + //Extend options if external options exist + if (typeof AdminLTEOptions !== "undefined") { + $.extend(true, + $.AdminLTE.options, + AdminLTEOptions); + } + + //Easy access to options + var o = $.AdminLTE.options; + + //Set up the object + _init(); + + //Activate the layout maker + $.AdminLTE.layout.activate(); + + //Enable sidebar tree view controls + $.AdminLTE.tree('.sidebar'); + + //Enable control sidebar + if (o.enableControlSidebar) { + $.AdminLTE.controlSidebar.activate(); + } + + //Add slimscroll to navbar dropdown + if (o.navbarMenuSlimscroll && typeof $.fn.slimscroll != 'undefined') { + $(".navbar .menu").slimscroll({ + height: o.navbarMenuHeight, + alwaysVisible: false, + size: o.navbarMenuSlimscrollWidth + }).css("width", "100%"); + } + + //Activate sidebar push menu + if (o.sidebarPushMenu) { + $.AdminLTE.pushMenu.activate(o.sidebarToggleSelector); + } - }); + //Activate Bootstrap tooltip + if (o.enableBSToppltip) { + $('body').tooltip({ + selector: o.BSTooltipSelector + }); + } + + //Activate box widget + if (o.enableBoxWidget) { + $.AdminLTE.boxWidget.activate(); + } + + //Activate fast click + if (o.enableFastclick && typeof FastClick != 'undefined') { + FastClick.attach(document.body); + } + + //Activate direct chat widget + if (o.directChat.enable) { + $(document).on('click', o.directChat.contactToggleSelector, function () { + var box = $(this).parents('.direct-chat').first(); + box.toggleClass('direct-chat-contacts-open'); + }); + } + + /* + * INITIALIZE BUTTON TOGGLE + * ------------------------ + */ + $('.btn-group[data-toggle="btn-toggle"]').each(function () { + var group = $(this); + $(this).find(".btn").on('click', function (e) { + group.find(".btn.active").removeClass("active"); + $(this).addClass("active"); + e.preventDefault(); + }); + + }); }); /* ---------------------------------- @@ -227,370 +227,370 @@ $(function () { * All AdminLTE functions are implemented below. */ function _init() { - 'use strict'; - /* Layout - * ====== - * Fixes the layout height in case min-height fails. - * - * @type Object - * @usage $.AdminLTE.layout.activate() - * $.AdminLTE.layout.fix() - * $.AdminLTE.layout.fixSidebar() - */ - $.AdminLTE.layout = { - activate: function () { - var _this = this; - _this.fix(); - _this.fixSidebar(); - $(window, ".wrapper").resize(function () { - _this.fix(); - _this.fixSidebar(); - }); - }, - fix: function () { - //Get window height and the wrapper height - var neg = $('.main-header').outerHeight() + $('.main-footer').outerHeight(); - var window_height = $(window).height(); - var sidebar_height = $(".sidebar").height(); - //Set the min-height of the content and sidebar based on the - //the height of the document. - if ($("body").hasClass("fixed")) { - $(".content-wrapper, .right-side").css('min-height', window_height - $('.main-footer').outerHeight()); - } else { - var postSetWidth; - if (window_height >= sidebar_height) { - $(".content-wrapper, .right-side").css('min-height', window_height - neg); - postSetWidth = window_height - neg; - } else { - $(".content-wrapper, .right-side").css('min-height', sidebar_height); - postSetWidth = sidebar_height; + 'use strict'; + /* Layout + * ====== + * Fixes the layout height in case min-height fails. + * + * @type Object + * @usage $.AdminLTE.layout.activate() + * $.AdminLTE.layout.fix() + * $.AdminLTE.layout.fixSidebar() + */ + $.AdminLTE.layout = { + activate: function () { + var _this = this; + _this.fix(); + _this.fixSidebar(); + $(window, ".wrapper").resize(function () { + _this.fix(); + _this.fixSidebar(); + }); + }, + fix: function () { + //Get window height and the wrapper height + var neg = $('.main-header').outerHeight() + $('.main-footer').outerHeight(); + var window_height = $(window).height(); + var sidebar_height = $(".sidebar").height(); + //Set the min-height of the content and sidebar based on the + //the height of the document. + if ($("body").hasClass("fixed")) { + $(".content-wrapper, .right-side").css('min-height', window_height - $('.main-footer').outerHeight()); + } else { + var postSetWidth; + if (window_height >= sidebar_height) { + $(".content-wrapper, .right-side").css('min-height', window_height - neg); + postSetWidth = window_height - neg; + } else { + $(".content-wrapper, .right-side").css('min-height', sidebar_height); + postSetWidth = sidebar_height; + } + + //Fix for the control sidebar height + var controlSidebar = $($.AdminLTE.options.controlSidebarOptions.selector); + if (typeof controlSidebar !== "undefined") { + if (controlSidebar.height() > postSetWidth) + $(".content-wrapper, .right-side").css('min-height', controlSidebar.height()); + } + + } + }, + fixSidebar: function () { + //Make sure the body tag has the .fixed class + if (!$("body").hasClass("fixed")) { + if (typeof $.fn.slimScroll != 'undefined') { + $(".sidebar").slimScroll({destroy: true}).height("auto"); + } + return; + } else if (typeof $.fn.slimScroll == 'undefined' && window.console) { + window.console.error("Error: the fixed layout requires the slimscroll plugin!"); + } + //Enable slimscroll for fixed layout + if ($.AdminLTE.options.sidebarSlimScroll) { + if (typeof $.fn.slimScroll != 'undefined') { + //Destroy if it exists + $(".sidebar").slimScroll({destroy: true}).height("auto"); + //Add slimscroll + $(".sidebar").slimscroll({ + height: ($(window).height() - $(".main-header").height()) + "px", + color: "rgba(0,0,0,0.2)", + size: "3px" + }); + } + } } - - //Fix for the control sidebar height - var controlSidebar = $($.AdminLTE.options.controlSidebarOptions.selector); - if (typeof controlSidebar !== "undefined") { - if (controlSidebar.height() > postSetWidth) - $(".content-wrapper, .right-side").css('min-height', controlSidebar.height()); + }; + + /* PushMenu() + * ========== + * Adds the push menu functionality to the sidebar. + * + * @type Function + * @usage: $.AdminLTE.pushMenu("[data-toggle='offcanvas']") + */ + $.AdminLTE.pushMenu = { + activate: function (toggleBtn) { + //Get the screen sizes + var screenSizes = $.AdminLTE.options.screenSizes; + + //Enable sidebar toggle + $(document).on('click', toggleBtn, function (e) { + e.preventDefault(); + + //Enable sidebar push menu + if ($(window).width() > (screenSizes.sm - 1)) { + if ($("body").hasClass('sidebar-collapse')) { + $("body").removeClass('sidebar-collapse').trigger('expanded.pushMenu'); + } else { + $("body").addClass('sidebar-collapse').trigger('collapsed.pushMenu'); + } + } + //Handle sidebar push menu for small screens + else { + if ($("body").hasClass('sidebar-open')) { + $("body").removeClass('sidebar-open').removeClass('sidebar-collapse').trigger('collapsed.pushMenu'); + } else { + $("body").addClass('sidebar-open').trigger('expanded.pushMenu'); + } + } + }); + + $(".content-wrapper").click(function () { + //Enable hide menu when clicking on the content-wrapper on small screens + if ($(window).width() <= (screenSizes.sm - 1) && $("body").hasClass("sidebar-open")) { + $("body").removeClass('sidebar-open'); + } + }); + + //Enable expand on hover for sidebar mini + if ($.AdminLTE.options.sidebarExpandOnHover + || ($('body').hasClass('fixed') + && $('body').hasClass('sidebar-mini'))) { + this.expandOnHover(); + } + }, + expandOnHover: function () { + var _this = this; + var screenWidth = $.AdminLTE.options.screenSizes.sm - 1; + //Expand sidebar on hover + $('.main-sidebar').hover(function () { + if ($('body').hasClass('sidebar-mini') + && $("body").hasClass('sidebar-collapse') + && $(window).width() > screenWidth) { + _this.expand(); + } + }, function () { + if ($('body').hasClass('sidebar-mini') + && $('body').hasClass('sidebar-expanded-on-hover') + && $(window).width() > screenWidth) { + _this.collapse(); + } + }); + }, + expand: function () { + $("body").removeClass('sidebar-collapse').addClass('sidebar-expanded-on-hover'); + }, + collapse: function () { + if ($('body').hasClass('sidebar-expanded-on-hover')) { + $('body').removeClass('sidebar-expanded-on-hover').addClass('sidebar-collapse'); + } } - - } - }, - fixSidebar: function () { - //Make sure the body tag has the .fixed class - if (!$("body").hasClass("fixed")) { - if (typeof $.fn.slimScroll != 'undefined') { - $(".sidebar").slimScroll({destroy: true}).height("auto"); + }; + + /* Tree() + * ====== + * Converts the sidebar into a multilevel + * tree view menu. + * + * @type Function + * @Usage: $.AdminLTE.tree('.sidebar') + */ + $.AdminLTE.tree = function (menu) { + var _this = this; + var animationSpeed = $.AdminLTE.options.animationSpeed; + $(document).off('click', menu + ' li a') + .on('click', menu + ' li a', function (e) { + //Get the clicked link and the next element + var $this = $(this); + var checkElement = $this.next(); + + //Check if the next element is a menu and is visible + if ((checkElement.is('.treeview-menu')) && (checkElement.is(':visible')) && (!$('body').hasClass('sidebar-collapse'))) { + //Close the menu + checkElement.slideUp(animationSpeed, function () { + checkElement.removeClass('menu-open'); + //Fix the layout in case the sidebar stretches over the height of the window + //_this.layout.fix(); + }); + checkElement.parent("li").removeClass("active"); + } + //If the menu is not visible + else if ((checkElement.is('.treeview-menu')) && (!checkElement.is(':visible'))) { + //Get the parent menu + var parent = $this.parents('ul').first(); + //Close all open menus within the parent + var ul = parent.find('ul:visible').slideUp(animationSpeed); + //Remove the menu-open class from the parent + ul.removeClass('menu-open'); + //Get the parent li + var parent_li = $this.parent("li"); + + //Open the target menu and add the menu-open class + checkElement.slideDown(animationSpeed, function () { + //Add the class active to the parent li + checkElement.addClass('menu-open'); + parent.find('li.active').removeClass('active'); + parent_li.addClass('active'); + //Fix the layout in case the sidebar stretches over the height of the window + _this.layout.fix(); + }); + } + //if this isn't a link, prevent the page from being redirected + if (checkElement.is('.treeview-menu')) { + e.preventDefault(); + } + }); + }; + + /* ControlSidebar + * ============== + * Adds functionality to the right sidebar + * + * @type Object + * @usage $.AdminLTE.controlSidebar.activate(options) + */ + $.AdminLTE.controlSidebar = { + //instantiate the object + activate: function () { + //Get the object + var _this = this; + //Update options + var o = $.AdminLTE.options.controlSidebarOptions; + //Get the sidebar + var sidebar = $(o.selector); + //The toggle button + var btn = $(o.toggleBtnSelector); + + //Listen to the click event + btn.on('click', function (e) { + e.preventDefault(); + //If the sidebar is not open + if (!sidebar.hasClass('control-sidebar-open') + && !$('body').hasClass('control-sidebar-open')) { + //Open the sidebar + _this.open(sidebar, o.slide); + } else { + _this.close(sidebar, o.slide); + } + }); + + //If the body has a boxed layout, fix the sidebar bg position + var bg = $(".control-sidebar-bg"); + _this._fix(bg); + + //If the body has a fixed layout, make the control sidebar fixed + if ($('body').hasClass('fixed')) { + _this._fixForFixed(sidebar); + } else { + //If the content height is less than the sidebar's height, force max height + if ($('.content-wrapper, .right-side').height() < sidebar.height()) { + _this._fixForContent(sidebar); + } + } + }, + //Open the control sidebar + open: function (sidebar, slide) { + //Slide over content + if (slide) { + sidebar.addClass('control-sidebar-open'); + } else { + //Push the content by adding the open class to the body instead + //of the sidebar itself + $('body').addClass('control-sidebar-open'); + } + }, + //Close the control sidebar + close: function (sidebar, slide) { + if (slide) { + sidebar.removeClass('control-sidebar-open'); + } else { + $('body').removeClass('control-sidebar-open'); + } + }, + _fix: function (sidebar) { + var _this = this; + if ($("body").hasClass('layout-boxed')) { + sidebar.css('position', 'absolute'); + sidebar.height($(".wrapper").height()); + if (_this.hasBindedResize) { + return; + } + $(window).resize(function () { + _this._fix(sidebar); + }); + _this.hasBindedResize = true; + } else { + sidebar.css({ + 'position': 'fixed', + 'height': 'auto' + }); + } + }, + _fixForFixed: function (sidebar) { + sidebar.css({ + 'position': 'fixed', + 'max-height': '100%', + 'overflow': 'auto', + 'padding-bottom': '50px' + }); + }, + _fixForContent: function (sidebar) { + $(".content-wrapper, .right-side").css('min-height', sidebar.height()); } - return; - } else if (typeof $.fn.slimScroll == 'undefined' && window.console) { - window.console.error("Error: the fixed layout requires the slimscroll plugin!"); - } - //Enable slimscroll for fixed layout - if ($.AdminLTE.options.sidebarSlimScroll) { - if (typeof $.fn.slimScroll != 'undefined') { - //Destroy if it exists - $(".sidebar").slimScroll({destroy: true}).height("auto"); - //Add slimscroll - $(".sidebar").slimscroll({ - height: ($(window).height() - $(".main-header").height()) + "px", - color: "rgba(0,0,0,0.2)", - size: "3px" - }); - } - } - } - }; - - /* PushMenu() - * ========== - * Adds the push menu functionality to the sidebar. - * - * @type Function - * @usage: $.AdminLTE.pushMenu("[data-toggle='offcanvas']") - */ - $.AdminLTE.pushMenu = { - activate: function (toggleBtn) { - //Get the screen sizes - var screenSizes = $.AdminLTE.options.screenSizes; - - //Enable sidebar toggle - $(document).on('click', toggleBtn, function (e) { - e.preventDefault(); - - //Enable sidebar push menu - if ($(window).width() > (screenSizes.sm - 1)) { - if ($("body").hasClass('sidebar-collapse')) { - $("body").removeClass('sidebar-collapse').trigger('expanded.pushMenu'); - } else { - $("body").addClass('sidebar-collapse').trigger('collapsed.pushMenu'); - } + }; + + /* BoxWidget + * ========= + * BoxWidget is a plugin to handle collapsing and + * removing boxes from the screen. + * + * @type Object + * @usage $.AdminLTE.boxWidget.activate() + * Set all your options in the main $.AdminLTE.options object + */ + $.AdminLTE.boxWidget = { + selectors: $.AdminLTE.options.boxWidgetOptions.boxWidgetSelectors, + icons: $.AdminLTE.options.boxWidgetOptions.boxWidgetIcons, + animationSpeed: $.AdminLTE.options.animationSpeed, + activate: function (_box) { + var _this = this; + if (!_box) { + _box = document; // activate all boxes per default + } + //Listen for collapse event triggers + $(_box).on('click', _this.selectors.collapse, function (e) { + e.preventDefault(); + _this.collapse($(this)); + }); + + //Listen for remove event triggers + $(_box).on('click', _this.selectors.remove, function (e) { + e.preventDefault(); + _this.remove($(this)); + }); + }, + collapse: function (element) { + var _this = this; + //Find the box parent + var box = element.parents(".box").first(); + //Find the body and the footer + var box_content = box.find("> .box-body, > .box-footer, > form >.box-body, > form > .box-footer"); + if (!box.hasClass("collapsed-box")) { + //Convert minus into plus + element.children(":first") + .removeClass(_this.icons.collapse) + .addClass(_this.icons.open); + //Hide the content + box_content.slideUp(_this.animationSpeed, function () { + box.addClass("collapsed-box"); + }); + } else { + //Convert plus into minus + element.children(":first") + .removeClass(_this.icons.open) + .addClass(_this.icons.collapse); + //Show the content + box_content.slideDown(_this.animationSpeed, function () { + box.removeClass("collapsed-box"); + }); + } + }, + remove: function (element) { + //Find the box parent + var box = element.parents(".box").first(); + box.slideUp(this.animationSpeed); } - //Handle sidebar push menu for small screens - else { - if ($("body").hasClass('sidebar-open')) { - $("body").removeClass('sidebar-open').removeClass('sidebar-collapse').trigger('collapsed.pushMenu'); - } else { - $("body").addClass('sidebar-open').trigger('expanded.pushMenu'); - } - } - }); - - $(".content-wrapper").click(function () { - //Enable hide menu when clicking on the content-wrapper on small screens - if ($(window).width() <= (screenSizes.sm - 1) && $("body").hasClass("sidebar-open")) { - $("body").removeClass('sidebar-open'); - } - }); - - //Enable expand on hover for sidebar mini - if ($.AdminLTE.options.sidebarExpandOnHover - || ($('body').hasClass('fixed') - && $('body').hasClass('sidebar-mini'))) { - this.expandOnHover(); - } - }, - expandOnHover: function () { - var _this = this; - var screenWidth = $.AdminLTE.options.screenSizes.sm - 1; - //Expand sidebar on hover - $('.main-sidebar').hover(function () { - if ($('body').hasClass('sidebar-mini') - && $("body").hasClass('sidebar-collapse') - && $(window).width() > screenWidth) { - _this.expand(); - } - }, function () { - if ($('body').hasClass('sidebar-mini') - && $('body').hasClass('sidebar-expanded-on-hover') - && $(window).width() > screenWidth) { - _this.collapse(); - } - }); - }, - expand: function () { - $("body").removeClass('sidebar-collapse').addClass('sidebar-expanded-on-hover'); - }, - collapse: function () { - if ($('body').hasClass('sidebar-expanded-on-hover')) { - $('body').removeClass('sidebar-expanded-on-hover').addClass('sidebar-collapse'); - } - } - }; - - /* Tree() - * ====== - * Converts the sidebar into a multilevel - * tree view menu. - * - * @type Function - * @Usage: $.AdminLTE.tree('.sidebar') - */ - $.AdminLTE.tree = function (menu) { - var _this = this; - var animationSpeed = $.AdminLTE.options.animationSpeed; - $(document).off('click', menu + ' li a') - .on('click', menu + ' li a', function (e) { - //Get the clicked link and the next element - var $this = $(this); - var checkElement = $this.next(); - - //Check if the next element is a menu and is visible - if ((checkElement.is('.treeview-menu')) && (checkElement.is(':visible')) && (!$('body').hasClass('sidebar-collapse'))) { - //Close the menu - checkElement.slideUp(animationSpeed, function () { - checkElement.removeClass('menu-open'); - //Fix the layout in case the sidebar stretches over the height of the window - //_this.layout.fix(); - }); - checkElement.parent("li").removeClass("active"); - } - //If the menu is not visible - else if ((checkElement.is('.treeview-menu')) && (!checkElement.is(':visible'))) { - //Get the parent menu - var parent = $this.parents('ul').first(); - //Close all open menus within the parent - var ul = parent.find('ul:visible').slideUp(animationSpeed); - //Remove the menu-open class from the parent - ul.removeClass('menu-open'); - //Get the parent li - var parent_li = $this.parent("li"); - - //Open the target menu and add the menu-open class - checkElement.slideDown(animationSpeed, function () { - //Add the class active to the parent li - checkElement.addClass('menu-open'); - parent.find('li.active').removeClass('active'); - parent_li.addClass('active'); - //Fix the layout in case the sidebar stretches over the height of the window - _this.layout.fix(); - }); - } - //if this isn't a link, prevent the page from being redirected - if (checkElement.is('.treeview-menu')) { - e.preventDefault(); - } - }); - }; - - /* ControlSidebar - * ============== - * Adds functionality to the right sidebar - * - * @type Object - * @usage $.AdminLTE.controlSidebar.activate(options) - */ - $.AdminLTE.controlSidebar = { - //instantiate the object - activate: function () { - //Get the object - var _this = this; - //Update options - var o = $.AdminLTE.options.controlSidebarOptions; - //Get the sidebar - var sidebar = $(o.selector); - //The toggle button - var btn = $(o.toggleBtnSelector); - - //Listen to the click event - btn.on('click', function (e) { - e.preventDefault(); - //If the sidebar is not open - if (!sidebar.hasClass('control-sidebar-open') - && !$('body').hasClass('control-sidebar-open')) { - //Open the sidebar - _this.open(sidebar, o.slide); - } else { - _this.close(sidebar, o.slide); - } - }); - - //If the body has a boxed layout, fix the sidebar bg position - var bg = $(".control-sidebar-bg"); - _this._fix(bg); - - //If the body has a fixed layout, make the control sidebar fixed - if ($('body').hasClass('fixed')) { - _this._fixForFixed(sidebar); - } else { - //If the content height is less than the sidebar's height, force max height - if ($('.content-wrapper, .right-side').height() < sidebar.height()) { - _this._fixForContent(sidebar); - } - } - }, - //Open the control sidebar - open: function (sidebar, slide) { - //Slide over content - if (slide) { - sidebar.addClass('control-sidebar-open'); - } else { - //Push the content by adding the open class to the body instead - //of the sidebar itself - $('body').addClass('control-sidebar-open'); - } - }, - //Close the control sidebar - close: function (sidebar, slide) { - if (slide) { - sidebar.removeClass('control-sidebar-open'); - } else { - $('body').removeClass('control-sidebar-open'); - } - }, - _fix: function (sidebar) { - var _this = this; - if ($("body").hasClass('layout-boxed')) { - sidebar.css('position', 'absolute'); - sidebar.height($(".wrapper").height()); - if (_this.hasBindedResize) { - return; - } - $(window).resize(function () { - _this._fix(sidebar); - }); - _this.hasBindedResize = true; - } else { - sidebar.css({ - 'position': 'fixed', - 'height': 'auto' - }); - } - }, - _fixForFixed: function (sidebar) { - sidebar.css({ - 'position': 'fixed', - 'max-height': '100%', - 'overflow': 'auto', - 'padding-bottom': '50px' - }); - }, - _fixForContent: function (sidebar) { - $(".content-wrapper, .right-side").css('min-height', sidebar.height()); - } - }; - - /* BoxWidget - * ========= - * BoxWidget is a plugin to handle collapsing and - * removing boxes from the screen. - * - * @type Object - * @usage $.AdminLTE.boxWidget.activate() - * Set all your options in the main $.AdminLTE.options object - */ - $.AdminLTE.boxWidget = { - selectors: $.AdminLTE.options.boxWidgetOptions.boxWidgetSelectors, - icons: $.AdminLTE.options.boxWidgetOptions.boxWidgetIcons, - animationSpeed: $.AdminLTE.options.animationSpeed, - activate: function (_box) { - var _this = this; - if (!_box) { - _box = document; // activate all boxes per default - } - //Listen for collapse event triggers - $(_box).on('click', _this.selectors.collapse, function (e) { - e.preventDefault(); - _this.collapse($(this)); - }); - - //Listen for remove event triggers - $(_box).on('click', _this.selectors.remove, function (e) { - e.preventDefault(); - _this.remove($(this)); - }); - }, - collapse: function (element) { - var _this = this; - //Find the box parent - var box = element.parents(".box").first(); - //Find the body and the footer - var box_content = box.find("> .box-body, > .box-footer, > form >.box-body, > form > .box-footer"); - if (!box.hasClass("collapsed-box")) { - //Convert minus into plus - element.children(":first") - .removeClass(_this.icons.collapse) - .addClass(_this.icons.open); - //Hide the content - box_content.slideUp(_this.animationSpeed, function () { - box.addClass("collapsed-box"); - }); - } else { - //Convert plus into minus - element.children(":first") - .removeClass(_this.icons.open) - .addClass(_this.icons.collapse); - //Show the content - box_content.slideDown(_this.animationSpeed, function () { - box.removeClass("collapsed-box"); - }); - } - }, - remove: function (element) { - //Find the box parent - var box = element.parents(".box").first(); - box.slideUp(this.animationSpeed); - } - }; + }; } /* ------------------ @@ -610,70 +610,70 @@ function _init() { */ (function ($) { - "use strict"; - - $.fn.boxRefresh = function (options) { - - // Render options - var settings = $.extend({ - //Refresh button selector - trigger: ".refresh-btn", - //File source to be loaded (e.g: ajax/src.php) - source: "", - //Callbacks - onLoadStart: function (box) { - return box; - }, //Right after the button has been clicked - onLoadDone: function (box) { - return box; - } //When the source has been loaded - - }, options); - - //The overlay - var overlay = $('
'); - - return this.each(function () { - //if a source is specified - if (settings.source === "") { - if (window.console) { - window.console.log("Please specify a source first - boxRefresh()"); - } - return; - } - //the box - var box = $(this); - //the button - var rBtn = box.find(settings.trigger).first(); - - //On trigger click - rBtn.on('click', function (e) { - e.preventDefault(); - //Add loading overlay - start(box); - - //Perform ajax call - box.find(".box-body").load(settings.source, function () { - done(box); + "use strict"; + + $.fn.boxRefresh = function (options) { + + // Render options + var settings = $.extend({ + //Refresh button selector + trigger: ".refresh-btn", + //File source to be loaded (e.g: ajax/src.php) + source: "", + //Callbacks + onLoadStart: function (box) { + return box; + }, //Right after the button has been clicked + onLoadDone: function (box) { + return box; + } //When the source has been loaded + + }, options); + + //The overlay + var overlay = $('
'); + + return this.each(function () { + //if a source is specified + if (settings.source === "") { + if (window.console) { + window.console.log("Please specify a source first - boxRefresh()"); + } + return; + } + //the box + var box = $(this); + //the button + var rBtn = box.find(settings.trigger).first(); + + //On trigger click + rBtn.on('click', function (e) { + e.preventDefault(); + //Add loading overlay + start(box); + + //Perform ajax call + box.find(".box-body").load(settings.source, function () { + done(box); + }); + }); }); - }); - }); - function start(box) { - //Add overlay and loading img - box.append(overlay); + function start(box) { + //Add overlay and loading img + box.append(overlay); - settings.onLoadStart.call(box); - } + settings.onLoadStart.call(box); + } - function done(box) { - //Remove overlay and loading img - box.find(overlay).remove(); + function done(box) { + //Remove overlay and loading img + box.find(overlay).remove(); - settings.onLoadDone.call(box); - } + settings.onLoadDone.call(box); + } - }; + }; })(jQuery); @@ -690,21 +690,21 @@ function _init() { */ (function ($) { - 'use strict'; + 'use strict'; - $.fn.activateBox = function () { - $.AdminLTE.boxWidget.activate(this); - }; + $.fn.activateBox = function () { + $.AdminLTE.boxWidget.activate(this); + }; - $.fn.toggleBox = function () { - var button = $($.AdminLTE.boxWidget.selectors.collapse, this); - $.AdminLTE.boxWidget.collapse(button); - }; + $.fn.toggleBox = function () { + var button = $($.AdminLTE.boxWidget.selectors.collapse, this); + $.AdminLTE.boxWidget.collapse(button); + }; - $.fn.removeBox = function () { - var button = $($.AdminLTE.boxWidget.selectors.remove, this); - $.AdminLTE.boxWidget.remove(button); - }; + $.fn.removeBox = function () { + var button = $($.AdminLTE.boxWidget.selectors.remove, this); + $.AdminLTE.boxWidget.remove(button); + }; })(jQuery); @@ -718,46 +718,46 @@ function _init() { */ (function ($) { - 'use strict'; - - $.fn.todolist = function (options) { - // Render options - var settings = $.extend({ - //When the user checks the input - onCheck: function (ele) { - return ele; - }, - //When the user unchecks the input - onUncheck: function (ele) { - return ele; - } - }, options); - - return this.each(function () { - - if (typeof $.fn.iCheck != 'undefined') { - $('input', this).on('ifChecked', function () { - var ele = $(this).parents("li").first(); - ele.toggleClass("done"); - settings.onCheck.call(ele); + 'use strict'; + + $.fn.todolist = function (options) { + // Render options + var settings = $.extend({ + //When the user checks the input + onCheck: function (ele) { + return ele; + }, + //When the user unchecks the input + onUncheck: function (ele) { + return ele; + } + }, options); + + return this.each(function () { + + if (typeof $.fn.iCheck != 'undefined') { + $('input', this).on('ifChecked', function () { + var ele = $(this).parents("li").first(); + ele.toggleClass("done"); + settings.onCheck.call(ele); + }); + + $('input', this).on('ifUnchecked', function () { + var ele = $(this).parents("li").first(); + ele.toggleClass("done"); + settings.onUncheck.call(ele); + }); + } else { + $('input', this).on('change', function () { + var ele = $(this).parents("li").first(); + ele.toggleClass("done"); + if ($('input', ele).is(":checked")) { + settings.onCheck.call(ele); + } else { + settings.onUncheck.call(ele); + } + }); + } }); - - $('input', this).on('ifUnchecked', function () { - var ele = $(this).parents("li").first(); - ele.toggleClass("done"); - settings.onUncheck.call(ele); - }); - } else { - $('input', this).on('change', function () { - var ele = $(this).parents("li").first(); - ele.toggleClass("done"); - if ($('input', ele).is(":checked")) { - settings.onCheck.call(ele); - } else { - settings.onUncheck.call(ele); - } - }); - } - }); - }; + }; }(jQuery)); diff --git a/main/app/sprinkles/core/assets/userfrosting/js/attrchange.js b/main/app/sprinkles/core/assets/userfrosting/js/attrchange.js index 00878d3..df22df7 100644 --- a/main/app/sprinkles/core/assets/userfrosting/js/attrchange.js +++ b/main/app/sprinkles/core/assets/userfrosting/js/attrchange.js @@ -7,118 +7,126 @@ Copyright (C) 2013-2014 Selvakumar Arumugam You may use attrchange plugin under the terms of the MIT Licese. https://github.com/meetselva/attrchange/blob/master/MIT-License.txt */ -(function($) { - function isDOMAttrModifiedSupported() { - var p = document.createElement('p'); - var flag = false; +(function ($) { + function isDOMAttrModifiedSupported() { + var p = document.createElement('p'); + var flag = false; - if (p.addEventListener) { - p.addEventListener('DOMAttrModified', function() { - flag = true - }, false); - } else if (p.attachEvent) { - p.attachEvent('onDOMAttrModified', function() { - flag = true - }); - } else { return false; } - p.setAttribute('id', 'target'); - return flag; - } + if (p.addEventListener) { + p.addEventListener('DOMAttrModified', function () { + flag = true + }, false); + } else if (p.attachEvent) { + p.attachEvent('onDOMAttrModified', function () { + flag = true + }); + } else { + return false; + } + p.setAttribute('id', 'target'); + return flag; + } - function checkAttributes(chkAttr, e) { - if (chkAttr) { - var attributes = this.data('attr-old-value'); + function checkAttributes(chkAttr, e) { + if (chkAttr) { + var attributes = this.data('attr-old-value'); - if (e.attributeName.indexOf('style') >= 0) { - if (!attributes['style']) - attributes['style'] = {}; //initialize - var keys = e.attributeName.split('.'); - e.attributeName = keys[0]; - e.oldValue = attributes['style'][keys[1]]; //old value - e.newValue = keys[1] + ':' - + this.prop("style")[$.camelCase(keys[1])]; //new value - attributes['style'][keys[1]] = e.newValue; - } else { - e.oldValue = attributes[e.attributeName]; - e.newValue = this.attr(e.attributeName); - attributes[e.attributeName] = e.newValue; - } + if (e.attributeName.indexOf('style') >= 0) { + if (!attributes['style']) + attributes['style'] = {}; //initialize + var keys = e.attributeName.split('.'); + e.attributeName = keys[0]; + e.oldValue = attributes['style'][keys[1]]; //old value + e.newValue = keys[1] + ':' + + this.prop("style")[$.camelCase(keys[1])]; //new value + attributes['style'][keys[1]] = e.newValue; + } else { + e.oldValue = attributes[e.attributeName]; + e.newValue = this.attr(e.attributeName); + attributes[e.attributeName] = e.newValue; + } - this.data('attr-old-value', attributes); //update the old value object - } - } + this.data('attr-old-value', attributes); //update the old value object + } + } - //initialize Mutation Observer - var MutationObserver = window.MutationObserver - || window.WebKitMutationObserver; + //initialize Mutation Observer + var MutationObserver = window.MutationObserver + || window.WebKitMutationObserver; - $.fn.attrchange = function(a, b) { - if (typeof a == 'object') {//core - var cfg = { - trackValues : false, - callback : $.noop - }; - //backward compatibility - if (typeof a === "function") { cfg.callback = a; } else { $.extend(cfg, a); } + $.fn.attrchange = function (a, b) { + if (typeof a == 'object') {//core + var cfg = { + trackValues: false, + callback: $.noop + }; + //backward compatibility + if (typeof a === "function") { + cfg.callback = a; + } else { + $.extend(cfg, a); + } - if (cfg.trackValues) { //get attributes old value - this.each(function(i, el) { - var attributes = {}; - for ( var attr, i = 0, attrs = el.attributes, l = attrs.length; i < l; i++) { - attr = attrs.item(i); - attributes[attr.nodeName] = attr.value; - } - $(this).data('attr-old-value', attributes); - }); - } + if (cfg.trackValues) { //get attributes old value + this.each(function (i, el) { + var attributes = {}; + for (var attr, i = 0, attrs = el.attributes, l = attrs.length; i < l; i++) { + attr = attrs.item(i); + attributes[attr.nodeName] = attr.value; + } + $(this).data('attr-old-value', attributes); + }); + } - if (MutationObserver) { //Modern Browsers supporting MutationObserver - var mOptions = { - subtree : false, - attributes : true, - attributeOldValue : cfg.trackValues - }; - var observer = new MutationObserver(function(mutations) { - mutations.forEach(function(e) { - var _this = e.target; - //get new value if trackValues is true - if (cfg.trackValues) { - e.newValue = $(_this).attr(e.attributeName); - } - if ($(_this).data('attrchange-status') === 'connected') { //execute if connected - cfg.callback.call(_this, e); - } - }); - }); + if (MutationObserver) { //Modern Browsers supporting MutationObserver + var mOptions = { + subtree: false, + attributes: true, + attributeOldValue: cfg.trackValues + }; + var observer = new MutationObserver(function (mutations) { + mutations.forEach(function (e) { + var _this = e.target; + //get new value if trackValues is true + if (cfg.trackValues) { + e.newValue = $(_this).attr(e.attributeName); + } + if ($(_this).data('attrchange-status') === 'connected') { //execute if connected + cfg.callback.call(_this, e); + } + }); + }); - return this.data('attrchange-method', 'Mutation Observer').data('attrchange-status', 'connected') - .data('attrchange-obs', observer).each(function() { - observer.observe(this, mOptions); - }); - } else if (isDOMAttrModifiedSupported()) { //Opera - //Good old Mutation Events - return this.data('attrchange-method', 'DOMAttrModified').data('attrchange-status', 'connected').on('DOMAttrModified', function(event) { - if (event.originalEvent) { event = event.originalEvent; }//jQuery normalization is not required - event.attributeName = event.attrName; //property names to be consistent with MutationObserver - event.oldValue = event.prevValue; //property names to be consistent with MutationObserver - if ($(this).data('attrchange-status') === 'connected') { //disconnected logically - cfg.callback.call(this, event); - } - }); - } else if ('onpropertychange' in document.body) { //works only in IE - return this.data('attrchange-method', 'propertychange').data('attrchange-status', 'connected').on('propertychange', function(e) { - e.attributeName = window.event.propertyName; - //to set the attr old value - checkAttributes.call($(this), cfg.trackValues, e); - if ($(this).data('attrchange-status') === 'connected') { //disconnected logically - cfg.callback.call(this, e); - } - }); - } - return this; - } else if (typeof a == 'string' && $.fn.attrchange.hasOwnProperty('extensions') && - $.fn.attrchange['extensions'].hasOwnProperty(a)) { //extensions/options - return $.fn.attrchange['extensions'][a].call(this, b); - } - } + return this.data('attrchange-method', 'Mutation Observer').data('attrchange-status', 'connected') + .data('attrchange-obs', observer).each(function () { + observer.observe(this, mOptions); + }); + } else if (isDOMAttrModifiedSupported()) { //Opera + //Good old Mutation Events + return this.data('attrchange-method', 'DOMAttrModified').data('attrchange-status', 'connected').on('DOMAttrModified', function (event) { + if (event.originalEvent) { + event = event.originalEvent; + }//jQuery normalization is not required + event.attributeName = event.attrName; //property names to be consistent with MutationObserver + event.oldValue = event.prevValue; //property names to be consistent with MutationObserver + if ($(this).data('attrchange-status') === 'connected') { //disconnected logically + cfg.callback.call(this, event); + } + }); + } else if ('onpropertychange' in document.body) { //works only in IE + return this.data('attrchange-method', 'propertychange').data('attrchange-status', 'connected').on('propertychange', function (e) { + e.attributeName = window.event.propertyName; + //to set the attr old value + checkAttributes.call($(this), cfg.trackValues, e); + if ($(this).data('attrchange-status') === 'connected') { //disconnected logically + cfg.callback.call(this, e); + } + }); + } + return this; + } else if (typeof a == 'string' && $.fn.attrchange.hasOwnProperty('extensions') && + $.fn.attrchange['extensions'].hasOwnProperty(a)) { //extensions/options + return $.fn.attrchange['extensions'][a].call(this, b); + } + } })(jQuery); \ No newline at end of file diff --git a/main/app/sprinkles/core/assets/userfrosting/js/fortress-jqueryvalidation-methods.js b/main/app/sprinkles/core/assets/userfrosting/js/fortress-jqueryvalidation-methods.js index b008cf2..d92ab38 100644 --- a/main/app/sprinkles/core/assets/userfrosting/js/fortress-jqueryvalidation-methods.js +++ b/main/app/sprinkles/core/assets/userfrosting/js/fortress-jqueryvalidation-methods.js @@ -1,4 +1,4 @@ -$.validator.addMethod("equals", function(value, element, params) { +$.validator.addMethod("equals", function (value, element, params) { params = $.extend( true, // deep extend { @@ -10,10 +10,10 @@ $.validator.addMethod("equals", function(value, element, params) { params.value = params.value.toLowerCase(); value = value.toLowerCase(); } - return this.optional(element) || value == params.value; + return this.optional(element) || value == params.value; }, "Value is not correct."); -$.validator.addMethod("notEquals", function(value, element, params) { +$.validator.addMethod("notEquals", function (value, element, params) { params = $.extend( true, // deep extend { @@ -25,33 +25,33 @@ $.validator.addMethod("notEquals", function(value, element, params) { params.value = params.value.toLowerCase(); value = value.toLowerCase(); } - return this.optional(element) || value != params.value; + return this.optional(element) || value != params.value; }, "Value is not correct."); -$.validator.addMethod("noLeadingWhitespace", function(value, element) { - return this.optional(element) || /^\S.*$/i.test(value); +$.validator.addMethod("noLeadingWhitespace", function (value, element) { + return this.optional(element) || /^\S.*$/i.test(value); }, "No leading whitespace allowed"); -$.validator.addMethod("noTrailingWhitespace", function(value, element) { - return this.optional(element) || /^.*\S$/i.test(value); +$.validator.addMethod("noTrailingWhitespace", function (value, element) { + return this.optional(element) || /^.*\S$/i.test(value); }, "No trailing whitespace allowed"); -jQuery.validator.addMethod("memberOf", function(value, element, arr) { +jQuery.validator.addMethod("memberOf", function (value, element, arr) { return $.inArray(value, arr) != -1; }, "Data provided must match one of the provided options."); -jQuery.validator.addMethod("notMemberOf", function(value, element, arr) { +jQuery.validator.addMethod("notMemberOf", function (value, element, arr) { return $.inArray(value, arr) == -1; }, "Data provided must NOT match one of the provided options."); -jQuery.validator.addMethod("matchFormField", function(value, element, field) { +jQuery.validator.addMethod("matchFormField", function (value, element, field) { return value === $(element).closest('form').find("input[name=" + field + "]").val(); }, "The specified fields must match."); -jQuery.validator.addMethod("notMatchFormField", function(value, element, field) { +jQuery.validator.addMethod("notMatchFormField", function (value, element, field) { return value !== $(element).closest('form').find("input[name=" + field + "]").val(); }, "The specified fields must NOT match."); -$.validator.addMethod("username", function(value, element) { - return this.optional(element) || /^([a-z0-9\.\-_])+$/.test(value); +$.validator.addMethod("username", function (value, element) { + return this.optional(element) || /^([a-z0-9\.\-_])+$/.test(value); }, "The field may only contain lowercase letters, digits, '.', '-', and '_'."); diff --git a/main/app/sprinkles/core/assets/userfrosting/js/handlebars-helpers.js b/main/app/sprinkles/core/assets/userfrosting/js/handlebars-helpers.js index 96f47bb..60d71ea 100644 --- a/main/app/sprinkles/core/assets/userfrosting/js/handlebars-helpers.js +++ b/main/app/sprinkles/core/assets/userfrosting/js/handlebars-helpers.js @@ -4,10 +4,10 @@ * @see http://handlebarsjs.com/#helpers */ - /** - * Improved comparison operator - * See https://stackoverflow.com/a/16315366/2970321 - */ +/** + * Improved comparison operator + * See https://stackoverflow.com/a/16315366/2970321 + */ Handlebars.registerHelper('ifx', function (v1, operator, v2, options) { switch (operator) { case '==': @@ -37,7 +37,7 @@ Handlebars.registerHelper('ifx', function (v1, operator, v2, options) { /** * Perform simple calculations. - * + * * usage: {{calc x '+' 2}} */ Handlebars.registerHelper('calc', function (v1, operator, v2, options) { @@ -55,12 +55,12 @@ Handlebars.registerHelper('calc', function (v1, operator, v2, options) { /** * format an ISO date using Moment.js - * + * * moment syntax example: moment(Date("2011-07-18T15:50:52")).format("MMMM YYYY") * usage: {{dateFormat creation_date format="MMMM YYYY"}} * @requires momentjs http://momentjs.com/ */ -Handlebars.registerHelper('dateFormat', function(context, block) { +Handlebars.registerHelper('dateFormat', function (context, block) { if (window.moment) { var f = block.hash.format || "MMM Do, YYYY"; return moment(context).format(f); @@ -74,19 +74,19 @@ Handlebars.registerHelper('dateFormat', function(context, block) { /** * Format a phone number. */ -Handlebars.registerHelper("phoneUSFormat", function(phoneNumber) { - if (typeof phoneNumber === 'undefined') { - return ''; - } +Handlebars.registerHelper("phoneUSFormat", function (phoneNumber) { + if (typeof phoneNumber === 'undefined') { + return ''; + } - phoneNumber = phoneNumber.toString(); - return "(" + phoneNumber.substr(0,3) + ") " + phoneNumber.substr(3,3) + "-" + phoneNumber.substr(6,4); + phoneNumber = phoneNumber.toString(); + return "(" + phoneNumber.substr(0, 3) + ") " + phoneNumber.substr(3, 3) + "-" + phoneNumber.substr(6, 4); }); /** * Format currency (USD). */ -Handlebars.registerHelper("currencyUsdFormat", function(amount) { +Handlebars.registerHelper("currencyUsdFormat", function (amount) { var parsedAmount = parseFloat(amount); if (parsedAmount < 0) { return "-$" + Math.abs(parsedAmount).toFixed(2); @@ -100,7 +100,7 @@ Handlebars.registerHelper("currencyUsdFormat", function(amount) { * * @requires speakingurl https://pid.github.io/speakingurl/ */ -Handlebars.registerHelper('slug', function(text) { +Handlebars.registerHelper('slug', function (text) { return getSlug(text); }); @@ -110,8 +110,8 @@ Handlebars.registerHelper('slug', function(text) { * @deprecated since 4.1 - use ifx instead * usage: {{ifCond apple orange}} */ -Handlebars.registerHelper('ifCond', function(v1, v2, options) { - if(v1 == v2) { +Handlebars.registerHelper('ifCond', function (v1, v2, options) { + if (v1 == v2) { return options.fn(this); } diff --git a/main/app/sprinkles/core/assets/userfrosting/js/query-string.js b/main/app/sprinkles/core/assets/userfrosting/js/query-string.js index 5e0d780..ff3c88c 100644 --- a/main/app/sprinkles/core/assets/userfrosting/js/query-string.js +++ b/main/app/sprinkles/core/assets/userfrosting/js/query-string.js @@ -17,13 +17,13 @@ $.String = $.extend($.String || {}, { * } * } */ - deparam: function(params){ + deparam: function (params) { var digitTest = /^\d+$/, keyBreaker = /([^\[\]]+)|(\[\])/g, plus = /\+/g, paramTest = /([^?#]*)(#.*)?$/; - if(! params || ! paramTest.test(params) ) { + if (!params || !paramTest.test(params)) { return {}; } @@ -32,31 +32,31 @@ $.String = $.extend($.String || {}, { pairs = params.split('&'), current; - for(var i=0; i < pairs.length; i++){ + for (var i = 0; i < pairs.length; i++) { current = data; var pair = pairs[i].split('='); // if we find foo=1+1=2 - if(pair.length != 2) { + if (pair.length != 2) { pair = [pair[0], pair.slice(1).join("=")] } - var key = decodeURIComponent(pair[0].replace(plus, " ")), - value = decodeURIComponent(pair[1].replace(plus, " ")), + var key = decodeURIComponent(pair[0].replace(plus, " ")), + value = decodeURIComponent(pair[1].replace(plus, " ")), parts = key.match(keyBreaker); - for ( var j = 0; j < parts.length - 1; j++ ) { + for (var j = 0; j < parts.length - 1; j++) { var part = parts[j]; - if (!current[part] ) { + if (!current[part]) { // if what we are pointing to looks like an array - current[part] = digitTest.test(parts[j+1]) || parts[j+1] == "[]" ? [] : {} + current[part] = digitTest.test(parts[j + 1]) || parts[j + 1] == "[]" ? [] : {} } current = current[part]; } lastPart = parts[parts.length - 1]; - if(lastPart == "[]"){ + if (lastPart == "[]") { current.push(value) - }else{ + } else { current[lastPart] = value; } } diff --git a/main/app/sprinkles/core/assets/userfrosting/js/tablesorter/widget-sort2Hash.js b/main/app/sprinkles/core/assets/userfrosting/js/tablesorter/widget-sort2Hash.js index 1be9c85..3b98529 100644 --- a/main/app/sprinkles/core/assets/userfrosting/js/tablesorter/widget-sort2Hash.js +++ b/main/app/sprinkles/core/assets/userfrosting/js/tablesorter/widget-sort2Hash.js @@ -4,268 +4,274 @@ * * Temporary patched version of widget to handle browser history issues (#712). */ -;( function( $ ) { - 'use strict'; - var ts = $.tablesorter || {}, - s2h = ts.sort2Hash = { - init : function( c, wo ) { - var filter, temp, page, size, - table = c.table, - pager = c.pager, - hasSaveSort = ts.hasWidget( table, 'saveSort' ), - sort = s2h.decodeHash( c, wo, 'sort' ); - if ( ( sort && !hasSaveSort ) || ( sort && hasSaveSort && wo.sort2Hash_overrideSaveSort ) ) { - s2h.convertString2Sort( c, wo, sort ); - } - if ( ts.hasWidget( c.table, 'pager' ) ) { - temp = parseInt( s2h.decodeHash( c, wo, 'page' ), 10 ); - page = pager.page = ( temp < 0 ? 0 : ( temp > pager.totalPages ? pager.totalPages - 1 : temp ) ); - size = pager.size = parseInt( s2h.decodeHash( c, wo, 'size' ), 10 ); - } - if ( ts.hasWidget( table, 'filter' ) ) { - filter = s2h.decodeHash( c, wo, 'filter' ); - if ( filter ) { - filter = filter.split( wo.sort2Hash_separator ); - c.$table.one( 'tablesorter-ready', function() { - setTimeout(function(){ - c.$table.one( 'filterEnd', function() { - $(this).triggerHandler( 'pageAndSize', [ page, size ] ); - }); - // use the newest filter comparison code - if ( ts.filter.equalFilters ) { - temp = ts.filter.equalFilters( c, c.lastSearch, filter ); - } else { - // quick n' dirty comparison... it will miss filter changes of - // the same value in a different column, see #1363 - temp = ( c.lastSearch || [] ).join( '' ) !== ( filter || [] ).join( '' ); - } - // don't set filters if they haven't changed - if ( !temp ) { - $.tablesorter.setFilters( table, filter, true ); - } - }, 100 ); - }); - } - } - if ( !filter ) { - c.$table.one( 'tablesorter-ready', function() { - c.$table.triggerHandler( 'pageAndSize', [ page, size ] ); - }); - } +;(function ($) { + 'use strict'; + var ts = $.tablesorter || {}, + s2h = ts.sort2Hash = { + init: function (c, wo) { + var filter, temp, page, size, + table = c.table, + pager = c.pager, + hasSaveSort = ts.hasWidget(table, 'saveSort'), + sort = s2h.decodeHash(c, wo, 'sort'); + if ((sort && !hasSaveSort) || (sort && hasSaveSort && wo.sort2Hash_overrideSaveSort)) { + s2h.convertString2Sort(c, wo, sort); + } + if (ts.hasWidget(c.table, 'pager')) { + temp = parseInt(s2h.decodeHash(c, wo, 'page'), 10); + page = pager.page = (temp < 0 ? 0 : (temp > pager.totalPages ? pager.totalPages - 1 : temp)); + size = pager.size = parseInt(s2h.decodeHash(c, wo, 'size'), 10); + } + if (ts.hasWidget(table, 'filter')) { + filter = s2h.decodeHash(c, wo, 'filter'); + if (filter) { + filter = filter.split(wo.sort2Hash_separator); + c.$table.one('tablesorter-ready', function () { + setTimeout(function () { + c.$table.one('filterEnd', function () { + $(this).triggerHandler('pageAndSize', [page, size]); + }); + // use the newest filter comparison code + if (ts.filter.equalFilters) { + temp = ts.filter.equalFilters(c, c.lastSearch, filter); + } else { + // quick n' dirty comparison... it will miss filter changes of + // the same value in a different column, see #1363 + temp = (c.lastSearch || []).join('') !== (filter || []).join(''); + } + // don't set filters if they haven't changed + if (!temp) { + $.tablesorter.setFilters(table, filter, true); + } + }, 100); + }); + } + } + if (!filter) { + c.$table.one('tablesorter-ready', function () { + c.$table.triggerHandler('pageAndSize', [page, size]); + }); + } - c.$table.on( 'sortEnd.sort2hash filterEnd.sort2hash pagerComplete.sort2Hash', function() { - if ( this.hasInitialized ) { - s2h.setHash( this.config, this.config.widgetOptions ); - } - }); - }, + c.$table.on('sortEnd.sort2hash filterEnd.sort2hash pagerComplete.sort2Hash', function () { + if (this.hasInitialized) { + s2h.setHash(this.config, this.config.widgetOptions); + } + }); + }, - getTableId : function( c, wo ) { - // option > table id > table index on page - return wo.sort2Hash_tableId || - c.table.id || - 'table' + $( 'table' ).index( c.$table ); - }, - regexEscape : function( v ) { - return v.replace( /([\.\^\$\*\+\-\?\(\)\[\]\{\}\\\|])/g, '\\$1'); - }, - // convert 'first%20name,asc,last%20name,desc' into [[0,0], [1,1]] - convertString2Sort : function( c, wo, sortHash ) { - var regex, column, direction, temp, index, $cell, - arry = sortHash.split( wo.sort2Hash_separator ), - indx = 0, - len = arry.length, - sort = []; - while ( indx < len ) { - // column index or text - column = arry[ indx++ ]; - temp = parseInt( column, 10 ); - // ignore wo.sort2Hash_useHeaderText setting & - // just see if column contains a number - if ( isNaN( temp ) || temp > c.columns ) { - regex = new RegExp( '(' + s2h.regexEscape( column ) + ')', 'i' ); - for ( index = 0; index < c.columns; index++ ) { - $cell = c.$headerIndexed[ index ]; - if ( regex.test( $cell.attr( wo.sort2Hash_headerTextAttr ) ) ) { - column = index; - index = c.columns; - } - } - } - direction = arry[ indx++ ]; - // ignore unpaired values - if ( typeof column !== 'undefined' && typeof direction !== 'undefined' ) { - // convert text to 0, 1 - if ( isNaN( direction ) ) { - // default to ascending sort - direction = direction.indexOf( wo.sort2Hash_directionText[ 1 ] ) > -1 ? 1 : 0; - } - sort.push( [ column, direction ] ); - } - } - if ( sort.length ) { - c.sortList = sort; - } - }, + getTableId: function (c, wo) { + // option > table id > table index on page + return wo.sort2Hash_tableId || + c.table.id || + 'table' + $('table').index(c.$table); + }, + regexEscape: function (v) { + return v.replace(/([\.\^\$\*\+\-\?\(\)\[\]\{\}\\\|])/g, '\\$1'); + }, + // convert 'first%20name,asc,last%20name,desc' into [[0,0], [1,1]] + convertString2Sort: function (c, wo, sortHash) { + var regex, column, direction, temp, index, $cell, + arry = sortHash.split(wo.sort2Hash_separator), + indx = 0, + len = arry.length, + sort = []; + while (indx < len) { + // column index or text + column = arry[indx++]; + temp = parseInt(column, 10); + // ignore wo.sort2Hash_useHeaderText setting & + // just see if column contains a number + if (isNaN(temp) || temp > c.columns) { + regex = new RegExp('(' + s2h.regexEscape(column) + ')', 'i'); + for (index = 0; index < c.columns; index++) { + $cell = c.$headerIndexed[index]; + if (regex.test($cell.attr(wo.sort2Hash_headerTextAttr))) { + column = index; + index = c.columns; + } + } + } + direction = arry[indx++]; + // ignore unpaired values + if (typeof column !== 'undefined' && typeof direction !== 'undefined') { + // convert text to 0, 1 + if (isNaN(direction)) { + // default to ascending sort + direction = direction.indexOf(wo.sort2Hash_directionText[1]) > -1 ? 1 : 0; + } + sort.push([column, direction]); + } + } + if (sort.length) { + c.sortList = sort; + } + }, - // convert [[0,0],[1,1]] to 'first%20name,asc,last%20name,desc' - convertSort2String : function( c, wo ) { - var index, txt, column, direction, - sort = [], - arry = c.sortList || [], - len = arry.length; - for ( index = 0; index < len; index++ ) { - column = arry[ index ][ 0 ]; - txt = $.trim( c.$headerIndexed[ column ].attr( wo.sort2Hash_headerTextAttr ) ); - sort.push( txt !== '' ? encodeURIComponent( txt ) : column ); - direction = wo.sort2Hash_directionText[ arry[ index ][ 1 ] ]; - sort.push( direction ); - } - // join with separator - return sort.join( wo.sort2Hash_separator ); - }, + // convert [[0,0],[1,1]] to 'first%20name,asc,last%20name,desc' + convertSort2String: function (c, wo) { + var index, txt, column, direction, + sort = [], + arry = c.sortList || [], + len = arry.length; + for (index = 0; index < len; index++) { + column = arry[index][0]; + txt = $.trim(c.$headerIndexed[column].attr(wo.sort2Hash_headerTextAttr)); + sort.push(txt !== '' ? encodeURIComponent(txt) : column); + direction = wo.sort2Hash_directionText[arry[index][1]]; + sort.push(direction); + } + // join with separator + return sort.join(wo.sort2Hash_separator); + }, - convertFilter2String : function( c, wo ) { - var index, txt, column, direction, - sort = [], - arry = c.sortList || [], - len = arry.length; - for ( index = 0; index < len; index++ ) { - column = arry[ index ][ 0 ]; - txt = $.trim( c.$headerIndexed[ column ].attr( wo.sort2Hash_headerTextAttr ) ); - column = typeof txt !== 'undefined' ? encodeURIComponent( txt ) : column; - sort.push( column ); - direction = wo.sort2Hash_directionText[ arry[ index ][ 1 ] ]; - sort.push( direction ); - } - // join with separator - return sort.join( wo.sort2Hash_separator ); - }, + convertFilter2String: function (c, wo) { + var index, txt, column, direction, + sort = [], + arry = c.sortList || [], + len = arry.length; + for (index = 0; index < len; index++) { + column = arry[index][0]; + txt = $.trim(c.$headerIndexed[column].attr(wo.sort2Hash_headerTextAttr)); + column = typeof txt !== 'undefined' ? encodeURIComponent(txt) : column; + sort.push(column); + direction = wo.sort2Hash_directionText[arry[index][1]]; + sort.push(direction); + } + // join with separator + return sort.join(wo.sort2Hash_separator); + }, - // Get URL Parameters (getParam) - // modified from http://www.netlobo.com/url_query_string_javascript.html - getParam : function ( name, hash, returnRegex ) { - if ( !hash ) { hash = window.location.hash; } - var regex = new RegExp( '[\\?&]' + s2h.regexEscape( name ) + '=([^&#]*)' ), - match = regex.exec( hash ); - if ( returnRegex ) { return regex; } - return match === null ? '' : decodeURIComponent( match[ 1 ] ); - }, + // Get URL Parameters (getParam) + // modified from http://www.netlobo.com/url_query_string_javascript.html + getParam: function (name, hash, returnRegex) { + if (!hash) { + hash = window.location.hash; + } + var regex = new RegExp('[\\?&]' + s2h.regexEscape(name) + '=([^&#]*)'), + match = regex.exec(hash); + if (returnRegex) { + return regex; + } + return match === null ? '' : decodeURIComponent(match[1]); + }, - // remove parameter from hash - removeParam : function( name, hash ) { - if ( !hash ) { hash = window.location.hash; } - var index, - regex = s2h.getParam( name, hash, true ), - result = [], - parts = hash.split( '&' ), - len = parts.length; - for ( index = 0; index < len; index++ ) { - // regex expects a leading '&'... - if ( !regex.test( '&' + parts[ index ] ) ) { - result.push( parts[ index ] ); - } - } - return result.length ? result.join( '&' ) : ''; - }, + // remove parameter from hash + removeParam: function (name, hash) { + if (!hash) { + hash = window.location.hash; + } + var index, + regex = s2h.getParam(name, hash, true), + result = [], + parts = hash.split('&'), + len = parts.length; + for (index = 0; index < len; index++) { + // regex expects a leading '&'... + if (!regex.test('&' + parts[index])) { + result.push(parts[index]); + } + } + return result.length ? result.join('&') : ''; + }, - encodeHash : function( c, wo, component, value, rawValue ) { - var result = false, - tableId = s2h.getTableId( c, wo ); - if ( typeof wo.sort2Hash_encodeHash === 'function' ) { - result = wo.sort2Hash_encodeHash( c, tableId, component, value, rawValue || value ); - } - if ( result === false ) { - result = '&' + component + '[' + tableId + ']=' + value; - } - return result; - }, + encodeHash: function (c, wo, component, value, rawValue) { + var result = false, + tableId = s2h.getTableId(c, wo); + if (typeof wo.sort2Hash_encodeHash === 'function') { + result = wo.sort2Hash_encodeHash(c, tableId, component, value, rawValue || value); + } + if (result === false) { + result = '&' + component + '[' + tableId + ']=' + value; + } + return result; + }, - decodeHash : function( c, wo, component ) { - var result = false, - tableId = s2h.getTableId( c, wo ); - if ( typeof wo.sort2Hash_decodeHash === 'function' ) { - // return a string - result = wo.sort2Hash_decodeHash( c, tableId, component ); - } - if ( result === false ) { - result = s2h.getParam( component + '[' + tableId + ']' ); - } - return result || ''; - }, + decodeHash: function (c, wo, component) { + var result = false, + tableId = s2h.getTableId(c, wo); + if (typeof wo.sort2Hash_decodeHash === 'function') { + // return a string + result = wo.sort2Hash_decodeHash(c, tableId, component); + } + if (result === false) { + result = s2h.getParam(component + '[' + tableId + ']'); + } + return result || ''; + }, - cleanHash : function( c, wo, component, hash ) { - var result = false, - tableId = s2h.getTableId( c, wo ); - if ( typeof wo.sort2Hash_cleanHash === 'function' ) { - // can return an array or string - result = wo.sort2Hash_cleanHash( c, tableId, component, hash ); - } - if ( result === false ) { - // parameter example: 'sort[table0]=0,0' - result = s2h.removeParam( component + '[' + tableId + ']', hash ); - } - return result || ''; - }, + cleanHash: function (c, wo, component, hash) { + var result = false, + tableId = s2h.getTableId(c, wo); + if (typeof wo.sort2Hash_cleanHash === 'function') { + // can return an array or string + result = wo.sort2Hash_cleanHash(c, tableId, component, hash); + } + if (result === false) { + // parameter example: 'sort[table0]=0,0' + result = s2h.removeParam(component + '[' + tableId + ']', hash); + } + return result || ''; + }, - setHash : function( c, wo ) { - var str = '', - hash = window.location.hash, - hasPager = ts.hasWidget( c.table, 'pager' ), - hasFilter = ts.hasWidget( c.table, 'filter' ), - sortList = s2h.convertSort2String( c, wo ), - filters = ( hasFilter && c.lastSearch.join('') !== '' ? c.lastSearch : [] ), - filtersStr = encodeURIComponent( filters.join( c.widgetOptions.sort2Hash_separator ) ), - components = { - 'sort' : sortList ? s2h.encodeHash( c, wo, 'sort', sortList, c.sortList ) : '', - 'page' : hasPager ? s2h.encodeHash( c, wo, 'page', c.pager.page + 1 ) : '', - 'size' : hasPager ? s2h.encodeHash( c, wo, 'size', c.pager.size ) : '', - 'filter' : filtersStr ? s2h.encodeHash( c, wo, 'filter', filtersStr, filters ) : '' - }; - // remove old hash - $.each( components, function( component, value ) { - hash = s2h.cleanHash( c, wo, component, hash ); - str += value; - }); + setHash: function (c, wo) { + var str = '', + hash = window.location.hash, + hasPager = ts.hasWidget(c.table, 'pager'), + hasFilter = ts.hasWidget(c.table, 'filter'), + sortList = s2h.convertSort2String(c, wo), + filters = (hasFilter && c.lastSearch.join('') !== '' ? c.lastSearch : []), + filtersStr = encodeURIComponent(filters.join(c.widgetOptions.sort2Hash_separator)), + components = { + 'sort': sortList ? s2h.encodeHash(c, wo, 'sort', sortList, c.sortList) : '', + 'page': hasPager ? s2h.encodeHash(c, wo, 'page', c.pager.page + 1) : '', + 'size': hasPager ? s2h.encodeHash(c, wo, 'size', c.pager.size) : '', + 'filter': filtersStr ? s2h.encodeHash(c, wo, 'filter', filtersStr, filters) : '' + }; + // remove old hash + $.each(components, function (component, value) { + hash = s2h.cleanHash(c, wo, component, hash); + str += value; + }); - // Combine new hash with any existing hashes - var hashChar = c.widgetOptions.sort2Hash_hash; - var newHash = ( ( window.location.hash || '' ).replace( hashChar, '' ).length ? hash : wo.sort2Hash_hash ) + str; - var baseUrl = window.location.href.split(hashChar)[0]; - // Ensure that there is a leading hash character - var firstChar = newHash[0]; - if (firstChar != hashChar) { - newHash = hashChar + newHash; - } + // Combine new hash with any existing hashes + var hashChar = c.widgetOptions.sort2Hash_hash; + var newHash = ((window.location.hash || '').replace(hashChar, '').length ? hash : wo.sort2Hash_hash) + str; + var baseUrl = window.location.href.split(hashChar)[0]; + // Ensure that there is a leading hash character + var firstChar = newHash[0]; + if (firstChar != hashChar) { + newHash = hashChar + newHash; + } - // Update URL in browser - window.location.replace(baseUrl + newHash); - } - }; + // Update URL in browser + window.location.replace(baseUrl + newHash); + } + }; - ts.addWidget({ - id: 'sort2Hash', - priority: 60, // after saveSort & pager - options: { - sort2Hash_hash : '#', // hash prefix - sort2Hash_separator : '-', // don't '#' or '=' here - sort2Hash_headerTextAttr : 'data-header', // data attribute containing alternate header text - sort2Hash_directionText : [ 0, 1 ], // [ 'asc', 'desc' ], - sort2Hash_overrideSaveSort : false, // if true, override saveSort widget if saved sort available + ts.addWidget({ + id: 'sort2Hash', + priority: 60, // after saveSort & pager + options: { + sort2Hash_hash: '#', // hash prefix + sort2Hash_separator: '-', // don't '#' or '=' here + sort2Hash_headerTextAttr: 'data-header', // data attribute containing alternate header text + sort2Hash_directionText: [0, 1], // [ 'asc', 'desc' ], + sort2Hash_overrideSaveSort: false, // if true, override saveSort widget if saved sort available - // this option > table ID > table index on page - sort2Hash_tableId : null, - // custom hash processing functions - sort2Hash_encodeHash : null, - sort2Hash_decodeHash : null, - sort2Hash_cleanHash : null - }, - init: function(table, thisWidget, c, wo) { - s2h.init( c, wo ); - }, - remove: function(table, c) { - c.$table.off( '.sort2hash' ); - } - }); + // this option > table ID > table index on page + sort2Hash_tableId: null, + // custom hash processing functions + sort2Hash_encodeHash: null, + sort2Hash_decodeHash: null, + sort2Hash_cleanHash: null + }, + init: function (table, thisWidget, c, wo) { + s2h.init(c, wo); + }, + remove: function (table, c) { + c.$table.off('.sort2hash'); + } + }); })(jQuery); diff --git a/main/app/sprinkles/core/assets/userfrosting/js/uf-captcha.js b/main/app/sprinkles/core/assets/userfrosting/js/uf-captcha.js index ed3ecea..a027f9c 100644 --- a/main/app/sprinkles/core/assets/userfrosting/js/uf-captcha.js +++ b/main/app/sprinkles/core/assets/userfrosting/js/uf-captcha.js @@ -1,8 +1,8 @@ /** * This plugin reloads the captcha in the specified element. */ -(function( $ ) { - $.fn.captcha = function() { +(function ($) { + $.fn.captcha = function () { // Set the new captcha image $(this).attr('src', site.uri.public + "/account/captcha?" + new Date().getTime()); @@ -10,4 +10,4 @@ var target = $(this).data('target'); $(target).val(""); }; -}( jQuery )); +}(jQuery)); diff --git a/main/app/sprinkles/core/assets/userfrosting/js/uf-collection.js b/main/app/sprinkles/core/assets/userfrosting/js/uf-collection.js index a2afc6e..8146f3f 100644 --- a/main/app/sprinkles/core/assets/userfrosting/js/uf-collection.js +++ b/main/app/sprinkles/core/assets/userfrosting/js/uf-collection.js @@ -32,26 +32,26 @@ * UserFrosting https://www.userfrosting.com * @author Alexander Weissman */ -;(function($, window, document, undefined) { - "use strict"; +;(function ($, window, document, undefined) { + "use strict"; // Define plugin name and defaults. var pluginName = "ufCollection", defaults = { useDropdown: true, dropdown: { - ajax : { - url : "", - dataType : "json", - delay : 250, - data : function (params) { + ajax: { + url: "", + dataType: "json", + delay: 250, + data: function (params) { return { filters: { - info : params.term + info: params.term } }; }, - processResults : function (data, params) { + processResults: function (data, params) { // Process the data into dropdown options var suggestions = []; if (data && data.rows) { @@ -61,25 +61,25 @@ results: suggestions }; }, - cache : true + cache: true }, - placeholder : "Item", - selectOnClose : false, // Make a selection when they click out of the box/press the next button - theme : "default", - width : "100%", + placeholder: "Item", + selectOnClose: false, // Make a selection when they click out of the box/press the next button + theme: "default", + width: "100%", }, transformDropdownSelection: function (item) { return item; }, - dropdownControl : null, + dropdownControl: null, dropdownTemplate: "", - rowContainer : null, - rowTemplate : "", - DEBUG : false - }; + rowContainer: null, + rowTemplate: "", + DEBUG: false + }; // Constructor - function Plugin (element, options) { + function Plugin(element, options) { this.element = element[0]; this.$element = $(this.element); var lateDefaults = { @@ -91,7 +91,11 @@ this._name = pluginName; // Detect changes to element attributes - this.$element.attrchange({ callback: function (event) { this.element = event.target; }.bind(this) }); + this.$element.attrchange({ + callback: function (event) { + this.element = event.target; + }.bind(this) + }); // Internal counter for adding rows to the collection. Gets updated every time `_createRow` is called. this._rownum = 0; @@ -108,7 +112,7 @@ this.$element.toggleClass("uf-collection", true); // Add bindings for any rows already present in the DOM - $.each(this.settings.rowContainer.find('.uf-collection-row'), $.proxy(function(idx, row) { + $.each(this.settings.rowContainer.find('.uf-collection-row'), $.proxy(function (idx, row) { this._onNewRow($(row)); this._lastRow = row; }, this)); @@ -117,7 +121,7 @@ if (this.settings.useDropdown) { this._initDropdownField(this.settings.dropdownControl); - this.settings.dropdownControl.on("select2:select", $.proxy(function(e) { + this.settings.dropdownControl.on("select2:select", $.proxy(function (e) { var item = $(e.target).select2("data")[0]; // Apply any transformations before rendering as a row var transformed = this.settings.transformDropdownSelection(item); @@ -137,7 +141,7 @@ /** * Add a new row to the collection, optionally passing in prepopulated template data. */ - addRow: function(options) { + addRow: function (options) { // Grab params, if any var params = {}; if (typeof options !== 'undefined') { @@ -153,7 +157,7 @@ * Virgin rows are rows that have not yet been brought into focus by the user. * When a virgin row is brought into focus, it loses its virgin status and a new virgin row is created. */ - addVirginRow: function(options) { + addVirginRow: function (options) { // Grab params, if any var params = {}; if (typeof options !== 'undefined') { @@ -167,7 +171,7 @@ /** * Delete a target row. */ - deleteRow: function(row) { + deleteRow: function (row) { this._deleteRow(row); return this.$element; @@ -175,7 +179,7 @@ /** * Get the dropdown control for the collection, if one exists. */ - getDropdown: function() { + getDropdown: function () { return this.settings.dropdownControl; }, /** @@ -187,7 +191,7 @@ /** * Touch a target row. */ - touchRow: function(row) { + touchRow: function (row) { this._touchRow(row); return this.$element; @@ -195,12 +199,12 @@ /** * Create a new row and attach the handler for deletion to the js-delete-row button */ - _createRow: function(params) { + _createRow: function (params) { params = $.extend(true, - { - id: "", - rownum: this._rownum - }, params); + { + id: "", + rownum: this._rownum + }, params); // Generate the row and append to table var newRowTemplate = this._rowTemplateCompiled(params), @@ -224,7 +228,7 @@ /** * Create a new, blank row with the 'virgin' status. */ - _createVirginRow: function(params) { + _createVirginRow: function (params) { // Generate the row and append to table var newRow = this._createRow(params); @@ -237,21 +241,21 @@ /** * Delete a row from the collection. */ - _deleteRow: function(row) { - row.remove(); - this.$element.trigger('rowDelete.ufCollection'); - }, - /** + _deleteRow: function (row) { + row.remove(); + this.$element.trigger('rowDelete.ufCollection'); + }, + /** * Add delete and touch bindings for a row, increment the internal row counter, and fire the rowAdd event */ - _onNewRow: function(row) { + _onNewRow: function (row) { // Trigger to delete row - row.find('.js-delete-row').on('click', $.proxy(function(e) { + row.find('.js-delete-row').on('click', $.proxy(function (e) { this._deleteRow($(e.target).closest('.uf-collection-row')); }, this)); // Once the new row comes into focus for the first time, it has been "touched" - row.find(':input').on('focus', $.proxy(function() { + row.find(':input').on('focus', $.proxy(function () { this._touchRow(row); }, this)); @@ -263,7 +267,7 @@ /** * Remove a row's virgin status, show the delete button, and add a new virgin row if needed */ - _touchRow: function(row) { + _touchRow: function (row) { row.removeClass('uf-collection-row-virgin'); row.find('.js-delete-row').show(); @@ -280,11 +284,11 @@ /** * Initialize the select2 dropdown for this collection on a specified control element. */ - _initDropdownField: function(field) { + _initDropdownField: function (field) { var options = this.settings.dropdown; if (!("templateResult" in options)) { - options.templateResult = $.proxy(function(item) { + options.templateResult = $.proxy(function (item) { // Display loading text if the item is marked as "loading" if (item.loading) return item.text; @@ -317,7 +321,7 @@ }); // Handles instantiation and access to non-private methods. - $.fn[pluginName] = function(methodOrOptions) { + $.fn[pluginName] = function (methodOrOptions) { // Grab plugin instance var instance = $(this).data(pluginName); // If undefined or object, initalise plugin. @@ -332,14 +336,14 @@ else if (typeof methodOrOptions === 'string' && typeof instance[methodOrOptions] === 'function') { // Ensure not a private function if (methodOrOptions.indexOf('_') !== 0) { - return instance[methodOrOptions]( Array.prototype.slice.call(arguments, 1)); + return instance[methodOrOptions](Array.prototype.slice.call(arguments, 1)); } else { - console.warn( 'Method ' + methodOrOptions + ' is private!' ); + console.warn('Method ' + methodOrOptions + ' is private!'); } } else { - console.warn( 'Method ' + methodOrOptions + ' does not exist.' ); + console.warn('Method ' + methodOrOptions + ' does not exist.'); } }; })(jQuery, window, document); diff --git a/main/app/sprinkles/core/assets/userfrosting/js/uf-copy.js b/main/app/sprinkles/core/assets/userfrosting/js/uf-copy.js index a47f6b8..58930e5 100644 --- a/main/app/sprinkles/core/assets/userfrosting/js/uf-copy.js +++ b/main/app/sprinkles/core/assets/userfrosting/js/uf-copy.js @@ -10,7 +10,7 @@ $.uf.copy = function (button) { var _this = this; var clipboard = new Clipboard(button, { - text: function(trigger) { + text: function (trigger) { var el = $(trigger).closest('.js-copy-container').find('.js-copy-target'); if (el.is(':input')) { return el.val(); @@ -20,26 +20,26 @@ $.uf.copy = function (button) { } }); - clipboard.on('success', function(e) { + clipboard.on('success', function (e) { setTooltip(e.trigger, 'Copied!'); hideTooltip(e.trigger); }); - clipboard.on('error', function(e) { + clipboard.on('error', function (e) { setTooltip(e.trigger, 'Failed!'); hideTooltip(e.trigger); }); function setTooltip(btn, message) { $(btn) - .attr('data-original-title', message) - .tooltip('show'); + .attr('data-original-title', message) + .tooltip('show'); } - + function hideTooltip(btn) { - setTimeout(function() { + setTimeout(function () { $(btn).tooltip('hide') - .attr('data-original-title', ""); + .attr('data-original-title', ""); }, 1000); } diff --git a/main/app/sprinkles/core/assets/userfrosting/js/uf-form.js b/main/app/sprinkles/core/assets/userfrosting/js/uf-form.js index 15952ab..3724ef7 100644 --- a/main/app/sprinkles/core/assets/userfrosting/js/uf-form.js +++ b/main/app/sprinkles/core/assets/userfrosting/js/uf-form.js @@ -28,32 +28,32 @@ * * UserFrosting https://www.userfrosting.com * @author Alexander Weissman - * + * * @todo Implement proper fallback for when `set` function isn't supported by FormData. */ -;(function($, window, document, undefined) { - 'use strict'; +;(function ($, window, document, undefined) { + 'use strict'; // Define plugin name and defaults. var pluginName = 'ufForm', defaults = { validators: { - 'rules' : {}, + 'rules': {}, 'messages': {} }, - submittingText : "", + submittingText: "", beforeSubmitCallback: null, - binaryCheckboxes : true, // submit checked/unchecked checkboxes as 0/1 values - keyupDelay : 0, + binaryCheckboxes: true, // submit checked/unchecked checkboxes as 0/1 values + keyupDelay: 0, DEBUG: false }; // Constructor - function Plugin (element, options) { + function Plugin(element, options) { this.element = element[0]; this.$element = $(this.element); var lateDefaults = { - encType : (typeof this.$element.attr('enctype') !== 'undefined') ? this.$element.attr('enctype') : '', + encType: (typeof this.$element.attr('enctype') !== 'undefined') ? this.$element.attr('enctype') : '', msgTarget: this.$element.find('.js-form-alerts:first') }; this.settings = $.extend(true, {}, defaults, lateDefaults, options); @@ -70,10 +70,10 @@ // Setup validator this.validator = this.$element.validate({ - rules : this.settings.validators.rules, - messages : this.settings.validators.messages, + rules: this.settings.validators.rules, + messages: this.settings.validators.messages, submitHandler: $.proxy(this._submitHandler, this), - onkeyup : $.proxy(this._onKeyUp, this) + onkeyup: $.proxy(this._onKeyUp, this) }); return this; @@ -84,7 +84,7 @@ /** * Handles the form submission after successful client-side validation. */ - Plugin.prototype._submitHandler = function(form, event) { + Plugin.prototype._submitHandler = function (form, event) { // Execute any "before submit" callback if (this.settings.beforeSubmitCallback) { this.settings.beforeSubmitCallback(); @@ -104,7 +104,7 @@ var reqParams = { converters: { // Override jQuery's strict JSON parsing - 'text json': function(result) { + 'text json': function (result) { try { // First try to use native browser parsing if (typeof JSON === 'object' && typeof JSON.parse === 'function') { @@ -113,9 +113,9 @@ return $.parseJSON(result); } } catch (e) { - // statements to handle any exceptions - console.warn('Could not parse expected JSON response.'); - return {}; + // statements to handle any exceptions + console.warn('Could not parse expected JSON response.'); + return {}; } } }, @@ -139,10 +139,10 @@ // Submit the form via AJAX $.ajax(reqParams).then( // Submission successful - $.proxy(function(data, textStatus, jqXHR) { + $.proxy(function (data, textStatus, jqXHR) { // Restore button text and re-enable submit button if (submitButton) { - submitButton.prop('disabled', false ); + submitButton.prop('disabled', false); submitButton.html(submitButtonText); } @@ -150,10 +150,10 @@ return jqXHR; }, this), // Submission failed - $.proxy(function(jqXHR, textStatus, errorThrown) { + $.proxy(function (jqXHR, textStatus, errorThrown) { // Restore button text and re-enable submit button if (submitButton) { - submitButton.prop('disabled', false ); + submitButton.prop('disabled', false); submitButton.html(submitButtonText); } // Error messages @@ -163,7 +163,7 @@ document.close(); } else { if (this.settings.DEBUG) { - console.log('Error (' + jqXHR.status + '): ' + jqXHR.responseText ); + console.log('Error (' + jqXHR.status + '): ' + jqXHR.responseText); } // Display errors on failure // TODO: ufAlerts widget should have a 'destroy' method @@ -186,13 +186,13 @@ /** * Helper function for encoding data as urlencoded */ - Plugin.prototype._urlencodeData = function(form) { + Plugin.prototype._urlencodeData = function (form) { // Serialize and post to the backend script in ajax mode var serializedData; if (this.settings.binaryCheckboxes) { serializedData = form.find(':input').not(':checkbox').serialize(); // Get unchecked checkbox values, set them to 0 - form.find('input[type=checkbox]:enabled').each(function() { + form.find('input[type=checkbox]:enabled').each(function () { if ($(this).is(':checked')) { serializedData += '&' + encodeURIComponent(this.name) + '=1'; } else { @@ -210,7 +210,7 @@ /** * Helper function for encoding data as multipart/form-data */ - Plugin.prototype._multipartData = function(form) { + Plugin.prototype._multipartData = function (form) { // Use FormData to wrap form contents. // https://developer.mozilla.org/en/docs/Web/API/FormData var formData = new FormData(form[0]); @@ -222,7 +222,7 @@ if (typeof formData.set !== 'function') { this.settings.msgTarget.ufAlerts('push', 'danger', "Your browser is missing a required feature. This form will still attempt to submit, but if it fails, you'll need to use Chrome for desktop or FireFox for desktop."); } else { - checkboxes.each(function() { + checkboxes.each(function () { if ($(this).is(':checked')) { // this replaces checkbox value with 1 (as we're using binaryCheckboxes). formData.set(this.name, 1); @@ -237,10 +237,10 @@ return formData; }; - Plugin.prototype._onKeyUp = function(element, event) { + Plugin.prototype._onKeyUp = function (element, event) { var validator = this.validator; // See http://stackoverflow.com/questions/41363409/jquery-validate-add-delay-to-keyup-validation - setTimeout(function() { + setTimeout(function () { // Avoid revalidate the field when pressing one of the following keys // Shift => 16 // Ctrl => 17 @@ -260,16 +260,16 @@ 38, 39, 40, 45, 144, 225 ]; - if ( event.which === 9 && validator.elementValue( element ) === '' || $.inArray( event.keyCode, excludedKeys ) !== -1 ) { + if (event.which === 9 && validator.elementValue(element) === '' || $.inArray(event.keyCode, excludedKeys) !== -1) { return; - } else if ( element.name in validator.submitted || element.name in validator.invalid ) { - validator.element( element ); + } else if (element.name in validator.submitted || element.name in validator.invalid) { + validator.element(element); } }, this.settings.keyupDelay); }; // Handles instantiation and access to non-private methods. - $.fn[pluginName] = function(methodOrOptions) { + $.fn[pluginName] = function (methodOrOptions) { // Grab plugin instance var instance = $(this).data(pluginName); // If undefined or object, initalise plugin. @@ -284,14 +284,14 @@ else if (typeof methodOrOptions === 'string' && typeof instance[methodOrOptions] === 'function') { // Ensure not a private function if (methodOrOptions.indexOf('_') !== 0) { - return instance[methodOrOptions]( Array.prototype.slice.call(arguments, 1)); + return instance[methodOrOptions](Array.prototype.slice.call(arguments, 1)); } else { - console.warn( 'Method ' + methodOrOptions + ' is private!' ); + console.warn('Method ' + methodOrOptions + ' is private!'); } } else { - console.warn( 'Method ' + methodOrOptions + ' does not exist.' ); + console.warn('Method ' + methodOrOptions + ' does not exist.'); } }; })(jQuery, window, document); diff --git a/main/app/sprinkles/core/assets/userfrosting/js/uf-init.js b/main/app/sprinkles/core/assets/userfrosting/js/uf-init.js index 2d447dd..3e5e574 100644 --- a/main/app/sprinkles/core/assets/userfrosting/js/uf-init.js +++ b/main/app/sprinkles/core/assets/userfrosting/js/uf-init.js @@ -1,12 +1,13 @@ /** * Contains code that should be initialized in all UF pages. */ - -$(document).ready(function() { - + +$(document).ready(function () { + // Override Bootstrap's tendency to steal focus from child elements in modals (such as select2). // See https://github.com/select2/select2/issues/1436#issuecomment-21028474 - $.fn.modal.Constructor.prototype.enforceFocus = function() {}; + $.fn.modal.Constructor.prototype.enforceFocus = function () { + }; // Link all copy buttons $.uf.copy('.js-copy-trigger'); diff --git a/main/app/sprinkles/core/assets/userfrosting/js/uf-jqueryvalidation-config.js b/main/app/sprinkles/core/assets/userfrosting/js/uf-jqueryvalidation-config.js index 3969ad6..26b5f7a 100644 --- a/main/app/sprinkles/core/assets/userfrosting/js/uf-jqueryvalidation-config.js +++ b/main/app/sprinkles/core/assets/userfrosting/js/uf-jqueryvalidation-config.js @@ -2,7 +2,7 @@ * Set jQuery.validate settings for bootstrap integration */ jQuery.validator.setDefaults({ - highlight: function(element) { + highlight: function (element) { var formGroup = jQuery(element).closest('.form-group'); formGroup.addClass('has-error has-feedback'); formGroup.removeClass('has-success'); @@ -12,7 +12,7 @@ jQuery.validator.setDefaults({ // Hide any help block text formGroup.find('.help-block').hide(); }, - unhighlight: function(element) { + unhighlight: function (element) { var formGroup = jQuery(element).closest('.form-group'); formGroup.removeClass('has-error'); @@ -30,14 +30,14 @@ jQuery.validator.setDefaults({ }, errorElement: 'p', errorClass: 'error-block', - errorPlacement: function(error, element) { - if(element.parent('.input-group').length) { + errorPlacement: function (error, element) { + if (element.parent('.input-group').length) { error.insertAfter(element.parent()); } else { error.insertAfter(element); } }, - success: function(element) { + success: function (element) { var formGroup = jQuery(element).closest('.form-group'); formGroup.addClass('has-success has-feedback'); formGroup.find('.form-control-feedback').remove(); diff --git a/main/app/sprinkles/core/assets/userfrosting/js/uf-modal.js b/main/app/sprinkles/core/assets/userfrosting/js/uf-modal.js index b84a59a..588c40b 100644 --- a/main/app/sprinkles/core/assets/userfrosting/js/uf-modal.js +++ b/main/app/sprinkles/core/assets/userfrosting/js/uf-modal.js @@ -5,8 +5,7 @@ * UserFrosting https://www.userfrosting.com * @author Alexander Weissman https://alexanderweissman.com */ -(function( $ ) -{ +(function ($) { /** * The plugin namespace, ie for $('.selector').ufModal(options) * @@ -14,18 +13,17 @@ */ var PLUGIN_NS = 'ufModal'; - var Plugin = function ( target, options ) - { + var Plugin = function (target, options) { this.$T = $(target); /** #### OPTIONS #### */ - this.options= $.extend( + this.options = $.extend( true, // deep extend { - sourceUrl : "", + sourceUrl: "", ajaxParams: {}, - msgTarget : null, + msgTarget: null, DEBUG: false }, options @@ -33,14 +31,13 @@ this.modal = null; - this._init( target ); + this._init(target); return this; }; /** #### INITIALISER #### */ - Plugin.prototype._init = function ( target ) - { + Plugin.prototype._init = function (target) { var base = this; var $el = $(target); @@ -51,58 +48,58 @@ // Fetch and render the form $.ajax({ - type: "GET", - url: base.options.sourceUrl, - data: base.options.ajaxParams, - cache: false + type: "GET", + url: base.options.sourceUrl, + data: base.options.ajaxParams, + cache: false }) - .then( - // Fetch successful - function (data) { - // Append the form as a modal dialog to the body - base.modal = $(data); - $el.append(base.modal); - - base.modal.modal('show'); - - // Bind modal to be deleted when closed - base.modal.on("hidden.bs.modal", function () { - base.destroy(); - }); + .then( + // Fetch successful + function (data) { + // Append the form as a modal dialog to the body + base.modal = $(data); + $el.append(base.modal); + + base.modal.modal('show'); + + // Bind modal to be deleted when closed + base.modal.on("hidden.bs.modal", function () { + base.destroy(); + }); - base.$T.trigger('renderSuccess.ufModal'); - return data; - }, - // Fetch failed - function (data) { - // Error messages - if ((typeof site !== "undefined") && site.debug.ajax && data.responseText) { - base.$T.trigger('renderError.ufModal'); - document.write(data.responseText); - document.close(); - } else { - if (base.options.DEBUG) { - console.log("Error (" + data.status + "): " + data.responseText ); - } - // Display errors on failure - // TODO: ufAlerts widget should have a 'destroy' method - if (!base.options.msgTarget.data('ufAlerts')) { - base.options.msgTarget.ufAlerts(); + base.$T.trigger('renderSuccess.ufModal'); + return data; + }, + // Fetch failed + function (data) { + // Error messages + if ((typeof site !== "undefined") && site.debug.ajax && data.responseText) { + base.$T.trigger('renderError.ufModal'); + document.write(data.responseText); + document.close(); } else { - base.options.msgTarget.ufAlerts('clear'); + if (base.options.DEBUG) { + console.log("Error (" + data.status + "): " + data.responseText); + } + // Display errors on failure + // TODO: ufAlerts widget should have a 'destroy' method + if (!base.options.msgTarget.data('ufAlerts')) { + base.options.msgTarget.ufAlerts(); + } else { + base.options.msgTarget.ufAlerts('clear'); + } + + base.options.msgTarget.ufAlerts('fetch').ufAlerts('render'); + base.options.msgTarget.on("render.ufAlerts", function () { + base.$T.trigger('renderError.ufModal'); + }); } - base.options.msgTarget.ufAlerts('fetch').ufAlerts('render'); - base.options.msgTarget.on("render.ufAlerts", function () { - base.$T.trigger('renderError.ufModal'); - }); - } - - base.destroy(); + base.destroy(); - return data; - } - ); + return data; + } + ); }; Plugin.prototype.destroy = function () { @@ -127,26 +124,24 @@ Plugin.prototype.getModal = function () { return this.modal; }; - + /** * EZ Logging/Warning (technically private but saving an '_' is worth it imo) */ - Plugin.prototype.DLOG = function () - { + Plugin.prototype.DLOG = function () { if (!this.DEBUG) return; for (var i in arguments) { - console.log( PLUGIN_NS + ': ', arguments[i] ); + console.log(PLUGIN_NS + ': ', arguments[i]); } } - Plugin.prototype.DWARN = function () - { - this.DEBUG && console.warn( arguments ); + Plugin.prototype.DWARN = function () { + this.DEBUG && console.warn(arguments); } -/*################################################################################### - * JQUERY HOOK - ###################################################################################*/ + /*################################################################################### + * JQUERY HOOK + ###################################################################################*/ /** * Generic jQuery plugin instantiation method call logic @@ -155,38 +150,37 @@ * Notice, myActionMethod mustn't start with an underscore (_) as this is used to * indicate private methods on the PLUGIN class. */ - $.fn[ PLUGIN_NS ] = function( methodOrOptions ) - { + $.fn[PLUGIN_NS] = function (methodOrOptions) { if (!$(this).length) { return $(this); } var instance = $(this).data(PLUGIN_NS); // CASE: action method (public method on PLUGIN class) - if ( instance - && methodOrOptions.indexOf('_') != 0 - && instance[ methodOrOptions ] - && typeof( instance[ methodOrOptions ] ) == 'function' ) { + if (instance + && methodOrOptions.indexOf('_') != 0 + && instance[methodOrOptions] + && typeof(instance[methodOrOptions]) == 'function') { - return instance[ methodOrOptions ]( Array.prototype.slice.call( arguments, 1 ) ); + return instance[methodOrOptions](Array.prototype.slice.call(arguments, 1)); - // CASE: argument is options object or empty = initialise - } else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) { + // CASE: argument is options object or empty = initialise + } else if (typeof methodOrOptions === 'object' || !methodOrOptions) { - instance = new Plugin( $(this), methodOrOptions ); // ok to overwrite if this is a re-init - $(this).data( PLUGIN_NS, instance ); + instance = new Plugin($(this), methodOrOptions); // ok to overwrite if this is a re-init + $(this).data(PLUGIN_NS, instance); return $(this); - // CASE: method called before init - } else if ( !instance ) { - console.warn( 'Plugin must be initialised before using method: ' + methodOrOptions ); + // CASE: method called before init + } else if (!instance) { + console.warn('Plugin must be initialised before using method: ' + methodOrOptions); - // CASE: invalid method - } else if ( methodOrOptions.indexOf('_') == 0 ) { - console.warn( 'Method ' + methodOrOptions + ' is private!' ); + // CASE: invalid method + } else if (methodOrOptions.indexOf('_') == 0) { + console.warn('Method ' + methodOrOptions + ' is private!'); } else { - console.warn( 'Method ' + methodOrOptions + ' does not exist.' ); + console.warn('Method ' + methodOrOptions + ' does not exist.'); } }; })(jQuery); \ No newline at end of file diff --git a/main/app/sprinkles/core/assets/userfrosting/js/uf-table.js b/main/app/sprinkles/core/assets/userfrosting/js/uf-table.js index 77aa30a..692dccc 100644 --- a/main/app/sprinkles/core/assets/userfrosting/js/uf-table.js +++ b/main/app/sprinkles/core/assets/userfrosting/js/uf-table.js @@ -12,59 +12,59 @@ * - Your table should have a unique id, and your paging controls should be wrapped in an element with the `.js-uf-table-pager` class. * - Create a button with the `.js-uf-table-download` class, and it will be automatically bound to trigger an AJAX request for downloading the table (CSV, etc). * -
- - - - - - - - - -
User Last Activity
- - - - - -
- - - - - -

- Jump to Page: • Show: - -
- - -
+
+ + + + + + + + + +
User Last Activity
+ + + + + +
+ + + + + +

+ Jump to Page: • Show: + +
+ + +
* * Initialize ufTable on your container object: * @@ -89,36 +89,38 @@ * UserFrosting https://www.userfrosting.com * @author Alexander Weissman */ -;(function($, window, document, undefined) { +;(function ($, window, document, undefined) { 'use strict'; // Define plugin name and defaults. var pluginName = 'ufTable', defaults = { - DEBUG : false, - site : site, // global site variables - dataUrl : '', - msgTarget : $('#alerts-page'), - addParams : {}, - filterAllField : '_all', - useLoadingTransition : true, - rowTemplate : null, - columnTemplates : {}, - tablesorter : { + DEBUG: false, + site: site, // global site variables + dataUrl: '', + msgTarget: $('#alerts-page'), + addParams: {}, + filterAllField: '_all', + useLoadingTransition: true, + rowTemplate: null, + columnTemplates: {}, + tablesorter: { debug: false, - theme : 'bootstrap', + theme: 'bootstrap', widthFixed: true, // Set up pagination of data via an AJAX source // See http://jsfiddle.net/Mottie/uwZc2/ // Also see https://mottie.github.io/tablesorter/docs/example-pager-ajax.html widgets: ['saveSort', 'sort2Hash', 'filter', 'pager', 'columnSelector', 'reflow2'], - widgetOptions : { - columnSelector_layout : '', + widgetOptions: { + columnSelector_layout: '', filter_cssFilter: 'form-control', - filter_saveFilters : true, - filter_serversideFiltering : true, - filter_selectSource : { - '.filter-select' : function() { return null; } + filter_saveFilters: true, + filter_serversideFiltering: true, + filter_selectSource: { + '.filter-select': function () { + return null; + } }, // apply disabled classname to the pager arrows when the rows at either extreme is visible @@ -143,8 +145,8 @@ // target the pager markup - see the HTML block below pager_css: { - errorRow : 'uf-table-error-row', // error information row - disabled : 'disabled' // Note there is no period "." in front of this class name + errorRow: 'uf-table-error-row', // error information row + disabled: 'disabled' // Note there is no period "." in front of this class name }, // Must be initialized with a 'data' key @@ -154,23 +156,23 @@ }, // hash prefix - sort2Hash_hash : '#', + sort2Hash_hash: '#', // don't '#' or '=' here - sort2Hash_separator : '|', + sort2Hash_separator: '|', // this option > table ID > table index on page - sort2Hash_tableId : null, + sort2Hash_tableId: null, // if true, show header cell text instead of a zero-based column index - sort2Hash_headerTextAttr : 'data-column-name', + sort2Hash_headerTextAttr: 'data-column-name', // direction text shown in the URL e.g. [ 'asc', 'desc' ] - sort2Hash_directionText : [ 'asc', 'desc' ], // default values + sort2Hash_directionText: ['asc', 'desc'], // default values // if true, override saveSort widget sort, if used & stored sort is available - sort2Hash_overrideSaveSort : true, // default = false + sort2Hash_overrideSaveSort: true, // default = false } } }; // Constructor - function Plugin (element, options) { + function Plugin(element, options) { this.element = element[0]; this.$element = $(this.element); @@ -189,19 +191,19 @@ tableElement: this.$element.find('.tablesorter'), tablesorter: { widgetOptions: { - columnSelector_container : this.$element.find('.js-uf-table-cs-options'), - filter_external : this.$element.find('.js-uf-table-search input'), + columnSelector_container: this.$element.find('.js-uf-table-cs-options'), + filter_external: this.$element.find('.js-uf-table-search input'), // Pager selectors pager_selectors: { - container : this.$element.find('.js-uf-table-pager'), - first : '.first', // go to first page arrow - prev : '.prev', // previous page arrow - next : '.next', // next page arrow - last : '.last', // go to last page arrow - gotoPage : '.gotoPage', // go to page selector - select dropdown that sets the current page - pageDisplay : '.pagedisplay', // location of where the "output" is displayed - pageSize : '.pagesize' // page size selector - select dropdown that sets the "size" option + container: this.$element.find('.js-uf-table-pager'), + first: '.first', // go to first page arrow + prev: '.prev', // previous page arrow + next: '.next', // next page arrow + last: '.last', // go to last page arrow + gotoPage: '.gotoPage', // go to page selector - select dropdown that sets the current page + pageDisplay: '.pagedisplay', // location of where the "output" is displayed + pageSize: '.pagesize' // page size selector - select dropdown that sets the "size" option }, // We need to use $.proxy to properly bind the context for callbacks that will be called by Tablesorter @@ -233,16 +235,16 @@ var dataAttributeDefaults = { info: { messageEmptyRows: infoContainer.data('message-empty-rows') ? - infoContainer.data('message-empty-rows') : - "Sorry, we've got nothing here." + infoContainer.data('message-empty-rows') : + "Sorry, we've got nothing here." }, tablesorter: { widgetOptions: { // possible variables: {size}, {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows} // also {page:input} & {startRow:input} will add a modifiable input in place of the value pager_output: pagerContainer.data('output-template') ? - pagerContainer.data('output-template') : - '{startRow} to {endRow} of {filteredRows} ({totalRows})' // default if not set on data-* attribute + pagerContainer.data('output-template') : + '{startRow} to {endRow} of {filteredRows} ({totalRows})' // default if not set on data-* attribute } } }; @@ -264,9 +266,9 @@ // Set up 'loading' overlays if (this.settings.useLoadingTransition) { var overlay = this.settings.overlay.container; - tableElement.bind('sortStart filterStart pageMoved', function() { + tableElement.bind('sortStart filterStart pageMoved', function () { overlay.removeClass('hidden'); - }).bind('pagerComplete updateComplete', function() { + }).bind('pagerComplete updateComplete', function () { overlay.addClass('hidden'); }); } @@ -320,7 +322,7 @@ this.settings.download.button.on('click', this.settings.download.callback); // Allow clicking on the labels in the table menu without closing the menu - $(this.settings.tablesorter.widgetOptions.columnSelector_container).find('label').on('click', function(e) { + $(this.settings.tablesorter.widgetOptions.columnSelector_container).find('label').on('click', function (e) { e.stopPropagation(); }); @@ -345,7 +347,7 @@ /** * Get state variables for this table, as required by the AJAX data source: sorts, filters, size, page */ - Plugin.prototype.getTableStateVars = function(table) { + Plugin.prototype.getTableStateVars = function (table) { var base = this; // Get sort column and order @@ -394,7 +396,7 @@ /** * Get saved filters from the browser local storage. Those should always be up to date */ - Plugin.prototype.getSavedFilters = function(table) { + Plugin.prototype.getSavedFilters = function (table) { // Fallback to `getFilters` or empty in case of failure var filterList = $.tablesorter.getFilters(table) || []; @@ -402,12 +404,12 @@ // Overwrite list with saved filter for filter-select not setup by ts var isArray, saved, wo = table.config.widgetOptions; - if ( wo.filter_saveFilters && $.tablesorter.storage ) { - saved = $.tablesorter.storage( table, 'tablesorter-filters' ) || []; - isArray = $.isArray( saved ); + if (wo.filter_saveFilters && $.tablesorter.storage) { + saved = $.tablesorter.storage(table, 'tablesorter-filters') || []; + isArray = $.isArray(saved); // make sure we're not just getting an empty array - if ( !( isArray && saved.join( '' ) === '' || !isArray ) ) { - filterList = $.tablesorter.filter.processFilters( saved ); + if (!(isArray && saved.join('') === '' || !isArray)) { + filterList = $.tablesorter.filter.processFilters(saved); } } @@ -419,7 +421,7 @@ * Used as the default callback for pager_customAjaxUrl * @private */ - Plugin.prototype._generateUrl = function(table, url) { + Plugin.prototype._generateUrl = function (table, url) { var tableState = this.getTableStateVars(table); if (this.settings.DEBUG) { @@ -438,7 +440,7 @@ * Used as the default callback for pager_ajaxProcessing * @private */ - Plugin.prototype._processAjax = function(data) { + Plugin.prototype._processAjax = function (data) { var ts = this.ts[0]; var json = {}, rows = ''; @@ -450,8 +452,8 @@ for (var row = 0; row < size; row++) { var cellData = { rownum: row, - row : data.rows[row], // It is safe to use the data from the API because Handlebars escapes HTML - site : this.settings.site + row: data.rows[row], // It is safe to use the data from the API because Handlebars escapes HTML + site: this.settings.site }; rows += this.rowTemplate(cellData); @@ -484,7 +486,7 @@ * Initialize filter select menus using the ajax `listable` values * @private */ - Plugin.prototype._ajaxInitFilterSelects = function(columns, listable) { + Plugin.prototype._ajaxInitFilterSelects = function (columns, listable) { var ts = this.ts[0]; var filters = this.getSavedFilters(ts); // Find columns with `.filter-select` and match them to column numbers based on their data-column-name @@ -527,7 +529,7 @@ * Handle pager ajax errors. * @private */ - Plugin.prototype._pagerAjaxError = function(c, jqXHR, settings, exception) { + Plugin.prototype._pagerAjaxError = function (c, jqXHR, settings, exception) { this._ajaxError(jqXHR); // Let TS handle the in-table error message @@ -538,7 +540,7 @@ * Handle ajax error * @private */ - Plugin.prototype._ajaxError = function(jqXHR) { + Plugin.prototype._ajaxError = function (jqXHR) { if (typeof jqXHR === 'object') { // Error messages if (this._debugAjax && jqXHR.responseText) { @@ -546,7 +548,7 @@ document.close(); } else { if (this.settings.DEBUG) { - console.log('Error (' + jqXHR.status + '): ' + jqXHR.responseText ); + console.log('Error (' + jqXHR.status + '): ' + jqXHR.responseText); } // Display errors on failure // TODO: ufAlerts widget should have a 'destroy' method @@ -583,9 +585,9 @@ * Default callback for sort2Hash_encodeHash * @private */ - Plugin.prototype._encodeHash = function(config, tableId, component, value, rawValue) { + Plugin.prototype._encodeHash = function (config, tableId, component, value, rawValue) { var wo = config.widgetOptions; - if ( component === 'filter' ) { + if (component === 'filter') { // rawValue is an array of filter values, numerically indexed var encodedFilters = ''; var len = rawValue.length; @@ -599,7 +601,7 @@ } } return encodedFilters; - } else if ( component === 'sort' ) { + } else if (component === 'sort') { // rawValue is an array of sort pairs [columnNum, sortDirection] var encodedFilters = ''; var len = rawValue.length; @@ -619,7 +621,7 @@ * Default callback for sort2Hash_decodeHash * @private */ - Plugin.prototype._decodeHash = function(config, tableId, component) { + Plugin.prototype._decodeHash = function (config, tableId, component) { var wo = config.widgetOptions; var result; // Convert hash into JSON object @@ -657,7 +659,7 @@ * Default callback for sort2Hash_cleanHash * @private */ - Plugin.prototype._cleanHash = function(config, tableId, component, hash) { + Plugin.prototype._cleanHash = function (config, tableId, component, hash) { var wo = config.widgetOptions; // Convert hash to JSON object var urlObject = $.String.deparam(hash); @@ -678,7 +680,7 @@ }; // Handles instantiation and access to non-private methods. - $.fn[pluginName] = function(methodOrOptions) { + $.fn[pluginName] = function (methodOrOptions) { // Grab plugin instance var instance = $(this).data(pluginName); // If undefined or object, initalise plugin. @@ -688,17 +690,17 @@ $(this).data(pluginName, new Plugin(this, methodOrOptions)); } return this; - // Otherwise ensure first parameter is a valid string, and is the name of an actual function. + // Otherwise ensure first parameter is a valid string, and is the name of an actual function. } else if (typeof methodOrOptions === 'string' && typeof instance[methodOrOptions] === 'function') { // Ensure not a private function if (methodOrOptions.indexOf('_') !== 0) { - return instance[methodOrOptions]( Array.prototype.slice.call(arguments, 1)); + return instance[methodOrOptions](Array.prototype.slice.call(arguments, 1)); } else { - console.warn( 'Method ' + methodOrOptions + ' is private!' ); + console.warn('Method ' + methodOrOptions + ' is private!'); } } else { - console.warn( 'Method ' + methodOrOptions + ' does not exist.' ); + console.warn('Method ' + methodOrOptions + ' does not exist.'); } }; })(jQuery, window, document); diff --git a/main/app/sprinkles/core/assets/userfrosting/js/uf-tablesorter-parsers.js b/main/app/sprinkles/core/assets/userfrosting/js/uf-tablesorter-parsers.js index 0d83c10..02901c5 100644 --- a/main/app/sprinkles/core/assets/userfrosting/js/uf-tablesorter-parsers.js +++ b/main/app/sprinkles/core/assets/userfrosting/js/uf-tablesorter-parsers.js @@ -3,14 +3,14 @@ $.tablesorter.addParser({ // set a unique id id: 'metanum', - is: function(s) { - // return false so this parser is not auto detected - return false; + is: function (s) { + // return false so this parser is not auto detected + return false; }, - format: function(s, table, cell, cellIndex) { - var $cell = $(cell); - // returns metadata, or cell text (s) if it doesn't exist - return $cell.attr('data-num') || s; + format: function (s, table, cell, cellIndex) { + var $cell = $(cell); + // returns metadata, or cell text (s) if it doesn't exist + return $cell.attr('data-num') || s; }, // set type to numeric @@ -20,14 +20,14 @@ $.tablesorter.addParser({ $.tablesorter.addParser({ // set a unique id id: 'metatext', - is: function(s) { - // return false so this parser is not auto detected - return false; + is: function (s) { + // return false so this parser is not auto detected + return false; }, - format: function(s, table, cell, cellIndex) { - var $cell = $(cell); - // returns metadata, or cell text (s) if it doesn't exist - return $cell.attr('data-text') || s; + format: function (s, table, cell, cellIndex) { + var $cell = $(cell); + // returns metadata, or cell text (s) if it doesn't exist + return $cell.attr('data-text') || s; }, @@ -37,15 +37,15 @@ $.tablesorter.addParser({ $.tablesorter.addParser({ // set a unique id id: 'isblank', - is: function(s) { - // return false so this parser is not auto detected - return false; + is: function (s) { + // return false so this parser is not auto detected + return false; }, - format: function(s, table, cell, cellIndex) { - var $cell = $(cell); - // returns 1 if blank (whitespace), 0 otherwise - var isBlank = $cell.html().trim() == " " ? 1 : 0; - return isBlank; + format: function (s, table, cell, cellIndex) { + var $cell = $(cell); + // returns 1 if blank (whitespace), 0 otherwise + var isBlank = $cell.html().trim() == " " ? 1 : 0; + return isBlank; }, -- cgit v1.2.3