From 29e3302484ba0b7be964cb6f9c4c628c669c32af Mon Sep 17 00:00:00 2001 From: SASSU Thomas <thomas.sassu5@etu.univ-lorraine.fr> Date: Tue, 3 Mar 2020 19:54:18 +0100 Subject: [PATCH] hierarchie --- .gitignore | 2 +- README.md => GamePedia/README.md | 0 composer.json => GamePedia/composer.json | 0 composer.lock => GamePedia/composer.lock | 0 {css => GamePedia/css}/style.css | 0 index.php => GamePedia/index.php | 0 {php => GamePedia/php}/script_TD1.php | 0 .../src}/controleurs/ControleurPrincipal.php | 0 .../src}/controleurs/ControleurScript.php | 0 {src => GamePedia/src}/modeles/Character.php | 0 {src => GamePedia/src}/modeles/Client.php | 0 {src => GamePedia/src}/modeles/Company.php | 0 {src => GamePedia/src}/modeles/Contient.php | 0 {src => GamePedia/src}/modeles/Game.php | 0 {src => GamePedia/src}/modeles/Genre.php | 0 {src => GamePedia/src}/modeles/Platform.php | 0 {src => GamePedia/src}/modeles/Theme.php | 0 {src => GamePedia/src}/vues/VuePrincipale.php | 0 vendor/autoload.php | 7 - vendor/bin/upgrade-carbon | 17 - vendor/bin/upgrade-carbon.bat | 4 - vendor/composer/ClassLoader.php | 445 -- vendor/composer/LICENSE | 21 - vendor/composer/autoload_classmap.php | 9 - vendor/composer/autoload_files.php | 11 - vendor/composer/autoload_namespaces.php | 11 - vendor/composer/autoload_psr4.php | 22 - vendor/composer/autoload_real.php | 70 - vendor/composer/autoload_static.php | 126 - vendor/composer/installed.json | 787 --- vendor/doctrine/inflector/LICENSE | 19 - vendor/doctrine/inflector/README.md | 6 - vendor/doctrine/inflector/composer.json | 32 - .../Doctrine/Common/Inflector/Inflector.php | 492 -- vendor/illuminate/container/BoundMethod.php | 172 - vendor/illuminate/container/Container.php | 1245 ---- .../container/ContextualBindingBuilder.php | 68 - .../container/EntryNotFoundException.php | 11 - vendor/illuminate/container/composer.json | 35 - .../contracts/Auth/Access/Authorizable.php | 15 - .../illuminate/contracts/Auth/Access/Gate.php | 120 - .../contracts/Auth/Authenticatable.php | 49 - .../contracts/Auth/CanResetPassword.php | 21 - vendor/illuminate/contracts/Auth/Factory.php | 22 - vendor/illuminate/contracts/Auth/Guard.php | 50 - .../contracts/Auth/PasswordBroker.php | 76 - .../contracts/Auth/PasswordBrokerFactory.php | 14 - .../contracts/Auth/StatefulGuard.php | 63 - .../contracts/Auth/SupportsBasicAuth.php | 24 - .../contracts/Auth/UserProvider.php | 49 - .../contracts/Broadcasting/Broadcaster.php | 33 - .../contracts/Broadcasting/Factory.php | 14 - .../Broadcasting/ShouldBroadcast.php | 15 - .../Broadcasting/ShouldBroadcastNow.php | 8 - .../illuminate/contracts/Bus/Dispatcher.php | 31 - .../contracts/Bus/QueueingDispatcher.php | 14 - vendor/illuminate/contracts/Cache/Factory.php | 14 - vendor/illuminate/contracts/Cache/Lock.php | 30 - .../contracts/Cache/LockProvider.php | 15 - .../contracts/Cache/LockTimeoutException.php | 10 - .../illuminate/contracts/Cache/Repository.php | 125 - vendor/illuminate/contracts/Cache/Store.php | 92 - .../contracts/Config/Repository.php | 57 - .../contracts/Console/Application.php | 22 - .../illuminate/contracts/Console/Kernel.php | 47 - .../Container/BindingResolutionException.php | 11 - .../contracts/Container/Container.php | 153 - .../Container/ContextualBindingBuilder.php | 22 - .../illuminate/contracts/Cookie/Factory.php | 43 - .../contracts/Cookie/QueueingFactory.php | 28 - .../contracts/Database/ModelIdentifier.php | 44 - .../contracts/Debug/ExceptionHandler.php | 34 - .../contracts/Encryption/DecryptException.php | 10 - .../contracts/Encryption/EncryptException.php | 10 - .../contracts/Encryption/Encrypter.php | 24 - .../contracts/Events/Dispatcher.php | 82 - .../illuminate/contracts/Filesystem/Cloud.php | 14 - .../contracts/Filesystem/Factory.php | 14 - .../Filesystem/FileNotFoundException.php | 10 - .../contracts/Filesystem/Filesystem.php | 175 - .../contracts/Foundation/Application.php | 106 - .../illuminate/contracts/Hashing/Hasher.php | 34 - vendor/illuminate/contracts/Http/Kernel.php | 37 - vendor/illuminate/contracts/Logging/Log.php | 98 - .../illuminate/contracts/Mail/MailQueue.php | 25 - vendor/illuminate/contracts/Mail/Mailable.php | 33 - vendor/illuminate/contracts/Mail/Mailer.php | 48 - .../contracts/Notifications/Dispatcher.php | 24 - .../contracts/Notifications/Factory.php | 32 - .../Pagination/LengthAwarePaginator.php | 29 - .../contracts/Pagination/Paginator.php | 117 - vendor/illuminate/contracts/Pipeline/Hub.php | 15 - .../contracts/Pipeline/Pipeline.php | 40 - .../Queue/EntityNotFoundException.php | 22 - .../contracts/Queue/EntityResolver.php | 15 - vendor/illuminate/contracts/Queue/Factory.php | 14 - vendor/illuminate/contracts/Queue/Job.php | 115 - vendor/illuminate/contracts/Queue/Monitor.php | 30 - vendor/illuminate/contracts/Queue/Queue.php | 99 - .../contracts/Queue/QueueableCollection.php | 27 - .../contracts/Queue/QueueableEntity.php | 20 - .../contracts/Queue/ShouldQueue.php | 8 - vendor/illuminate/contracts/Redis/Factory.php | 14 - .../Redis/LimiterTimeoutException.php | 10 - .../contracts/Routing/BindingRegistrar.php | 23 - .../contracts/Routing/Registrar.php | 105 - .../contracts/Routing/ResponseFactory.php | 126 - .../contracts/Routing/UrlGenerator.php | 71 - .../contracts/Routing/UrlRoutable.php | 28 - .../illuminate/contracts/Session/Session.php | 165 - .../contracts/Support/Arrayable.php | 13 - .../illuminate/contracts/Support/Htmlable.php | 13 - .../illuminate/contracts/Support/Jsonable.php | 14 - .../contracts/Support/MessageBag.php | 107 - .../contracts/Support/MessageProvider.php | 13 - .../contracts/Support/Renderable.php | 13 - .../contracts/Support/Responsable.php | 14 - .../contracts/Translation/Loader.php | 40 - .../contracts/Translation/Translator.php | 42 - .../contracts/Validation/Factory.php | 46 - .../contracts/Validation/ImplicitRule.php | 8 - .../illuminate/contracts/Validation/Rule.php | 22 - .../Validation/ValidatesWhenResolved.php | 13 - .../contracts/Validation/Validator.php | 47 - vendor/illuminate/contracts/View/Engine.php | 15 - vendor/illuminate/contracts/View/Factory.php | 79 - vendor/illuminate/contracts/View/View.php | 24 - vendor/illuminate/contracts/composer.json | 35 - .../illuminate/database/Capsule/Manager.php | 201 - .../database/Concerns/BuildsQueries.php | 161 - .../database/Concerns/ManagesTransactions.php | 219 - vendor/illuminate/database/Connection.php | 1238 ---- .../database/ConnectionInterface.php | 150 - .../database/ConnectionResolver.php | 92 - .../database/ConnectionResolverInterface.php | 29 - .../database/Connectors/ConnectionFactory.php | 288 - .../database/Connectors/Connector.php | 136 - .../Connectors/ConnectorInterface.php | 14 - .../database/Connectors/MySqlConnector.php | 186 - .../database/Connectors/PostgresConnector.php | 174 - .../database/Connectors/SQLiteConnector.php | 39 - .../Connectors/SqlServerConnector.php | 183 - .../Console/Factories/FactoryMakeCommand.php | 84 - .../Console/Factories/stubs/factory.stub | 9 - .../Console/Migrations/BaseCommand.php | 39 - .../Console/Migrations/FreshCommand.php | 112 - .../Console/Migrations/InstallCommand.php | 70 - .../Console/Migrations/MigrateCommand.php | 102 - .../Console/Migrations/MigrateMakeCommand.php | 131 - .../Console/Migrations/RefreshCommand.php | 154 - .../Console/Migrations/ResetCommand.php | 96 - .../Console/Migrations/RollbackCommand.php | 94 - .../Console/Migrations/StatusCommand.php | 108 - .../database/Console/Seeds/SeedCommand.php | 106 - .../Console/Seeds/SeederMakeCommand.php | 96 - .../database/Console/Seeds/stubs/seeder.stub | 16 - .../illuminate/database/DatabaseManager.php | 329 - .../database/DatabaseServiceProvider.php | 99 - .../illuminate/database/DetectsDeadlocks.php | 32 - .../database/DetectsLostConnections.php | 40 - .../illuminate/database/Eloquent/Builder.php | 1328 ---- .../database/Eloquent/Collection.php | 440 -- .../Eloquent/Concerns/GuardsAttributes.php | 193 - .../Eloquent/Concerns/HasAttributes.php | 1141 ---- .../database/Eloquent/Concerns/HasEvents.php | 340 -- .../Eloquent/Concerns/HasGlobalScopes.php | 71 - .../Eloquent/Concerns/HasRelationships.php | 741 --- .../Eloquent/Concerns/HasTimestamps.php | 125 - .../Eloquent/Concerns/HidesAttributes.php | 126 - .../Concerns/QueriesRelationships.php | 310 - .../illuminate/database/Eloquent/Factory.php | 253 - .../database/Eloquent/FactoryBuilder.php | 331 - .../Eloquent/JsonEncodingException.php | 35 - .../Eloquent/MassAssignmentException.php | 10 - vendor/illuminate/database/Eloquent/Model.php | 1511 ----- .../Eloquent/ModelNotFoundException.php | 66 - .../database/Eloquent/QueueEntityResolver.php | 29 - .../Eloquent/RelationNotFoundException.php | 41 - .../database/Eloquent/Relations/BelongsTo.php | 362 -- .../Eloquent/Relations/BelongsToMany.php | 994 --- .../Concerns/InteractsWithPivotTable.php | 517 -- .../Concerns/SupportsDefaultModels.php | 63 - .../database/Eloquent/Relations/HasMany.php | 47 - .../Eloquent/Relations/HasManyThrough.php | 520 -- .../database/Eloquent/Relations/HasOne.php | 64 - .../Eloquent/Relations/HasOneOrMany.php | 423 -- .../database/Eloquent/Relations/MorphMany.php | 47 - .../database/Eloquent/Relations/MorphOne.php | 64 - .../Eloquent/Relations/MorphOneOrMany.php | 140 - .../Eloquent/Relations/MorphPivot.php | 79 - .../database/Eloquent/Relations/MorphTo.php | 279 - .../Eloquent/Relations/MorphToMany.php | 168 - .../database/Eloquent/Relations/Pivot.php | 235 - .../database/Eloquent/Relations/Relation.php | 385 -- vendor/illuminate/database/Eloquent/Scope.php | 15 - .../database/Eloquent/SoftDeletes.php | 169 - .../database/Eloquent/SoftDeletingScope.php | 131 - .../database/Events/ConnectionEvent.php | 32 - .../database/Events/QueryExecuted.php | 59 - .../database/Events/StatementPrepared.php | 33 - .../database/Events/TransactionBeginning.php | 8 - .../database/Events/TransactionCommitted.php | 8 - .../database/Events/TransactionRolledBack.php | 8 - vendor/illuminate/database/Grammar.php | 205 - .../database/MigrationServiceProvider.php | 87 - .../DatabaseMigrationRepository.php | 199 - .../database/Migrations/Migration.php | 30 - .../database/Migrations/MigrationCreator.php | 202 - .../MigrationRepositoryInterface.php | 74 - .../database/Migrations/Migrator.php | 578 -- .../database/Migrations/stubs/blank.stub | 28 - .../database/Migrations/stubs/create.stub | 31 - .../database/Migrations/stubs/update.stub | 32 - .../illuminate/database/MySqlConnection.php | 84 - .../database/PostgresConnection.php | 66 - vendor/illuminate/database/Query/Builder.php | 2485 -------- .../illuminate/database/Query/Expression.php | 44 - .../database/Query/Grammars/Grammar.php | 863 --- .../database/Query/Grammars/MySqlGrammar.php | 316 - .../Query/Grammars/PostgresGrammar.php | 345 -- .../database/Query/Grammars/SQLiteGrammar.php | 202 - .../Query/Grammars/SqlServerGrammar.php | 442 -- .../illuminate/database/Query/JoinClause.php | 110 - .../database/Query/JsonExpression.php | 45 - .../Query/Processors/MySqlProcessor.php | 19 - .../Query/Processors/PostgresProcessor.php | 41 - .../database/Query/Processors/Processor.php | 49 - .../Query/Processors/SQLiteProcessor.php | 19 - .../Query/Processors/SqlServerProcessor.php | 69 - vendor/illuminate/database/QueryException.php | 78 - vendor/illuminate/database/README.md | 69 - .../illuminate/database/SQLiteConnection.php | 66 - .../illuminate/database/Schema/Blueprint.php | 1263 ---- vendor/illuminate/database/Schema/Builder.php | 304 - .../database/Schema/Grammars/ChangeColumn.php | 205 - .../database/Schema/Grammars/Grammar.php | 255 - .../database/Schema/Grammars/MySqlGrammar.php | 967 --- .../Schema/Grammars/PostgresGrammar.php | 802 --- .../database/Schema/Grammars/RenameColumn.php | 69 - .../Schema/Grammars/SQLiteGrammar.php | 799 --- .../Schema/Grammars/SqlServerGrammar.php | 785 --- .../database/Schema/MySqlBuilder.php | 78 - .../database/Schema/PostgresBuilder.php | 105 - .../database/Schema/SQLiteBuilder.php | 34 - .../database/Schema/SqlServerBuilder.php | 20 - vendor/illuminate/database/Seeder.php | 125 - .../database/SqlServerConnection.php | 113 - vendor/illuminate/database/composer.json | 45 - .../support/AggregateServiceProvider.php | 52 - vendor/illuminate/support/Arr.php | 610 -- vendor/illuminate/support/Carbon.php | 48 - vendor/illuminate/support/Collection.php | 1798 ------ vendor/illuminate/support/Composer.php | 99 - vendor/illuminate/support/Debug/Dumper.php | 26 - .../illuminate/support/Debug/HtmlDumper.php | 29 - vendor/illuminate/support/Facades/App.php | 31 - vendor/illuminate/support/Facades/Artisan.php | 27 - vendor/illuminate/support/Facades/Auth.php | 48 - vendor/illuminate/support/Facades/Blade.php | 19 - .../illuminate/support/Facades/Broadcast.php | 21 - vendor/illuminate/support/Facades/Bus.php | 32 - vendor/illuminate/support/Facades/Cache.php | 20 - vendor/illuminate/support/Facades/Config.php | 19 - vendor/illuminate/support/Facades/Cookie.php | 42 - vendor/illuminate/support/Facades/Crypt.php | 19 - vendor/illuminate/support/Facades/DB.php | 20 - vendor/illuminate/support/Facades/Event.php | 35 - vendor/illuminate/support/Facades/Facade.php | 223 - vendor/illuminate/support/Facades/File.php | 19 - vendor/illuminate/support/Facades/Gate.php | 21 - vendor/illuminate/support/Facades/Hash.php | 19 - vendor/illuminate/support/Facades/Input.php | 33 - vendor/illuminate/support/Facades/Lang.php | 19 - vendor/illuminate/support/Facades/Log.php | 21 - vendor/illuminate/support/Facades/Mail.php | 31 - .../support/Facades/Notification.php | 47 - .../illuminate/support/Facades/Password.php | 54 - vendor/illuminate/support/Facades/Queue.php | 32 - .../illuminate/support/Facades/Redirect.php | 19 - vendor/illuminate/support/Facades/Redis.php | 20 - vendor/illuminate/support/Facades/Request.php | 19 - .../illuminate/support/Facades/Response.php | 21 - vendor/illuminate/support/Facades/Route.php | 42 - vendor/illuminate/support/Facades/Schema.php | 35 - vendor/illuminate/support/Facades/Session.php | 20 - vendor/illuminate/support/Facades/Storage.php | 54 - vendor/illuminate/support/Facades/URL.php | 19 - .../illuminate/support/Facades/Validator.php | 19 - vendor/illuminate/support/Facades/View.php | 19 - vendor/illuminate/support/Fluent.php | 192 - .../support/HigherOrderCollectionProxy.php | 63 - .../support/HigherOrderTapProxy.php | 38 - vendor/illuminate/support/HtmlString.php | 46 - .../illuminate/support/InteractsWithTime.php | 64 - vendor/illuminate/support/Manager.php | 140 - vendor/illuminate/support/MessageBag.php | 395 -- .../support/NamespacedItemResolver.php | 102 - vendor/illuminate/support/Optional.php | 110 - vendor/illuminate/support/Pluralizer.php | 119 - vendor/illuminate/support/ProcessUtils.php | 69 - vendor/illuminate/support/ServiceProvider.php | 300 - vendor/illuminate/support/Str.php | 683 --- .../support/Testing/Fakes/BusFake.php | 132 - .../support/Testing/Fakes/EventFake.php | 260 - .../support/Testing/Fakes/MailFake.php | 316 - .../Testing/Fakes/NotificationFake.php | 199 - .../support/Testing/Fakes/PendingMailFake.php | 53 - .../support/Testing/Fakes/QueueFake.php | 267 - .../support/Traits/CapsuleManagerTrait.php | 69 - .../illuminate/support/Traits/Macroable.php | 107 - vendor/illuminate/support/ViewErrorBag.php | 130 - vendor/illuminate/support/composer.json | 48 - vendor/illuminate/support/helpers.php | 1176 ---- vendor/kylekatarnls/update-helper/LICENSE | 22 - .../kylekatarnls/update-helper/composer.json | 50 - .../src/UpdateHelper/ComposerPlugin.php | 37 - .../NotUpdateInterfaceInstanceException.php | 9 - .../src/UpdateHelper/UpdateHelper.php | 385 -- .../UpdateHelper/UpdateHelperInterface.php | 8 - vendor/nesbot/carbon/LICENSE | 19 - vendor/nesbot/carbon/bin/upgrade-carbon | 34 - vendor/nesbot/carbon/bin/upgrade-carbon.bat | 4 - vendor/nesbot/carbon/composer.json | 70 - vendor/nesbot/carbon/readme.md | 94 - vendor/nesbot/carbon/src/Carbon/Carbon.php | 5427 ----------------- .../carbon/src/Carbon/CarbonInterval.php | 1163 ---- .../nesbot/carbon/src/Carbon/CarbonPeriod.php | 1453 ----- .../Exceptions/InvalidDateException.php | 67 - vendor/nesbot/carbon/src/Carbon/Lang/af.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/ar.php | 31 - .../carbon/src/Carbon/Lang/ar_Shakl.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/az.php | 40 - vendor/nesbot/carbon/src/Carbon/Lang/bg.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/bn.php | 38 - .../nesbot/carbon/src/Carbon/Lang/bs_BA.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/ca.php | 40 - vendor/nesbot/carbon/src/Carbon/Lang/cs.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/cy.php | 29 - vendor/nesbot/carbon/src/Carbon/Lang/da.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/de.php | 46 - .../nesbot/carbon/src/Carbon/Lang/dv_MV.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/el.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/en.php | 40 - vendor/nesbot/carbon/src/Carbon/Lang/eo.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/es.php | 36 - vendor/nesbot/carbon/src/Carbon/Lang/et.php | 38 - vendor/nesbot/carbon/src/Carbon/Lang/eu.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/fa.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/fi.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/fo.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/fr.php | 40 - vendor/nesbot/carbon/src/Carbon/Lang/gl.php | 24 - vendor/nesbot/carbon/src/Carbon/Lang/gu.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/he.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/hi.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/hr.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/hu.php | 52 - vendor/nesbot/carbon/src/Carbon/Lang/hy.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/id.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/is.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/it.php | 36 - vendor/nesbot/carbon/src/Carbon/Lang/ja.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/ka.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/kk.php | 29 - vendor/nesbot/carbon/src/Carbon/Lang/km.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/ko.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/lt.php | 38 - vendor/nesbot/carbon/src/Carbon/Lang/lv.php | 47 - vendor/nesbot/carbon/src/Carbon/Lang/mk.php | 24 - vendor/nesbot/carbon/src/Carbon/Lang/mn.php | 62 - vendor/nesbot/carbon/src/Carbon/Lang/ms.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/my.php | 37 - vendor/nesbot/carbon/src/Carbon/Lang/ne.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/nl.php | 36 - vendor/nesbot/carbon/src/Carbon/Lang/no.php | 36 - vendor/nesbot/carbon/src/Carbon/Lang/oc.php | 44 - vendor/nesbot/carbon/src/Carbon/Lang/pl.php | 36 - vendor/nesbot/carbon/src/Carbon/Lang/ps.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/pt.php | 31 - .../nesbot/carbon/src/Carbon/Lang/pt_BR.php | 40 - vendor/nesbot/carbon/src/Carbon/Lang/ro.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/ru.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/sh.php | 35 - vendor/nesbot/carbon/src/Carbon/Lang/sk.php | 38 - vendor/nesbot/carbon/src/Carbon/Lang/sl.php | 43 - vendor/nesbot/carbon/src/Carbon/Lang/sq.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/sr.php | 37 - .../nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php | 43 - .../carbon/src/Carbon/Lang/sr_Cyrl_ME.php | 43 - .../carbon/src/Carbon/Lang/sr_Latn_ME.php | 43 - .../nesbot/carbon/src/Carbon/Lang/sr_ME.php | 12 - vendor/nesbot/carbon/src/Carbon/Lang/sv.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/sw.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/th.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/tr.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/uk.php | 40 - vendor/nesbot/carbon/src/Carbon/Lang/ur.php | 24 - vendor/nesbot/carbon/src/Carbon/Lang/uz.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/vi.php | 31 - vendor/nesbot/carbon/src/Carbon/Lang/zh.php | 31 - .../nesbot/carbon/src/Carbon/Lang/zh_TW.php | 31 - .../src/Carbon/Laravel/ServiceProvider.php | 37 - .../nesbot/carbon/src/Carbon/Translator.php | 143 - vendor/nesbot/carbon/src/Carbon/Upgrade.php | 150 - vendor/nesbot/carbon/src/JsonSerializable.php | 18 - vendor/psr/container/.gitignore | 3 - vendor/psr/container/LICENSE | 21 - vendor/psr/container/README.md | 5 - vendor/psr/container/composer.json | 27 - .../src/ContainerExceptionInterface.php | 13 - .../psr/container/src/ContainerInterface.php | 37 - .../src/NotFoundExceptionInterface.php | 13 - vendor/psr/simple-cache/.editorconfig | 12 - vendor/psr/simple-cache/LICENSE.md | 21 - vendor/psr/simple-cache/README.md | 8 - vendor/psr/simple-cache/composer.json | 25 - .../psr/simple-cache/src/CacheException.php | 10 - .../psr/simple-cache/src/CacheInterface.php | 114 - .../src/InvalidArgumentException.php | 13 - vendor/slim/slim/.gitignore | 1 - vendor/slim/slim/.travis.yml | 12 - vendor/slim/slim/CONTRIBUTING.md | 20 - vendor/slim/slim/LICENSE | 19 - vendor/slim/slim/README.markdown | 212 - vendor/slim/slim/Slim/Environment.php | 228 - vendor/slim/slim/Slim/Exception/Pass.php | 49 - vendor/slim/slim/Slim/Exception/Stop.php | 47 - vendor/slim/slim/Slim/Helper/Set.php | 246 - vendor/slim/slim/Slim/Http/Cookies.php | 91 - vendor/slim/slim/Slim/Http/Headers.php | 104 - vendor/slim/slim/Slim/Http/Request.php | 621 -- vendor/slim/slim/Slim/Http/Response.php | 520 -- vendor/slim/slim/Slim/Http/Util.php | 434 -- vendor/slim/slim/Slim/Log.php | 354 -- vendor/slim/slim/Slim/LogWriter.php | 75 - vendor/slim/slim/Slim/Middleware.php | 114 - .../slim/Slim/Middleware/ContentTypes.php | 174 - vendor/slim/slim/Slim/Middleware/Flash.php | 212 - .../slim/Slim/Middleware/MethodOverride.php | 94 - .../slim/Slim/Middleware/PrettyExceptions.php | 116 - .../slim/Slim/Middleware/SessionCookie.php | 205 - vendor/slim/slim/Slim/Route.php | 471 -- vendor/slim/slim/Slim/Router.php | 257 - vendor/slim/slim/Slim/Slim.php | 1443 ----- vendor/slim/slim/Slim/View.php | 282 - vendor/slim/slim/composer.json | 25 - vendor/slim/slim/index.php | 169 - vendor/slim/slim/phpunit.xml.dist | 25 - vendor/slim/slim/tests/EnvironmentTest.php | 376 -- vendor/slim/slim/tests/Foo.php | 7 - vendor/slim/slim/tests/Helper/SetTest.php | 241 - vendor/slim/slim/tests/Http/CookiesTest.php | 92 - vendor/slim/slim/tests/Http/HeadersTest.php | 59 - vendor/slim/slim/tests/Http/RequestTest.php | 977 --- vendor/slim/slim/tests/Http/ResponseTest.php | 271 - vendor/slim/slim/tests/Http/UtilTest.php | 493 -- vendor/slim/slim/tests/LogTest.php | 208 - vendor/slim/slim/tests/LogWriterTest.php | 48 - .../tests/Middleware/ContentTypesTest.php | 162 - .../slim/slim/tests/Middleware/FlashTest.php | 141 - .../tests/Middleware/MethodOverrideTest.php | 149 - .../tests/Middleware/PrettyExceptionsTest.php | 153 - .../tests/Middleware/SessionCookieTest.php | 463 -- vendor/slim/slim/tests/MiddlewareTest.php | 79 - vendor/slim/slim/tests/README | 18 - vendor/slim/slim/tests/RouteTest.php | 617 -- vendor/slim/slim/tests/RouterTest.php | 250 - vendor/slim/slim/tests/SlimTest.php | 1657 ----- vendor/slim/slim/tests/ViewTest.php | 199 - vendor/slim/slim/tests/bootstrap.php | 22 - vendor/slim/slim/tests/templates/test.php | 1 - vendor/symfony/polyfill-mbstring/LICENSE | 19 - vendor/symfony/polyfill-mbstring/Mbstring.php | 847 --- vendor/symfony/polyfill-mbstring/README.md | 13 - .../Resources/unidata/lowerCase.php | 1096 ---- .../Resources/unidata/titleCaseRegexp.php | 5 - .../Resources/unidata/upperCase.php | 1104 ---- .../symfony/polyfill-mbstring/bootstrap.php | 62 - .../symfony/polyfill-mbstring/composer.json | 34 - vendor/symfony/translation/CHANGELOG.md | 133 - .../Catalogue/AbstractOperation.php | 157 - .../translation/Catalogue/MergeOperation.php | 58 - .../Catalogue/OperationInterface.php | 77 - .../translation/Catalogue/TargetOperation.php | 72 - .../translation/Command/XliffLintCommand.php | 273 - .../TranslationDataCollector.php | 174 - .../translation/DataCollectorTranslator.php | 182 - .../TranslationDumperPass.php | 44 - .../TranslationExtractorPass.php | 49 - .../DependencyInjection/TranslatorPass.php | 89 - .../translation/Dumper/CsvFileDumper.php | 63 - .../translation/Dumper/DumperInterface.php | 30 - .../symfony/translation/Dumper/FileDumper.php | 130 - .../translation/Dumper/IcuResFileDumper.php | 104 - .../translation/Dumper/IniFileDumper.php | 45 - .../translation/Dumper/JsonFileDumper.php | 40 - .../translation/Dumper/MoFileDumper.php | 82 - .../translation/Dumper/PhpFileDumper.php | 38 - .../translation/Dumper/PoFileDumper.php | 137 - .../translation/Dumper/QtFileDumper.php | 61 - .../translation/Dumper/XliffFileDumper.php | 203 - .../translation/Dumper/YamlFileDumper.php | 62 - .../Exception/ExceptionInterface.php | 21 - .../Exception/InvalidArgumentException.php | 21 - .../Exception/InvalidResourceException.php | 21 - .../translation/Exception/LogicException.php | 21 - .../Exception/NotFoundResourceException.php | 21 - .../Exception/RuntimeException.php | 21 - .../Extractor/AbstractFileExtractor.php | 80 - .../translation/Extractor/ChainExtractor.php | 59 - .../Extractor/ExtractorInterface.php | 37 - .../translation/Extractor/PhpExtractor.php | 275 - .../Extractor/PhpStringTokenParser.php | 142 - .../ChoiceMessageFormatterInterface.php | 32 - .../Formatter/MessageFormatter.php | 79 - .../Formatter/MessageFormatterInterface.php | 30 - .../translation/IdentityTranslator.php | 77 - vendor/symfony/translation/Interval.php | 112 - vendor/symfony/translation/LICENSE | 19 - .../translation/Loader/ArrayLoader.php | 58 - .../translation/Loader/CsvFileLoader.php | 69 - .../symfony/translation/Loader/FileLoader.php | 65 - .../translation/Loader/IcuDatFileLoader.php | 61 - .../translation/Loader/IcuResFileLoader.php | 91 - .../translation/Loader/IniFileLoader.php | 28 - .../translation/Loader/JsonFileLoader.php | 60 - .../translation/Loader/LoaderInterface.php | 38 - .../translation/Loader/MoFileLoader.php | 140 - .../translation/Loader/PhpFileLoader.php | 42 - .../translation/Loader/PoFileLoader.php | 149 - .../translation/Loader/QtFileLoader.php | 77 - .../translation/Loader/XliffFileLoader.php | 208 - .../translation/Loader/YamlFileLoader.php | 54 - .../symfony/translation/LoggingTranslator.php | 152 - .../symfony/translation/MessageCatalogue.php | 317 - .../translation/MessageCatalogueInterface.php | 138 - .../symfony/translation/MessageSelector.php | 98 - .../translation/MetadataAwareInterface.php | 54 - .../translation/PluralizationRules.php | 218 - vendor/symfony/translation/README.md | 31 - .../translation/Reader/TranslationReader.php | 62 - .../Reader/TranslationReaderInterface.php | 29 - .../Resources/bin/translation-status.php | 207 - .../schemas/xliff-core-1.2-strict.xsd | 2223 ------- vendor/symfony/translation/Translator.php | 540 -- .../translation/TranslatorBagInterface.php | 33 - .../translation/TranslatorInterface.php | 70 - .../translation/Util/ArrayConverter.php | 99 - .../translation/Writer/TranslationWriter.php | 88 - .../Writer/TranslationWriterInterface.php | 33 - vendor/symfony/translation/composer.json | 60 - 551 files changed, 1 insertion(+), 83341 deletions(-) rename README.md => GamePedia/README.md (100%) rename composer.json => GamePedia/composer.json (100%) rename composer.lock => GamePedia/composer.lock (100%) rename {css => GamePedia/css}/style.css (100%) rename index.php => GamePedia/index.php (100%) rename {php => GamePedia/php}/script_TD1.php (100%) rename {src => GamePedia/src}/controleurs/ControleurPrincipal.php (100%) rename {src => GamePedia/src}/controleurs/ControleurScript.php (100%) rename {src => GamePedia/src}/modeles/Character.php (100%) rename {src => GamePedia/src}/modeles/Client.php (100%) rename {src => GamePedia/src}/modeles/Company.php (100%) rename {src => GamePedia/src}/modeles/Contient.php (100%) rename {src => GamePedia/src}/modeles/Game.php (100%) rename {src => GamePedia/src}/modeles/Genre.php (100%) rename {src => GamePedia/src}/modeles/Platform.php (100%) rename {src => GamePedia/src}/modeles/Theme.php (100%) rename {src => GamePedia/src}/vues/VuePrincipale.php (100%) delete mode 100644 vendor/autoload.php delete mode 100644 vendor/bin/upgrade-carbon delete mode 100644 vendor/bin/upgrade-carbon.bat delete mode 100644 vendor/composer/ClassLoader.php delete mode 100644 vendor/composer/LICENSE delete mode 100644 vendor/composer/autoload_classmap.php delete mode 100644 vendor/composer/autoload_files.php delete mode 100644 vendor/composer/autoload_namespaces.php delete mode 100644 vendor/composer/autoload_psr4.php delete mode 100644 vendor/composer/autoload_real.php delete mode 100644 vendor/composer/autoload_static.php delete mode 100644 vendor/composer/installed.json delete mode 100644 vendor/doctrine/inflector/LICENSE delete mode 100644 vendor/doctrine/inflector/README.md delete mode 100644 vendor/doctrine/inflector/composer.json delete mode 100644 vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php delete mode 100644 vendor/illuminate/container/BoundMethod.php delete mode 100644 vendor/illuminate/container/Container.php delete mode 100644 vendor/illuminate/container/ContextualBindingBuilder.php delete mode 100644 vendor/illuminate/container/EntryNotFoundException.php delete mode 100644 vendor/illuminate/container/composer.json delete mode 100644 vendor/illuminate/contracts/Auth/Access/Authorizable.php delete mode 100644 vendor/illuminate/contracts/Auth/Access/Gate.php delete mode 100644 vendor/illuminate/contracts/Auth/Authenticatable.php delete mode 100644 vendor/illuminate/contracts/Auth/CanResetPassword.php delete mode 100644 vendor/illuminate/contracts/Auth/Factory.php delete mode 100644 vendor/illuminate/contracts/Auth/Guard.php delete mode 100644 vendor/illuminate/contracts/Auth/PasswordBroker.php delete mode 100644 vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php delete mode 100644 vendor/illuminate/contracts/Auth/StatefulGuard.php delete mode 100644 vendor/illuminate/contracts/Auth/SupportsBasicAuth.php delete mode 100644 vendor/illuminate/contracts/Auth/UserProvider.php delete mode 100644 vendor/illuminate/contracts/Broadcasting/Broadcaster.php delete mode 100644 vendor/illuminate/contracts/Broadcasting/Factory.php delete mode 100644 vendor/illuminate/contracts/Broadcasting/ShouldBroadcast.php delete mode 100644 vendor/illuminate/contracts/Broadcasting/ShouldBroadcastNow.php delete mode 100644 vendor/illuminate/contracts/Bus/Dispatcher.php delete mode 100644 vendor/illuminate/contracts/Bus/QueueingDispatcher.php delete mode 100644 vendor/illuminate/contracts/Cache/Factory.php delete mode 100644 vendor/illuminate/contracts/Cache/Lock.php delete mode 100644 vendor/illuminate/contracts/Cache/LockProvider.php delete mode 100644 vendor/illuminate/contracts/Cache/LockTimeoutException.php delete mode 100644 vendor/illuminate/contracts/Cache/Repository.php delete mode 100644 vendor/illuminate/contracts/Cache/Store.php delete mode 100644 vendor/illuminate/contracts/Config/Repository.php delete mode 100644 vendor/illuminate/contracts/Console/Application.php delete mode 100644 vendor/illuminate/contracts/Console/Kernel.php delete mode 100644 vendor/illuminate/contracts/Container/BindingResolutionException.php delete mode 100644 vendor/illuminate/contracts/Container/Container.php delete mode 100644 vendor/illuminate/contracts/Container/ContextualBindingBuilder.php delete mode 100644 vendor/illuminate/contracts/Cookie/Factory.php delete mode 100644 vendor/illuminate/contracts/Cookie/QueueingFactory.php delete mode 100644 vendor/illuminate/contracts/Database/ModelIdentifier.php delete mode 100644 vendor/illuminate/contracts/Debug/ExceptionHandler.php delete mode 100644 vendor/illuminate/contracts/Encryption/DecryptException.php delete mode 100644 vendor/illuminate/contracts/Encryption/EncryptException.php delete mode 100644 vendor/illuminate/contracts/Encryption/Encrypter.php delete mode 100644 vendor/illuminate/contracts/Events/Dispatcher.php delete mode 100644 vendor/illuminate/contracts/Filesystem/Cloud.php delete mode 100644 vendor/illuminate/contracts/Filesystem/Factory.php delete mode 100644 vendor/illuminate/contracts/Filesystem/FileNotFoundException.php delete mode 100644 vendor/illuminate/contracts/Filesystem/Filesystem.php delete mode 100644 vendor/illuminate/contracts/Foundation/Application.php delete mode 100644 vendor/illuminate/contracts/Hashing/Hasher.php delete mode 100644 vendor/illuminate/contracts/Http/Kernel.php delete mode 100644 vendor/illuminate/contracts/Logging/Log.php delete mode 100644 vendor/illuminate/contracts/Mail/MailQueue.php delete mode 100644 vendor/illuminate/contracts/Mail/Mailable.php delete mode 100644 vendor/illuminate/contracts/Mail/Mailer.php delete mode 100644 vendor/illuminate/contracts/Notifications/Dispatcher.php delete mode 100644 vendor/illuminate/contracts/Notifications/Factory.php delete mode 100644 vendor/illuminate/contracts/Pagination/LengthAwarePaginator.php delete mode 100644 vendor/illuminate/contracts/Pagination/Paginator.php delete mode 100644 vendor/illuminate/contracts/Pipeline/Hub.php delete mode 100644 vendor/illuminate/contracts/Pipeline/Pipeline.php delete mode 100644 vendor/illuminate/contracts/Queue/EntityNotFoundException.php delete mode 100644 vendor/illuminate/contracts/Queue/EntityResolver.php delete mode 100644 vendor/illuminate/contracts/Queue/Factory.php delete mode 100644 vendor/illuminate/contracts/Queue/Job.php delete mode 100644 vendor/illuminate/contracts/Queue/Monitor.php delete mode 100644 vendor/illuminate/contracts/Queue/Queue.php delete mode 100644 vendor/illuminate/contracts/Queue/QueueableCollection.php delete mode 100644 vendor/illuminate/contracts/Queue/QueueableEntity.php delete mode 100644 vendor/illuminate/contracts/Queue/ShouldQueue.php delete mode 100644 vendor/illuminate/contracts/Redis/Factory.php delete mode 100644 vendor/illuminate/contracts/Redis/LimiterTimeoutException.php delete mode 100644 vendor/illuminate/contracts/Routing/BindingRegistrar.php delete mode 100644 vendor/illuminate/contracts/Routing/Registrar.php delete mode 100644 vendor/illuminate/contracts/Routing/ResponseFactory.php delete mode 100644 vendor/illuminate/contracts/Routing/UrlGenerator.php delete mode 100644 vendor/illuminate/contracts/Routing/UrlRoutable.php delete mode 100644 vendor/illuminate/contracts/Session/Session.php delete mode 100644 vendor/illuminate/contracts/Support/Arrayable.php delete mode 100644 vendor/illuminate/contracts/Support/Htmlable.php delete mode 100644 vendor/illuminate/contracts/Support/Jsonable.php delete mode 100644 vendor/illuminate/contracts/Support/MessageBag.php delete mode 100644 vendor/illuminate/contracts/Support/MessageProvider.php delete mode 100644 vendor/illuminate/contracts/Support/Renderable.php delete mode 100644 vendor/illuminate/contracts/Support/Responsable.php delete mode 100644 vendor/illuminate/contracts/Translation/Loader.php delete mode 100644 vendor/illuminate/contracts/Translation/Translator.php delete mode 100644 vendor/illuminate/contracts/Validation/Factory.php delete mode 100644 vendor/illuminate/contracts/Validation/ImplicitRule.php delete mode 100644 vendor/illuminate/contracts/Validation/Rule.php delete mode 100644 vendor/illuminate/contracts/Validation/ValidatesWhenResolved.php delete mode 100644 vendor/illuminate/contracts/Validation/Validator.php delete mode 100644 vendor/illuminate/contracts/View/Engine.php delete mode 100644 vendor/illuminate/contracts/View/Factory.php delete mode 100644 vendor/illuminate/contracts/View/View.php delete mode 100644 vendor/illuminate/contracts/composer.json delete mode 100644 vendor/illuminate/database/Capsule/Manager.php delete mode 100644 vendor/illuminate/database/Concerns/BuildsQueries.php delete mode 100644 vendor/illuminate/database/Concerns/ManagesTransactions.php delete mode 100644 vendor/illuminate/database/Connection.php delete mode 100644 vendor/illuminate/database/ConnectionInterface.php delete mode 100644 vendor/illuminate/database/ConnectionResolver.php delete mode 100644 vendor/illuminate/database/ConnectionResolverInterface.php delete mode 100644 vendor/illuminate/database/Connectors/ConnectionFactory.php delete mode 100644 vendor/illuminate/database/Connectors/Connector.php delete mode 100644 vendor/illuminate/database/Connectors/ConnectorInterface.php delete mode 100644 vendor/illuminate/database/Connectors/MySqlConnector.php delete mode 100644 vendor/illuminate/database/Connectors/PostgresConnector.php delete mode 100644 vendor/illuminate/database/Connectors/SQLiteConnector.php delete mode 100644 vendor/illuminate/database/Connectors/SqlServerConnector.php delete mode 100644 vendor/illuminate/database/Console/Factories/FactoryMakeCommand.php delete mode 100644 vendor/illuminate/database/Console/Factories/stubs/factory.stub delete mode 100644 vendor/illuminate/database/Console/Migrations/BaseCommand.php delete mode 100644 vendor/illuminate/database/Console/Migrations/FreshCommand.php delete mode 100644 vendor/illuminate/database/Console/Migrations/InstallCommand.php delete mode 100644 vendor/illuminate/database/Console/Migrations/MigrateCommand.php delete mode 100644 vendor/illuminate/database/Console/Migrations/MigrateMakeCommand.php delete mode 100644 vendor/illuminate/database/Console/Migrations/RefreshCommand.php delete mode 100644 vendor/illuminate/database/Console/Migrations/ResetCommand.php delete mode 100644 vendor/illuminate/database/Console/Migrations/RollbackCommand.php delete mode 100644 vendor/illuminate/database/Console/Migrations/StatusCommand.php delete mode 100644 vendor/illuminate/database/Console/Seeds/SeedCommand.php delete mode 100644 vendor/illuminate/database/Console/Seeds/SeederMakeCommand.php delete mode 100644 vendor/illuminate/database/Console/Seeds/stubs/seeder.stub delete mode 100644 vendor/illuminate/database/DatabaseManager.php delete mode 100644 vendor/illuminate/database/DatabaseServiceProvider.php delete mode 100644 vendor/illuminate/database/DetectsDeadlocks.php delete mode 100644 vendor/illuminate/database/DetectsLostConnections.php delete mode 100644 vendor/illuminate/database/Eloquent/Builder.php delete mode 100644 vendor/illuminate/database/Eloquent/Collection.php delete mode 100644 vendor/illuminate/database/Eloquent/Concerns/GuardsAttributes.php delete mode 100644 vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php delete mode 100644 vendor/illuminate/database/Eloquent/Concerns/HasEvents.php delete mode 100644 vendor/illuminate/database/Eloquent/Concerns/HasGlobalScopes.php delete mode 100644 vendor/illuminate/database/Eloquent/Concerns/HasRelationships.php delete mode 100644 vendor/illuminate/database/Eloquent/Concerns/HasTimestamps.php delete mode 100644 vendor/illuminate/database/Eloquent/Concerns/HidesAttributes.php delete mode 100644 vendor/illuminate/database/Eloquent/Concerns/QueriesRelationships.php delete mode 100644 vendor/illuminate/database/Eloquent/Factory.php delete mode 100644 vendor/illuminate/database/Eloquent/FactoryBuilder.php delete mode 100644 vendor/illuminate/database/Eloquent/JsonEncodingException.php delete mode 100644 vendor/illuminate/database/Eloquent/MassAssignmentException.php delete mode 100644 vendor/illuminate/database/Eloquent/Model.php delete mode 100644 vendor/illuminate/database/Eloquent/ModelNotFoundException.php delete mode 100644 vendor/illuminate/database/Eloquent/QueueEntityResolver.php delete mode 100644 vendor/illuminate/database/Eloquent/RelationNotFoundException.php delete mode 100644 vendor/illuminate/database/Eloquent/Relations/BelongsTo.php delete mode 100644 vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php delete mode 100644 vendor/illuminate/database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php delete mode 100644 vendor/illuminate/database/Eloquent/Relations/Concerns/SupportsDefaultModels.php delete mode 100644 vendor/illuminate/database/Eloquent/Relations/HasMany.php delete mode 100644 vendor/illuminate/database/Eloquent/Relations/HasManyThrough.php delete mode 100644 vendor/illuminate/database/Eloquent/Relations/HasOne.php delete mode 100644 vendor/illuminate/database/Eloquent/Relations/HasOneOrMany.php delete mode 100644 vendor/illuminate/database/Eloquent/Relations/MorphMany.php delete mode 100644 vendor/illuminate/database/Eloquent/Relations/MorphOne.php delete mode 100644 vendor/illuminate/database/Eloquent/Relations/MorphOneOrMany.php delete mode 100644 vendor/illuminate/database/Eloquent/Relations/MorphPivot.php delete mode 100644 vendor/illuminate/database/Eloquent/Relations/MorphTo.php delete mode 100644 vendor/illuminate/database/Eloquent/Relations/MorphToMany.php delete mode 100644 vendor/illuminate/database/Eloquent/Relations/Pivot.php delete mode 100644 vendor/illuminate/database/Eloquent/Relations/Relation.php delete mode 100644 vendor/illuminate/database/Eloquent/Scope.php delete mode 100644 vendor/illuminate/database/Eloquent/SoftDeletes.php delete mode 100644 vendor/illuminate/database/Eloquent/SoftDeletingScope.php delete mode 100644 vendor/illuminate/database/Events/ConnectionEvent.php delete mode 100644 vendor/illuminate/database/Events/QueryExecuted.php delete mode 100644 vendor/illuminate/database/Events/StatementPrepared.php delete mode 100644 vendor/illuminate/database/Events/TransactionBeginning.php delete mode 100644 vendor/illuminate/database/Events/TransactionCommitted.php delete mode 100644 vendor/illuminate/database/Events/TransactionRolledBack.php delete mode 100644 vendor/illuminate/database/Grammar.php delete mode 100644 vendor/illuminate/database/MigrationServiceProvider.php delete mode 100644 vendor/illuminate/database/Migrations/DatabaseMigrationRepository.php delete mode 100644 vendor/illuminate/database/Migrations/Migration.php delete mode 100644 vendor/illuminate/database/Migrations/MigrationCreator.php delete mode 100644 vendor/illuminate/database/Migrations/MigrationRepositoryInterface.php delete mode 100644 vendor/illuminate/database/Migrations/Migrator.php delete mode 100644 vendor/illuminate/database/Migrations/stubs/blank.stub delete mode 100644 vendor/illuminate/database/Migrations/stubs/create.stub delete mode 100644 vendor/illuminate/database/Migrations/stubs/update.stub delete mode 100644 vendor/illuminate/database/MySqlConnection.php delete mode 100644 vendor/illuminate/database/PostgresConnection.php delete mode 100644 vendor/illuminate/database/Query/Builder.php delete mode 100644 vendor/illuminate/database/Query/Expression.php delete mode 100644 vendor/illuminate/database/Query/Grammars/Grammar.php delete mode 100644 vendor/illuminate/database/Query/Grammars/MySqlGrammar.php delete mode 100644 vendor/illuminate/database/Query/Grammars/PostgresGrammar.php delete mode 100644 vendor/illuminate/database/Query/Grammars/SQLiteGrammar.php delete mode 100644 vendor/illuminate/database/Query/Grammars/SqlServerGrammar.php delete mode 100644 vendor/illuminate/database/Query/JoinClause.php delete mode 100644 vendor/illuminate/database/Query/JsonExpression.php delete mode 100644 vendor/illuminate/database/Query/Processors/MySqlProcessor.php delete mode 100644 vendor/illuminate/database/Query/Processors/PostgresProcessor.php delete mode 100644 vendor/illuminate/database/Query/Processors/Processor.php delete mode 100644 vendor/illuminate/database/Query/Processors/SQLiteProcessor.php delete mode 100644 vendor/illuminate/database/Query/Processors/SqlServerProcessor.php delete mode 100644 vendor/illuminate/database/QueryException.php delete mode 100644 vendor/illuminate/database/README.md delete mode 100644 vendor/illuminate/database/SQLiteConnection.php delete mode 100644 vendor/illuminate/database/Schema/Blueprint.php delete mode 100644 vendor/illuminate/database/Schema/Builder.php delete mode 100644 vendor/illuminate/database/Schema/Grammars/ChangeColumn.php delete mode 100644 vendor/illuminate/database/Schema/Grammars/Grammar.php delete mode 100644 vendor/illuminate/database/Schema/Grammars/MySqlGrammar.php delete mode 100644 vendor/illuminate/database/Schema/Grammars/PostgresGrammar.php delete mode 100644 vendor/illuminate/database/Schema/Grammars/RenameColumn.php delete mode 100644 vendor/illuminate/database/Schema/Grammars/SQLiteGrammar.php delete mode 100644 vendor/illuminate/database/Schema/Grammars/SqlServerGrammar.php delete mode 100644 vendor/illuminate/database/Schema/MySqlBuilder.php delete mode 100644 vendor/illuminate/database/Schema/PostgresBuilder.php delete mode 100644 vendor/illuminate/database/Schema/SQLiteBuilder.php delete mode 100644 vendor/illuminate/database/Schema/SqlServerBuilder.php delete mode 100644 vendor/illuminate/database/Seeder.php delete mode 100644 vendor/illuminate/database/SqlServerConnection.php delete mode 100644 vendor/illuminate/database/composer.json delete mode 100644 vendor/illuminate/support/AggregateServiceProvider.php delete mode 100644 vendor/illuminate/support/Arr.php delete mode 100644 vendor/illuminate/support/Carbon.php delete mode 100644 vendor/illuminate/support/Collection.php delete mode 100644 vendor/illuminate/support/Composer.php delete mode 100644 vendor/illuminate/support/Debug/Dumper.php delete mode 100644 vendor/illuminate/support/Debug/HtmlDumper.php delete mode 100644 vendor/illuminate/support/Facades/App.php delete mode 100644 vendor/illuminate/support/Facades/Artisan.php delete mode 100644 vendor/illuminate/support/Facades/Auth.php delete mode 100644 vendor/illuminate/support/Facades/Blade.php delete mode 100644 vendor/illuminate/support/Facades/Broadcast.php delete mode 100644 vendor/illuminate/support/Facades/Bus.php delete mode 100644 vendor/illuminate/support/Facades/Cache.php delete mode 100644 vendor/illuminate/support/Facades/Config.php delete mode 100644 vendor/illuminate/support/Facades/Cookie.php delete mode 100644 vendor/illuminate/support/Facades/Crypt.php delete mode 100644 vendor/illuminate/support/Facades/DB.php delete mode 100644 vendor/illuminate/support/Facades/Event.php delete mode 100644 vendor/illuminate/support/Facades/Facade.php delete mode 100644 vendor/illuminate/support/Facades/File.php delete mode 100644 vendor/illuminate/support/Facades/Gate.php delete mode 100644 vendor/illuminate/support/Facades/Hash.php delete mode 100644 vendor/illuminate/support/Facades/Input.php delete mode 100644 vendor/illuminate/support/Facades/Lang.php delete mode 100644 vendor/illuminate/support/Facades/Log.php delete mode 100644 vendor/illuminate/support/Facades/Mail.php delete mode 100644 vendor/illuminate/support/Facades/Notification.php delete mode 100644 vendor/illuminate/support/Facades/Password.php delete mode 100644 vendor/illuminate/support/Facades/Queue.php delete mode 100644 vendor/illuminate/support/Facades/Redirect.php delete mode 100644 vendor/illuminate/support/Facades/Redis.php delete mode 100644 vendor/illuminate/support/Facades/Request.php delete mode 100644 vendor/illuminate/support/Facades/Response.php delete mode 100644 vendor/illuminate/support/Facades/Route.php delete mode 100644 vendor/illuminate/support/Facades/Schema.php delete mode 100644 vendor/illuminate/support/Facades/Session.php delete mode 100644 vendor/illuminate/support/Facades/Storage.php delete mode 100644 vendor/illuminate/support/Facades/URL.php delete mode 100644 vendor/illuminate/support/Facades/Validator.php delete mode 100644 vendor/illuminate/support/Facades/View.php delete mode 100644 vendor/illuminate/support/Fluent.php delete mode 100644 vendor/illuminate/support/HigherOrderCollectionProxy.php delete mode 100644 vendor/illuminate/support/HigherOrderTapProxy.php delete mode 100644 vendor/illuminate/support/HtmlString.php delete mode 100644 vendor/illuminate/support/InteractsWithTime.php delete mode 100644 vendor/illuminate/support/Manager.php delete mode 100644 vendor/illuminate/support/MessageBag.php delete mode 100644 vendor/illuminate/support/NamespacedItemResolver.php delete mode 100644 vendor/illuminate/support/Optional.php delete mode 100644 vendor/illuminate/support/Pluralizer.php delete mode 100644 vendor/illuminate/support/ProcessUtils.php delete mode 100644 vendor/illuminate/support/ServiceProvider.php delete mode 100644 vendor/illuminate/support/Str.php delete mode 100644 vendor/illuminate/support/Testing/Fakes/BusFake.php delete mode 100644 vendor/illuminate/support/Testing/Fakes/EventFake.php delete mode 100644 vendor/illuminate/support/Testing/Fakes/MailFake.php delete mode 100644 vendor/illuminate/support/Testing/Fakes/NotificationFake.php delete mode 100644 vendor/illuminate/support/Testing/Fakes/PendingMailFake.php delete mode 100644 vendor/illuminate/support/Testing/Fakes/QueueFake.php delete mode 100644 vendor/illuminate/support/Traits/CapsuleManagerTrait.php delete mode 100644 vendor/illuminate/support/Traits/Macroable.php delete mode 100644 vendor/illuminate/support/ViewErrorBag.php delete mode 100644 vendor/illuminate/support/composer.json delete mode 100644 vendor/illuminate/support/helpers.php delete mode 100644 vendor/kylekatarnls/update-helper/LICENSE delete mode 100644 vendor/kylekatarnls/update-helper/composer.json delete mode 100644 vendor/kylekatarnls/update-helper/src/UpdateHelper/ComposerPlugin.php delete mode 100644 vendor/kylekatarnls/update-helper/src/UpdateHelper/NotUpdateInterfaceInstanceException.php delete mode 100644 vendor/kylekatarnls/update-helper/src/UpdateHelper/UpdateHelper.php delete mode 100644 vendor/kylekatarnls/update-helper/src/UpdateHelper/UpdateHelperInterface.php delete mode 100644 vendor/nesbot/carbon/LICENSE delete mode 100644 vendor/nesbot/carbon/bin/upgrade-carbon delete mode 100644 vendor/nesbot/carbon/bin/upgrade-carbon.bat delete mode 100644 vendor/nesbot/carbon/composer.json delete mode 100644 vendor/nesbot/carbon/readme.md delete mode 100644 vendor/nesbot/carbon/src/Carbon/Carbon.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/CarbonInterval.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/af.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/ar.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/ar_Shakl.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/az.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/bg.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/bn.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/ca.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/cs.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/cy.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/da.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/de.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/el.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/en.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/eo.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/es.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/et.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/eu.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/fa.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/fi.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/fo.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/fr.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/gl.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/gu.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/he.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/hi.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/hr.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/hu.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/hy.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/id.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/is.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/it.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/ja.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/ka.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/kk.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/km.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/ko.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/lt.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/lv.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/mk.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/mn.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/ms.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/my.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/ne.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/nl.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/no.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/oc.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/pl.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/ps.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/pt.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/pt_BR.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/ro.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/ru.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/sh.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/sk.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/sl.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/sq.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/sr.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/sv.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/sw.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/th.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/tr.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/uk.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/ur.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/uz.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/vi.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/zh.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Lang/zh_TW.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Translator.php delete mode 100644 vendor/nesbot/carbon/src/Carbon/Upgrade.php delete mode 100644 vendor/nesbot/carbon/src/JsonSerializable.php delete mode 100644 vendor/psr/container/.gitignore delete mode 100644 vendor/psr/container/LICENSE delete mode 100644 vendor/psr/container/README.md delete mode 100644 vendor/psr/container/composer.json delete mode 100644 vendor/psr/container/src/ContainerExceptionInterface.php delete mode 100644 vendor/psr/container/src/ContainerInterface.php delete mode 100644 vendor/psr/container/src/NotFoundExceptionInterface.php delete mode 100644 vendor/psr/simple-cache/.editorconfig delete mode 100644 vendor/psr/simple-cache/LICENSE.md delete mode 100644 vendor/psr/simple-cache/README.md delete mode 100644 vendor/psr/simple-cache/composer.json delete mode 100644 vendor/psr/simple-cache/src/CacheException.php delete mode 100644 vendor/psr/simple-cache/src/CacheInterface.php delete mode 100644 vendor/psr/simple-cache/src/InvalidArgumentException.php delete mode 100644 vendor/slim/slim/.gitignore delete mode 100644 vendor/slim/slim/.travis.yml delete mode 100644 vendor/slim/slim/CONTRIBUTING.md delete mode 100644 vendor/slim/slim/LICENSE delete mode 100644 vendor/slim/slim/README.markdown delete mode 100644 vendor/slim/slim/Slim/Environment.php delete mode 100644 vendor/slim/slim/Slim/Exception/Pass.php delete mode 100644 vendor/slim/slim/Slim/Exception/Stop.php delete mode 100644 vendor/slim/slim/Slim/Helper/Set.php delete mode 100644 vendor/slim/slim/Slim/Http/Cookies.php delete mode 100644 vendor/slim/slim/Slim/Http/Headers.php delete mode 100644 vendor/slim/slim/Slim/Http/Request.php delete mode 100644 vendor/slim/slim/Slim/Http/Response.php delete mode 100644 vendor/slim/slim/Slim/Http/Util.php delete mode 100644 vendor/slim/slim/Slim/Log.php delete mode 100644 vendor/slim/slim/Slim/LogWriter.php delete mode 100644 vendor/slim/slim/Slim/Middleware.php delete mode 100644 vendor/slim/slim/Slim/Middleware/ContentTypes.php delete mode 100644 vendor/slim/slim/Slim/Middleware/Flash.php delete mode 100644 vendor/slim/slim/Slim/Middleware/MethodOverride.php delete mode 100644 vendor/slim/slim/Slim/Middleware/PrettyExceptions.php delete mode 100644 vendor/slim/slim/Slim/Middleware/SessionCookie.php delete mode 100644 vendor/slim/slim/Slim/Route.php delete mode 100644 vendor/slim/slim/Slim/Router.php delete mode 100644 vendor/slim/slim/Slim/Slim.php delete mode 100644 vendor/slim/slim/Slim/View.php delete mode 100644 vendor/slim/slim/composer.json delete mode 100644 vendor/slim/slim/index.php delete mode 100644 vendor/slim/slim/phpunit.xml.dist delete mode 100644 vendor/slim/slim/tests/EnvironmentTest.php delete mode 100644 vendor/slim/slim/tests/Foo.php delete mode 100644 vendor/slim/slim/tests/Helper/SetTest.php delete mode 100644 vendor/slim/slim/tests/Http/CookiesTest.php delete mode 100644 vendor/slim/slim/tests/Http/HeadersTest.php delete mode 100644 vendor/slim/slim/tests/Http/RequestTest.php delete mode 100644 vendor/slim/slim/tests/Http/ResponseTest.php delete mode 100644 vendor/slim/slim/tests/Http/UtilTest.php delete mode 100644 vendor/slim/slim/tests/LogTest.php delete mode 100644 vendor/slim/slim/tests/LogWriterTest.php delete mode 100644 vendor/slim/slim/tests/Middleware/ContentTypesTest.php delete mode 100644 vendor/slim/slim/tests/Middleware/FlashTest.php delete mode 100644 vendor/slim/slim/tests/Middleware/MethodOverrideTest.php delete mode 100644 vendor/slim/slim/tests/Middleware/PrettyExceptionsTest.php delete mode 100644 vendor/slim/slim/tests/Middleware/SessionCookieTest.php delete mode 100644 vendor/slim/slim/tests/MiddlewareTest.php delete mode 100644 vendor/slim/slim/tests/README delete mode 100644 vendor/slim/slim/tests/RouteTest.php delete mode 100644 vendor/slim/slim/tests/RouterTest.php delete mode 100644 vendor/slim/slim/tests/SlimTest.php delete mode 100644 vendor/slim/slim/tests/ViewTest.php delete mode 100644 vendor/slim/slim/tests/bootstrap.php delete mode 100644 vendor/slim/slim/tests/templates/test.php delete mode 100644 vendor/symfony/polyfill-mbstring/LICENSE delete mode 100644 vendor/symfony/polyfill-mbstring/Mbstring.php delete mode 100644 vendor/symfony/polyfill-mbstring/README.md delete mode 100644 vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php delete mode 100644 vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php delete mode 100644 vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php delete mode 100644 vendor/symfony/polyfill-mbstring/bootstrap.php delete mode 100644 vendor/symfony/polyfill-mbstring/composer.json delete mode 100644 vendor/symfony/translation/CHANGELOG.md delete mode 100644 vendor/symfony/translation/Catalogue/AbstractOperation.php delete mode 100644 vendor/symfony/translation/Catalogue/MergeOperation.php delete mode 100644 vendor/symfony/translation/Catalogue/OperationInterface.php delete mode 100644 vendor/symfony/translation/Catalogue/TargetOperation.php delete mode 100644 vendor/symfony/translation/Command/XliffLintCommand.php delete mode 100644 vendor/symfony/translation/DataCollector/TranslationDataCollector.php delete mode 100644 vendor/symfony/translation/DataCollectorTranslator.php delete mode 100644 vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php delete mode 100644 vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php delete mode 100644 vendor/symfony/translation/DependencyInjection/TranslatorPass.php delete mode 100644 vendor/symfony/translation/Dumper/CsvFileDumper.php delete mode 100644 vendor/symfony/translation/Dumper/DumperInterface.php delete mode 100644 vendor/symfony/translation/Dumper/FileDumper.php delete mode 100644 vendor/symfony/translation/Dumper/IcuResFileDumper.php delete mode 100644 vendor/symfony/translation/Dumper/IniFileDumper.php delete mode 100644 vendor/symfony/translation/Dumper/JsonFileDumper.php delete mode 100644 vendor/symfony/translation/Dumper/MoFileDumper.php delete mode 100644 vendor/symfony/translation/Dumper/PhpFileDumper.php delete mode 100644 vendor/symfony/translation/Dumper/PoFileDumper.php delete mode 100644 vendor/symfony/translation/Dumper/QtFileDumper.php delete mode 100644 vendor/symfony/translation/Dumper/XliffFileDumper.php delete mode 100644 vendor/symfony/translation/Dumper/YamlFileDumper.php delete mode 100644 vendor/symfony/translation/Exception/ExceptionInterface.php delete mode 100644 vendor/symfony/translation/Exception/InvalidArgumentException.php delete mode 100644 vendor/symfony/translation/Exception/InvalidResourceException.php delete mode 100644 vendor/symfony/translation/Exception/LogicException.php delete mode 100644 vendor/symfony/translation/Exception/NotFoundResourceException.php delete mode 100644 vendor/symfony/translation/Exception/RuntimeException.php delete mode 100644 vendor/symfony/translation/Extractor/AbstractFileExtractor.php delete mode 100644 vendor/symfony/translation/Extractor/ChainExtractor.php delete mode 100644 vendor/symfony/translation/Extractor/ExtractorInterface.php delete mode 100644 vendor/symfony/translation/Extractor/PhpExtractor.php delete mode 100644 vendor/symfony/translation/Extractor/PhpStringTokenParser.php delete mode 100644 vendor/symfony/translation/Formatter/ChoiceMessageFormatterInterface.php delete mode 100644 vendor/symfony/translation/Formatter/MessageFormatter.php delete mode 100644 vendor/symfony/translation/Formatter/MessageFormatterInterface.php delete mode 100644 vendor/symfony/translation/IdentityTranslator.php delete mode 100644 vendor/symfony/translation/Interval.php delete mode 100644 vendor/symfony/translation/LICENSE delete mode 100644 vendor/symfony/translation/Loader/ArrayLoader.php delete mode 100644 vendor/symfony/translation/Loader/CsvFileLoader.php delete mode 100644 vendor/symfony/translation/Loader/FileLoader.php delete mode 100644 vendor/symfony/translation/Loader/IcuDatFileLoader.php delete mode 100644 vendor/symfony/translation/Loader/IcuResFileLoader.php delete mode 100644 vendor/symfony/translation/Loader/IniFileLoader.php delete mode 100644 vendor/symfony/translation/Loader/JsonFileLoader.php delete mode 100644 vendor/symfony/translation/Loader/LoaderInterface.php delete mode 100644 vendor/symfony/translation/Loader/MoFileLoader.php delete mode 100644 vendor/symfony/translation/Loader/PhpFileLoader.php delete mode 100644 vendor/symfony/translation/Loader/PoFileLoader.php delete mode 100644 vendor/symfony/translation/Loader/QtFileLoader.php delete mode 100644 vendor/symfony/translation/Loader/XliffFileLoader.php delete mode 100644 vendor/symfony/translation/Loader/YamlFileLoader.php delete mode 100644 vendor/symfony/translation/LoggingTranslator.php delete mode 100644 vendor/symfony/translation/MessageCatalogue.php delete mode 100644 vendor/symfony/translation/MessageCatalogueInterface.php delete mode 100644 vendor/symfony/translation/MessageSelector.php delete mode 100644 vendor/symfony/translation/MetadataAwareInterface.php delete mode 100644 vendor/symfony/translation/PluralizationRules.php delete mode 100644 vendor/symfony/translation/README.md delete mode 100644 vendor/symfony/translation/Reader/TranslationReader.php delete mode 100644 vendor/symfony/translation/Reader/TranslationReaderInterface.php delete mode 100644 vendor/symfony/translation/Resources/bin/translation-status.php delete mode 100644 vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd delete mode 100644 vendor/symfony/translation/Translator.php delete mode 100644 vendor/symfony/translation/TranslatorBagInterface.php delete mode 100644 vendor/symfony/translation/TranslatorInterface.php delete mode 100644 vendor/symfony/translation/Util/ArrayConverter.php delete mode 100644 vendor/symfony/translation/Writer/TranslationWriter.php delete mode 100644 vendor/symfony/translation/Writer/TranslationWriterInterface.php delete mode 100644 vendor/symfony/translation/composer.json diff --git a/.gitignore b/.gitignore index bd75eb9..77c71d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # Add any directories, files, or patterns you don't want to be tracked by version control -/vendor +*/vendor *.phar .ini conf.ini diff --git a/README.md b/GamePedia/README.md similarity index 100% rename from README.md rename to GamePedia/README.md diff --git a/composer.json b/GamePedia/composer.json similarity index 100% rename from composer.json rename to GamePedia/composer.json diff --git a/composer.lock b/GamePedia/composer.lock similarity index 100% rename from composer.lock rename to GamePedia/composer.lock diff --git a/css/style.css b/GamePedia/css/style.css similarity index 100% rename from css/style.css rename to GamePedia/css/style.css diff --git a/index.php b/GamePedia/index.php similarity index 100% rename from index.php rename to GamePedia/index.php diff --git a/php/script_TD1.php b/GamePedia/php/script_TD1.php similarity index 100% rename from php/script_TD1.php rename to GamePedia/php/script_TD1.php diff --git a/src/controleurs/ControleurPrincipal.php b/GamePedia/src/controleurs/ControleurPrincipal.php similarity index 100% rename from src/controleurs/ControleurPrincipal.php rename to GamePedia/src/controleurs/ControleurPrincipal.php diff --git a/src/controleurs/ControleurScript.php b/GamePedia/src/controleurs/ControleurScript.php similarity index 100% rename from src/controleurs/ControleurScript.php rename to GamePedia/src/controleurs/ControleurScript.php diff --git a/src/modeles/Character.php b/GamePedia/src/modeles/Character.php similarity index 100% rename from src/modeles/Character.php rename to GamePedia/src/modeles/Character.php diff --git a/src/modeles/Client.php b/GamePedia/src/modeles/Client.php similarity index 100% rename from src/modeles/Client.php rename to GamePedia/src/modeles/Client.php diff --git a/src/modeles/Company.php b/GamePedia/src/modeles/Company.php similarity index 100% rename from src/modeles/Company.php rename to GamePedia/src/modeles/Company.php diff --git a/src/modeles/Contient.php b/GamePedia/src/modeles/Contient.php similarity index 100% rename from src/modeles/Contient.php rename to GamePedia/src/modeles/Contient.php diff --git a/src/modeles/Game.php b/GamePedia/src/modeles/Game.php similarity index 100% rename from src/modeles/Game.php rename to GamePedia/src/modeles/Game.php diff --git a/src/modeles/Genre.php b/GamePedia/src/modeles/Genre.php similarity index 100% rename from src/modeles/Genre.php rename to GamePedia/src/modeles/Genre.php diff --git a/src/modeles/Platform.php b/GamePedia/src/modeles/Platform.php similarity index 100% rename from src/modeles/Platform.php rename to GamePedia/src/modeles/Platform.php diff --git a/src/modeles/Theme.php b/GamePedia/src/modeles/Theme.php similarity index 100% rename from src/modeles/Theme.php rename to GamePedia/src/modeles/Theme.php diff --git a/src/vues/VuePrincipale.php b/GamePedia/src/vues/VuePrincipale.php similarity index 100% rename from src/vues/VuePrincipale.php rename to GamePedia/src/vues/VuePrincipale.php diff --git a/vendor/autoload.php b/vendor/autoload.php deleted file mode 100644 index 46bc09f..0000000 --- a/vendor/autoload.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php - -// autoload.php @generated by Composer - -require_once __DIR__ . '/composer/autoload_real.php'; - -return ComposerAutoloaderInit9dd92070b68bdceeba5acfcd17a6e4b5::getLoader(); diff --git a/vendor/bin/upgrade-carbon b/vendor/bin/upgrade-carbon deleted file mode 100644 index 69f41bc..0000000 --- a/vendor/bin/upgrade-carbon +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env sh - -dir=$(d=${0%[/\\]*}; cd "$d" > /dev/null; cd "../nesbot/carbon/bin" && pwd) - -# See if we are running in Cygwin by checking for cygpath program -if command -v 'cygpath' >/dev/null 2>&1; then - # Cygwin paths start with /cygdrive/ which will break windows PHP, - # so we need to translate the dir path to windows format. However - # we could be using cygwin PHP which does not require this, so we - # test if the path to PHP starts with /cygdrive/ rather than /usr/bin - if [[ $(which php) == /cygdrive/* ]]; then - dir=$(cygpath -m "$dir"); - fi -fi - -dir=$(echo $dir | sed 's/ /\ /g') -"${dir}/upgrade-carbon" "$@" diff --git a/vendor/bin/upgrade-carbon.bat b/vendor/bin/upgrade-carbon.bat deleted file mode 100644 index a6372b2..0000000 --- a/vendor/bin/upgrade-carbon.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO OFF -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/../nesbot/carbon/bin/upgrade-carbon -php "%BIN_TARGET%" %* diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php deleted file mode 100644 index fce8549..0000000 --- a/vendor/composer/ClassLoader.php +++ /dev/null @@ -1,445 +0,0 @@ -<?php - -/* - * This file is part of Composer. - * - * (c) Nils Adermann <naderman@naderman.de> - * Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier <fabien@symfony.com> - * @author Jordi Boggiano <j.boggiano@seld.be> - * @see http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - // PSR-4 - private $prefixLengthsPsr4 = array(); - private $prefixDirsPsr4 = array(); - private $fallbackDirsPsr4 = array(); - - // PSR-0 - private $prefixesPsr0 = array(); - private $fallbackDirsPsr0 = array(); - - private $useIncludePath = false; - private $classMap = array(); - private $classMapAuthoritative = false; - private $missingClasses = array(); - private $apcuPrefix; - - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', $this->prefixesPsr0); - } - - return array(); - } - - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * 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 - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * 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 - * - * @throws \InvalidArgumentException - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!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) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * 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 - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * 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 - * - * @throws \InvalidArgumentException - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $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; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - 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; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - 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, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath . '\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; -} diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE deleted file mode 100644 index f27399a..0000000 --- a/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php deleted file mode 100644 index 7a91153..0000000 --- a/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -// autoload_classmap.php @generated by Composer - -$vendorDir = dirname(dirname(__FILE__)); -$baseDir = dirname($vendorDir); - -return array( -); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php deleted file mode 100644 index b9aeb22..0000000 --- a/vendor/composer/autoload_files.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -// autoload_files.php @generated by Composer - -$vendorDir = dirname(dirname(__FILE__)); -$baseDir = dirname($vendorDir); - -return array( - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - '72579e7bd17821bb1321b87411366eae' => $vendorDir . '/illuminate/support/helpers.php', -); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php deleted file mode 100644 index e7b19d7..0000000 --- a/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -// autoload_namespaces.php @generated by Composer - -$vendorDir = dirname(dirname(__FILE__)); -$baseDir = dirname($vendorDir); - -return array( - 'UpdateHelper\\' => array($vendorDir . '/kylekatarnls/update-helper/src'), - 'Slim' => array($vendorDir . '/slim/slim'), -); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php deleted file mode 100644 index 6dea160..0000000 --- a/vendor/composer/autoload_psr4.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -// autoload_psr4.php @generated by Composer - -$vendorDir = dirname(dirname(__FILE__)); -$baseDir = dirname($vendorDir); - -return array( - 'gp\\' => array($baseDir . '/src'), - 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), - 'Symfony\\Contracts\\Translation\\' => array($vendorDir . '/symfony/translation-contracts'), - 'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'), - 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'), - 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), - 'Illuminate\\Support\\' => array($vendorDir . '/illuminate/support'), - 'Illuminate\\Pagination\\' => array($vendorDir . '/illuminate/pagination'), - 'Illuminate\\Database\\' => array($vendorDir . '/illuminate/database'), - 'Illuminate\\Contracts\\' => array($vendorDir . '/illuminate/contracts'), - 'Illuminate\\Container\\' => array($vendorDir . '/illuminate/container'), - 'Doctrine\\Common\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Common/Inflector'), - '' => array($vendorDir . '/nesbot/carbon/src'), -); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php deleted file mode 100644 index e359119..0000000 --- a/vendor/composer/autoload_real.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -// autoload_real.php @generated by Composer - -class ComposerAutoloaderInit9dd92070b68bdceeba5acfcd17a6e4b5 -{ - private static $loader; - - public static function loadClassLoader($class) - { - if ('Composer\Autoload\ClassLoader' === $class) { - require __DIR__ . '/ClassLoader.php'; - } - } - - public static function getLoader() - { - if (null !== self::$loader) { - return self::$loader; - } - - spl_autoload_register(array('ComposerAutoloaderInit9dd92070b68bdceeba5acfcd17a6e4b5', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit9dd92070b68bdceeba5acfcd17a6e4b5', 'loadClassLoader')); - - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require_once __DIR__ . '/autoload_static.php'; - - call_user_func(\Composer\Autoload\ComposerStaticInit9dd92070b68bdceeba5acfcd17a6e4b5::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } - - $loader->register(true); - - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit9dd92070b68bdceeba5acfcd17a6e4b5::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire9dd92070b68bdceeba5acfcd17a6e4b5($fileIdentifier, $file); - } - - return $loader; - } -} - -function composerRequire9dd92070b68bdceeba5acfcd17a6e4b5($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - } -} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php deleted file mode 100644 index b302af9..0000000 --- a/vendor/composer/autoload_static.php +++ /dev/null @@ -1,126 +0,0 @@ -<?php - -// autoload_static.php @generated by Composer - -namespace Composer\Autoload; - -class ComposerStaticInit9dd92070b68bdceeba5acfcd17a6e4b5 -{ - public static $files = array ( - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - '72579e7bd17821bb1321b87411366eae' => __DIR__ . '/..' . '/illuminate/support/helpers.php', - ); - - public static $prefixLengthsPsr4 = array ( - 'g' => - array ( - 'gp\\' => 3, - ), - 'S' => - array ( - 'Symfony\\Polyfill\\Mbstring\\' => 26, - 'Symfony\\Contracts\\Translation\\' => 30, - 'Symfony\\Component\\Translation\\' => 30, - ), - 'P' => - array ( - 'Psr\\SimpleCache\\' => 16, - 'Psr\\Container\\' => 14, - ), - 'I' => - array ( - 'Illuminate\\Support\\' => 19, - 'Illuminate\\Pagination\\' => 22, - 'Illuminate\\Database\\' => 20, - 'Illuminate\\Contracts\\' => 21, - 'Illuminate\\Container\\' => 21, - ), - 'D' => - array ( - 'Doctrine\\Common\\Inflector\\' => 26, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'gp\\' => - array ( - 0 => __DIR__ . '/../..' . '/src', - ), - 'Symfony\\Polyfill\\Mbstring\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', - ), - 'Symfony\\Contracts\\Translation\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/translation-contracts', - ), - 'Symfony\\Component\\Translation\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/translation', - ), - 'Psr\\SimpleCache\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/simple-cache/src', - ), - 'Psr\\Container\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/container/src', - ), - 'Illuminate\\Support\\' => - array ( - 0 => __DIR__ . '/..' . '/illuminate/support', - ), - 'Illuminate\\Pagination\\' => - array ( - 0 => __DIR__ . '/..' . '/illuminate/pagination', - ), - 'Illuminate\\Database\\' => - array ( - 0 => __DIR__ . '/..' . '/illuminate/database', - ), - 'Illuminate\\Contracts\\' => - array ( - 0 => __DIR__ . '/..' . '/illuminate/contracts', - ), - 'Illuminate\\Container\\' => - array ( - 0 => __DIR__ . '/..' . '/illuminate/container', - ), - 'Doctrine\\Common\\Inflector\\' => - array ( - 0 => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Common/Inflector', - ), - ); - - public static $fallbackDirsPsr4 = array ( - 0 => __DIR__ . '/..' . '/nesbot/carbon/src', - ); - - public static $prefixesPsr0 = array ( - 'U' => - array ( - 'UpdateHelper\\' => - array ( - 0 => __DIR__ . '/..' . '/kylekatarnls/update-helper/src', - ), - ), - 'S' => - array ( - 'Slim' => - array ( - 0 => __DIR__ . '/..' . '/slim/slim', - ), - ), - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit9dd92070b68bdceeba5acfcd17a6e4b5::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit9dd92070b68bdceeba5acfcd17a6e4b5::$prefixDirsPsr4; - $loader->fallbackDirsPsr4 = ComposerStaticInit9dd92070b68bdceeba5acfcd17a6e4b5::$fallbackDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInit9dd92070b68bdceeba5acfcd17a6e4b5::$prefixesPsr0; - - }, null, ClassLoader::class); - } -} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json deleted file mode 100644 index fc262e7..0000000 --- a/vendor/composer/installed.json +++ /dev/null @@ -1,787 +0,0 @@ -[ - { - "name": "doctrine/inflector", - "version": "1.3.1", - "version_normalized": "1.3.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/ec3a55242203ffa6a4b27c58176da97ff0a7aec1", - "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^6.2" - }, - "time": "2019-10-30T19:59:35+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "inflection", - "pluralize", - "singularize", - "string" - ] - }, - { - "name": "illuminate/container", - "version": "v5.5.44", - "version_normalized": "5.5.44.0", - "source": { - "type": "git", - "url": "https://github.com/illuminate/container.git", - "reference": "7917f4c86ecf7f4d0efcfd83248ad3e301e08858" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/7917f4c86ecf7f4d0efcfd83248ad3e301e08858", - "reference": "7917f4c86ecf7f4d0efcfd83248ad3e301e08858", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.5.*", - "php": ">=7.0", - "psr/container": "~1.0" - }, - "time": "2018-01-19T17:58:33+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Illuminate\\Container\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Container package.", - "homepage": "https://laravel.com" - }, - { - "name": "illuminate/contracts", - "version": "v5.5.44", - "version_normalized": "5.5.44.0", - "source": { - "type": "git", - "url": "https://github.com/illuminate/contracts.git", - "reference": "b2a62b4a85485fca9cf5fa61a933ad64006ff528" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/b2a62b4a85485fca9cf5fa61a933ad64006ff528", - "reference": "b2a62b4a85485fca9cf5fa61a933ad64006ff528", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "psr/container": "~1.0", - "psr/simple-cache": "~1.0" - }, - "time": "2018-03-20T15:34:35+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Illuminate\\Contracts\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Contracts package.", - "homepage": "https://laravel.com" - }, - { - "name": "illuminate/database", - "version": "v5.5.44", - "version_normalized": "5.5.44.0", - "source": { - "type": "git", - "url": "https://github.com/illuminate/database.git", - "reference": "f5403b3dd774eb89ff0ef5e633e57458c3dc537d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/f5403b3dd774eb89ff0ef5e633e57458c3dc537d", - "reference": "f5403b3dd774eb89ff0ef5e633e57458c3dc537d", - "shasum": "" - }, - "require": { - "illuminate/container": "5.5.*", - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*", - "php": ">=7.0" - }, - "suggest": { - "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.5).", - "fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).", - "illuminate/console": "Required to use the database commands (5.5.*).", - "illuminate/events": "Required to use the observers with Eloquent (5.5.*).", - "illuminate/filesystem": "Required to use the migrations (5.5.*).", - "illuminate/pagination": "Required to paginate the result set (5.5.*)." - }, - "time": "2018-09-23T18:58:54+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Illuminate\\Database\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Database package.", - "homepage": "https://laravel.com", - "keywords": [ - "database", - "laravel", - "orm", - "sql" - ] - }, - { - "name": "illuminate/pagination", - "version": "v5.5.44", - "version_normalized": "5.5.44.0", - "source": { - "type": "git", - "url": "https://github.com/illuminate/pagination.git", - "reference": "686b121987164d161fe3440f407014ad026bdbbc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/pagination/zipball/686b121987164d161fe3440f407014ad026bdbbc", - "reference": "686b121987164d161fe3440f407014ad026bdbbc", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*", - "php": ">=7.0" - }, - "time": "2017-10-13T15:07:13+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Illuminate\\Pagination\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Pagination package.", - "homepage": "https://laravel.com" - }, - { - "name": "illuminate/support", - "version": "v5.5.44", - "version_normalized": "5.5.44.0", - "source": { - "type": "git", - "url": "https://github.com/illuminate/support.git", - "reference": "5c405512d75dcaf5d37791badce02d86ed8e4bc4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/5c405512d75dcaf5d37791badce02d86ed8e4bc4", - "reference": "5c405512d75dcaf5d37791badce02d86ed8e4bc4", - "shasum": "" - }, - "require": { - "doctrine/inflector": "~1.1", - "ext-mbstring": "*", - "illuminate/contracts": "5.5.*", - "nesbot/carbon": "^1.24.1", - "php": ">=7.0" - }, - "replace": { - "tightenco/collect": "<5.5.33" - }, - "suggest": { - "illuminate/filesystem": "Required to use the composer class (5.5.*).", - "symfony/process": "Required to use the composer class (~3.3).", - "symfony/var-dumper": "Required to use the dd function (~3.3)." - }, - "time": "2018-08-10T19:40:01+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.5-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - }, - "files": [ - "helpers.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Support package.", - "homepage": "https://laravel.com" - }, - { - "name": "kylekatarnls/update-helper", - "version": "1.2.0", - "version_normalized": "1.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/kylekatarnls/update-helper.git", - "reference": "5786fa188e0361b9adf9e8199d7280d1b2db165e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/kylekatarnls/update-helper/zipball/5786fa188e0361b9adf9e8199d7280d1b2db165e", - "reference": "5786fa188e0361b9adf9e8199d7280d1b2db165e", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1.0 || ^2.0.0", - "php": ">=5.3.0" - }, - "require-dev": { - "codeclimate/php-test-reporter": "dev-master", - "composer/composer": "2.0.x-dev || ^2.0.0-dev", - "phpunit/phpunit": ">=4.8.35 <6.0" - }, - "time": "2019-07-29T11:03:54+00:00", - "type": "composer-plugin", - "extra": { - "class": "UpdateHelper\\ComposerPlugin" - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "UpdateHelper\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kyle", - "email": "kylekatarnls@gmail.com" - } - ], - "description": "Update helper" - }, - { - "name": "nesbot/carbon", - "version": "1.39.1", - "version_normalized": "1.39.1.0", - "source": { - "type": "git", - "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "4be0c005164249208ce1b5ca633cd57bdd42ff33" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4be0c005164249208ce1b5ca633cd57bdd42ff33", - "reference": "4be0c005164249208ce1b5ca633cd57bdd42ff33", - "shasum": "" - }, - "require": { - "kylekatarnls/update-helper": "^1.1", - "php": ">=5.3.9", - "symfony/translation": "~2.6 || ~3.0 || ~4.0" - }, - "require-dev": { - "composer/composer": "^1.2", - "friendsofphp/php-cs-fixer": "~2", - "phpunit/phpunit": "^4.8.35 || ^5.7" - }, - "time": "2019-10-14T05:51:36+00:00", - "bin": [ - "bin/upgrade-carbon" - ], - "type": "library", - "extra": { - "update-helper": "Carbon\\Upgrade", - "laravel": { - "providers": [ - "Carbon\\Laravel\\ServiceProvider" - ] - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Brian Nesbitt", - "email": "brian@nesbot.com", - "homepage": "http://nesbot.com" - } - ], - "description": "A simple API extension for DateTime.", - "homepage": "http://carbon.nesbot.com", - "keywords": [ - "date", - "datetime", - "time" - ] - }, - { - "name": "psr/container", - "version": "1.0.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2017-02-14T16:28:37+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ] - }, - { - "name": "psr/simple-cache", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2017-10-23T01:57:42+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\SimpleCache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interfaces for simple caching", - "keywords": [ - "cache", - "caching", - "psr", - "psr-16", - "simple-cache" - ] - }, - { - "name": "slim/slim", - "version": "2.6.3", - "version_normalized": "2.6.3.0", - "source": { - "type": "git", - "url": "https://github.com/slimphp/Slim.git", - "reference": "9224ed81ac1c412881e8d762755e3d76ebf580c0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slimphp/Slim/zipball/9224ed81ac1c412881e8d762755e3d76ebf580c0", - "reference": "9224ed81ac1c412881e8d762755e3d76ebf580c0", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "suggest": { - "ext-mcrypt": "Required for HTTP cookie encryption", - "phpseclib/mcrypt_compat": "Polyfil for mcrypt extension" - }, - "time": "2017-01-07T12:21:41+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Slim": "." - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Josh Lockhart", - "email": "info@joshlockhart.com", - "homepage": "http://www.joshlockhart.com/" - } - ], - "description": "Slim Framework, a PHP micro framework", - "homepage": "http://github.com/codeguy/Slim", - "keywords": [ - "microframework", - "rest", - "router" - ] - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.14.0", - "version_normalized": "1.14.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/34094cfa9abe1f0f14f48f490772db7a775559f2", - "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "time": "2020-01-13T11:15:53+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.14-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/translation", - "version": "v4.4.5", - "version_normalized": "4.4.5.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "0a19a77fba20818a969ef03fdaf1602de0546353" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/0a19a77fba20818a969ef03fdaf1602de0546353", - "reference": "0a19a77fba20818a969ef03fdaf1602de0546353", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^1.1.6|^2" - }, - "conflict": { - "symfony/config": "<3.4", - "symfony/dependency-injection": "<3.4", - "symfony/http-kernel": "<4.4", - "symfony/yaml": "<3.4" - }, - "provide": { - "symfony/translation-implementation": "1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/console": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/finder": "~2.8|~3.0|~4.0|^5.0", - "symfony/http-kernel": "^4.4", - "symfony/intl": "^3.4|^4.0|^5.0", - "symfony/service-contracts": "^1.1.2|^2", - "symfony/yaml": "^3.4|^4.0|^5.0" - }, - "suggest": { - "psr/log-implementation": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "time": "2020-02-04T09:32:40+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "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 Translation Component", - "homepage": "https://symfony.com" - }, - { - "name": "symfony/translation-contracts", - "version": "v2.0.1", - "version_normalized": "2.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation-contracts.git", - "reference": "8cc682ac458d75557203b2f2f14b0b92e1c744ed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/8cc682ac458d75557203b2f2f14b0b92e1c744ed", - "reference": "8cc682ac458d75557203b2f2f14b0b92e1c744ed", - "shasum": "" - }, - "require": { - "php": "^7.2.5" - }, - "suggest": { - "symfony/translation-implementation": "" - }, - "time": "2019-11-18T17:27:11+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Translation\\": "" - } - }, - "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": "Generic abstractions related to translation", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ] - } -] diff --git a/vendor/doctrine/inflector/LICENSE b/vendor/doctrine/inflector/LICENSE deleted file mode 100644 index 8c38cc1..0000000 --- a/vendor/doctrine/inflector/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2006-2015 Doctrine Project - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/doctrine/inflector/README.md b/vendor/doctrine/inflector/README.md deleted file mode 100644 index acb55a0..0000000 --- a/vendor/doctrine/inflector/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Doctrine Inflector - -Doctrine Inflector is a small library that can perform string manipulations -with regard to upper-/lowercase and singular/plural forms of words. - -[](https://travis-ci.org/doctrine/inflector) diff --git a/vendor/doctrine/inflector/composer.json b/vendor/doctrine/inflector/composer.json deleted file mode 100644 index 2189ff1..0000000 --- a/vendor/doctrine/inflector/composer.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "doctrine/inflector", - "type": "library", - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "keywords": ["string", "inflection", "singularize", "pluralize"], - "homepage": "http://www.doctrine-project.org", - "license": "MIT", - "authors": [ - {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, - {"name": "Roman Borschel", "email": "roman@code-factory.org"}, - {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, - {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, - {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"} - ], - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^6.2" - }, - "autoload": { - "psr-4": { "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" } - }, - "autoload-dev": { - "psr-4": { "Doctrine\\Tests\\Common\\Inflector\\": "tests/Doctrine/Tests/Common/Inflector" } - }, - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - } -} diff --git a/vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php b/vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php deleted file mode 100644 index 35b5c68..0000000 --- a/vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php +++ /dev/null @@ -1,492 +0,0 @@ -<?php -/* - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This software consists of voluntary contributions made by many individuals - * and is licensed under the MIT license. For more information, see - * <http://www.doctrine-project.org>. - */ - -namespace Doctrine\Common\Inflector; - -/** - * Doctrine inflector has static methods for inflecting text. - * - * The methods in these classes are from several different sources collected - * across several different php projects and several different authors. The - * original author names and emails are not known. - * - * Pluralize & Singularize implementation are borrowed from CakePHP with some modifications. - * - * @link www.doctrine-project.org - * @since 1.0 - * @author Konsta Vesterinen <kvesteri@cc.hut.fi> - * @author Jonathan H. Wage <jonwage@gmail.com> - */ -class Inflector -{ - /** - * Plural inflector rules. - * - * @var string[][] - */ - private static $plural = array( - 'rules' => array( - '/(s)tatus$/i' => '\1\2tatuses', - '/(quiz)$/i' => '\1zes', - '/^(ox)$/i' => '\1\2en', - '/([m|l])ouse$/i' => '\1ice', - '/(matr|vert|ind)(ix|ex)$/i' => '\1ices', - '/(x|ch|ss|sh)$/i' => '\1es', - '/([^aeiouy]|qu)y$/i' => '\1ies', - '/(hive|gulf)$/i' => '\1s', - '/(?:([^f])fe|([lr])f)$/i' => '\1\2ves', - '/sis$/i' => 'ses', - '/([ti])um$/i' => '\1a', - '/(c)riterion$/i' => '\1riteria', - '/(p)erson$/i' => '\1eople', - '/(m)an$/i' => '\1en', - '/(c)hild$/i' => '\1hildren', - '/(f)oot$/i' => '\1eet', - '/(buffal|her|potat|tomat|volcan)o$/i' => '\1\2oes', - '/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|vir)us$/i' => '\1i', - '/us$/i' => 'uses', - '/(alias)$/i' => '\1es', - '/(analys|ax|cris|test|thes)is$/i' => '\1es', - '/s$/' => 's', - '/^$/' => '', - '/$/' => 's', - ), - 'uninflected' => array( - '.*[nrlm]ese', - '.*deer', - '.*fish', - '.*measles', - '.*ois', - '.*pox', - '.*sheep', - 'people', - 'cookie', - 'police', - ), - 'irregular' => array( - 'atlas' => 'atlases', - 'axe' => 'axes', - 'beef' => 'beefs', - 'brother' => 'brothers', - 'cafe' => 'cafes', - 'canvas' => 'canvases', - 'chateau' => 'chateaux', - 'niveau' => 'niveaux', - 'child' => 'children', - 'cookie' => 'cookies', - 'corpus' => 'corpuses', - 'cow' => 'cows', - 'criterion' => 'criteria', - 'curriculum' => 'curricula', - 'demo' => 'demos', - 'domino' => 'dominoes', - 'echo' => 'echoes', - 'foot' => 'feet', - 'fungus' => 'fungi', - 'ganglion' => 'ganglions', - 'gas' => 'gases', - 'genie' => 'genies', - 'genus' => 'genera', - 'goose' => 'geese', - 'graffito' => 'graffiti', - 'hippopotamus' => 'hippopotami', - 'hoof' => 'hoofs', - 'human' => 'humans', - 'iris' => 'irises', - 'larva' => 'larvae', - 'leaf' => 'leaves', - 'loaf' => 'loaves', - 'man' => 'men', - 'medium' => 'media', - 'memorandum' => 'memoranda', - 'money' => 'monies', - 'mongoose' => 'mongooses', - 'motto' => 'mottoes', - 'move' => 'moves', - 'mythos' => 'mythoi', - 'niche' => 'niches', - 'nucleus' => 'nuclei', - 'numen' => 'numina', - 'occiput' => 'occiputs', - 'octopus' => 'octopuses', - 'opus' => 'opuses', - 'ox' => 'oxen', - 'passerby' => 'passersby', - 'penis' => 'penises', - 'person' => 'people', - 'plateau' => 'plateaux', - 'runner-up' => 'runners-up', - 'sex' => 'sexes', - 'soliloquy' => 'soliloquies', - 'son-in-law' => 'sons-in-law', - 'syllabus' => 'syllabi', - 'testis' => 'testes', - 'thief' => 'thieves', - 'tooth' => 'teeth', - 'tornado' => 'tornadoes', - 'trilby' => 'trilbys', - 'turf' => 'turfs', - 'valve' => 'valves', - 'volcano' => 'volcanoes', - ) - ); - - /** - * Singular inflector rules. - * - * @var string[][] - */ - private static $singular = array( - 'rules' => array( - '/(s)tatuses$/i' => '\1\2tatus', - '/^(.*)(menu)s$/i' => '\1\2', - '/(quiz)zes$/i' => '\\1', - '/(matr)ices$/i' => '\1ix', - '/(vert|ind)ices$/i' => '\1ex', - '/^(ox)en/i' => '\1', - '/(alias)(es)*$/i' => '\1', - '/(buffal|her|potat|tomat|volcan)oes$/i' => '\1o', - '/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|viri?)i$/i' => '\1us', - '/([ftw]ax)es/i' => '\1', - '/(analys|ax|cris|test|thes)es$/i' => '\1is', - '/(shoe|slave)s$/i' => '\1', - '/(o)es$/i' => '\1', - '/ouses$/' => 'ouse', - '/([^a])uses$/' => '\1us', - '/([m|l])ice$/i' => '\1ouse', - '/(x|ch|ss|sh)es$/i' => '\1', - '/(m)ovies$/i' => '\1\2ovie', - '/(s)eries$/i' => '\1\2eries', - '/([^aeiouy]|qu)ies$/i' => '\1y', - '/([lr])ves$/i' => '\1f', - '/(tive)s$/i' => '\1', - '/(hive)s$/i' => '\1', - '/(drive)s$/i' => '\1', - '/(dive)s$/i' => '\1', - '/(olive)s$/i' => '\1', - '/([^fo])ves$/i' => '\1fe', - '/(^analy)ses$/i' => '\1sis', - '/(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis', - '/(c)riteria$/i' => '\1riterion', - '/([ti])a$/i' => '\1um', - '/(p)eople$/i' => '\1\2erson', - '/(m)en$/i' => '\1an', - '/(c)hildren$/i' => '\1\2hild', - '/(f)eet$/i' => '\1oot', - '/(n)ews$/i' => '\1\2ews', - '/eaus$/' => 'eau', - '/^(.*us)$/' => '\\1', - '/s$/i' => '', - ), - 'uninflected' => array( - '.*[nrlm]ese', - '.*deer', - '.*fish', - '.*measles', - '.*ois', - '.*pox', - '.*sheep', - '.*ss', - 'data', - 'police', - 'pants', - 'clothes', - ), - 'irregular' => array( - 'abuses' => 'abuse', - 'avalanches' => 'avalanche', - 'caches' => 'cache', - 'criteria' => 'criterion', - 'curves' => 'curve', - 'emphases' => 'emphasis', - 'foes' => 'foe', - 'geese' => 'goose', - 'graves' => 'grave', - 'hoaxes' => 'hoax', - 'media' => 'medium', - 'neuroses' => 'neurosis', - 'waves' => 'wave', - 'oases' => 'oasis', - 'valves' => 'valve', - ) - ); - - /** - * Words that should not be inflected. - * - * @var array - */ - private static $uninflected = array( - '.*?media', 'Amoyese', 'audio', 'bison', 'Borghese', 'bream', 'breeches', - 'britches', 'buffalo', 'cantus', 'carp', 'chassis', 'clippers', 'cod', 'coitus', 'compensation', 'Congoese', - 'contretemps', 'coreopsis', 'corps', 'data', 'debris', 'deer', 'diabetes', 'djinn', 'education', 'eland', - 'elk', 'emoji', 'equipment', 'evidence', 'Faroese', 'feedback', 'fish', 'flounder', 'Foochowese', - 'Furniture', 'furniture', 'gallows', 'Genevese', 'Genoese', 'Gilbertese', 'gold', - 'headquarters', 'herpes', 'hijinks', 'Hottentotese', 'information', 'innings', 'jackanapes', 'jedi', - 'Kiplingese', 'knowledge', 'Kongoese', 'love', 'Lucchese', 'Luggage', 'mackerel', 'Maltese', 'metadata', - 'mews', 'moose', 'mumps', 'Nankingese', 'news', 'nexus', 'Niasese', 'nutrition', 'offspring', - 'Pekingese', 'Piedmontese', 'pincers', 'Pistoiese', 'plankton', 'pliers', 'pokemon', 'police', 'Portuguese', - 'proceedings', 'rabies', 'rain', 'rhinoceros', 'rice', 'salmon', 'Sarawakese', 'scissors', 'sea[- ]bass', - 'series', 'Shavese', 'shears', 'sheep', 'siemens', 'species', 'staff', 'swine', 'traffic', - 'trousers', 'trout', 'tuna', 'us', 'Vermontese', 'Wenchowese', 'wheat', 'whiting', 'wildebeest', 'Yengeese' - ); - - /** - * Method cache array. - * - * @var array - */ - private static $cache = array(); - - /** - * The initial state of Inflector so reset() works. - * - * @var array - */ - private static $initialState = array(); - - /** - * Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'. - */ - public static function tableize(string $word) : string - { - return strtolower(preg_replace('~(?<=\\w)([A-Z])~', '_$1', $word)); - } - - /** - * Converts a word into the format for a Doctrine class name. Converts 'table_name' to 'TableName'. - */ - public static function classify(string $word) : string - { - return str_replace([' ', '_', '-'], '', ucwords($word, ' _-')); - } - - /** - * Camelizes a word. This uses the classify() method and turns the first character to lowercase. - */ - public static function camelize(string $word) : string - { - return lcfirst(self::classify($word)); - } - - /** - * Uppercases words with configurable delimeters between words. - * - * Takes a string and capitalizes all of the words, like PHP's built-in - * ucwords function. This extends that behavior, however, by allowing the - * word delimeters to be configured, rather than only separating on - * whitespace. - * - * Here is an example: - * <code> - * <?php - * $string = 'top-o-the-morning to all_of_you!'; - * echo \Doctrine\Common\Inflector\Inflector::ucwords($string); - * // Top-O-The-Morning To All_of_you! - * - * echo \Doctrine\Common\Inflector\Inflector::ucwords($string, '-_ '); - * // Top-O-The-Morning To All_Of_You! - * ?> - * </code> - * - * @param string $string The string to operate on. - * @param string $delimiters A list of word separators. - * - * @return string The string with all delimeter-separated words capitalized. - */ - public static function ucwords(string $string, string $delimiters = " \n\t\r\0\x0B-") : string - { - return ucwords($string, $delimiters); - } - - /** - * Clears Inflectors inflected value caches, and resets the inflection - * rules to the initial values. - */ - public static function reset() : void - { - if (empty(self::$initialState)) { - self::$initialState = get_class_vars('Inflector'); - - return; - } - - foreach (self::$initialState as $key => $val) { - if ($key !== 'initialState') { - self::${$key} = $val; - } - } - } - - /** - * Adds custom inflection $rules, of either 'plural' or 'singular' $type. - * - * ### Usage: - * - * {{{ - * Inflector::rules('plural', array('/^(inflect)or$/i' => '\1ables')); - * Inflector::rules('plural', array( - * 'rules' => array('/^(inflect)ors$/i' => '\1ables'), - * 'uninflected' => array('dontinflectme'), - * 'irregular' => array('red' => 'redlings') - * )); - * }}} - * - * @param string $type The type of inflection, either 'plural' or 'singular' - * @param array|iterable $rules An array of rules to be added. - * @param boolean $reset If true, will unset default inflections for all - * new rules that are being defined in $rules. - * - * @return void - */ - public static function rules(string $type, iterable $rules, bool $reset = false) : void - { - foreach ($rules as $rule => $pattern) { - if ( ! is_array($pattern)) { - continue; - } - - if ($reset) { - self::${$type}[$rule] = $pattern; - } else { - self::${$type}[$rule] = ($rule === 'uninflected') - ? array_merge($pattern, self::${$type}[$rule]) - : $pattern + self::${$type}[$rule]; - } - - unset($rules[$rule], self::${$type}['cache' . ucfirst($rule)]); - - if (isset(self::${$type}['merged'][$rule])) { - unset(self::${$type}['merged'][$rule]); - } - - if ($type === 'plural') { - self::$cache['pluralize'] = self::$cache['tableize'] = array(); - } elseif ($type === 'singular') { - self::$cache['singularize'] = array(); - } - } - - self::${$type}['rules'] = $rules + self::${$type}['rules']; - } - - /** - * Returns a word in plural form. - * - * @param string $word The word in singular form. - * - * @return string The word in plural form. - */ - public static function pluralize(string $word) : string - { - if (isset(self::$cache['pluralize'][$word])) { - return self::$cache['pluralize'][$word]; - } - - if (!isset(self::$plural['merged']['irregular'])) { - self::$plural['merged']['irregular'] = self::$plural['irregular']; - } - - if (!isset(self::$plural['merged']['uninflected'])) { - self::$plural['merged']['uninflected'] = array_merge(self::$plural['uninflected'], self::$uninflected); - } - - if (!isset(self::$plural['cacheUninflected']) || !isset(self::$plural['cacheIrregular'])) { - self::$plural['cacheUninflected'] = '(?:' . implode('|', self::$plural['merged']['uninflected']) . ')'; - self::$plural['cacheIrregular'] = '(?:' . implode('|', array_keys(self::$plural['merged']['irregular'])) . ')'; - } - - if (preg_match('/(.*)\\b(' . self::$plural['cacheIrregular'] . ')$/i', $word, $regs)) { - self::$cache['pluralize'][$word] = $regs[1] . $word[0] . substr(self::$plural['merged']['irregular'][strtolower($regs[2])], 1); - - return self::$cache['pluralize'][$word]; - } - - if (preg_match('/^(' . self::$plural['cacheUninflected'] . ')$/i', $word, $regs)) { - self::$cache['pluralize'][$word] = $word; - - return $word; - } - - foreach (self::$plural['rules'] as $rule => $replacement) { - if (preg_match($rule, $word)) { - self::$cache['pluralize'][$word] = preg_replace($rule, $replacement, $word); - - return self::$cache['pluralize'][$word]; - } - } - } - - /** - * Returns a word in singular form. - * - * @param string $word The word in plural form. - * - * @return string The word in singular form. - */ - public static function singularize(string $word) : string - { - if (isset(self::$cache['singularize'][$word])) { - return self::$cache['singularize'][$word]; - } - - if (!isset(self::$singular['merged']['uninflected'])) { - self::$singular['merged']['uninflected'] = array_merge( - self::$singular['uninflected'], - self::$uninflected - ); - } - - if (!isset(self::$singular['merged']['irregular'])) { - self::$singular['merged']['irregular'] = array_merge( - self::$singular['irregular'], - array_flip(self::$plural['irregular']) - ); - } - - if (!isset(self::$singular['cacheUninflected']) || !isset(self::$singular['cacheIrregular'])) { - self::$singular['cacheUninflected'] = '(?:' . implode('|', self::$singular['merged']['uninflected']) . ')'; - self::$singular['cacheIrregular'] = '(?:' . implode('|', array_keys(self::$singular['merged']['irregular'])) . ')'; - } - - if (preg_match('/(.*)\\b(' . self::$singular['cacheIrregular'] . ')$/i', $word, $regs)) { - self::$cache['singularize'][$word] = $regs[1] . $word[0] . substr(self::$singular['merged']['irregular'][strtolower($regs[2])], 1); - - return self::$cache['singularize'][$word]; - } - - if (preg_match('/^(' . self::$singular['cacheUninflected'] . ')$/i', $word, $regs)) { - self::$cache['singularize'][$word] = $word; - - return $word; - } - - foreach (self::$singular['rules'] as $rule => $replacement) { - if (preg_match($rule, $word)) { - self::$cache['singularize'][$word] = preg_replace($rule, $replacement, $word); - - return self::$cache['singularize'][$word]; - } - } - - self::$cache['singularize'][$word] = $word; - - return $word; - } -} diff --git a/vendor/illuminate/container/BoundMethod.php b/vendor/illuminate/container/BoundMethod.php deleted file mode 100644 index 0dfd6fd..0000000 --- a/vendor/illuminate/container/BoundMethod.php +++ /dev/null @@ -1,172 +0,0 @@ -<?php - -namespace Illuminate\Container; - -use Closure; -use ReflectionMethod; -use ReflectionFunction; -use InvalidArgumentException; - -class BoundMethod -{ - /** - * Call the given Closure / class@method and inject its dependencies. - * - * @param \Illuminate\Container\Container $container - * @param callable|string $callback - * @param array $parameters - * @param string|null $defaultMethod - * @return mixed - */ - public static function call($container, $callback, array $parameters = [], $defaultMethod = null) - { - if (static::isCallableWithAtSign($callback) || $defaultMethod) { - return static::callClass($container, $callback, $parameters, $defaultMethod); - } - - return static::callBoundMethod($container, $callback, function () use ($container, $callback, $parameters) { - return call_user_func_array( - $callback, static::getMethodDependencies($container, $callback, $parameters) - ); - }); - } - - /** - * Call a string reference to a class using Class@method syntax. - * - * @param \Illuminate\Container\Container $container - * @param string $target - * @param array $parameters - * @param string|null $defaultMethod - * @return mixed - * - * @throws \InvalidArgumentException - */ - protected static function callClass($container, $target, array $parameters = [], $defaultMethod = null) - { - $segments = explode('@', $target); - - // We will assume an @ sign is used to delimit the class name from the method - // name. We will split on this @ sign and then build a callable array that - // we can pass right back into the "call" method for dependency binding. - $method = count($segments) == 2 - ? $segments[1] : $defaultMethod; - - if (is_null($method)) { - throw new InvalidArgumentException('Method not provided.'); - } - - return static::call( - $container, [$container->make($segments[0]), $method], $parameters - ); - } - - /** - * Call a method that has been bound to the container. - * - * @param \Illuminate\Container\Container $container - * @param callable $callback - * @param mixed $default - * @return mixed - */ - protected static function callBoundMethod($container, $callback, $default) - { - if (! is_array($callback)) { - return $default instanceof Closure ? $default() : $default; - } - - // Here we need to turn the array callable into a Class@method string we can use to - // examine the container and see if there are any method bindings for this given - // method. If there are, we can call this method binding callback immediately. - $method = static::normalizeMethod($callback); - - if ($container->hasMethodBinding($method)) { - return $container->callMethodBinding($method, $callback[0]); - } - - return $default instanceof Closure ? $default() : $default; - } - - /** - * Normalize the given callback into a Class@method string. - * - * @param callable $callback - * @return string - */ - protected static function normalizeMethod($callback) - { - $class = is_string($callback[0]) ? $callback[0] : get_class($callback[0]); - - return "{$class}@{$callback[1]}"; - } - - /** - * Get all dependencies for a given method. - * - * @param \Illuminate\Container\Container $container - * @param callable|string $callback - * @param array $parameters - * @return array - */ - protected static function getMethodDependencies($container, $callback, array $parameters = []) - { - $dependencies = []; - - foreach (static::getCallReflector($callback)->getParameters() as $parameter) { - static::addDependencyForCallParameter($container, $parameter, $parameters, $dependencies); - } - - return array_merge($dependencies, $parameters); - } - - /** - * Get the proper reflection instance for the given callback. - * - * @param callable|string $callback - * @return \ReflectionFunctionAbstract - */ - protected static function getCallReflector($callback) - { - if (is_string($callback) && strpos($callback, '::') !== false) { - $callback = explode('::', $callback); - } - - return is_array($callback) - ? new ReflectionMethod($callback[0], $callback[1]) - : new ReflectionFunction($callback); - } - - /** - * Get the dependency for the given call parameter. - * - * @param \Illuminate\Container\Container $container - * @param \ReflectionParameter $parameter - * @param array $parameters - * @param array $dependencies - * @return mixed - */ - protected static function addDependencyForCallParameter($container, $parameter, - array &$parameters, &$dependencies) - { - if (array_key_exists($parameter->name, $parameters)) { - $dependencies[] = $parameters[$parameter->name]; - - unset($parameters[$parameter->name]); - } elseif ($parameter->getClass()) { - $dependencies[] = $container->make($parameter->getClass()->name); - } elseif ($parameter->isDefaultValueAvailable()) { - $dependencies[] = $parameter->getDefaultValue(); - } - } - - /** - * Determine if the given string is in Class@method syntax. - * - * @param mixed $callback - * @return bool - */ - protected static function isCallableWithAtSign($callback) - { - return is_string($callback) && strpos($callback, '@') !== false; - } -} diff --git a/vendor/illuminate/container/Container.php b/vendor/illuminate/container/Container.php deleted file mode 100644 index 61c2b5e..0000000 --- a/vendor/illuminate/container/Container.php +++ /dev/null @@ -1,1245 +0,0 @@ -<?php - -namespace Illuminate\Container; - -use Closure; -use ArrayAccess; -use LogicException; -use ReflectionClass; -use ReflectionParameter; -use Illuminate\Contracts\Container\BindingResolutionException; -use Illuminate\Contracts\Container\Container as ContainerContract; - -class Container implements ArrayAccess, ContainerContract -{ - /** - * The current globally available container (if any). - * - * @var static - */ - protected static $instance; - - /** - * An array of the types that have been resolved. - * - * @var array - */ - protected $resolved = []; - - /** - * The container's bindings. - * - * @var array - */ - protected $bindings = []; - - /** - * The container's method bindings. - * - * @var array - */ - protected $methodBindings = []; - - /** - * The container's shared instances. - * - * @var array - */ - protected $instances = []; - - /** - * The registered type aliases. - * - * @var array - */ - protected $aliases = []; - - /** - * The registered aliases keyed by the abstract name. - * - * @var array - */ - protected $abstractAliases = []; - - /** - * The extension closures for services. - * - * @var array - */ - protected $extenders = []; - - /** - * All of the registered tags. - * - * @var array - */ - protected $tags = []; - - /** - * The stack of concretions currently being built. - * - * @var array - */ - protected $buildStack = []; - - /** - * The parameter override stack. - * - * @var array - */ - protected $with = []; - - /** - * The contextual binding map. - * - * @var array - */ - public $contextual = []; - - /** - * All of the registered rebound callbacks. - * - * @var array - */ - protected $reboundCallbacks = []; - - /** - * All of the global resolving callbacks. - * - * @var array - */ - protected $globalResolvingCallbacks = []; - - /** - * All of the global after resolving callbacks. - * - * @var array - */ - protected $globalAfterResolvingCallbacks = []; - - /** - * All of the resolving callbacks by class type. - * - * @var array - */ - protected $resolvingCallbacks = []; - - /** - * All of the after resolving callbacks by class type. - * - * @var array - */ - protected $afterResolvingCallbacks = []; - - /** - * Define a contextual binding. - * - * @param string $concrete - * @return \Illuminate\Contracts\Container\ContextualBindingBuilder - */ - public function when($concrete) - { - return new ContextualBindingBuilder($this, $this->getAlias($concrete)); - } - - /** - * Determine if the given abstract type has been bound. - * - * @param string $abstract - * @return bool - */ - public function bound($abstract) - { - return isset($this->bindings[$abstract]) || - isset($this->instances[$abstract]) || - $this->isAlias($abstract); - } - - /** - * {@inheritdoc} - */ - public function has($id) - { - return $this->bound($id); - } - - /** - * Determine if the given abstract type has been resolved. - * - * @param string $abstract - * @return bool - */ - public function resolved($abstract) - { - if ($this->isAlias($abstract)) { - $abstract = $this->getAlias($abstract); - } - - return isset($this->resolved[$abstract]) || - isset($this->instances[$abstract]); - } - - /** - * Determine if a given type is shared. - * - * @param string $abstract - * @return bool - */ - public function isShared($abstract) - { - return isset($this->instances[$abstract]) || - (isset($this->bindings[$abstract]['shared']) && - $this->bindings[$abstract]['shared'] === true); - } - - /** - * Determine if a given string is an alias. - * - * @param string $name - * @return bool - */ - public function isAlias($name) - { - return isset($this->aliases[$name]); - } - - /** - * Register a binding with the container. - * - * @param string $abstract - * @param \Closure|string|null $concrete - * @param bool $shared - * @return void - */ - public function bind($abstract, $concrete = null, $shared = false) - { - // If no concrete type was given, we will simply set the concrete type to the - // abstract type. After that, the concrete type to be registered as shared - // without being forced to state their classes in both of the parameters. - $this->dropStaleInstances($abstract); - - if (is_null($concrete)) { - $concrete = $abstract; - } - - // If the factory is not a Closure, it means it is just a class name which is - // bound into this container to the abstract type and we will just wrap it - // up inside its own Closure to give us more convenience when extending. - if (! $concrete instanceof Closure) { - $concrete = $this->getClosure($abstract, $concrete); - } - - $this->bindings[$abstract] = compact('concrete', 'shared'); - - // If the abstract type was already resolved in this container we'll fire the - // rebound listener so that any objects which have already gotten resolved - // can have their copy of the object updated via the listener callbacks. - if ($this->resolved($abstract)) { - $this->rebound($abstract); - } - } - - /** - * Get the Closure to be used when building a type. - * - * @param string $abstract - * @param string $concrete - * @return \Closure - */ - protected function getClosure($abstract, $concrete) - { - return function ($container, $parameters = []) use ($abstract, $concrete) { - if ($abstract == $concrete) { - return $container->build($concrete); - } - - return $container->make($concrete, $parameters); - }; - } - - /** - * Determine if the container has a method binding. - * - * @param string $method - * @return bool - */ - public function hasMethodBinding($method) - { - return isset($this->methodBindings[$method]); - } - - /** - * Bind a callback to resolve with Container::call. - * - * @param string $method - * @param \Closure $callback - * @return void - */ - public function bindMethod($method, $callback) - { - $this->methodBindings[$method] = $callback; - } - - /** - * Get the method binding for the given method. - * - * @param string $method - * @param mixed $instance - * @return mixed - */ - public function callMethodBinding($method, $instance) - { - return call_user_func($this->methodBindings[$method], $instance, $this); - } - - /** - * Add a contextual binding to the container. - * - * @param string $concrete - * @param string $abstract - * @param \Closure|string $implementation - * @return void - */ - public function addContextualBinding($concrete, $abstract, $implementation) - { - $this->contextual[$concrete][$this->getAlias($abstract)] = $implementation; - } - - /** - * Register a binding if it hasn't already been registered. - * - * @param string $abstract - * @param \Closure|string|null $concrete - * @param bool $shared - * @return void - */ - public function bindIf($abstract, $concrete = null, $shared = false) - { - if (! $this->bound($abstract)) { - $this->bind($abstract, $concrete, $shared); - } - } - - /** - * Register a shared binding in the container. - * - * @param string $abstract - * @param \Closure|string|null $concrete - * @return void - */ - public function singleton($abstract, $concrete = null) - { - $this->bind($abstract, $concrete, true); - } - - /** - * "Extend" an abstract type in the container. - * - * @param string $abstract - * @param \Closure $closure - * @return void - * - * @throws \InvalidArgumentException - */ - public function extend($abstract, Closure $closure) - { - $abstract = $this->getAlias($abstract); - - if (isset($this->instances[$abstract])) { - $this->instances[$abstract] = $closure($this->instances[$abstract], $this); - - $this->rebound($abstract); - } else { - $this->extenders[$abstract][] = $closure; - - if ($this->resolved($abstract)) { - $this->rebound($abstract); - } - } - } - - /** - * Register an existing instance as shared in the container. - * - * @param string $abstract - * @param mixed $instance - * @return mixed - */ - public function instance($abstract, $instance) - { - $this->removeAbstractAlias($abstract); - - $isBound = $this->bound($abstract); - - unset($this->aliases[$abstract]); - - // We'll check to determine if this type has been bound before, and if it has - // we will fire the rebound callbacks registered with the container and it - // can be updated with consuming classes that have gotten resolved here. - $this->instances[$abstract] = $instance; - - if ($isBound) { - $this->rebound($abstract); - } - - return $instance; - } - - /** - * Remove an alias from the contextual binding alias cache. - * - * @param string $searched - * @return void - */ - protected function removeAbstractAlias($searched) - { - if (! isset($this->aliases[$searched])) { - return; - } - - foreach ($this->abstractAliases as $abstract => $aliases) { - foreach ($aliases as $index => $alias) { - if ($alias == $searched) { - unset($this->abstractAliases[$abstract][$index]); - } - } - } - } - - /** - * Assign a set of tags to a given binding. - * - * @param array|string $abstracts - * @param array|mixed ...$tags - * @return void - */ - public function tag($abstracts, $tags) - { - $tags = is_array($tags) ? $tags : array_slice(func_get_args(), 1); - - foreach ($tags as $tag) { - if (! isset($this->tags[$tag])) { - $this->tags[$tag] = []; - } - - foreach ((array) $abstracts as $abstract) { - $this->tags[$tag][] = $abstract; - } - } - } - - /** - * Resolve all of the bindings for a given tag. - * - * @param string $tag - * @return array - */ - public function tagged($tag) - { - $results = []; - - if (isset($this->tags[$tag])) { - foreach ($this->tags[$tag] as $abstract) { - $results[] = $this->make($abstract); - } - } - - return $results; - } - - /** - * Alias a type to a different name. - * - * @param string $abstract - * @param string $alias - * @return void - */ - public function alias($abstract, $alias) - { - $this->aliases[$alias] = $abstract; - - $this->abstractAliases[$abstract][] = $alias; - } - - /** - * Bind a new callback to an abstract's rebind event. - * - * @param string $abstract - * @param \Closure $callback - * @return mixed - */ - public function rebinding($abstract, Closure $callback) - { - $this->reboundCallbacks[$abstract = $this->getAlias($abstract)][] = $callback; - - if ($this->bound($abstract)) { - return $this->make($abstract); - } - } - - /** - * Refresh an instance on the given target and method. - * - * @param string $abstract - * @param mixed $target - * @param string $method - * @return mixed - */ - public function refresh($abstract, $target, $method) - { - return $this->rebinding($abstract, function ($app, $instance) use ($target, $method) { - $target->{$method}($instance); - }); - } - - /** - * Fire the "rebound" callbacks for the given abstract type. - * - * @param string $abstract - * @return void - */ - protected function rebound($abstract) - { - $instance = $this->make($abstract); - - foreach ($this->getReboundCallbacks($abstract) as $callback) { - call_user_func($callback, $this, $instance); - } - } - - /** - * Get the rebound callbacks for a given type. - * - * @param string $abstract - * @return array - */ - protected function getReboundCallbacks($abstract) - { - if (isset($this->reboundCallbacks[$abstract])) { - return $this->reboundCallbacks[$abstract]; - } - - return []; - } - - /** - * Wrap the given closure such that its dependencies will be injected when executed. - * - * @param \Closure $callback - * @param array $parameters - * @return \Closure - */ - public function wrap(Closure $callback, array $parameters = []) - { - return function () use ($callback, $parameters) { - return $this->call($callback, $parameters); - }; - } - - /** - * Call the given Closure / class@method and inject its dependencies. - * - * @param callable|string $callback - * @param array $parameters - * @param string|null $defaultMethod - * @return mixed - */ - public function call($callback, array $parameters = [], $defaultMethod = null) - { - return BoundMethod::call($this, $callback, $parameters, $defaultMethod); - } - - /** - * Get a closure to resolve the given type from the container. - * - * @param string $abstract - * @return \Closure - */ - public function factory($abstract) - { - return function () use ($abstract) { - return $this->make($abstract); - }; - } - - /** - * An alias function name for make(). - * - * @param string $abstract - * @param array $parameters - * @return mixed - */ - public function makeWith($abstract, array $parameters = []) - { - return $this->make($abstract, $parameters); - } - - /** - * Resolve the given type from the container. - * - * @param string $abstract - * @param array $parameters - * @return mixed - */ - public function make($abstract, array $parameters = []) - { - return $this->resolve($abstract, $parameters); - } - - /** - * {@inheritdoc} - */ - public function get($id) - { - if ($this->has($id)) { - return $this->resolve($id); - } - - throw new EntryNotFoundException; - } - - /** - * Resolve the given type from the container. - * - * @param string $abstract - * @param array $parameters - * @return mixed - */ - protected function resolve($abstract, $parameters = []) - { - $abstract = $this->getAlias($abstract); - - $needsContextualBuild = ! empty($parameters) || ! is_null( - $this->getContextualConcrete($abstract) - ); - - // If an instance of the type is currently being managed as a singleton we'll - // just return an existing instance instead of instantiating new instances - // so the developer can keep using the same objects instance every time. - if (isset($this->instances[$abstract]) && ! $needsContextualBuild) { - return $this->instances[$abstract]; - } - - $this->with[] = $parameters; - - $concrete = $this->getConcrete($abstract); - - // We're ready to instantiate an instance of the concrete type registered for - // the binding. This will instantiate the types, as well as resolve any of - // its "nested" dependencies recursively until all have gotten resolved. - if ($this->isBuildable($concrete, $abstract)) { - $object = $this->build($concrete); - } else { - $object = $this->make($concrete); - } - - // If we defined any extenders for this type, we'll need to spin through them - // and apply them to the object being built. This allows for the extension - // of services, such as changing configuration or decorating the object. - foreach ($this->getExtenders($abstract) as $extender) { - $object = $extender($object, $this); - } - - // If the requested type is registered as a singleton we'll want to cache off - // the instances in "memory" so we can return it later without creating an - // entirely new instance of an object on each subsequent request for it. - if ($this->isShared($abstract) && ! $needsContextualBuild) { - $this->instances[$abstract] = $object; - } - - $this->fireResolvingCallbacks($abstract, $object); - - // Before returning, we will also set the resolved flag to "true" and pop off - // the parameter overrides for this build. After those two things are done - // we will be ready to return back the fully constructed class instance. - $this->resolved[$abstract] = true; - - array_pop($this->with); - - return $object; - } - - /** - * Get the concrete type for a given abstract. - * - * @param string $abstract - * @return mixed $concrete - */ - protected function getConcrete($abstract) - { - if (! is_null($concrete = $this->getContextualConcrete($abstract))) { - return $concrete; - } - - // If we don't have a registered resolver or concrete for the type, we'll just - // assume each type is a concrete name and will attempt to resolve it as is - // since the container should be able to resolve concretes automatically. - if (isset($this->bindings[$abstract])) { - return $this->bindings[$abstract]['concrete']; - } - - return $abstract; - } - - /** - * Get the contextual concrete binding for the given abstract. - * - * @param string $abstract - * @return string|null - */ - protected function getContextualConcrete($abstract) - { - if (! is_null($binding = $this->findInContextualBindings($abstract))) { - return $binding; - } - - // Next we need to see if a contextual binding might be bound under an alias of the - // given abstract type. So, we will need to check if any aliases exist with this - // type and then spin through them and check for contextual bindings on these. - if (empty($this->abstractAliases[$abstract])) { - return; - } - - foreach ($this->abstractAliases[$abstract] as $alias) { - if (! is_null($binding = $this->findInContextualBindings($alias))) { - return $binding; - } - } - } - - /** - * Find the concrete binding for the given abstract in the contextual binding array. - * - * @param string $abstract - * @return string|null - */ - protected function findInContextualBindings($abstract) - { - if (isset($this->contextual[end($this->buildStack)][$abstract])) { - return $this->contextual[end($this->buildStack)][$abstract]; - } - } - - /** - * Determine if the given concrete is buildable. - * - * @param mixed $concrete - * @param string $abstract - * @return bool - */ - protected function isBuildable($concrete, $abstract) - { - return $concrete === $abstract || $concrete instanceof Closure; - } - - /** - * Instantiate a concrete instance of the given type. - * - * @param string $concrete - * @return mixed - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - public function build($concrete) - { - // If the concrete type is actually a Closure, we will just execute it and - // hand back the results of the functions, which allows functions to be - // used as resolvers for more fine-tuned resolution of these objects. - if ($concrete instanceof Closure) { - return $concrete($this, $this->getLastParameterOverride()); - } - - $reflector = new ReflectionClass($concrete); - - // If the type is not instantiable, the developer is attempting to resolve - // an abstract type such as an Interface of Abstract Class and there is - // no binding registered for the abstractions so we need to bail out. - if (! $reflector->isInstantiable()) { - return $this->notInstantiable($concrete); - } - - $this->buildStack[] = $concrete; - - $constructor = $reflector->getConstructor(); - - // If there are no constructors, that means there are no dependencies then - // we can just resolve the instances of the objects right away, without - // resolving any other types or dependencies out of these containers. - if (is_null($constructor)) { - array_pop($this->buildStack); - - return new $concrete; - } - - $dependencies = $constructor->getParameters(); - - // Once we have all the constructor's parameters we can create each of the - // dependency instances and then use the reflection instances to make a - // new instance of this class, injecting the created dependencies in. - $instances = $this->resolveDependencies( - $dependencies - ); - - array_pop($this->buildStack); - - return $reflector->newInstanceArgs($instances); - } - - /** - * Resolve all of the dependencies from the ReflectionParameters. - * - * @param array $dependencies - * @return array - */ - protected function resolveDependencies(array $dependencies) - { - $results = []; - - foreach ($dependencies as $dependency) { - // If this dependency has a override for this particular build we will use - // that instead as the value. Otherwise, we will continue with this run - // of resolutions and let reflection attempt to determine the result. - if ($this->hasParameterOverride($dependency)) { - $results[] = $this->getParameterOverride($dependency); - - continue; - } - - // If the class is null, it means the dependency is a string or some other - // primitive type which we can not resolve since it is not a class and - // we will just bomb out with an error since we have no-where to go. - $results[] = is_null($dependency->getClass()) - ? $this->resolvePrimitive($dependency) - : $this->resolveClass($dependency); - } - - return $results; - } - - /** - * Determine if the given dependency has a parameter override. - * - * @param \ReflectionParameter $dependency - * @return bool - */ - protected function hasParameterOverride($dependency) - { - return array_key_exists( - $dependency->name, $this->getLastParameterOverride() - ); - } - - /** - * Get a parameter override for a dependency. - * - * @param \ReflectionParameter $dependency - * @return mixed - */ - protected function getParameterOverride($dependency) - { - return $this->getLastParameterOverride()[$dependency->name]; - } - - /** - * Get the last parameter override. - * - * @return array - */ - protected function getLastParameterOverride() - { - return count($this->with) ? end($this->with) : []; - } - - /** - * Resolve a non-class hinted primitive dependency. - * - * @param \ReflectionParameter $parameter - * @return mixed - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - protected function resolvePrimitive(ReflectionParameter $parameter) - { - if (! is_null($concrete = $this->getContextualConcrete('$'.$parameter->name))) { - return $concrete instanceof Closure ? $concrete($this) : $concrete; - } - - if ($parameter->isDefaultValueAvailable()) { - return $parameter->getDefaultValue(); - } - - $this->unresolvablePrimitive($parameter); - } - - /** - * Resolve a class based dependency from the container. - * - * @param \ReflectionParameter $parameter - * @return mixed - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - protected function resolveClass(ReflectionParameter $parameter) - { - try { - return $this->make($parameter->getClass()->name); - } - - // If we can not resolve the class instance, we will check to see if the value - // is optional, and if it is we will return the optional parameter value as - // the value of the dependency, similarly to how we do this with scalars. - catch (BindingResolutionException $e) { - if ($parameter->isOptional()) { - return $parameter->getDefaultValue(); - } - - throw $e; - } - } - - /** - * Throw an exception that the concrete is not instantiable. - * - * @param string $concrete - * @return void - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - protected function notInstantiable($concrete) - { - if (! empty($this->buildStack)) { - $previous = implode(', ', $this->buildStack); - - $message = "Target [$concrete] is not instantiable while building [$previous]."; - } else { - $message = "Target [$concrete] is not instantiable."; - } - - throw new BindingResolutionException($message); - } - - /** - * Throw an exception for an unresolvable primitive. - * - * @param \ReflectionParameter $parameter - * @return void - * - * @throws \Illuminate\Contracts\Container\BindingResolutionException - */ - protected function unresolvablePrimitive(ReflectionParameter $parameter) - { - $message = "Unresolvable dependency resolving [$parameter] in class {$parameter->getDeclaringClass()->getName()}"; - - throw new BindingResolutionException($message); - } - - /** - * Register a new resolving callback. - * - * @param \Closure|string $abstract - * @param \Closure|null $callback - * @return void - */ - public function resolving($abstract, Closure $callback = null) - { - if (is_string($abstract)) { - $abstract = $this->getAlias($abstract); - } - - if (is_null($callback) && $abstract instanceof Closure) { - $this->globalResolvingCallbacks[] = $abstract; - } else { - $this->resolvingCallbacks[$abstract][] = $callback; - } - } - - /** - * Register a new after resolving callback for all types. - * - * @param \Closure|string $abstract - * @param \Closure|null $callback - * @return void - */ - public function afterResolving($abstract, Closure $callback = null) - { - if (is_string($abstract)) { - $abstract = $this->getAlias($abstract); - } - - if ($abstract instanceof Closure && is_null($callback)) { - $this->globalAfterResolvingCallbacks[] = $abstract; - } else { - $this->afterResolvingCallbacks[$abstract][] = $callback; - } - } - - /** - * Fire all of the resolving callbacks. - * - * @param string $abstract - * @param mixed $object - * @return void - */ - protected function fireResolvingCallbacks($abstract, $object) - { - $this->fireCallbackArray($object, $this->globalResolvingCallbacks); - - $this->fireCallbackArray( - $object, $this->getCallbacksForType($abstract, $object, $this->resolvingCallbacks) - ); - - $this->fireAfterResolvingCallbacks($abstract, $object); - } - - /** - * Fire all of the after resolving callbacks. - * - * @param string $abstract - * @param mixed $object - * @return void - */ - protected function fireAfterResolvingCallbacks($abstract, $object) - { - $this->fireCallbackArray($object, $this->globalAfterResolvingCallbacks); - - $this->fireCallbackArray( - $object, $this->getCallbacksForType($abstract, $object, $this->afterResolvingCallbacks) - ); - } - - /** - * Get all callbacks for a given type. - * - * @param string $abstract - * @param object $object - * @param array $callbacksPerType - * - * @return array - */ - protected function getCallbacksForType($abstract, $object, array $callbacksPerType) - { - $results = []; - - foreach ($callbacksPerType as $type => $callbacks) { - if ($type === $abstract || $object instanceof $type) { - $results = array_merge($results, $callbacks); - } - } - - return $results; - } - - /** - * Fire an array of callbacks with an object. - * - * @param mixed $object - * @param array $callbacks - * @return void - */ - protected function fireCallbackArray($object, array $callbacks) - { - foreach ($callbacks as $callback) { - $callback($object, $this); - } - } - - /** - * Get the container's bindings. - * - * @return array - */ - public function getBindings() - { - return $this->bindings; - } - - /** - * Get the alias for an abstract if available. - * - * @param string $abstract - * @return string - * - * @throws \LogicException - */ - public function getAlias($abstract) - { - if (! isset($this->aliases[$abstract])) { - return $abstract; - } - - if ($this->aliases[$abstract] === $abstract) { - throw new LogicException("[{$abstract}] is aliased to itself."); - } - - return $this->getAlias($this->aliases[$abstract]); - } - - /** - * Get the extender callbacks for a given type. - * - * @param string $abstract - * @return array - */ - protected function getExtenders($abstract) - { - $abstract = $this->getAlias($abstract); - - if (isset($this->extenders[$abstract])) { - return $this->extenders[$abstract]; - } - - return []; - } - - /** - * Remove all of the extender callbacks for a given type. - * - * @param string $abstract - * @return void - */ - public function forgetExtenders($abstract) - { - unset($this->extenders[$this->getAlias($abstract)]); - } - - /** - * Drop all of the stale instances and aliases. - * - * @param string $abstract - * @return void - */ - protected function dropStaleInstances($abstract) - { - unset($this->instances[$abstract], $this->aliases[$abstract]); - } - - /** - * Remove a resolved instance from the instance cache. - * - * @param string $abstract - * @return void - */ - public function forgetInstance($abstract) - { - unset($this->instances[$abstract]); - } - - /** - * Clear all of the instances from the container. - * - * @return void - */ - public function forgetInstances() - { - $this->instances = []; - } - - /** - * Flush the container of all bindings and resolved instances. - * - * @return void - */ - public function flush() - { - $this->aliases = []; - $this->resolved = []; - $this->bindings = []; - $this->instances = []; - $this->abstractAliases = []; - } - - /** - * Set the globally available instance of the container. - * - * @return static - */ - public static function getInstance() - { - if (is_null(static::$instance)) { - static::$instance = new static; - } - - return static::$instance; - } - - /** - * Set the shared instance of the container. - * - * @param \Illuminate\Contracts\Container\Container|null $container - * @return static - */ - public static function setInstance(ContainerContract $container = null) - { - return static::$instance = $container; - } - - /** - * Determine if a given offset exists. - * - * @param string $key - * @return bool - */ - public function offsetExists($key) - { - return $this->bound($key); - } - - /** - * Get the value at a given offset. - * - * @param string $key - * @return mixed - */ - public function offsetGet($key) - { - return $this->make($key); - } - - /** - * Set the value at a given offset. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function offsetSet($key, $value) - { - $this->bind($key, $value instanceof Closure ? $value : function () use ($value) { - return $value; - }); - } - - /** - * Unset the value at a given offset. - * - * @param string $key - * @return void - */ - public function offsetUnset($key) - { - unset($this->bindings[$key], $this->instances[$key], $this->resolved[$key]); - } - - /** - * Dynamically access container services. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - return $this[$key]; - } - - /** - * Dynamically set container services. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function __set($key, $value) - { - $this[$key] = $value; - } -} diff --git a/vendor/illuminate/container/ContextualBindingBuilder.php b/vendor/illuminate/container/ContextualBindingBuilder.php deleted file mode 100644 index 58b70ce..0000000 --- a/vendor/illuminate/container/ContextualBindingBuilder.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php - -namespace Illuminate\Container; - -use Illuminate\Contracts\Container\ContextualBindingBuilder as ContextualBindingBuilderContract; - -class ContextualBindingBuilder implements ContextualBindingBuilderContract -{ - /** - * The underlying container instance. - * - * @var \Illuminate\Container\Container - */ - protected $container; - - /** - * The concrete instance. - * - * @var string - */ - protected $concrete; - - /** - * The abstract target. - * - * @var string - */ - protected $needs; - - /** - * Create a new contextual binding builder. - * - * @param \Illuminate\Container\Container $container - * @param string $concrete - * @return void - */ - public function __construct(Container $container, $concrete) - { - $this->concrete = $concrete; - $this->container = $container; - } - - /** - * Define the abstract target that depends on the context. - * - * @param string $abstract - * @return $this - */ - public function needs($abstract) - { - $this->needs = $abstract; - - return $this; - } - - /** - * Define the implementation for the contextual binding. - * - * @param \Closure|string $implementation - * @return void - */ - public function give($implementation) - { - $this->container->addContextualBinding( - $this->concrete, $this->needs, $implementation - ); - } -} diff --git a/vendor/illuminate/container/EntryNotFoundException.php b/vendor/illuminate/container/EntryNotFoundException.php deleted file mode 100644 index 4266921..0000000 --- a/vendor/illuminate/container/EntryNotFoundException.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -namespace Illuminate\Container; - -use Exception; -use Psr\Container\NotFoundExceptionInterface; - -class EntryNotFoundException extends Exception implements NotFoundExceptionInterface -{ - // -} diff --git a/vendor/illuminate/container/composer.json b/vendor/illuminate/container/composer.json deleted file mode 100644 index 7347da1..0000000 --- a/vendor/illuminate/container/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "illuminate/container", - "description": "The Illuminate Container package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": ">=7.0", - "illuminate/contracts": "5.5.*", - "psr/container": "~1.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Container\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "5.5-dev" - } - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/illuminate/contracts/Auth/Access/Authorizable.php b/vendor/illuminate/contracts/Auth/Access/Authorizable.php deleted file mode 100644 index 2f9657c..0000000 --- a/vendor/illuminate/contracts/Auth/Access/Authorizable.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Auth\Access; - -interface Authorizable -{ - /** - * Determine if the entity has a given ability. - * - * @param string $ability - * @param array|mixed $arguments - * @return bool - */ - public function can($ability, $arguments = []); -} diff --git a/vendor/illuminate/contracts/Auth/Access/Gate.php b/vendor/illuminate/contracts/Auth/Access/Gate.php deleted file mode 100644 index 2021b57..0000000 --- a/vendor/illuminate/contracts/Auth/Access/Gate.php +++ /dev/null @@ -1,120 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Auth\Access; - -interface Gate -{ - /** - * Determine if a given ability has been defined. - * - * @param string $ability - * @return bool - */ - public function has($ability); - - /** - * Define a new ability. - * - * @param string $ability - * @param callable|string $callback - * @return $this - */ - public function define($ability, $callback); - - /** - * Define a policy class for a given class type. - * - * @param string $class - * @param string $policy - * @return $this - */ - public function policy($class, $policy); - - /** - * Register a callback to run before all Gate checks. - * - * @param callable $callback - * @return $this - */ - public function before(callable $callback); - - /** - * Register a callback to run after all Gate checks. - * - * @param callable $callback - * @return $this - */ - public function after(callable $callback); - - /** - * Determine if the given ability should be granted for the current user. - * - * @param string $ability - * @param array|mixed $arguments - * @return bool - */ - public function allows($ability, $arguments = []); - - /** - * Determine if the given ability should be denied for the current user. - * - * @param string $ability - * @param array|mixed $arguments - * @return bool - */ - public function denies($ability, $arguments = []); - - /** - * Determine if all of the given abilities should be granted for the current user. - * - * @param iterable|string $abilities - * @param array|mixed $arguments - * @return bool - */ - public function check($abilities, $arguments = []); - - /** - * Determine if any one of the given abilities should be granted for the current user. - * - * @param iterable|string $abilities - * @param array|mixed $arguments - * @return bool - */ - public function any($abilities, $arguments = []); - - /** - * Determine if the given ability should be granted for the current user. - * - * @param string $ability - * @param array|mixed $arguments - * @return \Illuminate\Auth\Access\Response - * - * @throws \Illuminate\Auth\Access\AuthorizationException - */ - public function authorize($ability, $arguments = []); - - /** - * Get a policy instance for a given class. - * - * @param object|string $class - * @return mixed - * - * @throws \InvalidArgumentException - */ - public function getPolicyFor($class); - - /** - * Get a guard instance for the given user. - * - * @param \Illuminate\Contracts\Auth\Authenticatable|mixed $user - * @return static - */ - public function forUser($user); - - /** - * Get all of the defined abilities. - * - * @return array - */ - public function abilities(); -} diff --git a/vendor/illuminate/contracts/Auth/Authenticatable.php b/vendor/illuminate/contracts/Auth/Authenticatable.php deleted file mode 100644 index ac4ed88..0000000 --- a/vendor/illuminate/contracts/Auth/Authenticatable.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Auth; - -interface Authenticatable -{ - /** - * Get the name of the unique identifier for the user. - * - * @return string - */ - public function getAuthIdentifierName(); - - /** - * Get the unique identifier for the user. - * - * @return mixed - */ - public function getAuthIdentifier(); - - /** - * Get the password for the user. - * - * @return string - */ - public function getAuthPassword(); - - /** - * Get the token value for the "remember me" session. - * - * @return string - */ - public function getRememberToken(); - - /** - * Set the token value for the "remember me" session. - * - * @param string $value - * @return void - */ - public function setRememberToken($value); - - /** - * Get the column name for the "remember me" token. - * - * @return string - */ - public function getRememberTokenName(); -} diff --git a/vendor/illuminate/contracts/Auth/CanResetPassword.php b/vendor/illuminate/contracts/Auth/CanResetPassword.php deleted file mode 100644 index 3a67707..0000000 --- a/vendor/illuminate/contracts/Auth/CanResetPassword.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Auth; - -interface CanResetPassword -{ - /** - * Get the e-mail address where password reset links are sent. - * - * @return string - */ - public function getEmailForPasswordReset(); - - /** - * Send the password reset notification. - * - * @param string $token - * @return void - */ - public function sendPasswordResetNotification($token); -} diff --git a/vendor/illuminate/contracts/Auth/Factory.php b/vendor/illuminate/contracts/Auth/Factory.php deleted file mode 100644 index 3ee9c8c..0000000 --- a/vendor/illuminate/contracts/Auth/Factory.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Auth; - -interface Factory -{ - /** - * Get a guard instance by name. - * - * @param string|null $name - * @return mixed - */ - public function guard($name = null); - - /** - * Set the default guard the factory should serve. - * - * @param string $name - * @return void - */ - public function shouldUse($name); -} diff --git a/vendor/illuminate/contracts/Auth/Guard.php b/vendor/illuminate/contracts/Auth/Guard.php deleted file mode 100644 index 2a2ed3d..0000000 --- a/vendor/illuminate/contracts/Auth/Guard.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Auth; - -interface Guard -{ - /** - * Determine if the current user is authenticated. - * - * @return bool - */ - public function check(); - - /** - * Determine if the current user is a guest. - * - * @return bool - */ - public function guest(); - - /** - * Get the currently authenticated user. - * - * @return \Illuminate\Contracts\Auth\Authenticatable|null - */ - public function user(); - - /** - * Get the ID for the currently authenticated user. - * - * @return int|null - */ - public function id(); - - /** - * Validate a user's credentials. - * - * @param array $credentials - * @return bool - */ - public function validate(array $credentials = []); - - /** - * Set the current user. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @return void - */ - public function setUser(Authenticatable $user); -} diff --git a/vendor/illuminate/contracts/Auth/PasswordBroker.php b/vendor/illuminate/contracts/Auth/PasswordBroker.php deleted file mode 100644 index e8ac0c0..0000000 --- a/vendor/illuminate/contracts/Auth/PasswordBroker.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Auth; - -use Closure; - -interface PasswordBroker -{ - /** - * Constant representing a successfully sent reminder. - * - * @var string - */ - const RESET_LINK_SENT = 'passwords.sent'; - - /** - * Constant representing a successfully reset password. - * - * @var string - */ - const PASSWORD_RESET = 'passwords.reset'; - - /** - * Constant representing the user not found response. - * - * @var string - */ - const INVALID_USER = 'passwords.user'; - - /** - * Constant representing an invalid password. - * - * @var string - */ - const INVALID_PASSWORD = 'passwords.password'; - - /** - * Constant representing an invalid token. - * - * @var string - */ - const INVALID_TOKEN = 'passwords.token'; - - /** - * Send a password reset link to a user. - * - * @param array $credentials - * @return string - */ - public function sendResetLink(array $credentials); - - /** - * Reset the password for the given token. - * - * @param array $credentials - * @param \Closure $callback - * @return mixed - */ - public function reset(array $credentials, Closure $callback); - - /** - * Set a custom password validator. - * - * @param \Closure $callback - * @return void - */ - public function validator(Closure $callback); - - /** - * Determine if the passwords match for the request. - * - * @param array $credentials - * @return bool - */ - public function validateNewPassword(array $credentials); -} diff --git a/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php b/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php deleted file mode 100644 index 47b1c08..0000000 --- a/vendor/illuminate/contracts/Auth/PasswordBrokerFactory.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Auth; - -interface PasswordBrokerFactory -{ - /** - * Get a password broker instance by name. - * - * @param string|null $name - * @return mixed - */ - public function broker($name = null); -} diff --git a/vendor/illuminate/contracts/Auth/StatefulGuard.php b/vendor/illuminate/contracts/Auth/StatefulGuard.php deleted file mode 100644 index cfd623d..0000000 --- a/vendor/illuminate/contracts/Auth/StatefulGuard.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Auth; - -interface StatefulGuard extends Guard -{ - /** - * Attempt to authenticate a user using the given credentials. - * - * @param array $credentials - * @param bool $remember - * @return bool - */ - public function attempt(array $credentials = [], $remember = false); - - /** - * Log a user into the application without sessions or cookies. - * - * @param array $credentials - * @return bool - */ - public function once(array $credentials = []); - - /** - * Log a user into the application. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @param bool $remember - * @return void - */ - public function login(Authenticatable $user, $remember = false); - - /** - * Log the given user ID into the application. - * - * @param mixed $id - * @param bool $remember - * @return \Illuminate\Contracts\Auth\Authenticatable - */ - public function loginUsingId($id, $remember = false); - - /** - * Log the given user ID into the application without sessions or cookies. - * - * @param mixed $id - * @return bool - */ - public function onceUsingId($id); - - /** - * Determine if the user was authenticated via "remember me" cookie. - * - * @return bool - */ - public function viaRemember(); - - /** - * Log the user out of the application. - * - * @return void - */ - public function logout(); -} diff --git a/vendor/illuminate/contracts/Auth/SupportsBasicAuth.php b/vendor/illuminate/contracts/Auth/SupportsBasicAuth.php deleted file mode 100644 index 9c54591..0000000 --- a/vendor/illuminate/contracts/Auth/SupportsBasicAuth.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Auth; - -interface SupportsBasicAuth -{ - /** - * Attempt to authenticate using HTTP Basic Auth. - * - * @param string $field - * @param array $extraConditions - * @return \Symfony\Component\HttpFoundation\Response|null - */ - public function basic($field = 'email', $extraConditions = []); - - /** - * Perform a stateless HTTP Basic login attempt. - * - * @param string $field - * @param array $extraConditions - * @return \Symfony\Component\HttpFoundation\Response|null - */ - public function onceBasic($field = 'email', $extraConditions = []); -} diff --git a/vendor/illuminate/contracts/Auth/UserProvider.php b/vendor/illuminate/contracts/Auth/UserProvider.php deleted file mode 100644 index a12aa3d..0000000 --- a/vendor/illuminate/contracts/Auth/UserProvider.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Auth; - -interface UserProvider -{ - /** - * Retrieve a user by their unique identifier. - * - * @param mixed $identifier - * @return \Illuminate\Contracts\Auth\Authenticatable|null - */ - public function retrieveById($identifier); - - /** - * Retrieve a user by their unique identifier and "remember me" token. - * - * @param mixed $identifier - * @param string $token - * @return \Illuminate\Contracts\Auth\Authenticatable|null - */ - public function retrieveByToken($identifier, $token); - - /** - * Update the "remember me" token for the given user in storage. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @param string $token - * @return void - */ - public function updateRememberToken(Authenticatable $user, $token); - - /** - * Retrieve a user by the given credentials. - * - * @param array $credentials - * @return \Illuminate\Contracts\Auth\Authenticatable|null - */ - public function retrieveByCredentials(array $credentials); - - /** - * Validate a user against the given credentials. - * - * @param \Illuminate\Contracts\Auth\Authenticatable $user - * @param array $credentials - * @return bool - */ - public function validateCredentials(Authenticatable $user, array $credentials); -} diff --git a/vendor/illuminate/contracts/Broadcasting/Broadcaster.php b/vendor/illuminate/contracts/Broadcasting/Broadcaster.php deleted file mode 100644 index 1034e44..0000000 --- a/vendor/illuminate/contracts/Broadcasting/Broadcaster.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Broadcasting; - -interface Broadcaster -{ - /** - * Authenticate the incoming request for a given channel. - * - * @param \Illuminate\Http\Request $request - * @return mixed - */ - public function auth($request); - - /** - * Return the valid authentication response. - * - * @param \Illuminate\Http\Request $request - * @param mixed $result - * @return mixed - */ - public function validAuthenticationResponse($request, $result); - - /** - * Broadcast the given event. - * - * @param array $channels - * @param string $event - * @param array $payload - * @return void - */ - public function broadcast(array $channels, $event, array $payload = []); -} diff --git a/vendor/illuminate/contracts/Broadcasting/Factory.php b/vendor/illuminate/contracts/Broadcasting/Factory.php deleted file mode 100644 index 1d3a737..0000000 --- a/vendor/illuminate/contracts/Broadcasting/Factory.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Broadcasting; - -interface Factory -{ - /** - * Get a broadcaster implementation by name. - * - * @param string $name - * @return void - */ - public function connection($name = null); -} diff --git a/vendor/illuminate/contracts/Broadcasting/ShouldBroadcast.php b/vendor/illuminate/contracts/Broadcasting/ShouldBroadcast.php deleted file mode 100644 index b051e3b..0000000 --- a/vendor/illuminate/contracts/Broadcasting/ShouldBroadcast.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Broadcasting; - -use Illuminate\Broadcasting\Channel; - -interface ShouldBroadcast -{ - /** - * Get the channels the event should broadcast on. - * - * @return Channel|Channel[] - */ - public function broadcastOn(); -} diff --git a/vendor/illuminate/contracts/Broadcasting/ShouldBroadcastNow.php b/vendor/illuminate/contracts/Broadcasting/ShouldBroadcastNow.php deleted file mode 100644 index eba3584..0000000 --- a/vendor/illuminate/contracts/Broadcasting/ShouldBroadcastNow.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Broadcasting; - -interface ShouldBroadcastNow extends ShouldBroadcast -{ - // -} diff --git a/vendor/illuminate/contracts/Bus/Dispatcher.php b/vendor/illuminate/contracts/Bus/Dispatcher.php deleted file mode 100644 index 3370ad3..0000000 --- a/vendor/illuminate/contracts/Bus/Dispatcher.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Bus; - -interface Dispatcher -{ - /** - * Dispatch a command to its appropriate handler. - * - * @param mixed $command - * @return mixed - */ - public function dispatch($command); - - /** - * Dispatch a command to its appropriate handler in the current process. - * - * @param mixed $command - * @param mixed $handler - * @return mixed - */ - public function dispatchNow($command, $handler = null); - - /** - * Set the pipes commands should be piped through before dispatching. - * - * @param array $pipes - * @return $this - */ - public function pipeThrough(array $pipes); -} diff --git a/vendor/illuminate/contracts/Bus/QueueingDispatcher.php b/vendor/illuminate/contracts/Bus/QueueingDispatcher.php deleted file mode 100644 index e99f7eb..0000000 --- a/vendor/illuminate/contracts/Bus/QueueingDispatcher.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Bus; - -interface QueueingDispatcher extends Dispatcher -{ - /** - * Dispatch a command to its appropriate handler behind a queue. - * - * @param mixed $command - * @return mixed - */ - public function dispatchToQueue($command); -} diff --git a/vendor/illuminate/contracts/Cache/Factory.php b/vendor/illuminate/contracts/Cache/Factory.php deleted file mode 100644 index 3924662..0000000 --- a/vendor/illuminate/contracts/Cache/Factory.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Cache; - -interface Factory -{ - /** - * Get a cache store instance by name. - * - * @param string|null $name - * @return \Illuminate\Contracts\Cache\Repository - */ - public function store($name = null); -} diff --git a/vendor/illuminate/contracts/Cache/Lock.php b/vendor/illuminate/contracts/Cache/Lock.php deleted file mode 100644 index ee7dddc..0000000 --- a/vendor/illuminate/contracts/Cache/Lock.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Cache; - -interface Lock -{ - /** - * Attempt to acquire the lock. - * - * @param callable|null $callback - * @return bool - */ - public function get($callback = null); - - /** - * Attempt to acquire the lock for the given number of seconds. - * - * @param int $seconds - * @param callable|null $callback - * @return bool - */ - public function block($seconds, $callback = null); - - /** - * Release the lock. - * - * @return void - */ - public function release(); -} diff --git a/vendor/illuminate/contracts/Cache/LockProvider.php b/vendor/illuminate/contracts/Cache/LockProvider.php deleted file mode 100644 index d7e18b2..0000000 --- a/vendor/illuminate/contracts/Cache/LockProvider.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Cache; - -interface LockProvider -{ - /** - * Get a lock instance. - * - * @param string $name - * @param int $seconds - * @return \Illuminate\Contracts\Cache\Lock - */ - public function lock($name, $seconds = 0); -} diff --git a/vendor/illuminate/contracts/Cache/LockTimeoutException.php b/vendor/illuminate/contracts/Cache/LockTimeoutException.php deleted file mode 100644 index 53327e2..0000000 --- a/vendor/illuminate/contracts/Cache/LockTimeoutException.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Cache; - -use Exception; - -class LockTimeoutException extends Exception -{ - // -} diff --git a/vendor/illuminate/contracts/Cache/Repository.php b/vendor/illuminate/contracts/Cache/Repository.php deleted file mode 100644 index 7820fbf..0000000 --- a/vendor/illuminate/contracts/Cache/Repository.php +++ /dev/null @@ -1,125 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Cache; - -use Closure; -use Psr\SimpleCache\CacheInterface; - -interface Repository extends CacheInterface -{ - /** - * Determine if an item exists in the cache. - * - * @param string $key - * @return bool - */ - public function has($key); - - /** - * Retrieve an item from the cache by key. - * - * @param string $key - * @param mixed $default - * @return mixed - */ - public function get($key, $default = null); - - /** - * Retrieve an item from the cache and delete it. - * - * @param string $key - * @param mixed $default - * @return mixed - */ - public function pull($key, $default = null); - - /** - * Store an item in the cache. - * - * @param string $key - * @param mixed $value - * @param \DateTimeInterface|\DateInterval|float|int $minutes - * @return void - */ - public function put($key, $value, $minutes); - - /** - * Store an item in the cache if the key does not exist. - * - * @param string $key - * @param mixed $value - * @param \DateTimeInterface|\DateInterval|float|int $minutes - * @return bool - */ - public function add($key, $value, $minutes); - - /** - * Increment the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function increment($key, $value = 1); - - /** - * Decrement the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function decrement($key, $value = 1); - - /** - * Store an item in the cache indefinitely. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function forever($key, $value); - - /** - * Get an item from the cache, or store the default value. - * - * @param string $key - * @param \DateTimeInterface|\DateInterval|float|int $minutes - * @param \Closure $callback - * @return mixed - */ - public function remember($key, $minutes, Closure $callback); - - /** - * Get an item from the cache, or store the default value forever. - * - * @param string $key - * @param \Closure $callback - * @return mixed - */ - public function sear($key, Closure $callback); - - /** - * Get an item from the cache, or store the default value forever. - * - * @param string $key - * @param \Closure $callback - * @return mixed - */ - public function rememberForever($key, Closure $callback); - - /** - * Remove an item from the cache. - * - * @param string $key - * @return bool - */ - public function forget($key); - - /** - * Get the cache store implementation. - * - * @return \Illuminate\Contracts\Cache\Store - */ - public function getStore(); -} diff --git a/vendor/illuminate/contracts/Cache/Store.php b/vendor/illuminate/contracts/Cache/Store.php deleted file mode 100644 index 5615762..0000000 --- a/vendor/illuminate/contracts/Cache/Store.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Cache; - -interface Store -{ - /** - * Retrieve an item from the cache by key. - * - * @param string|array $key - * @return mixed - */ - public function get($key); - - /** - * Retrieve multiple items from the cache by key. - * - * Items not found in the cache will have a null value. - * - * @param array $keys - * @return array - */ - public function many(array $keys); - - /** - * Store an item in the cache for a given number of minutes. - * - * @param string $key - * @param mixed $value - * @param float|int $minutes - * @return void - */ - public function put($key, $value, $minutes); - - /** - * Store multiple items in the cache for a given number of minutes. - * - * @param array $values - * @param float|int $minutes - * @return void - */ - public function putMany(array $values, $minutes); - - /** - * Increment the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function increment($key, $value = 1); - - /** - * Decrement the value of an item in the cache. - * - * @param string $key - * @param mixed $value - * @return int|bool - */ - public function decrement($key, $value = 1); - - /** - * Store an item in the cache indefinitely. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function forever($key, $value); - - /** - * Remove an item from the cache. - * - * @param string $key - * @return bool - */ - public function forget($key); - - /** - * Remove all items from the cache. - * - * @return bool - */ - public function flush(); - - /** - * Get the cache key prefix. - * - * @return string - */ - public function getPrefix(); -} diff --git a/vendor/illuminate/contracts/Config/Repository.php b/vendor/illuminate/contracts/Config/Repository.php deleted file mode 100644 index 17c1d5f..0000000 --- a/vendor/illuminate/contracts/Config/Repository.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Config; - -interface Repository -{ - /** - * Determine if the given configuration value exists. - * - * @param string $key - * @return bool - */ - public function has($key); - - /** - * Get the specified configuration value. - * - * @param array|string $key - * @param mixed $default - * @return mixed - */ - public function get($key, $default = null); - - /** - * Get all of the configuration items for the application. - * - * @return array - */ - public function all(); - - /** - * Set a given configuration value. - * - * @param array|string $key - * @param mixed $value - * @return void - */ - public function set($key, $value = null); - - /** - * Prepend a value onto an array configuration value. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function prepend($key, $value); - - /** - * Push a value onto an array configuration value. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function push($key, $value); -} diff --git a/vendor/illuminate/contracts/Console/Application.php b/vendor/illuminate/contracts/Console/Application.php deleted file mode 100644 index a59e431..0000000 --- a/vendor/illuminate/contracts/Console/Application.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Console; - -interface Application -{ - /** - * Call a console application command. - * - * @param string $command - * @param array $parameters - * @return int - */ - public function call($command, array $parameters = []); - - /** - * Get the output from the last command. - * - * @return string - */ - public function output(); -} diff --git a/vendor/illuminate/contracts/Console/Kernel.php b/vendor/illuminate/contracts/Console/Kernel.php deleted file mode 100644 index 4cf7986..0000000 --- a/vendor/illuminate/contracts/Console/Kernel.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Console; - -interface Kernel -{ - /** - * Handle an incoming console command. - * - * @param \Symfony\Component\Console\Input\InputInterface $input - * @param \Symfony\Component\Console\Output\OutputInterface $output - * @return int - */ - public function handle($input, $output = null); - - /** - * Run an Artisan console command by name. - * - * @param string $command - * @param array $parameters - * @return int - */ - public function call($command, array $parameters = []); - - /** - * Queue an Artisan console command by name. - * - * @param string $command - * @param array $parameters - * @return \Illuminate\Foundation\Bus\PendingDispatch - */ - public function queue($command, array $parameters = []); - - /** - * Get all of the commands registered with the console. - * - * @return array - */ - public function all(); - - /** - * Get the output for the last run command. - * - * @return string - */ - public function output(); -} diff --git a/vendor/illuminate/contracts/Container/BindingResolutionException.php b/vendor/illuminate/contracts/Container/BindingResolutionException.php deleted file mode 100644 index a69c24c..0000000 --- a/vendor/illuminate/contracts/Container/BindingResolutionException.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Container; - -use Exception; -use Psr\Container\ContainerExceptionInterface; - -class BindingResolutionException extends Exception implements ContainerExceptionInterface -{ - // -} diff --git a/vendor/illuminate/contracts/Container/Container.php b/vendor/illuminate/contracts/Container/Container.php deleted file mode 100644 index c68c645..0000000 --- a/vendor/illuminate/contracts/Container/Container.php +++ /dev/null @@ -1,153 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Container; - -use Closure; -use Psr\Container\ContainerInterface; - -interface Container extends ContainerInterface -{ - /** - * Determine if the given abstract type has been bound. - * - * @param string $abstract - * @return bool - */ - public function bound($abstract); - - /** - * Alias a type to a different name. - * - * @param string $abstract - * @param string $alias - * @return void - */ - public function alias($abstract, $alias); - - /** - * Assign a set of tags to a given binding. - * - * @param array|string $abstracts - * @param array|mixed ...$tags - * @return void - */ - public function tag($abstracts, $tags); - - /** - * Resolve all of the bindings for a given tag. - * - * @param string $tag - * @return array - */ - public function tagged($tag); - - /** - * Register a binding with the container. - * - * @param string $abstract - * @param \Closure|string|null $concrete - * @param bool $shared - * @return void - */ - public function bind($abstract, $concrete = null, $shared = false); - - /** - * Register a binding if it hasn't already been registered. - * - * @param string $abstract - * @param \Closure|string|null $concrete - * @param bool $shared - * @return void - */ - public function bindIf($abstract, $concrete = null, $shared = false); - - /** - * Register a shared binding in the container. - * - * @param string $abstract - * @param \Closure|string|null $concrete - * @return void - */ - public function singleton($abstract, $concrete = null); - - /** - * "Extend" an abstract type in the container. - * - * @param string $abstract - * @param \Closure $closure - * @return void - * - * @throws \InvalidArgumentException - */ - public function extend($abstract, Closure $closure); - - /** - * Register an existing instance as shared in the container. - * - * @param string $abstract - * @param mixed $instance - * @return mixed - */ - public function instance($abstract, $instance); - - /** - * Define a contextual binding. - * - * @param string $concrete - * @return \Illuminate\Contracts\Container\ContextualBindingBuilder - */ - public function when($concrete); - - /** - * Get a closure to resolve the given type from the container. - * - * @param string $abstract - * @return \Closure - */ - public function factory($abstract); - - /** - * Resolve the given type from the container. - * - * @param string $abstract - * @param array $parameters - * @return mixed - */ - public function make($abstract, array $parameters = []); - - /** - * Call the given Closure / class@method and inject its dependencies. - * - * @param callable|string $callback - * @param array $parameters - * @param string|null $defaultMethod - * @return mixed - */ - public function call($callback, array $parameters = [], $defaultMethod = null); - - /** - * Determine if the given abstract type has been resolved. - * - * @param string $abstract - * @return bool - */ - public function resolved($abstract); - - /** - * Register a new resolving callback. - * - * @param \Closure|string $abstract - * @param \Closure|null $callback - * @return void - */ - public function resolving($abstract, Closure $callback = null); - - /** - * Register a new after resolving callback. - * - * @param \Closure|string $abstract - * @param \Closure|null $callback - * @return void - */ - public function afterResolving($abstract, Closure $callback = null); -} diff --git a/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php b/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php deleted file mode 100644 index e2ee147..0000000 --- a/vendor/illuminate/contracts/Container/ContextualBindingBuilder.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Container; - -interface ContextualBindingBuilder -{ - /** - * Define the abstract target that depends on the context. - * - * @param string $abstract - * @return $this - */ - public function needs($abstract); - - /** - * Define the implementation for the contextual binding. - * - * @param \Closure|string $implementation - * @return void - */ - public function give($implementation); -} diff --git a/vendor/illuminate/contracts/Cookie/Factory.php b/vendor/illuminate/contracts/Cookie/Factory.php deleted file mode 100644 index 6124397..0000000 --- a/vendor/illuminate/contracts/Cookie/Factory.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Cookie; - -interface Factory -{ - /** - * Create a new cookie instance. - * - * @param string $name - * @param string $value - * @param int $minutes - * @param string $path - * @param string $domain - * @param bool $secure - * @param bool $httpOnly - * @return \Symfony\Component\HttpFoundation\Cookie - */ - public function make($name, $value, $minutes = 0, $path = null, $domain = null, $secure = false, $httpOnly = true); - - /** - * Create a cookie that lasts "forever" (five years). - * - * @param string $name - * @param string $value - * @param string $path - * @param string $domain - * @param bool $secure - * @param bool $httpOnly - * @return \Symfony\Component\HttpFoundation\Cookie - */ - public function forever($name, $value, $path = null, $domain = null, $secure = false, $httpOnly = true); - - /** - * Expire the given cookie. - * - * @param string $name - * @param string $path - * @param string $domain - * @return \Symfony\Component\HttpFoundation\Cookie - */ - public function forget($name, $path = null, $domain = null); -} diff --git a/vendor/illuminate/contracts/Cookie/QueueingFactory.php b/vendor/illuminate/contracts/Cookie/QueueingFactory.php deleted file mode 100644 index e8fa3e2..0000000 --- a/vendor/illuminate/contracts/Cookie/QueueingFactory.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Cookie; - -interface QueueingFactory extends Factory -{ - /** - * Queue a cookie to send with the next response. - * - * @param array $parameters - * @return void - */ - public function queue(...$parameters); - - /** - * Remove a cookie from the queue. - * - * @param string $name - */ - public function unqueue($name); - - /** - * Get the cookies which have been queued for the next request. - * - * @return array - */ - public function getQueuedCookies(); -} diff --git a/vendor/illuminate/contracts/Database/ModelIdentifier.php b/vendor/illuminate/contracts/Database/ModelIdentifier.php deleted file mode 100644 index 587044a..0000000 --- a/vendor/illuminate/contracts/Database/ModelIdentifier.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Database; - -class ModelIdentifier -{ - /** - * The class name of the model. - * - * @var string - */ - public $class; - - /** - * The unique identifier of the model. - * - * This may be either a single ID or an array of IDs. - * - * @var mixed - */ - public $id; - - /** - * The connection name of the model. - * - * @var string|null - */ - public $connection; - - /** - * Create a new model identifier. - * - * @param string $class - * @param mixed $id - * @param mixed $connection - * @return void - */ - public function __construct($class, $id, $connection) - { - $this->id = $id; - $this->class = $class; - $this->connection = $connection; - } -} diff --git a/vendor/illuminate/contracts/Debug/ExceptionHandler.php b/vendor/illuminate/contracts/Debug/ExceptionHandler.php deleted file mode 100644 index e3f18a5..0000000 --- a/vendor/illuminate/contracts/Debug/ExceptionHandler.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Debug; - -use Exception; - -interface ExceptionHandler -{ - /** - * Report or log an exception. - * - * @param \Exception $e - * @return void - */ - public function report(Exception $e); - - /** - * Render an exception into an HTTP response. - * - * @param \Illuminate\Http\Request $request - * @param \Exception $e - * @return \Symfony\Component\HttpFoundation\Response - */ - public function render($request, Exception $e); - - /** - * Render an exception to the console. - * - * @param \Symfony\Component\Console\Output\OutputInterface $output - * @param \Exception $e - * @return void - */ - public function renderForConsole($output, Exception $e); -} diff --git a/vendor/illuminate/contracts/Encryption/DecryptException.php b/vendor/illuminate/contracts/Encryption/DecryptException.php deleted file mode 100644 index 7edebc9..0000000 --- a/vendor/illuminate/contracts/Encryption/DecryptException.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Encryption; - -use RuntimeException; - -class DecryptException extends RuntimeException -{ - // -} diff --git a/vendor/illuminate/contracts/Encryption/EncryptException.php b/vendor/illuminate/contracts/Encryption/EncryptException.php deleted file mode 100644 index 2146ee0..0000000 --- a/vendor/illuminate/contracts/Encryption/EncryptException.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Encryption; - -use RuntimeException; - -class EncryptException extends RuntimeException -{ - // -} diff --git a/vendor/illuminate/contracts/Encryption/Encrypter.php b/vendor/illuminate/contracts/Encryption/Encrypter.php deleted file mode 100644 index 11e0b45..0000000 --- a/vendor/illuminate/contracts/Encryption/Encrypter.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Encryption; - -interface Encrypter -{ - /** - * Encrypt the given value. - * - * @param string $value - * @param bool $serialize - * @return string - */ - public function encrypt($value, $serialize = true); - - /** - * Decrypt the given value. - * - * @param string $payload - * @param bool $unserialize - * @return string - */ - public function decrypt($payload, $unserialize = true); -} diff --git a/vendor/illuminate/contracts/Events/Dispatcher.php b/vendor/illuminate/contracts/Events/Dispatcher.php deleted file mode 100644 index a533e7d..0000000 --- a/vendor/illuminate/contracts/Events/Dispatcher.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Events; - -interface Dispatcher -{ - /** - * Register an event listener with the dispatcher. - * - * @param string|array $events - * @param mixed $listener - * @return void - */ - public function listen($events, $listener); - - /** - * Determine if a given event has listeners. - * - * @param string $eventName - * @return bool - */ - public function hasListeners($eventName); - - /** - * Register an event subscriber with the dispatcher. - * - * @param object|string $subscriber - * @return void - */ - public function subscribe($subscriber); - - /** - * Dispatch an event until the first non-null response is returned. - * - * @param string|object $event - * @param mixed $payload - * @return array|null - */ - public function until($event, $payload = []); - - /** - * Dispatch an event and call the listeners. - * - * @param string|object $event - * @param mixed $payload - * @param bool $halt - * @return array|null - */ - public function dispatch($event, $payload = [], $halt = false); - - /** - * Register an event and payload to be fired later. - * - * @param string $event - * @param array $payload - * @return void - */ - public function push($event, $payload = []); - - /** - * Flush a set of pushed events. - * - * @param string $event - * @return void - */ - public function flush($event); - - /** - * Remove a set of listeners from the dispatcher. - * - * @param string $event - * @return void - */ - public function forget($event); - - /** - * Forget all of the queued listeners. - * - * @return void - */ - public function forgetPushed(); -} diff --git a/vendor/illuminate/contracts/Filesystem/Cloud.php b/vendor/illuminate/contracts/Filesystem/Cloud.php deleted file mode 100644 index 86bea26..0000000 --- a/vendor/illuminate/contracts/Filesystem/Cloud.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Filesystem; - -interface Cloud extends Filesystem -{ - /** - * Get the URL for the file at the given path. - * - * @param string $path - * @return string - */ - public function url($path); -} diff --git a/vendor/illuminate/contracts/Filesystem/Factory.php b/vendor/illuminate/contracts/Filesystem/Factory.php deleted file mode 100644 index 7a86138..0000000 --- a/vendor/illuminate/contracts/Filesystem/Factory.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Filesystem; - -interface Factory -{ - /** - * Get a filesystem implementation. - * - * @param string $name - * @return \Illuminate\Contracts\Filesystem\Filesystem - */ - public function disk($name = null); -} diff --git a/vendor/illuminate/contracts/Filesystem/FileNotFoundException.php b/vendor/illuminate/contracts/Filesystem/FileNotFoundException.php deleted file mode 100644 index 37b7930..0000000 --- a/vendor/illuminate/contracts/Filesystem/FileNotFoundException.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Filesystem; - -use Exception; - -class FileNotFoundException extends Exception -{ - // -} diff --git a/vendor/illuminate/contracts/Filesystem/Filesystem.php b/vendor/illuminate/contracts/Filesystem/Filesystem.php deleted file mode 100644 index 69a189c..0000000 --- a/vendor/illuminate/contracts/Filesystem/Filesystem.php +++ /dev/null @@ -1,175 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Filesystem; - -interface Filesystem -{ - /** - * The public visibility setting. - * - * @var string - */ - const VISIBILITY_PUBLIC = 'public'; - - /** - * The private visibility setting. - * - * @var string - */ - const VISIBILITY_PRIVATE = 'private'; - - /** - * Determine if a file exists. - * - * @param string $path - * @return bool - */ - public function exists($path); - - /** - * Get the contents of a file. - * - * @param string $path - * @return string - * - * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException - */ - public function get($path); - - /** - * Write the contents of a file. - * - * @param string $path - * @param string|resource $contents - * @param mixed $options - * @return bool - */ - public function put($path, $contents, $options = []); - - /** - * Get the visibility for the given path. - * - * @param string $path - * @return string - */ - public function getVisibility($path); - - /** - * Set the visibility for the given path. - * - * @param string $path - * @param string $visibility - * @return void - */ - public function setVisibility($path, $visibility); - - /** - * Prepend to a file. - * - * @param string $path - * @param string $data - * @return int - */ - public function prepend($path, $data); - - /** - * Append to a file. - * - * @param string $path - * @param string $data - * @return int - */ - public function append($path, $data); - - /** - * Delete the file at a given path. - * - * @param string|array $paths - * @return bool - */ - public function delete($paths); - - /** - * Copy a file to a new location. - * - * @param string $from - * @param string $to - * @return bool - */ - public function copy($from, $to); - - /** - * Move a file to a new location. - * - * @param string $from - * @param string $to - * @return bool - */ - public function move($from, $to); - - /** - * Get the file size of a given file. - * - * @param string $path - * @return int - */ - public function size($path); - - /** - * Get the file's last modification time. - * - * @param string $path - * @return int - */ - public function lastModified($path); - - /** - * Get an array of all files in a directory. - * - * @param string|null $directory - * @param bool $recursive - * @return array - */ - public function files($directory = null, $recursive = false); - - /** - * Get all of the files from the given directory (recursive). - * - * @param string|null $directory - * @return array - */ - public function allFiles($directory = null); - - /** - * Get all of the directories within a given directory. - * - * @param string|null $directory - * @param bool $recursive - * @return array - */ - public function directories($directory = null, $recursive = false); - - /** - * Get all (recursive) of the directories within a given directory. - * - * @param string|null $directory - * @return array - */ - public function allDirectories($directory = null); - - /** - * Create a directory. - * - * @param string $path - * @return bool - */ - public function makeDirectory($path); - - /** - * Recursively delete a directory. - * - * @param string $directory - * @return bool - */ - public function deleteDirectory($directory); -} diff --git a/vendor/illuminate/contracts/Foundation/Application.php b/vendor/illuminate/contracts/Foundation/Application.php deleted file mode 100644 index a7d643b..0000000 --- a/vendor/illuminate/contracts/Foundation/Application.php +++ /dev/null @@ -1,106 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Foundation; - -use Illuminate\Contracts\Container\Container; - -interface Application extends Container -{ - /** - * Get the version number of the application. - * - * @return string - */ - public function version(); - - /** - * Get the base path of the Laravel installation. - * - * @return string - */ - public function basePath(); - - /** - * Get or check the current application environment. - * - * @return string - */ - public function environment(); - - /** - * Determine if we are running in the console. - * - * @return bool - */ - public function runningInConsole(); - - /** - * Determine if the application is currently down for maintenance. - * - * @return bool - */ - public function isDownForMaintenance(); - - /** - * Register all of the configured providers. - * - * @return void - */ - public function registerConfiguredProviders(); - - /** - * Register a service provider with the application. - * - * @param \Illuminate\Support\ServiceProvider|string $provider - * @param array $options - * @param bool $force - * @return \Illuminate\Support\ServiceProvider - */ - public function register($provider, $options = [], $force = false); - - /** - * Register a deferred provider and service. - * - * @param string $provider - * @param string|null $service - * @return void - */ - public function registerDeferredProvider($provider, $service = null); - - /** - * Boot the application's service providers. - * - * @return void - */ - public function boot(); - - /** - * Register a new boot listener. - * - * @param mixed $callback - * @return void - */ - public function booting($callback); - - /** - * Register a new "booted" listener. - * - * @param mixed $callback - * @return void - */ - public function booted($callback); - - /** - * Get the path to the cached services.php file. - * - * @return string - */ - public function getCachedServicesPath(); - - /** - * Get the path to the cached packages.php file. - * - * @return string - */ - public function getCachedPackagesPath(); -} diff --git a/vendor/illuminate/contracts/Hashing/Hasher.php b/vendor/illuminate/contracts/Hashing/Hasher.php deleted file mode 100644 index 3310136..0000000 --- a/vendor/illuminate/contracts/Hashing/Hasher.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Hashing; - -interface Hasher -{ - /** - * Hash the given value. - * - * @param string $value - * @param array $options - * @return string - */ - public function make($value, array $options = []); - - /** - * Check the given plain value against a hash. - * - * @param string $value - * @param string $hashedValue - * @param array $options - * @return bool - */ - public function check($value, $hashedValue, array $options = []); - - /** - * Check if the given hash has been hashed using the given options. - * - * @param string $hashedValue - * @param array $options - * @return bool - */ - public function needsRehash($hashedValue, array $options = []); -} diff --git a/vendor/illuminate/contracts/Http/Kernel.php b/vendor/illuminate/contracts/Http/Kernel.php deleted file mode 100644 index 6eab6e6..0000000 --- a/vendor/illuminate/contracts/Http/Kernel.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Http; - -interface Kernel -{ - /** - * Bootstrap the application for HTTP requests. - * - * @return void - */ - public function bootstrap(); - - /** - * Handle an incoming HTTP request. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * @return \Symfony\Component\HttpFoundation\Response - */ - public function handle($request); - - /** - * Perform any final actions for the request lifecycle. - * - * @param \Symfony\Component\HttpFoundation\Request $request - * @param \Symfony\Component\HttpFoundation\Response $response - * @return void - */ - public function terminate($request, $response); - - /** - * Get the Laravel application instance. - * - * @return \Illuminate\Contracts\Foundation\Application - */ - public function getApplication(); -} diff --git a/vendor/illuminate/contracts/Logging/Log.php b/vendor/illuminate/contracts/Logging/Log.php deleted file mode 100644 index 5ecb9f8..0000000 --- a/vendor/illuminate/contracts/Logging/Log.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Logging; - -interface Log -{ - /** - * Log an alert message to the logs. - * - * @param string $message - * @param array $context - * @return void - */ - public function alert($message, array $context = []); - - /** - * Log a critical message to the logs. - * - * @param string $message - * @param array $context - * @return void - */ - public function critical($message, array $context = []); - - /** - * Log an error message to the logs. - * - * @param string $message - * @param array $context - * @return void - */ - public function error($message, array $context = []); - - /** - * Log a warning message to the logs. - * - * @param string $message - * @param array $context - * @return void - */ - public function warning($message, array $context = []); - - /** - * Log a notice to the logs. - * - * @param string $message - * @param array $context - * @return void - */ - public function notice($message, array $context = []); - - /** - * Log an informational message to the logs. - * - * @param string $message - * @param array $context - * @return void - */ - public function info($message, array $context = []); - - /** - * Log a debug message to the logs. - * - * @param string $message - * @param array $context - * @return void - */ - public function debug($message, array $context = []); - - /** - * Log a message to the logs. - * - * @param string $level - * @param string $message - * @param array $context - * @return void - */ - public function log($level, $message, array $context = []); - - /** - * Register a file log handler. - * - * @param string $path - * @param string $level - * @return void - */ - public function useFiles($path, $level = 'debug'); - - /** - * Register a daily file log handler. - * - * @param string $path - * @param int $days - * @param string $level - * @return void - */ - public function useDailyFiles($path, $days = 0, $level = 'debug'); -} diff --git a/vendor/illuminate/contracts/Mail/MailQueue.php b/vendor/illuminate/contracts/Mail/MailQueue.php deleted file mode 100644 index 1019b05..0000000 --- a/vendor/illuminate/contracts/Mail/MailQueue.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Mail; - -interface MailQueue -{ - /** - * Queue a new e-mail message for sending. - * - * @param string|array|MailableContract $view - * @param string $queue - * @return mixed - */ - public function queue($view, $queue = null); - - /** - * Queue a new e-mail message for sending after (n) seconds. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @param string|array|MailableContract $view - * @param string $queue - * @return mixed - */ - public function later($delay, $view, $queue = null); -} diff --git a/vendor/illuminate/contracts/Mail/Mailable.php b/vendor/illuminate/contracts/Mail/Mailable.php deleted file mode 100644 index 2612070..0000000 --- a/vendor/illuminate/contracts/Mail/Mailable.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Mail; - -use Illuminate\Contracts\Queue\Factory as Queue; - -interface Mailable -{ - /** - * Send the message using the given mailer. - * - * @param \Illuminate\Contracts\Mail\Mailer $mailer - * @return void - */ - public function send(Mailer $mailer); - - /** - * Queue the given message. - * - * @param \Illuminate\Contracts\Queue\Factory $queue - * @return mixed - */ - public function queue(Queue $queue); - - /** - * Deliver the queued message after the given delay. - * - * @param \DateTime|int $delay - * @param \Illuminate\Contracts\Queue\Factory $queue - * @return mixed - */ - public function later($delay, Queue $queue); -} diff --git a/vendor/illuminate/contracts/Mail/Mailer.php b/vendor/illuminate/contracts/Mail/Mailer.php deleted file mode 100644 index 559adfc..0000000 --- a/vendor/illuminate/contracts/Mail/Mailer.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Mail; - -interface Mailer -{ - /** - * Begin the process of mailing a mailable class instance. - * - * @param mixed $users - * @return \Illuminate\Mail\PendingMail - */ - public function to($users); - - /** - * Begin the process of mailing a mailable class instance. - * - * @param mixed $users - * @return \Illuminate\Mail\PendingMail - */ - public function bcc($users); - - /** - * Send a new message when only a raw text part. - * - * @param string $text - * @param mixed $callback - * @return void - */ - public function raw($text, $callback); - - /** - * Send a new message using a view. - * - * @param string|array|MailableContract $view - * @param array $data - * @param \Closure|string $callback - * @return void - */ - public function send($view, array $data = [], $callback = null); - - /** - * Get the array of failed recipients. - * - * @return array - */ - public function failures(); -} diff --git a/vendor/illuminate/contracts/Notifications/Dispatcher.php b/vendor/illuminate/contracts/Notifications/Dispatcher.php deleted file mode 100644 index a483ca2..0000000 --- a/vendor/illuminate/contracts/Notifications/Dispatcher.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Notifications; - -interface Dispatcher -{ - /** - * Send the given notification to the given notifiable entities. - * - * @param \Illuminate\Support\Collection|array|mixed $notifiables - * @param mixed $notification - * @return void - */ - public function send($notifiables, $notification); - - /** - * Send the given notification immediately. - * - * @param \Illuminate\Support\Collection|array|mixed $notifiables - * @param mixed $notification - * @return void - */ - public function sendNow($notifiables, $notification); -} diff --git a/vendor/illuminate/contracts/Notifications/Factory.php b/vendor/illuminate/contracts/Notifications/Factory.php deleted file mode 100644 index 7705678..0000000 --- a/vendor/illuminate/contracts/Notifications/Factory.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Notifications; - -interface Factory -{ - /** - * Get a channel instance by name. - * - * @param string|null $name - * @return mixed - */ - public function channel($name = null); - - /** - * Send the given notification to the given notifiable entities. - * - * @param \Illuminate\Support\Collection|array|mixed $notifiables - * @param mixed $notification - * @return void - */ - public function send($notifiables, $notification); - - /** - * Send the given notification immediately. - * - * @param \Illuminate\Support\Collection|array|mixed $notifiables - * @param mixed $notification - * @return void - */ - public function sendNow($notifiables, $notification); -} diff --git a/vendor/illuminate/contracts/Pagination/LengthAwarePaginator.php b/vendor/illuminate/contracts/Pagination/LengthAwarePaginator.php deleted file mode 100644 index 4e6ef71..0000000 --- a/vendor/illuminate/contracts/Pagination/LengthAwarePaginator.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Pagination; - -interface LengthAwarePaginator extends Paginator -{ - /** - * Create a range of pagination URLs. - * - * @param int $start - * @param int $end - * @return array - */ - public function getUrlRange($start, $end); - - /** - * Determine the total number of items in the data store. - * - * @return int - */ - public function total(); - - /** - * Get the page number of the last available page. - * - * @return int - */ - public function lastPage(); -} diff --git a/vendor/illuminate/contracts/Pagination/Paginator.php b/vendor/illuminate/contracts/Pagination/Paginator.php deleted file mode 100644 index a4301ef..0000000 --- a/vendor/illuminate/contracts/Pagination/Paginator.php +++ /dev/null @@ -1,117 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Pagination; - -interface Paginator -{ - /** - * Get the URL for a given page. - * - * @param int $page - * @return string - */ - public function url($page); - - /** - * Add a set of query string values to the paginator. - * - * @param array|string $key - * @param string|null $value - * @return $this - */ - public function appends($key, $value = null); - - /** - * Get / set the URL fragment to be appended to URLs. - * - * @param string|null $fragment - * @return $this|string - */ - public function fragment($fragment = null); - - /** - * The URL for the next page, or null. - * - * @return string|null - */ - public function nextPageUrl(); - - /** - * Get the URL for the previous page, or null. - * - * @return string|null - */ - public function previousPageUrl(); - - /** - * Get all of the items being paginated. - * - * @return array - */ - public function items(); - - /** - * Get the "index" of the first item being paginated. - * - * @return int - */ - public function firstItem(); - - /** - * Get the "index" of the last item being paginated. - * - * @return int - */ - public function lastItem(); - - /** - * Determine how many items are being shown per page. - * - * @return int - */ - public function perPage(); - - /** - * Determine the current page being paginated. - * - * @return int - */ - public function currentPage(); - - /** - * Determine if there are enough items to split into multiple pages. - * - * @return bool - */ - public function hasPages(); - - /** - * Determine if there is more items in the data store. - * - * @return bool - */ - public function hasMorePages(); - - /** - * Determine if the list of items is empty or not. - * - * @return bool - */ - public function isEmpty(); - - /** - * Determine if the list of items is not empty. - * - * @return bool - */ - public function isNotEmpty(); - - /** - * Render the paginator using a given view. - * - * @param string|null $view - * @param array $data - * @return string - */ - public function render($view = null, $data = []); -} diff --git a/vendor/illuminate/contracts/Pipeline/Hub.php b/vendor/illuminate/contracts/Pipeline/Hub.php deleted file mode 100644 index 1ae675f..0000000 --- a/vendor/illuminate/contracts/Pipeline/Hub.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Pipeline; - -interface Hub -{ - /** - * Send an object through one of the available pipelines. - * - * @param mixed $object - * @param string|null $pipeline - * @return mixed - */ - public function pipe($object, $pipeline = null); -} diff --git a/vendor/illuminate/contracts/Pipeline/Pipeline.php b/vendor/illuminate/contracts/Pipeline/Pipeline.php deleted file mode 100644 index 226081c..0000000 --- a/vendor/illuminate/contracts/Pipeline/Pipeline.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Pipeline; - -use Closure; - -interface Pipeline -{ - /** - * Set the traveler object being sent on the pipeline. - * - * @param mixed $traveler - * @return $this - */ - public function send($traveler); - - /** - * Set the stops of the pipeline. - * - * @param dynamic|array $stops - * @return $this - */ - public function through($stops); - - /** - * Set the method to call on the stops. - * - * @param string $method - * @return $this - */ - public function via($method); - - /** - * Run the pipeline with a final destination callback. - * - * @param \Closure $destination - * @return mixed - */ - public function then(Closure $destination); -} diff --git a/vendor/illuminate/contracts/Queue/EntityNotFoundException.php b/vendor/illuminate/contracts/Queue/EntityNotFoundException.php deleted file mode 100644 index 079250d..0000000 --- a/vendor/illuminate/contracts/Queue/EntityNotFoundException.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Queue; - -use InvalidArgumentException; - -class EntityNotFoundException extends InvalidArgumentException -{ - /** - * Create a new exception instance. - * - * @param string $type - * @param mixed $id - * @return void - */ - public function __construct($type, $id) - { - $id = (string) $id; - - parent::__construct("Queueable entity [{$type}] not found for ID [{$id}]."); - } -} diff --git a/vendor/illuminate/contracts/Queue/EntityResolver.php b/vendor/illuminate/contracts/Queue/EntityResolver.php deleted file mode 100644 index aad97a1..0000000 --- a/vendor/illuminate/contracts/Queue/EntityResolver.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Queue; - -interface EntityResolver -{ - /** - * Resolve the entity for the given ID. - * - * @param string $type - * @param mixed $id - * @return mixed - */ - public function resolve($type, $id); -} diff --git a/vendor/illuminate/contracts/Queue/Factory.php b/vendor/illuminate/contracts/Queue/Factory.php deleted file mode 100644 index 3c21575..0000000 --- a/vendor/illuminate/contracts/Queue/Factory.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Queue; - -interface Factory -{ - /** - * Resolve a queue connection instance. - * - * @param string $name - * @return \Illuminate\Contracts\Queue\Queue - */ - public function connection($name = null); -} diff --git a/vendor/illuminate/contracts/Queue/Job.php b/vendor/illuminate/contracts/Queue/Job.php deleted file mode 100644 index 8a90798..0000000 --- a/vendor/illuminate/contracts/Queue/Job.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Queue; - -interface Job -{ - /** - * Fire the job. - * - * @return void - */ - public function fire(); - - /** - * Release the job back into the queue. - * - * @param int $delay - * @return mixed - */ - public function release($delay = 0); - - /** - * Delete the job from the queue. - * - * @return void - */ - public function delete(); - - /** - * Determine if the job has been deleted. - * - * @return bool - */ - public function isDeleted(); - - /** - * Determine if the job has been deleted or released. - * - * @return bool - */ - public function isDeletedOrReleased(); - - /** - * Get the number of times the job has been attempted. - * - * @return int - */ - public function attempts(); - - /** - * Process an exception that caused the job to fail. - * - * @param \Throwable $e - * @return void - */ - public function failed($e); - - /** - * Get the number of times to attempt a job. - * - * @return int|null - */ - public function maxTries(); - - /** - * Get the number of seconds the job can run. - * - * @return int|null - */ - public function timeout(); - - /** - * Get the timestamp indicating when the job should timeout. - * - * @return int|null - */ - public function timeoutAt(); - - /** - * Get the name of the queued job class. - * - * @return string - */ - public function getName(); - - /** - * Get the resolved name of the queued job class. - * - * Resolves the name of "wrapped" jobs such as class-based handlers. - * - * @return string - */ - public function resolveName(); - - /** - * Get the name of the connection the job belongs to. - * - * @return string - */ - public function getConnectionName(); - - /** - * Get the name of the queue the job belongs to. - * - * @return string - */ - public function getQueue(); - - /** - * Get the raw body string for the job. - * - * @return string - */ - public function getRawBody(); -} diff --git a/vendor/illuminate/contracts/Queue/Monitor.php b/vendor/illuminate/contracts/Queue/Monitor.php deleted file mode 100644 index 7da62d3..0000000 --- a/vendor/illuminate/contracts/Queue/Monitor.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Queue; - -interface Monitor -{ - /** - * Register a callback to be executed on every iteration through the queue loop. - * - * @param mixed $callback - * @return void - */ - public function looping($callback); - - /** - * Register a callback to be executed when a job fails after the maximum amount of retries. - * - * @param mixed $callback - * @return void - */ - public function failing($callback); - - /** - * Register a callback to be executed when a daemon queue is stopping. - * - * @param mixed $callback - * @return void - */ - public function stopping($callback); -} diff --git a/vendor/illuminate/contracts/Queue/Queue.php b/vendor/illuminate/contracts/Queue/Queue.php deleted file mode 100644 index 52fb1a7..0000000 --- a/vendor/illuminate/contracts/Queue/Queue.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Queue; - -interface Queue -{ - /** - * Get the size of the queue. - * - * @param string $queue - * @return int - */ - public function size($queue = null); - - /** - * Push a new job onto the queue. - * - * @param string|object $job - * @param mixed $data - * @param string $queue - * @return mixed - */ - public function push($job, $data = '', $queue = null); - - /** - * Push a new job onto the queue. - * - * @param string $queue - * @param string|object $job - * @param mixed $data - * @return mixed - */ - public function pushOn($queue, $job, $data = ''); - - /** - * Push a raw payload onto the queue. - * - * @param string $payload - * @param string $queue - * @param array $options - * @return mixed - */ - public function pushRaw($payload, $queue = null, array $options = []); - - /** - * Push a new job onto the queue after a delay. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @param string|object $job - * @param mixed $data - * @param string $queue - * @return mixed - */ - public function later($delay, $job, $data = '', $queue = null); - - /** - * Push a new job onto the queue after a delay. - * - * @param string $queue - * @param \DateTimeInterface|\DateInterval|int $delay - * @param string|object $job - * @param mixed $data - * @return mixed - */ - public function laterOn($queue, $delay, $job, $data = ''); - - /** - * Push an array of jobs onto the queue. - * - * @param array $jobs - * @param mixed $data - * @param string $queue - * @return mixed - */ - public function bulk($jobs, $data = '', $queue = null); - - /** - * Pop the next job off of the queue. - * - * @param string $queue - * @return \Illuminate\Contracts\Queue\Job|null - */ - public function pop($queue = null); - - /** - * Get the connection name for the queue. - * - * @return string - */ - public function getConnectionName(); - - /** - * Set the connection name for the queue. - * - * @param string $name - * @return $this - */ - public function setConnectionName($name); -} diff --git a/vendor/illuminate/contracts/Queue/QueueableCollection.php b/vendor/illuminate/contracts/Queue/QueueableCollection.php deleted file mode 100644 index 0331b81..0000000 --- a/vendor/illuminate/contracts/Queue/QueueableCollection.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Queue; - -interface QueueableCollection -{ - /** - * Get the type of the entities being queued. - * - * @return string|null - */ - public function getQueueableClass(); - - /** - * Get the identifiers for all of the entities. - * - * @return array - */ - public function getQueueableIds(); - - /** - * Get the connection of the entities being queued. - * - * @return string|null - */ - public function getQueueableConnection(); -} diff --git a/vendor/illuminate/contracts/Queue/QueueableEntity.php b/vendor/illuminate/contracts/Queue/QueueableEntity.php deleted file mode 100644 index 00e28f8..0000000 --- a/vendor/illuminate/contracts/Queue/QueueableEntity.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Queue; - -interface QueueableEntity -{ - /** - * Get the queueable identity for the entity. - * - * @return mixed - */ - public function getQueueableId(); - - /** - * Get the connection of the entity. - * - * @return string|null - */ - public function getQueueableConnection(); -} diff --git a/vendor/illuminate/contracts/Queue/ShouldQueue.php b/vendor/illuminate/contracts/Queue/ShouldQueue.php deleted file mode 100644 index 0e99652..0000000 --- a/vendor/illuminate/contracts/Queue/ShouldQueue.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Queue; - -interface ShouldQueue -{ - // -} diff --git a/vendor/illuminate/contracts/Redis/Factory.php b/vendor/illuminate/contracts/Redis/Factory.php deleted file mode 100644 index 8a10e25..0000000 --- a/vendor/illuminate/contracts/Redis/Factory.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Redis; - -interface Factory -{ - /** - * Get a Redis connection by name. - * - * @param string $name - * @return \Illuminate\Redis\Connections\Connection - */ - public function connection($name = null); -} diff --git a/vendor/illuminate/contracts/Redis/LimiterTimeoutException.php b/vendor/illuminate/contracts/Redis/LimiterTimeoutException.php deleted file mode 100644 index 651bf90..0000000 --- a/vendor/illuminate/contracts/Redis/LimiterTimeoutException.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Redis; - -use Exception; - -class LimiterTimeoutException extends Exception -{ - // -} diff --git a/vendor/illuminate/contracts/Routing/BindingRegistrar.php b/vendor/illuminate/contracts/Routing/BindingRegistrar.php deleted file mode 100644 index 6ed5079..0000000 --- a/vendor/illuminate/contracts/Routing/BindingRegistrar.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Routing; - -interface BindingRegistrar -{ - /** - * Add a new route parameter binder. - * - * @param string $key - * @param string|callable $binder - * @return void - */ - public function bind($key, $binder); - - /** - * Get the binding callback for a given binding. - * - * @param string $key - * @return \Closure - */ - public function getBindingCallback($key); -} diff --git a/vendor/illuminate/contracts/Routing/Registrar.php b/vendor/illuminate/contracts/Routing/Registrar.php deleted file mode 100644 index 38e188b..0000000 --- a/vendor/illuminate/contracts/Routing/Registrar.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Routing; - -interface Registrar -{ - /** - * Register a new GET route with the router. - * - * @param string $uri - * @param \Closure|array|string $action - * @return \Illuminate\Routing\Route - */ - public function get($uri, $action); - - /** - * Register a new POST route with the router. - * - * @param string $uri - * @param \Closure|array|string $action - * @return \Illuminate\Routing\Route - */ - public function post($uri, $action); - - /** - * Register a new PUT route with the router. - * - * @param string $uri - * @param \Closure|array|string $action - * @return \Illuminate\Routing\Route - */ - public function put($uri, $action); - - /** - * Register a new DELETE route with the router. - * - * @param string $uri - * @param \Closure|array|string $action - * @return \Illuminate\Routing\Route - */ - public function delete($uri, $action); - - /** - * Register a new PATCH route with the router. - * - * @param string $uri - * @param \Closure|array|string $action - * @return \Illuminate\Routing\Route - */ - public function patch($uri, $action); - - /** - * Register a new OPTIONS route with the router. - * - * @param string $uri - * @param \Closure|array|string $action - * @return \Illuminate\Routing\Route - */ - public function options($uri, $action); - - /** - * Register a new route with the given verbs. - * - * @param array|string $methods - * @param string $uri - * @param \Closure|array|string $action - * @return \Illuminate\Routing\Route - */ - public function match($methods, $uri, $action); - - /** - * Route a resource to a controller. - * - * @param string $name - * @param string $controller - * @param array $options - * @return \Illuminate\Routing\PendingResourceRegistration - */ - public function resource($name, $controller, array $options = []); - - /** - * Create a route group with shared attributes. - * - * @param array $attributes - * @param \Closure|string $routes - * @return void - */ - public function group(array $attributes, $routes); - - /** - * Substitute the route bindings onto the route. - * - * @param \Illuminate\Routing\Route $route - * @return \Illuminate\Routing\Route - */ - public function substituteBindings($route); - - /** - * Substitute the implicit Eloquent model bindings for the route. - * - * @param \Illuminate\Routing\Route $route - * @return void - */ - public function substituteImplicitBindings($route); -} diff --git a/vendor/illuminate/contracts/Routing/ResponseFactory.php b/vendor/illuminate/contracts/Routing/ResponseFactory.php deleted file mode 100644 index 5dd4ee0..0000000 --- a/vendor/illuminate/contracts/Routing/ResponseFactory.php +++ /dev/null @@ -1,126 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Routing; - -interface ResponseFactory -{ - /** - * Return a new response from the application. - * - * @param string $content - * @param int $status - * @param array $headers - * @return \Illuminate\Http\Response - */ - public function make($content = '', $status = 200, array $headers = []); - - /** - * Return a new view response from the application. - * - * @param string $view - * @param array $data - * @param int $status - * @param array $headers - * @return \Illuminate\Http\Response - */ - public function view($view, $data = [], $status = 200, array $headers = []); - - /** - * Return a new JSON response from the application. - * - * @param string|array $data - * @param int $status - * @param array $headers - * @param int $options - * @return \Illuminate\Http\JsonResponse - */ - public function json($data = [], $status = 200, array $headers = [], $options = 0); - - /** - * Return a new JSONP response from the application. - * - * @param string $callback - * @param string|array $data - * @param int $status - * @param array $headers - * @param int $options - * @return \Illuminate\Http\JsonResponse - */ - public function jsonp($callback, $data = [], $status = 200, array $headers = [], $options = 0); - - /** - * Return a new streamed response from the application. - * - * @param \Closure $callback - * @param int $status - * @param array $headers - * @return \Symfony\Component\HttpFoundation\StreamedResponse - */ - public function stream($callback, $status = 200, array $headers = []); - - /** - * Create a new file download response. - * - * @param \SplFileInfo|string $file - * @param string $name - * @param array $headers - * @param string|null $disposition - * @return \Symfony\Component\HttpFoundation\BinaryFileResponse - */ - public function download($file, $name = null, array $headers = [], $disposition = 'attachment'); - - /** - * Create a new redirect response to the given path. - * - * @param string $path - * @param int $status - * @param array $headers - * @param bool|null $secure - * @return \Illuminate\Http\RedirectResponse - */ - public function redirectTo($path, $status = 302, $headers = [], $secure = null); - - /** - * Create a new redirect response to a named route. - * - * @param string $route - * @param array $parameters - * @param int $status - * @param array $headers - * @return \Illuminate\Http\RedirectResponse - */ - public function redirectToRoute($route, $parameters = [], $status = 302, $headers = []); - - /** - * Create a new redirect response to a controller action. - * - * @param string $action - * @param array $parameters - * @param int $status - * @param array $headers - * @return \Illuminate\Http\RedirectResponse - */ - public function redirectToAction($action, $parameters = [], $status = 302, $headers = []); - - /** - * Create a new redirect response, while putting the current URL in the session. - * - * @param string $path - * @param int $status - * @param array $headers - * @param bool|null $secure - * @return \Illuminate\Http\RedirectResponse - */ - public function redirectGuest($path, $status = 302, $headers = [], $secure = null); - - /** - * Create a new redirect response to the previously intended location. - * - * @param string $default - * @param int $status - * @param array $headers - * @param bool|null $secure - * @return \Illuminate\Http\RedirectResponse - */ - public function redirectToIntended($default = '/', $status = 302, $headers = [], $secure = null); -} diff --git a/vendor/illuminate/contracts/Routing/UrlGenerator.php b/vendor/illuminate/contracts/Routing/UrlGenerator.php deleted file mode 100644 index d77b3af..0000000 --- a/vendor/illuminate/contracts/Routing/UrlGenerator.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Routing; - -interface UrlGenerator -{ - /** - * Get the current URL for the request. - * - * @return string - */ - public function current(); - - /** - * Generate an absolute URL to the given path. - * - * @param string $path - * @param mixed $extra - * @param bool $secure - * @return string - */ - public function to($path, $extra = [], $secure = null); - - /** - * Generate a secure, absolute URL to the given path. - * - * @param string $path - * @param array $parameters - * @return string - */ - public function secure($path, $parameters = []); - - /** - * Generate the URL to an application asset. - * - * @param string $path - * @param bool $secure - * @return string - */ - public function asset($path, $secure = null); - - /** - * Get the URL to a named route. - * - * @param string $name - * @param mixed $parameters - * @param bool $absolute - * @return string - * - * @throws \InvalidArgumentException - */ - public function route($name, $parameters = [], $absolute = true); - - /** - * Get the URL to a controller action. - * - * @param string $action - * @param mixed $parameters - * @param bool $absolute - * @return string - */ - public function action($action, $parameters = [], $absolute = true); - - /** - * Set the root controller namespace. - * - * @param string $rootNamespace - * @return $this - */ - public function setRootControllerNamespace($rootNamespace); -} diff --git a/vendor/illuminate/contracts/Routing/UrlRoutable.php b/vendor/illuminate/contracts/Routing/UrlRoutable.php deleted file mode 100644 index d1dd94c..0000000 --- a/vendor/illuminate/contracts/Routing/UrlRoutable.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Routing; - -interface UrlRoutable -{ - /** - * Get the value of the model's route key. - * - * @return mixed - */ - public function getRouteKey(); - - /** - * Get the route key for the model. - * - * @return string - */ - public function getRouteKeyName(); - - /** - * Retrieve the model for a bound value. - * - * @param mixed $value - * @return \Illuminate\Database\Eloquent\Model|null - */ - public function resolveRouteBinding($value); -} diff --git a/vendor/illuminate/contracts/Session/Session.php b/vendor/illuminate/contracts/Session/Session.php deleted file mode 100644 index 57c7550..0000000 --- a/vendor/illuminate/contracts/Session/Session.php +++ /dev/null @@ -1,165 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Session; - -interface Session -{ - /** - * Get the name of the session. - * - * @return string - */ - public function getName(); - - /** - * Get the current session ID. - * - * @return string - */ - public function getId(); - - /** - * Set the session ID. - * - * @param string $id - * @return void - */ - public function setId($id); - - /** - * Start the session, reading the data from a handler. - * - * @return bool - */ - public function start(); - - /** - * Save the session data to storage. - * - * @return bool - */ - public function save(); - - /** - * Get all of the session data. - * - * @return array - */ - public function all(); - - /** - * Checks if a key exists. - * - * @param string|array $key - * @return bool - */ - public function exists($key); - - /** - * Checks if an a key is present and not null. - * - * @param string|array $key - * @return bool - */ - public function has($key); - - /** - * Get an item from the session. - * - * @param string $key - * @param mixed $default - * @return mixed - */ - public function get($key, $default = null); - - /** - * Put a key / value pair or array of key / value pairs in the session. - * - * @param string|array $key - * @param mixed $value - * @return void - */ - public function put($key, $value = null); - - /** - * Get the CSRF token value. - * - * @return string - */ - public function token(); - - /** - * Remove an item from the session, returning its value. - * - * @param string $key - * @return mixed - */ - public function remove($key); - - /** - * Remove one or many items from the session. - * - * @param string|array $keys - * @return void - */ - public function forget($keys); - - /** - * Remove all of the items from the session. - * - * @return void - */ - public function flush(); - - /** - * Generate a new session ID for the session. - * - * @param bool $destroy - * @return bool - */ - public function migrate($destroy = false); - - /** - * Determine if the session has been started. - * - * @return bool - */ - public function isStarted(); - - /** - * Get the previous URL from the session. - * - * @return string|null - */ - public function previousUrl(); - - /** - * Set the "previous" URL in the session. - * - * @param string $url - * @return void - */ - public function setPreviousUrl($url); - - /** - * Get the session handler instance. - * - * @return \SessionHandlerInterface - */ - public function getHandler(); - - /** - * Determine if the session handler needs a request. - * - * @return bool - */ - public function handlerNeedsRequest(); - - /** - * Set the request on the handler instance. - * - * @param \Illuminate\Http\Request $request - * @return void - */ - public function setRequestOnHandler($request); -} diff --git a/vendor/illuminate/contracts/Support/Arrayable.php b/vendor/illuminate/contracts/Support/Arrayable.php deleted file mode 100644 index 5ad93b7..0000000 --- a/vendor/illuminate/contracts/Support/Arrayable.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Support; - -interface Arrayable -{ - /** - * Get the instance as an array. - * - * @return array - */ - public function toArray(); -} diff --git a/vendor/illuminate/contracts/Support/Htmlable.php b/vendor/illuminate/contracts/Support/Htmlable.php deleted file mode 100644 index 32f643a..0000000 --- a/vendor/illuminate/contracts/Support/Htmlable.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Support; - -interface Htmlable -{ - /** - * Get content as a string of HTML. - * - * @return string - */ - public function toHtml(); -} diff --git a/vendor/illuminate/contracts/Support/Jsonable.php b/vendor/illuminate/contracts/Support/Jsonable.php deleted file mode 100644 index f5641c3..0000000 --- a/vendor/illuminate/contracts/Support/Jsonable.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Support; - -interface Jsonable -{ - /** - * Convert the object to its JSON representation. - * - * @param int $options - * @return string - */ - public function toJson($options = 0); -} diff --git a/vendor/illuminate/contracts/Support/MessageBag.php b/vendor/illuminate/contracts/Support/MessageBag.php deleted file mode 100644 index 512ba0e..0000000 --- a/vendor/illuminate/contracts/Support/MessageBag.php +++ /dev/null @@ -1,107 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Support; - -interface MessageBag extends Arrayable -{ - /** - * Get the keys present in the message bag. - * - * @return array - */ - public function keys(); - - /** - * Add a message to the bag. - * - * @param string $key - * @param string $message - * @return $this - */ - public function add($key, $message); - - /** - * Merge a new array of messages into the bag. - * - * @param \Illuminate\Contracts\Support\MessageProvider|array $messages - * @return $this - */ - public function merge($messages); - - /** - * Determine if messages exist for a given key. - * - * @param string|array $key - * @return bool - */ - public function has($key); - - /** - * Get the first message from the bag for a given key. - * - * @param string $key - * @param string $format - * @return string - */ - public function first($key = null, $format = null); - - /** - * Get all of the messages from the bag for a given key. - * - * @param string $key - * @param string $format - * @return array - */ - public function get($key, $format = null); - - /** - * Get all of the messages for every key in the bag. - * - * @param string $format - * @return array - */ - public function all($format = null); - - /** - * Get the raw messages in the container. - * - * @return array - */ - public function getMessages(); - - /** - * Get the default message format. - * - * @return string - */ - public function getFormat(); - - /** - * Set the default message format. - * - * @param string $format - * @return $this - */ - public function setFormat($format = ':message'); - - /** - * Determine if the message bag has any messages. - * - * @return bool - */ - public function isEmpty(); - - /** - * Determine if the message bag has any messages. - * - * @return bool - */ - public function isNotEmpty(); - - /** - * Get the number of messages in the container. - * - * @return int - */ - public function count(); -} diff --git a/vendor/illuminate/contracts/Support/MessageProvider.php b/vendor/illuminate/contracts/Support/MessageProvider.php deleted file mode 100644 index f15ce73..0000000 --- a/vendor/illuminate/contracts/Support/MessageProvider.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Support; - -interface MessageProvider -{ - /** - * Get the messages for the instance. - * - * @return \Illuminate\Contracts\Support\MessageBag - */ - public function getMessageBag(); -} diff --git a/vendor/illuminate/contracts/Support/Renderable.php b/vendor/illuminate/contracts/Support/Renderable.php deleted file mode 100644 index 25c181e..0000000 --- a/vendor/illuminate/contracts/Support/Renderable.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Support; - -interface Renderable -{ - /** - * Get the evaluated contents of the object. - * - * @return string - */ - public function render(); -} diff --git a/vendor/illuminate/contracts/Support/Responsable.php b/vendor/illuminate/contracts/Support/Responsable.php deleted file mode 100644 index e20d658..0000000 --- a/vendor/illuminate/contracts/Support/Responsable.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Support; - -interface Responsable -{ - /** - * Create an HTTP response that represents the object. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\Response - */ - public function toResponse($request); -} diff --git a/vendor/illuminate/contracts/Translation/Loader.php b/vendor/illuminate/contracts/Translation/Loader.php deleted file mode 100644 index 807f0b6..0000000 --- a/vendor/illuminate/contracts/Translation/Loader.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Translation; - -interface Loader -{ - /** - * Load the messages for the given locale. - * - * @param string $locale - * @param string $group - * @param string $namespace - * @return array - */ - public function load($locale, $group, $namespace = null); - - /** - * Add a new namespace to the loader. - * - * @param string $namespace - * @param string $hint - * @return void - */ - public function addNamespace($namespace, $hint); - - /** - * Add a new JSON path to the loader. - * - * @param string $path - * @return void - */ - public function addJsonPath($path); - - /** - * Get an array of all the registered namespaces. - * - * @return array - */ - public function namespaces(); -} diff --git a/vendor/illuminate/contracts/Translation/Translator.php b/vendor/illuminate/contracts/Translation/Translator.php deleted file mode 100644 index 2fdd84f..0000000 --- a/vendor/illuminate/contracts/Translation/Translator.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Translation; - -interface Translator -{ - /** - * Get the translation for a given key. - * - * @param string $key - * @param array $replace - * @param string $locale - * @return mixed - */ - public function trans($key, array $replace = [], $locale = null); - - /** - * Get a translation according to an integer value. - * - * @param string $key - * @param int|array|\Countable $number - * @param array $replace - * @param string $locale - * @return string - */ - public function transChoice($key, $number, array $replace = [], $locale = null); - - /** - * Get the default locale being used. - * - * @return string - */ - public function getLocale(); - - /** - * Set the default locale. - * - * @param string $locale - * @return void - */ - public function setLocale($locale); -} diff --git a/vendor/illuminate/contracts/Validation/Factory.php b/vendor/illuminate/contracts/Validation/Factory.php deleted file mode 100644 index 33f27bb..0000000 --- a/vendor/illuminate/contracts/Validation/Factory.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Validation; - -interface Factory -{ - /** - * Create a new Validator instance. - * - * @param array $data - * @param array $rules - * @param array $messages - * @param array $customAttributes - * @return \Illuminate\Contracts\Validation\Validator - */ - public function make(array $data, array $rules, array $messages = [], array $customAttributes = []); - - /** - * Register a custom validator extension. - * - * @param string $rule - * @param \Closure|string $extension - * @param string $message - * @return void - */ - public function extend($rule, $extension, $message = null); - - /** - * Register a custom implicit validator extension. - * - * @param string $rule - * @param \Closure|string $extension - * @param string $message - * @return void - */ - public function extendImplicit($rule, $extension, $message = null); - - /** - * Register a custom implicit validator message replacer. - * - * @param string $rule - * @param \Closure|string $replacer - * @return void - */ - public function replacer($rule, $replacer); -} diff --git a/vendor/illuminate/contracts/Validation/ImplicitRule.php b/vendor/illuminate/contracts/Validation/ImplicitRule.php deleted file mode 100644 index bbc64f4..0000000 --- a/vendor/illuminate/contracts/Validation/ImplicitRule.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Validation; - -interface ImplicitRule extends Rule -{ - // -} diff --git a/vendor/illuminate/contracts/Validation/Rule.php b/vendor/illuminate/contracts/Validation/Rule.php deleted file mode 100644 index 709b620..0000000 --- a/vendor/illuminate/contracts/Validation/Rule.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Validation; - -interface Rule -{ - /** - * Determine if the validation rule passes. - * - * @param string $attribute - * @param mixed $value - * @return bool - */ - public function passes($attribute, $value); - - /** - * Get the validation error message. - * - * @return string - */ - public function message(); -} diff --git a/vendor/illuminate/contracts/Validation/ValidatesWhenResolved.php b/vendor/illuminate/contracts/Validation/ValidatesWhenResolved.php deleted file mode 100644 index 4c33629..0000000 --- a/vendor/illuminate/contracts/Validation/ValidatesWhenResolved.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Validation; - -interface ValidatesWhenResolved -{ - /** - * Validate the given class instance. - * - * @return void - */ - public function validate(); -} diff --git a/vendor/illuminate/contracts/Validation/Validator.php b/vendor/illuminate/contracts/Validation/Validator.php deleted file mode 100644 index 3404df2..0000000 --- a/vendor/illuminate/contracts/Validation/Validator.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -namespace Illuminate\Contracts\Validation; - -use Illuminate\Contracts\Support\MessageProvider; - -interface Validator extends MessageProvider -{ - /** - * Determine if the data fails the validation rules. - * - * @return bool - */ - public function fails(); - - /** - * Get the failed validation rules. - * - * @return array - */ - public function failed(); - - /** - * Add conditions to a given field based on a Closure. - * - * @param string $attribute - * @param string|array $rules - * @param callable $callback - * @return $this - */ - public function sometimes($attribute, $rules, callable $callback); - - /** - * After an after validation callback. - * - * @param callable|string $callback - * @return $this - */ - public function after($callback); - - /** - * Get all of the validation error messages. - * - * @return \Illuminate\Support\MessageBag - */ - public function errors(); -} diff --git a/vendor/illuminate/contracts/View/Engine.php b/vendor/illuminate/contracts/View/Engine.php deleted file mode 100644 index 4d0b268..0000000 --- a/vendor/illuminate/contracts/View/Engine.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -namespace Illuminate\Contracts\View; - -interface Engine -{ - /** - * Get the evaluated contents of the view. - * - * @param string $path - * @param array $data - * @return string - */ - public function get($path, array $data = []); -} diff --git a/vendor/illuminate/contracts/View/Factory.php b/vendor/illuminate/contracts/View/Factory.php deleted file mode 100644 index dc9b19a..0000000 --- a/vendor/illuminate/contracts/View/Factory.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php - -namespace Illuminate\Contracts\View; - -interface Factory -{ - /** - * Determine if a given view exists. - * - * @param string $view - * @return bool - */ - public function exists($view); - - /** - * Get the evaluated view contents for the given path. - * - * @param string $path - * @param array $data - * @param array $mergeData - * @return \Illuminate\Contracts\View\View - */ - public function file($path, $data = [], $mergeData = []); - - /** - * Get the evaluated view contents for the given view. - * - * @param string $view - * @param array $data - * @param array $mergeData - * @return \Illuminate\Contracts\View\View - */ - public function make($view, $data = [], $mergeData = []); - - /** - * Add a piece of shared data to the environment. - * - * @param array|string $key - * @param mixed $value - * @return mixed - */ - public function share($key, $value = null); - - /** - * Register a view composer event. - * - * @param array|string $views - * @param \Closure|string $callback - * @return array - */ - public function composer($views, $callback); - - /** - * Register a view creator event. - * - * @param array|string $views - * @param \Closure|string $callback - * @return array - */ - public function creator($views, $callback); - - /** - * Add a new namespace to the loader. - * - * @param string $namespace - * @param string|array $hints - * @return $this - */ - public function addNamespace($namespace, $hints); - - /** - * Replace the namespace hints for the given namespace. - * - * @param string $namespace - * @param string|array $hints - * @return $this - */ - public function replaceNamespace($namespace, $hints); -} diff --git a/vendor/illuminate/contracts/View/View.php b/vendor/illuminate/contracts/View/View.php deleted file mode 100644 index ba03d16..0000000 --- a/vendor/illuminate/contracts/View/View.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -namespace Illuminate\Contracts\View; - -use Illuminate\Contracts\Support\Renderable; - -interface View extends Renderable -{ - /** - * Get the name of the view. - * - * @return string - */ - public function name(); - - /** - * Add a piece of data to the view. - * - * @param string|array $key - * @param mixed $value - * @return $this - */ - public function with($key, $value = null); -} diff --git a/vendor/illuminate/contracts/composer.json b/vendor/illuminate/contracts/composer.json deleted file mode 100644 index c97fc25..0000000 --- a/vendor/illuminate/contracts/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "illuminate/contracts", - "description": "The Illuminate Contracts package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": ">=7.0", - "psr/container": "~1.0", - "psr/simple-cache": "~1.0" - }, - "autoload": { - "psr-4": { - "Illuminate\\Contracts\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "5.5-dev" - } - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/illuminate/database/Capsule/Manager.php b/vendor/illuminate/database/Capsule/Manager.php deleted file mode 100644 index b82a792..0000000 --- a/vendor/illuminate/database/Capsule/Manager.php +++ /dev/null @@ -1,201 +0,0 @@ -<?php - -namespace Illuminate\Database\Capsule; - -use PDO; -use Illuminate\Container\Container; -use Illuminate\Database\DatabaseManager; -use Illuminate\Contracts\Events\Dispatcher; -use Illuminate\Support\Traits\CapsuleManagerTrait; -use Illuminate\Database\Eloquent\Model as Eloquent; -use Illuminate\Database\Connectors\ConnectionFactory; - -class Manager -{ - use CapsuleManagerTrait; - - /** - * The database manager instance. - * - * @var \Illuminate\Database\DatabaseManager - */ - protected $manager; - - /** - * Create a new database capsule manager. - * - * @param \Illuminate\Container\Container|null $container - * @return void - */ - public function __construct(Container $container = null) - { - $this->setupContainer($container ?: new Container); - - // Once we have the container setup, we will setup the default configuration - // options in the container "config" binding. This will make the database - // manager work correctly out of the box without extreme configuration. - $this->setupDefaultConfiguration(); - - $this->setupManager(); - } - - /** - * Setup the default database configuration options. - * - * @return void - */ - protected function setupDefaultConfiguration() - { - $this->container['config']['database.fetch'] = PDO::FETCH_OBJ; - - $this->container['config']['database.default'] = 'default'; - } - - /** - * Build the database manager instance. - * - * @return void - */ - protected function setupManager() - { - $factory = new ConnectionFactory($this->container); - - $this->manager = new DatabaseManager($this->container, $factory); - } - - /** - * Get a connection instance from the global manager. - * - * @param string $connection - * @return \Illuminate\Database\Connection - */ - public static function connection($connection = null) - { - return static::$instance->getConnection($connection); - } - - /** - * Get a fluent query builder instance. - * - * @param string $table - * @param string $connection - * @return \Illuminate\Database\Query\Builder - */ - public static function table($table, $connection = null) - { - return static::$instance->connection($connection)->table($table); - } - - /** - * Get a schema builder instance. - * - * @param string $connection - * @return \Illuminate\Database\Schema\Builder - */ - public static function schema($connection = null) - { - return static::$instance->connection($connection)->getSchemaBuilder(); - } - - /** - * Get a registered connection instance. - * - * @param string $name - * @return \Illuminate\Database\Connection - */ - public function getConnection($name = null) - { - return $this->manager->connection($name); - } - - /** - * Register a connection with the manager. - * - * @param array $config - * @param string $name - * @return void - */ - public function addConnection(array $config, $name = 'default') - { - $connections = $this->container['config']['database.connections']; - - $connections[$name] = $config; - - $this->container['config']['database.connections'] = $connections; - } - - /** - * Bootstrap Eloquent so it is ready for usage. - * - * @return void - */ - public function bootEloquent() - { - Eloquent::setConnectionResolver($this->manager); - - // If we have an event dispatcher instance, we will go ahead and register it - // with the Eloquent ORM, allowing for model callbacks while creating and - // updating "model" instances; however, it is not necessary to operate. - if ($dispatcher = $this->getEventDispatcher()) { - Eloquent::setEventDispatcher($dispatcher); - } - } - - /** - * Set the fetch mode for the database connections. - * - * @param int $fetchMode - * @return $this - */ - public function setFetchMode($fetchMode) - { - $this->container['config']['database.fetch'] = $fetchMode; - - return $this; - } - - /** - * Get the database manager instance. - * - * @return \Illuminate\Database\DatabaseManager - */ - public function getDatabaseManager() - { - return $this->manager; - } - - /** - * Get the current event dispatcher instance. - * - * @return \Illuminate\Contracts\Events\Dispatcher|null - */ - public function getEventDispatcher() - { - if ($this->container->bound('events')) { - return $this->container['events']; - } - } - - /** - * Set the event dispatcher instance to be used by connections. - * - * @param \Illuminate\Contracts\Events\Dispatcher $dispatcher - * @return void - */ - public function setEventDispatcher(Dispatcher $dispatcher) - { - $this->container->instance('events', $dispatcher); - } - - /** - * Dynamically pass methods to the default connection. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public static function __callStatic($method, $parameters) - { - return static::connection()->$method(...$parameters); - } -} diff --git a/vendor/illuminate/database/Concerns/BuildsQueries.php b/vendor/illuminate/database/Concerns/BuildsQueries.php deleted file mode 100644 index 1051f2c..0000000 --- a/vendor/illuminate/database/Concerns/BuildsQueries.php +++ /dev/null @@ -1,161 +0,0 @@ -<?php - -namespace Illuminate\Database\Concerns; - -use Illuminate\Container\Container; -use Illuminate\Pagination\Paginator; -use Illuminate\Pagination\LengthAwarePaginator; - -trait BuildsQueries -{ - /** - * Chunk the results of the query. - * - * @param int $count - * @param callable $callback - * @return bool - */ - public function chunk($count, callable $callback) - { - $this->enforceOrderBy(); - - $page = 1; - - do { - // We'll execute the query for the given page and get the results. If there are - // no results we can just break and return from here. When there are results - // we will call the callback with the current chunk of these results here. - $results = $this->forPage($page, $count)->get(); - - $countResults = $results->count(); - - if ($countResults == 0) { - break; - } - - // On each chunk result set, we will pass them to the callback and then let the - // developer take care of everything within the callback, which allows us to - // keep the memory low for spinning through large result sets for working. - if ($callback($results, $page) === false) { - return false; - } - - unset($results); - - $page++; - } while ($countResults == $count); - - return true; - } - - /** - * Execute a callback over each item while chunking. - * - * @param callable $callback - * @param int $count - * @return bool - */ - public function each(callable $callback, $count = 1000) - { - return $this->chunk($count, function ($results) use ($callback) { - foreach ($results as $key => $value) { - if ($callback($value, $key) === false) { - return false; - } - } - }); - } - - /** - * Execute the query and get the first result. - * - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model|object|static|null - */ - public function first($columns = ['*']) - { - return $this->take(1)->get($columns)->first(); - } - - /** - * Apply the callback's query changes if the given "value" is true. - * - * @param mixed $value - * @param callable $callback - * @param callable $default - * @return mixed - */ - public function when($value, $callback, $default = null) - { - if ($value) { - return $callback($this, $value) ?: $this; - } elseif ($default) { - return $default($this, $value) ?: $this; - } - - return $this; - } - - /** - * Pass the query to a given callback. - * - * @param \Closure $callback - * @return \Illuminate\Database\Query\Builder - */ - public function tap($callback) - { - return $this->when(true, $callback); - } - - /** - * Apply the callback's query changes if the given "value" is false. - * - * @param mixed $value - * @param callable $callback - * @param callable $default - * @return mixed - */ - public function unless($value, $callback, $default = null) - { - if (! $value) { - return $callback($this, $value) ?: $this; - } elseif ($default) { - return $default($this, $value) ?: $this; - } - - return $this; - } - - /** - * Create a new length-aware paginator instance. - * - * @param \Illuminate\Support\Collection $items - * @param int $total - * @param int $perPage - * @param int $currentPage - * @param array $options - * @return \Illuminate\Pagination\LengthAwarePaginator - */ - protected function paginator($items, $total, $perPage, $currentPage, $options) - { - return Container::getInstance()->makeWith(LengthAwarePaginator::class, compact( - 'items', 'total', 'perPage', 'currentPage', 'options' - )); - } - - /** - * Create a new simple paginator instance. - * - * @param \Illuminate\Support\Collection $items - * @param int $perPage - * @param int $currentPage - * @param array $options - * @return \Illuminate\Pagination\Paginator - */ - protected function simplePaginator($items, $perPage, $currentPage, $options) - { - return Container::getInstance()->makeWith(Paginator::class, compact( - 'items', 'perPage', 'currentPage', 'options' - )); - } -} diff --git a/vendor/illuminate/database/Concerns/ManagesTransactions.php b/vendor/illuminate/database/Concerns/ManagesTransactions.php deleted file mode 100644 index ec979f4..0000000 --- a/vendor/illuminate/database/Concerns/ManagesTransactions.php +++ /dev/null @@ -1,219 +0,0 @@ -<?php - -namespace Illuminate\Database\Concerns; - -use Closure; -use Exception; -use Throwable; - -trait ManagesTransactions -{ - /** - * Execute a Closure within a transaction. - * - * @param \Closure $callback - * @param int $attempts - * @return mixed - * - * @throws \Exception|\Throwable - */ - public function transaction(Closure $callback, $attempts = 1) - { - for ($currentAttempt = 1; $currentAttempt <= $attempts; $currentAttempt++) { - $this->beginTransaction(); - - // We'll simply execute the given callback within a try / catch block and if we - // catch any exception we can rollback this transaction so that none of this - // gets actually persisted to a database or stored in a permanent fashion. - try { - return tap($callback($this), function ($result) { - $this->commit(); - }); - } - - // If we catch an exception we'll rollback this transaction and try again if we - // are not out of attempts. If we are out of attempts we will just throw the - // exception back out and let the developer handle an uncaught exceptions. - catch (Exception $e) { - $this->handleTransactionException( - $e, $currentAttempt, $attempts - ); - } catch (Throwable $e) { - $this->rollBack(); - - throw $e; - } - } - } - - /** - * Handle an exception encountered when running a transacted statement. - * - * @param \Exception $e - * @param int $currentAttempt - * @param int $maxAttempts - * @return void - * - * @throws \Exception - */ - protected function handleTransactionException($e, $currentAttempt, $maxAttempts) - { - // On a deadlock, MySQL rolls back the entire transaction so we can't just - // retry the query. We have to throw this exception all the way out and - // let the developer handle it in another way. We will decrement too. - if ($this->causedByDeadlock($e) && - $this->transactions > 1) { - $this->transactions--; - - throw $e; - } - - // If there was an exception we will rollback this transaction and then we - // can check if we have exceeded the maximum attempt count for this and - // if we haven't we will return and try this query again in our loop. - $this->rollBack(); - - if ($this->causedByDeadlock($e) && - $currentAttempt < $maxAttempts) { - return; - } - - throw $e; - } - - /** - * Start a new database transaction. - * - * @return void - * @throws \Exception - */ - public function beginTransaction() - { - $this->createTransaction(); - - $this->transactions++; - - $this->fireConnectionEvent('beganTransaction'); - } - - /** - * Create a transaction within the database. - * - * @return void - */ - protected function createTransaction() - { - if ($this->transactions == 0) { - try { - $this->getPdo()->beginTransaction(); - } catch (Exception $e) { - $this->handleBeginTransactionException($e); - } - } elseif ($this->transactions >= 1 && $this->queryGrammar->supportsSavepoints()) { - $this->createSavepoint(); - } - } - - /** - * Create a save point within the database. - * - * @return void - */ - protected function createSavepoint() - { - $this->getPdo()->exec( - $this->queryGrammar->compileSavepoint('trans'.($this->transactions + 1)) - ); - } - - /** - * Handle an exception from a transaction beginning. - * - * @param \Exception $e - * @return void - * - * @throws \Exception - */ - protected function handleBeginTransactionException($e) - { - if ($this->causedByLostConnection($e)) { - $this->reconnect(); - - $this->pdo->beginTransaction(); - } else { - throw $e; - } - } - - /** - * Commit the active database transaction. - * - * @return void - */ - public function commit() - { - if ($this->transactions == 1) { - $this->getPdo()->commit(); - } - - $this->transactions = max(0, $this->transactions - 1); - - $this->fireConnectionEvent('committed'); - } - - /** - * Rollback the active database transaction. - * - * @param int|null $toLevel - * @return void - */ - public function rollBack($toLevel = null) - { - // We allow developers to rollback to a certain transaction level. We will verify - // that this given transaction level is valid before attempting to rollback to - // that level. If it's not we will just return out and not attempt anything. - $toLevel = is_null($toLevel) - ? $this->transactions - 1 - : $toLevel; - - if ($toLevel < 0 || $toLevel >= $this->transactions) { - return; - } - - // Next, we will actually perform this rollback within this database and fire the - // rollback event. We will also set the current transaction level to the given - // level that was passed into this method so it will be right from here out. - $this->performRollBack($toLevel); - - $this->transactions = $toLevel; - - $this->fireConnectionEvent('rollingBack'); - } - - /** - * Perform a rollback within the database. - * - * @param int $toLevel - * @return void - */ - protected function performRollBack($toLevel) - { - if ($toLevel == 0) { - $this->getPdo()->rollBack(); - } elseif ($this->queryGrammar->supportsSavepoints()) { - $this->getPdo()->exec( - $this->queryGrammar->compileSavepointRollBack('trans'.($toLevel + 1)) - ); - } - } - - /** - * Get the number of active transactions. - * - * @return int - */ - public function transactionLevel() - { - return $this->transactions; - } -} diff --git a/vendor/illuminate/database/Connection.php b/vendor/illuminate/database/Connection.php deleted file mode 100644 index a55776c..0000000 --- a/vendor/illuminate/database/Connection.php +++ /dev/null @@ -1,1238 +0,0 @@ -<?php - -namespace Illuminate\Database; - -use PDO; -use Closure; -use Exception; -use PDOStatement; -use LogicException; -use DateTimeInterface; -use Illuminate\Support\Arr; -use Illuminate\Database\Query\Expression; -use Illuminate\Contracts\Events\Dispatcher; -use Illuminate\Database\Events\QueryExecuted; -use Doctrine\DBAL\Connection as DoctrineConnection; -use Illuminate\Database\Query\Processors\Processor; -use Illuminate\Database\Query\Builder as QueryBuilder; -use Illuminate\Database\Schema\Builder as SchemaBuilder; -use Illuminate\Database\Query\Grammars\Grammar as QueryGrammar; - -class Connection implements ConnectionInterface -{ - use DetectsDeadlocks, - DetectsLostConnections, - Concerns\ManagesTransactions; - - /** - * The active PDO connection. - * - * @var \PDO|\Closure - */ - protected $pdo; - - /** - * The active PDO connection used for reads. - * - * @var \PDO|\Closure - */ - protected $readPdo; - - /** - * The name of the connected database. - * - * @var string - */ - protected $database; - - /** - * The table prefix for the connection. - * - * @var string - */ - protected $tablePrefix = ''; - - /** - * The database connection configuration options. - * - * @var array - */ - protected $config = []; - - /** - * The reconnector instance for the connection. - * - * @var callable - */ - protected $reconnector; - - /** - * The query grammar implementation. - * - * @var \Illuminate\Database\Query\Grammars\Grammar - */ - protected $queryGrammar; - - /** - * The schema grammar implementation. - * - * @var \Illuminate\Database\Schema\Grammars\Grammar - */ - protected $schemaGrammar; - - /** - * The query post processor implementation. - * - * @var \Illuminate\Database\Query\Processors\Processor - */ - protected $postProcessor; - - /** - * The event dispatcher instance. - * - * @var \Illuminate\Contracts\Events\Dispatcher - */ - protected $events; - - /** - * The default fetch mode of the connection. - * - * @var int - */ - protected $fetchMode = PDO::FETCH_OBJ; - - /** - * The number of active transactions. - * - * @var int - */ - protected $transactions = 0; - - /** - * Indicates if changes have been made to the database. - * - * @var int - */ - protected $recordsModified = false; - - /** - * All of the queries run against the connection. - * - * @var array - */ - protected $queryLog = []; - - /** - * Indicates whether queries are being logged. - * - * @var bool - */ - protected $loggingQueries = false; - - /** - * Indicates if the connection is in a "dry run". - * - * @var bool - */ - protected $pretending = false; - - /** - * The instance of Doctrine connection. - * - * @var \Doctrine\DBAL\Connection - */ - protected $doctrineConnection; - - /** - * The connection resolvers. - * - * @var array - */ - protected static $resolvers = []; - - /** - * Create a new database connection instance. - * - * @param \PDO|\Closure $pdo - * @param string $database - * @param string $tablePrefix - * @param array $config - * @return void - */ - public function __construct($pdo, $database = '', $tablePrefix = '', array $config = []) - { - $this->pdo = $pdo; - - // First we will setup the default properties. We keep track of the DB - // name we are connected to since it is needed when some reflective - // type commands are run such as checking whether a table exists. - $this->database = $database; - - $this->tablePrefix = $tablePrefix; - - $this->config = $config; - - // We need to initialize a query grammar and the query post processors - // which are both very important parts of the database abstractions - // so we initialize these to their default values while starting. - $this->useDefaultQueryGrammar(); - - $this->useDefaultPostProcessor(); - } - - /** - * Set the query grammar to the default implementation. - * - * @return void - */ - public function useDefaultQueryGrammar() - { - $this->queryGrammar = $this->getDefaultQueryGrammar(); - } - - /** - * Get the default query grammar instance. - * - * @return \Illuminate\Database\Query\Grammars\Grammar - */ - protected function getDefaultQueryGrammar() - { - return new QueryGrammar; - } - - /** - * Set the schema grammar to the default implementation. - * - * @return void - */ - public function useDefaultSchemaGrammar() - { - $this->schemaGrammar = $this->getDefaultSchemaGrammar(); - } - - /** - * Get the default schema grammar instance. - * - * @return \Illuminate\Database\Schema\Grammars\Grammar - */ - protected function getDefaultSchemaGrammar() - { - // - } - - /** - * Set the query post processor to the default implementation. - * - * @return void - */ - public function useDefaultPostProcessor() - { - $this->postProcessor = $this->getDefaultPostProcessor(); - } - - /** - * Get the default post processor instance. - * - * @return \Illuminate\Database\Query\Processors\Processor - */ - protected function getDefaultPostProcessor() - { - return new Processor; - } - - /** - * Get a schema builder instance for the connection. - * - * @return \Illuminate\Database\Schema\Builder - */ - public function getSchemaBuilder() - { - if (is_null($this->schemaGrammar)) { - $this->useDefaultSchemaGrammar(); - } - - return new SchemaBuilder($this); - } - - /** - * Begin a fluent query against a database table. - * - * @param string $table - * @return \Illuminate\Database\Query\Builder - */ - public function table($table) - { - return $this->query()->from($table); - } - - /** - * Get a new query builder instance. - * - * @return \Illuminate\Database\Query\Builder - */ - public function query() - { - return new QueryBuilder( - $this, $this->getQueryGrammar(), $this->getPostProcessor() - ); - } - - /** - * Run a select statement and return a single result. - * - * @param string $query - * @param array $bindings - * @param bool $useReadPdo - * @return mixed - */ - public function selectOne($query, $bindings = [], $useReadPdo = true) - { - $records = $this->select($query, $bindings, $useReadPdo); - - return array_shift($records); - } - - /** - * Run a select statement against the database. - * - * @param string $query - * @param array $bindings - * @return array - */ - public function selectFromWriteConnection($query, $bindings = []) - { - return $this->select($query, $bindings, false); - } - - /** - * Run a select statement against the database. - * - * @param string $query - * @param array $bindings - * @param bool $useReadPdo - * @return array - */ - public function select($query, $bindings = [], $useReadPdo = true) - { - return $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) { - if ($this->pretending()) { - return []; - } - - // For select statements, we'll simply execute the query and return an array - // of the database result set. Each element in the array will be a single - // row from the database table, and will either be an array or objects. - $statement = $this->prepared($this->getPdoForSelect($useReadPdo) - ->prepare($query)); - - $this->bindValues($statement, $this->prepareBindings($bindings)); - - $statement->execute(); - - return $statement->fetchAll(); - }); - } - - /** - * Run a select statement against the database and returns a generator. - * - * @param string $query - * @param array $bindings - * @param bool $useReadPdo - * @return \Generator - */ - public function cursor($query, $bindings = [], $useReadPdo = true) - { - $statement = $this->run($query, $bindings, function ($query, $bindings) use ($useReadPdo) { - if ($this->pretending()) { - return []; - } - - // First we will create a statement for the query. Then, we will set the fetch - // mode and prepare the bindings for the query. Once that's done we will be - // ready to execute the query against the database and return the cursor. - $statement = $this->prepared($this->getPdoForSelect($useReadPdo) - ->prepare($query)); - - $this->bindValues( - $statement, $this->prepareBindings($bindings) - ); - - // Next, we'll execute the query against the database and return the statement - // so we can return the cursor. The cursor will use a PHP generator to give - // back one row at a time without using a bunch of memory to render them. - $statement->execute(); - - return $statement; - }); - - while ($record = $statement->fetch()) { - yield $record; - } - } - - /** - * Configure the PDO prepared statement. - * - * @param \PDOStatement $statement - * @return \PDOStatement - */ - protected function prepared(PDOStatement $statement) - { - $statement->setFetchMode($this->fetchMode); - - $this->event(new Events\StatementPrepared( - $this, $statement - )); - - return $statement; - } - - /** - * Get the PDO connection to use for a select query. - * - * @param bool $useReadPdo - * @return \PDO - */ - protected function getPdoForSelect($useReadPdo = true) - { - return $useReadPdo ? $this->getReadPdo() : $this->getPdo(); - } - - /** - * Run an insert statement against the database. - * - * @param string $query - * @param array $bindings - * @return bool - */ - public function insert($query, $bindings = []) - { - return $this->statement($query, $bindings); - } - - /** - * Run an update statement against the database. - * - * @param string $query - * @param array $bindings - * @return int - */ - public function update($query, $bindings = []) - { - return $this->affectingStatement($query, $bindings); - } - - /** - * Run a delete statement against the database. - * - * @param string $query - * @param array $bindings - * @return int - */ - public function delete($query, $bindings = []) - { - return $this->affectingStatement($query, $bindings); - } - - /** - * Execute an SQL statement and return the boolean result. - * - * @param string $query - * @param array $bindings - * @return bool - */ - public function statement($query, $bindings = []) - { - return $this->run($query, $bindings, function ($query, $bindings) { - if ($this->pretending()) { - return true; - } - - $statement = $this->getPdo()->prepare($query); - - $this->bindValues($statement, $this->prepareBindings($bindings)); - - $this->recordsHaveBeenModified(); - - return $statement->execute(); - }); - } - - /** - * Run an SQL statement and get the number of rows affected. - * - * @param string $query - * @param array $bindings - * @return int - */ - public function affectingStatement($query, $bindings = []) - { - return $this->run($query, $bindings, function ($query, $bindings) { - if ($this->pretending()) { - return 0; - } - - // For update or delete statements, we want to get the number of rows affected - // by the statement and return that back to the developer. We'll first need - // to execute the statement and then we'll use PDO to fetch the affected. - $statement = $this->getPdo()->prepare($query); - - $this->bindValues($statement, $this->prepareBindings($bindings)); - - $statement->execute(); - - $this->recordsHaveBeenModified( - ($count = $statement->rowCount()) > 0 - ); - - return $count; - }); - } - - /** - * Run a raw, unprepared query against the PDO connection. - * - * @param string $query - * @return bool - */ - public function unprepared($query) - { - return $this->run($query, [], function ($query) { - if ($this->pretending()) { - return true; - } - - $this->recordsHaveBeenModified( - $change = ($this->getPdo()->exec($query) === false ? false : true) - ); - - return $change; - }); - } - - /** - * Execute the given callback in "dry run" mode. - * - * @param \Closure $callback - * @return array - */ - public function pretend(Closure $callback) - { - return $this->withFreshQueryLog(function () use ($callback) { - $this->pretending = true; - - // Basically to make the database connection "pretend", we will just return - // the default values for all the query methods, then we will return an - // array of queries that were "executed" within the Closure callback. - $callback($this); - - $this->pretending = false; - - return $this->queryLog; - }); - } - - /** - * Execute the given callback in "dry run" mode. - * - * @param \Closure $callback - * @return array - */ - protected function withFreshQueryLog($callback) - { - $loggingQueries = $this->loggingQueries; - - // First we will back up the value of the logging queries property and then - // we'll be ready to run callbacks. This query log will also get cleared - // so we will have a new log of all the queries that are executed now. - $this->enableQueryLog(); - - $this->queryLog = []; - - // Now we'll execute this callback and capture the result. Once it has been - // executed we will restore the value of query logging and give back the - // value of hte callback so the original callers can have the results. - $result = $callback(); - - $this->loggingQueries = $loggingQueries; - - return $result; - } - - /** - * Bind values to their parameters in the given statement. - * - * @param \PDOStatement $statement - * @param array $bindings - * @return void - */ - public function bindValues($statement, $bindings) - { - foreach ($bindings as $key => $value) { - $statement->bindValue( - is_string($key) ? $key : $key + 1, $value, - is_int($value) ? PDO::PARAM_INT : PDO::PARAM_STR - ); - } - } - - /** - * Prepare the query bindings for execution. - * - * @param array $bindings - * @return array - */ - public function prepareBindings(array $bindings) - { - $grammar = $this->getQueryGrammar(); - - foreach ($bindings as $key => $value) { - // We need to transform all instances of DateTimeInterface into the actual - // date string. Each query grammar maintains its own date string format - // so we'll just ask the grammar for the format to get from the date. - if ($value instanceof DateTimeInterface) { - $bindings[$key] = $value->format($grammar->getDateFormat()); - } elseif (is_bool($value)) { - $bindings[$key] = (int) $value; - } - } - - return $bindings; - } - - /** - * Run a SQL statement and log its execution context. - * - * @param string $query - * @param array $bindings - * @param \Closure $callback - * @return mixed - * - * @throws \Illuminate\Database\QueryException - */ - protected function run($query, $bindings, Closure $callback) - { - $this->reconnectIfMissingConnection(); - - $start = microtime(true); - - // Here we will run this query. If an exception occurs we'll determine if it was - // caused by a connection that has been lost. If that is the cause, we'll try - // to re-establish connection and re-run the query with a fresh connection. - try { - $result = $this->runQueryCallback($query, $bindings, $callback); - } catch (QueryException $e) { - $result = $this->handleQueryException( - $e, $query, $bindings, $callback - ); - } - - // Once we have run the query we will calculate the time that it took to run and - // then log the query, bindings, and execution time so we will report them on - // the event that the developer needs them. We'll log time in milliseconds. - $this->logQuery( - $query, $bindings, $this->getElapsedTime($start) - ); - - return $result; - } - - /** - * Run a SQL statement. - * - * @param string $query - * @param array $bindings - * @param \Closure $callback - * @return mixed - * - * @throws \Illuminate\Database\QueryException - */ - protected function runQueryCallback($query, $bindings, Closure $callback) - { - // To execute the statement, we'll simply call the callback, which will actually - // run the SQL against the PDO connection. Then we can calculate the time it - // took to execute and log the query SQL, bindings and time in our memory. - try { - $result = $callback($query, $bindings); - } - - // If an exception occurs when attempting to run a query, we'll format the error - // message to include the bindings with SQL, which will make this exception a - // lot more helpful to the developer instead of just the database's errors. - catch (Exception $e) { - throw new QueryException( - $query, $this->prepareBindings($bindings), $e - ); - } - - return $result; - } - - /** - * Log a query in the connection's query log. - * - * @param string $query - * @param array $bindings - * @param float|null $time - * @return void - */ - public function logQuery($query, $bindings, $time = null) - { - $this->event(new QueryExecuted($query, $bindings, $time, $this)); - - if ($this->loggingQueries) { - $this->queryLog[] = compact('query', 'bindings', 'time'); - } - } - - /** - * Get the elapsed time since a given starting point. - * - * @param int $start - * @return float - */ - protected function getElapsedTime($start) - { - return round((microtime(true) - $start) * 1000, 2); - } - - /** - * Handle a query exception. - * - * @param \Exception $e - * @param string $query - * @param array $bindings - * @param \Closure $callback - * @return mixed - * @throws \Exception - */ - protected function handleQueryException($e, $query, $bindings, Closure $callback) - { - if ($this->transactions >= 1) { - throw $e; - } - - return $this->tryAgainIfCausedByLostConnection( - $e, $query, $bindings, $callback - ); - } - - /** - * Handle a query exception that occurred during query execution. - * - * @param \Illuminate\Database\QueryException $e - * @param string $query - * @param array $bindings - * @param \Closure $callback - * @return mixed - * - * @throws \Illuminate\Database\QueryException - */ - protected function tryAgainIfCausedByLostConnection(QueryException $e, $query, $bindings, Closure $callback) - { - if ($this->causedByLostConnection($e->getPrevious())) { - $this->reconnect(); - - return $this->runQueryCallback($query, $bindings, $callback); - } - - throw $e; - } - - /** - * Reconnect to the database. - * - * @return void - * - * @throws \LogicException - */ - public function reconnect() - { - if (is_callable($this->reconnector)) { - return call_user_func($this->reconnector, $this); - } - - throw new LogicException('Lost connection and no reconnector available.'); - } - - /** - * Reconnect to the database if a PDO connection is missing. - * - * @return void - */ - protected function reconnectIfMissingConnection() - { - if (is_null($this->pdo)) { - $this->reconnect(); - } - } - - /** - * Disconnect from the underlying PDO connection. - * - * @return void - */ - public function disconnect() - { - $this->setPdo(null)->setReadPdo(null); - } - - /** - * Register a database query listener with the connection. - * - * @param \Closure $callback - * @return void - */ - public function listen(Closure $callback) - { - if (isset($this->events)) { - $this->events->listen(Events\QueryExecuted::class, $callback); - } - } - - /** - * Fire an event for this connection. - * - * @param string $event - * @return array|null - */ - protected function fireConnectionEvent($event) - { - if (! isset($this->events)) { - return; - } - - switch ($event) { - case 'beganTransaction': - return $this->events->dispatch(new Events\TransactionBeginning($this)); - case 'committed': - return $this->events->dispatch(new Events\TransactionCommitted($this)); - case 'rollingBack': - return $this->events->dispatch(new Events\TransactionRolledBack($this)); - } - } - - /** - * Fire the given event if possible. - * - * @param mixed $event - * @return void - */ - protected function event($event) - { - if (isset($this->events)) { - $this->events->dispatch($event); - } - } - - /** - * Get a new raw query expression. - * - * @param mixed $value - * @return \Illuminate\Database\Query\Expression - */ - public function raw($value) - { - return new Expression($value); - } - - /** - * Indicate if any records have been modified. - * - * @param bool $value - * @return void - */ - public function recordsHaveBeenModified($value = true) - { - if (! $this->recordsModified) { - $this->recordsModified = $value; - } - } - - /** - * Is Doctrine available? - * - * @return bool - */ - public function isDoctrineAvailable() - { - return class_exists('Doctrine\DBAL\Connection'); - } - - /** - * Get a Doctrine Schema Column instance. - * - * @param string $table - * @param string $column - * @return \Doctrine\DBAL\Schema\Column - */ - public function getDoctrineColumn($table, $column) - { - $schema = $this->getDoctrineSchemaManager(); - - return $schema->listTableDetails($table)->getColumn($column); - } - - /** - * Get the Doctrine DBAL schema manager for the connection. - * - * @return \Doctrine\DBAL\Schema\AbstractSchemaManager - */ - public function getDoctrineSchemaManager() - { - return $this->getDoctrineDriver()->getSchemaManager($this->getDoctrineConnection()); - } - - /** - * Get the Doctrine DBAL database connection instance. - * - * @return \Doctrine\DBAL\Connection - */ - public function getDoctrineConnection() - { - if (is_null($this->doctrineConnection)) { - $driver = $this->getDoctrineDriver(); - - $this->doctrineConnection = new DoctrineConnection([ - 'pdo' => $this->getPdo(), - 'dbname' => $this->getConfig('database'), - 'driver' => $driver->getName(), - ], $driver); - } - - return $this->doctrineConnection; - } - - /** - * Get the current PDO connection. - * - * @return \PDO - */ - public function getPdo() - { - if ($this->pdo instanceof Closure) { - return $this->pdo = call_user_func($this->pdo); - } - - return $this->pdo; - } - - /** - * Get the current PDO connection used for reading. - * - * @return \PDO - */ - public function getReadPdo() - { - if ($this->transactions > 0) { - return $this->getPdo(); - } - - if ($this->getConfig('sticky') && $this->recordsModified) { - return $this->getPdo(); - } - - if ($this->readPdo instanceof Closure) { - return $this->readPdo = call_user_func($this->readPdo); - } - - return $this->readPdo ?: $this->getPdo(); - } - - /** - * Set the PDO connection. - * - * @param \PDO|\Closure|null $pdo - * @return $this - */ - public function setPdo($pdo) - { - $this->transactions = 0; - - $this->pdo = $pdo; - - return $this; - } - - /** - * Set the PDO connection used for reading. - * - * @param \PDO||\Closure|null $pdo - * @return $this - */ - public function setReadPdo($pdo) - { - $this->readPdo = $pdo; - - return $this; - } - - /** - * Set the reconnect instance on the connection. - * - * @param callable $reconnector - * @return $this - */ - public function setReconnector(callable $reconnector) - { - $this->reconnector = $reconnector; - - return $this; - } - - /** - * Get the database connection name. - * - * @return string|null - */ - public function getName() - { - return $this->getConfig('name'); - } - - /** - * Get an option from the configuration options. - * - * @param string|null $option - * @return mixed - */ - public function getConfig($option = null) - { - return Arr::get($this->config, $option); - } - - /** - * Get the PDO driver name. - * - * @return string - */ - public function getDriverName() - { - return $this->getConfig('driver'); - } - - /** - * Get the query grammar used by the connection. - * - * @return \Illuminate\Database\Query\Grammars\Grammar - */ - public function getQueryGrammar() - { - return $this->queryGrammar; - } - - /** - * Set the query grammar used by the connection. - * - * @param \Illuminate\Database\Query\Grammars\Grammar $grammar - * @return void - */ - public function setQueryGrammar(Query\Grammars\Grammar $grammar) - { - $this->queryGrammar = $grammar; - } - - /** - * Get the schema grammar used by the connection. - * - * @return \Illuminate\Database\Schema\Grammars\Grammar - */ - public function getSchemaGrammar() - { - return $this->schemaGrammar; - } - - /** - * Set the schema grammar used by the connection. - * - * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar - * @return void - */ - public function setSchemaGrammar(Schema\Grammars\Grammar $grammar) - { - $this->schemaGrammar = $grammar; - } - - /** - * Get the query post processor used by the connection. - * - * @return \Illuminate\Database\Query\Processors\Processor - */ - public function getPostProcessor() - { - return $this->postProcessor; - } - - /** - * Set the query post processor used by the connection. - * - * @param \Illuminate\Database\Query\Processors\Processor $processor - * @return void - */ - public function setPostProcessor(Processor $processor) - { - $this->postProcessor = $processor; - } - - /** - * Get the event dispatcher used by the connection. - * - * @return \Illuminate\Contracts\Events\Dispatcher - */ - public function getEventDispatcher() - { - return $this->events; - } - - /** - * Set the event dispatcher instance on the connection. - * - * @param \Illuminate\Contracts\Events\Dispatcher $events - * @return void - */ - public function setEventDispatcher(Dispatcher $events) - { - $this->events = $events; - } - - /** - * Determine if the connection in a "dry run". - * - * @return bool - */ - public function pretending() - { - return $this->pretending === true; - } - - /** - * Get the connection query log. - * - * @return array - */ - public function getQueryLog() - { - return $this->queryLog; - } - - /** - * Clear the query log. - * - * @return void - */ - public function flushQueryLog() - { - $this->queryLog = []; - } - - /** - * Enable the query log on the connection. - * - * @return void - */ - public function enableQueryLog() - { - $this->loggingQueries = true; - } - - /** - * Disable the query log on the connection. - * - * @return void - */ - public function disableQueryLog() - { - $this->loggingQueries = false; - } - - /** - * Determine whether we're logging queries. - * - * @return bool - */ - public function logging() - { - return $this->loggingQueries; - } - - /** - * Get the name of the connected database. - * - * @return string - */ - public function getDatabaseName() - { - return $this->database; - } - - /** - * Set the name of the connected database. - * - * @param string $database - * @return string - */ - public function setDatabaseName($database) - { - $this->database = $database; - } - - /** - * Get the table prefix for the connection. - * - * @return string - */ - public function getTablePrefix() - { - return $this->tablePrefix; - } - - /** - * Set the table prefix in use by the connection. - * - * @param string $prefix - * @return void - */ - public function setTablePrefix($prefix) - { - $this->tablePrefix = $prefix; - - $this->getQueryGrammar()->setTablePrefix($prefix); - } - - /** - * Set the table prefix and return the grammar. - * - * @param \Illuminate\Database\Grammar $grammar - * @return \Illuminate\Database\Grammar - */ - public function withTablePrefix(Grammar $grammar) - { - $grammar->setTablePrefix($this->tablePrefix); - - return $grammar; - } - - /** - * Register a connection resolver. - * - * @param string $driver - * @param \Closure $callback - * @return void - */ - public static function resolverFor($driver, Closure $callback) - { - static::$resolvers[$driver] = $callback; - } - - /** - * Get the connection resolver for the given driver. - * - * @param string $driver - * @return mixed - */ - public static function getResolver($driver) - { - return static::$resolvers[$driver] ?? null; - } -} diff --git a/vendor/illuminate/database/ConnectionInterface.php b/vendor/illuminate/database/ConnectionInterface.php deleted file mode 100644 index 9262d6f..0000000 --- a/vendor/illuminate/database/ConnectionInterface.php +++ /dev/null @@ -1,150 +0,0 @@ -<?php - -namespace Illuminate\Database; - -use Closure; - -interface ConnectionInterface -{ - /** - * Begin a fluent query against a database table. - * - * @param string $table - * @return \Illuminate\Database\Query\Builder - */ - public function table($table); - - /** - * Get a new raw query expression. - * - * @param mixed $value - * @return \Illuminate\Database\Query\Expression - */ - public function raw($value); - - /** - * Run a select statement and return a single result. - * - * @param string $query - * @param array $bindings - * @return mixed - */ - public function selectOne($query, $bindings = []); - - /** - * Run a select statement against the database. - * - * @param string $query - * @param array $bindings - * @return array - */ - public function select($query, $bindings = []); - - /** - * Run an insert statement against the database. - * - * @param string $query - * @param array $bindings - * @return bool - */ - public function insert($query, $bindings = []); - - /** - * Run an update statement against the database. - * - * @param string $query - * @param array $bindings - * @return int - */ - public function update($query, $bindings = []); - - /** - * Run a delete statement against the database. - * - * @param string $query - * @param array $bindings - * @return int - */ - public function delete($query, $bindings = []); - - /** - * Execute an SQL statement and return the boolean result. - * - * @param string $query - * @param array $bindings - * @return bool - */ - public function statement($query, $bindings = []); - - /** - * Run an SQL statement and get the number of rows affected. - * - * @param string $query - * @param array $bindings - * @return int - */ - public function affectingStatement($query, $bindings = []); - - /** - * Run a raw, unprepared query against the PDO connection. - * - * @param string $query - * @return bool - */ - public function unprepared($query); - - /** - * Prepare the query bindings for execution. - * - * @param array $bindings - * @return array - */ - public function prepareBindings(array $bindings); - - /** - * Execute a Closure within a transaction. - * - * @param \Closure $callback - * @param int $attempts - * @return mixed - * - * @throws \Throwable - */ - public function transaction(Closure $callback, $attempts = 1); - - /** - * Start a new database transaction. - * - * @return void - */ - public function beginTransaction(); - - /** - * Commit the active database transaction. - * - * @return void - */ - public function commit(); - - /** - * Rollback the active database transaction. - * - * @return void - */ - public function rollBack(); - - /** - * Get the number of active transactions. - * - * @return int - */ - public function transactionLevel(); - - /** - * Execute the given callback in "dry run" mode. - * - * @param \Closure $callback - * @return array - */ - public function pretend(Closure $callback); -} diff --git a/vendor/illuminate/database/ConnectionResolver.php b/vendor/illuminate/database/ConnectionResolver.php deleted file mode 100644 index 425ab6b..0000000 --- a/vendor/illuminate/database/ConnectionResolver.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php - -namespace Illuminate\Database; - -class ConnectionResolver implements ConnectionResolverInterface -{ - /** - * All of the registered connections. - * - * @var array - */ - protected $connections = []; - - /** - * The default connection name. - * - * @var string - */ - protected $default; - - /** - * Create a new connection resolver instance. - * - * @param array $connections - * @return void - */ - public function __construct(array $connections = []) - { - foreach ($connections as $name => $connection) { - $this->addConnection($name, $connection); - } - } - - /** - * Get a database connection instance. - * - * @param string $name - * @return \Illuminate\Database\ConnectionInterface - */ - public function connection($name = null) - { - if (is_null($name)) { - $name = $this->getDefaultConnection(); - } - - return $this->connections[$name]; - } - - /** - * Add a connection to the resolver. - * - * @param string $name - * @param \Illuminate\Database\ConnectionInterface $connection - * @return void - */ - public function addConnection($name, ConnectionInterface $connection) - { - $this->connections[$name] = $connection; - } - - /** - * Check if a connection has been registered. - * - * @param string $name - * @return bool - */ - public function hasConnection($name) - { - return isset($this->connections[$name]); - } - - /** - * Get the default connection name. - * - * @return string - */ - public function getDefaultConnection() - { - return $this->default; - } - - /** - * Set the default connection name. - * - * @param string $name - * @return void - */ - public function setDefaultConnection($name) - { - $this->default = $name; - } -} diff --git a/vendor/illuminate/database/ConnectionResolverInterface.php b/vendor/illuminate/database/ConnectionResolverInterface.php deleted file mode 100644 index eb0397a..0000000 --- a/vendor/illuminate/database/ConnectionResolverInterface.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Illuminate\Database; - -interface ConnectionResolverInterface -{ - /** - * Get a database connection instance. - * - * @param string $name - * @return \Illuminate\Database\ConnectionInterface - */ - public function connection($name = null); - - /** - * Get the default connection name. - * - * @return string - */ - public function getDefaultConnection(); - - /** - * Set the default connection name. - * - * @param string $name - * @return void - */ - public function setDefaultConnection($name); -} diff --git a/vendor/illuminate/database/Connectors/ConnectionFactory.php b/vendor/illuminate/database/Connectors/ConnectionFactory.php deleted file mode 100644 index 0462c7b..0000000 --- a/vendor/illuminate/database/Connectors/ConnectionFactory.php +++ /dev/null @@ -1,288 +0,0 @@ -<?php - -namespace Illuminate\Database\Connectors; - -use PDOException; -use Illuminate\Support\Arr; -use InvalidArgumentException; -use Illuminate\Database\Connection; -use Illuminate\Database\MySqlConnection; -use Illuminate\Database\SQLiteConnection; -use Illuminate\Database\PostgresConnection; -use Illuminate\Database\SqlServerConnection; -use Illuminate\Contracts\Container\Container; -use Illuminate\Contracts\Debug\ExceptionHandler; - -class ConnectionFactory -{ - /** - * The IoC container instance. - * - * @var \Illuminate\Contracts\Container\Container - */ - protected $container; - - /** - * Create a new connection factory instance. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return void - */ - public function __construct(Container $container) - { - $this->container = $container; - } - - /** - * Establish a PDO connection based on the configuration. - * - * @param array $config - * @param string $name - * @return \Illuminate\Database\Connection - */ - public function make(array $config, $name = null) - { - $config = $this->parseConfig($config, $name); - - if (isset($config['read'])) { - return $this->createReadWriteConnection($config); - } - - return $this->createSingleConnection($config); - } - - /** - * Parse and prepare the database configuration. - * - * @param array $config - * @param string $name - * @return array - */ - protected function parseConfig(array $config, $name) - { - return Arr::add(Arr::add($config, 'prefix', ''), 'name', $name); - } - - /** - * Create a single database connection instance. - * - * @param array $config - * @return \Illuminate\Database\Connection - */ - protected function createSingleConnection(array $config) - { - $pdo = $this->createPdoResolver($config); - - return $this->createConnection( - $config['driver'], $pdo, $config['database'], $config['prefix'], $config - ); - } - - /** - * Create a single database connection instance. - * - * @param array $config - * @return \Illuminate\Database\Connection - */ - protected function createReadWriteConnection(array $config) - { - $connection = $this->createSingleConnection($this->getWriteConfig($config)); - - return $connection->setReadPdo($this->createReadPdo($config)); - } - - /** - * Create a new PDO instance for reading. - * - * @param array $config - * @return \Closure - */ - protected function createReadPdo(array $config) - { - return $this->createPdoResolver($this->getReadConfig($config)); - } - - /** - * Get the read configuration for a read / write connection. - * - * @param array $config - * @return array - */ - protected function getReadConfig(array $config) - { - return $this->mergeReadWriteConfig( - $config, $this->getReadWriteConfig($config, 'read') - ); - } - - /** - * Get the read configuration for a read / write connection. - * - * @param array $config - * @return array - */ - protected function getWriteConfig(array $config) - { - return $this->mergeReadWriteConfig( - $config, $this->getReadWriteConfig($config, 'write') - ); - } - - /** - * Get a read / write level configuration. - * - * @param array $config - * @param string $type - * @return array - */ - protected function getReadWriteConfig(array $config, $type) - { - return isset($config[$type][0]) - ? Arr::random($config[$type]) - : $config[$type]; - } - - /** - * Merge a configuration for a read / write connection. - * - * @param array $config - * @param array $merge - * @return array - */ - protected function mergeReadWriteConfig(array $config, array $merge) - { - return Arr::except(array_merge($config, $merge), ['read', 'write']); - } - - /** - * Create a new Closure that resolves to a PDO instance. - * - * @param array $config - * @return \Closure - */ - protected function createPdoResolver(array $config) - { - return array_key_exists('host', $config) - ? $this->createPdoResolverWithHosts($config) - : $this->createPdoResolverWithoutHosts($config); - } - - /** - * Create a new Closure that resolves to a PDO instance with a specific host or an array of hosts. - * - * @param array $config - * @return \Closure - */ - protected function createPdoResolverWithHosts(array $config) - { - return function () use ($config) { - foreach (Arr::shuffle($hosts = $this->parseHosts($config)) as $key => $host) { - $config['host'] = $host; - - try { - return $this->createConnector($config)->connect($config); - } catch (PDOException $e) { - if (count($hosts) - 1 === $key && $this->container->bound(ExceptionHandler::class)) { - $this->container->make(ExceptionHandler::class)->report($e); - } - } - } - - throw $e; - }; - } - - /** - * Parse the hosts configuration item into an array. - * - * @param array $config - * @return array - */ - protected function parseHosts(array $config) - { - $hosts = Arr::wrap($config['host']); - - if (empty($hosts)) { - throw new InvalidArgumentException('Database hosts array is empty.'); - } - - return $hosts; - } - - /** - * Create a new Closure that resolves to a PDO instance where there is no configured host. - * - * @param array $config - * @return \Closure - */ - protected function createPdoResolverWithoutHosts(array $config) - { - return function () use ($config) { - return $this->createConnector($config)->connect($config); - }; - } - - /** - * Create a connector instance based on the configuration. - * - * @param array $config - * @return \Illuminate\Database\Connectors\ConnectorInterface - * - * @throws \InvalidArgumentException - */ - public function createConnector(array $config) - { - if (! isset($config['driver'])) { - throw new InvalidArgumentException('A driver must be specified.'); - } - - if ($this->container->bound($key = "db.connector.{$config['driver']}")) { - return $this->container->make($key); - } - - switch ($config['driver']) { - case 'mysql': - return new MySqlConnector; - case 'pgsql': - return new PostgresConnector; - case 'sqlite': - return new SQLiteConnector; - case 'sqlsrv': - return new SqlServerConnector; - } - - throw new InvalidArgumentException("Unsupported driver [{$config['driver']}]"); - } - - /** - * Create a new connection instance. - * - * @param string $driver - * @param \PDO|\Closure $connection - * @param string $database - * @param string $prefix - * @param array $config - * @return \Illuminate\Database\Connection - * - * @throws \InvalidArgumentException - */ - protected function createConnection($driver, $connection, $database, $prefix = '', array $config = []) - { - if ($resolver = Connection::getResolver($driver)) { - return $resolver($connection, $database, $prefix, $config); - } - - switch ($driver) { - case 'mysql': - return new MySqlConnection($connection, $database, $prefix, $config); - case 'pgsql': - return new PostgresConnection($connection, $database, $prefix, $config); - case 'sqlite': - return new SQLiteConnection($connection, $database, $prefix, $config); - case 'sqlsrv': - return new SqlServerConnection($connection, $database, $prefix, $config); - } - - throw new InvalidArgumentException("Unsupported driver [$driver]"); - } -} diff --git a/vendor/illuminate/database/Connectors/Connector.php b/vendor/illuminate/database/Connectors/Connector.php deleted file mode 100644 index b772f52..0000000 --- a/vendor/illuminate/database/Connectors/Connector.php +++ /dev/null @@ -1,136 +0,0 @@ -<?php - -namespace Illuminate\Database\Connectors; - -use PDO; -use Exception; -use Doctrine\DBAL\Driver\PDOConnection; -use Illuminate\Database\DetectsLostConnections; - -class Connector -{ - use DetectsLostConnections; - - /** - * The default PDO connection options. - * - * @var array - */ - protected $options = [ - PDO::ATTR_CASE => PDO::CASE_NATURAL, - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL, - PDO::ATTR_STRINGIFY_FETCHES => false, - PDO::ATTR_EMULATE_PREPARES => false, - ]; - - /** - * Create a new PDO connection. - * - * @param string $dsn - * @param array $config - * @param array $options - * @return \PDO - */ - public function createConnection($dsn, array $config, array $options) - { - list($username, $password) = [ - $config['username'] ?? null, $config['password'] ?? null, - ]; - - try { - return $this->createPdoConnection( - $dsn, $username, $password, $options - ); - } catch (Exception $e) { - return $this->tryAgainIfCausedByLostConnection( - $e, $dsn, $username, $password, $options - ); - } - } - - /** - * Create a new PDO connection instance. - * - * @param string $dsn - * @param string $username - * @param string $password - * @param array $options - * @return \PDO - */ - protected function createPdoConnection($dsn, $username, $password, $options) - { - if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) { - return new PDOConnection($dsn, $username, $password, $options); - } - - return new PDO($dsn, $username, $password, $options); - } - - /** - * Determine if the connection is persistent. - * - * @param array $options - * @return bool - */ - protected function isPersistentConnection($options) - { - return isset($options[PDO::ATTR_PERSISTENT]) && - $options[PDO::ATTR_PERSISTENT]; - } - - /** - * Handle an exception that occurred during connect execution. - * - * @param \Exception $e - * @param string $dsn - * @param string $username - * @param string $password - * @param array $options - * @return \PDO - * - * @throws \Exception - */ - protected function tryAgainIfCausedByLostConnection(Exception $e, $dsn, $username, $password, $options) - { - if ($this->causedByLostConnection($e)) { - return $this->createPdoConnection($dsn, $username, $password, $options); - } - - throw $e; - } - - /** - * Get the PDO options based on the configuration. - * - * @param array $config - * @return array - */ - public function getOptions(array $config) - { - $options = $config['options'] ?? []; - - return array_diff_key($this->options, $options) + $options; - } - - /** - * Get the default PDO connection options. - * - * @return array - */ - public function getDefaultOptions() - { - return $this->options; - } - - /** - * Set the default PDO connection options. - * - * @param array $options - * @return void - */ - public function setDefaultOptions(array $options) - { - $this->options = $options; - } -} diff --git a/vendor/illuminate/database/Connectors/ConnectorInterface.php b/vendor/illuminate/database/Connectors/ConnectorInterface.php deleted file mode 100644 index 08597ac..0000000 --- a/vendor/illuminate/database/Connectors/ConnectorInterface.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Illuminate\Database\Connectors; - -interface ConnectorInterface -{ - /** - * Establish a database connection. - * - * @param array $config - * @return \PDO - */ - public function connect(array $config); -} diff --git a/vendor/illuminate/database/Connectors/MySqlConnector.php b/vendor/illuminate/database/Connectors/MySqlConnector.php deleted file mode 100644 index ed341aa..0000000 --- a/vendor/illuminate/database/Connectors/MySqlConnector.php +++ /dev/null @@ -1,186 +0,0 @@ -<?php - -namespace Illuminate\Database\Connectors; - -use PDO; - -class MySqlConnector extends Connector implements ConnectorInterface -{ - /** - * Establish a database connection. - * - * @param array $config - * @return \PDO - */ - public function connect(array $config) - { - $dsn = $this->getDsn($config); - - $options = $this->getOptions($config); - - // We need to grab the PDO options that should be used while making the brand - // new connection instance. The PDO options control various aspects of the - // connection's behavior, and some might be specified by the developers. - $connection = $this->createConnection($dsn, $config, $options); - - if (! empty($config['database'])) { - $connection->exec("use `{$config['database']}`;"); - } - - $this->configureEncoding($connection, $config); - - // Next, we will check to see if a timezone has been specified in this config - // and if it has we will issue a statement to modify the timezone with the - // database. Setting this DB timezone is an optional configuration item. - $this->configureTimezone($connection, $config); - - $this->setModes($connection, $config); - - return $connection; - } - - /** - * Set the connection character set and collation. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function configureEncoding($connection, array $config) - { - if (! isset($config['charset'])) { - return $connection; - } - - $connection->prepare( - "set names '{$config['charset']}'".$this->getCollation($config) - )->execute(); - } - - /** - * Get the collation for the configuration. - * - * @param array $config - * @return string - */ - protected function getCollation(array $config) - { - return isset($config['collation']) ? " collate '{$config['collation']}'" : ''; - } - - /** - * Set the timezone on the connection. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function configureTimezone($connection, array $config) - { - if (isset($config['timezone'])) { - $connection->prepare('set time_zone="'.$config['timezone'].'"')->execute(); - } - } - - /** - * Create a DSN string from a configuration. - * - * Chooses socket or host/port based on the 'unix_socket' config value. - * - * @param array $config - * @return string - */ - protected function getDsn(array $config) - { - return $this->hasSocket($config) - ? $this->getSocketDsn($config) - : $this->getHostDsn($config); - } - - /** - * Determine if the given configuration array has a UNIX socket value. - * - * @param array $config - * @return bool - */ - protected function hasSocket(array $config) - { - return isset($config['unix_socket']) && ! empty($config['unix_socket']); - } - - /** - * Get the DSN string for a socket configuration. - * - * @param array $config - * @return string - */ - protected function getSocketDsn(array $config) - { - return "mysql:unix_socket={$config['unix_socket']};dbname={$config['database']}"; - } - - /** - * Get the DSN string for a host / port configuration. - * - * @param array $config - * @return string - */ - protected function getHostDsn(array $config) - { - extract($config, EXTR_SKIP); - - return isset($port) - ? "mysql:host={$host};port={$port};dbname={$database}" - : "mysql:host={$host};dbname={$database}"; - } - - /** - * Set the modes for the connection. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function setModes(PDO $connection, array $config) - { - if (isset($config['modes'])) { - $this->setCustomModes($connection, $config); - } elseif (isset($config['strict'])) { - if ($config['strict']) { - $connection->prepare($this->strictMode($connection))->execute(); - } else { - $connection->prepare("set session sql_mode='NO_ENGINE_SUBSTITUTION'")->execute(); - } - } - } - - /** - * Set the custom modes on the connection. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function setCustomModes(PDO $connection, array $config) - { - $modes = implode(',', $config['modes']); - - $connection->prepare("set session sql_mode='{$modes}'")->execute(); - } - - /** - * Get the query to enable strict mode. - * - * @param \PDO $connection - * - * @return string - */ - protected function strictMode(PDO $connection) - { - if (version_compare($connection->getAttribute(PDO::ATTR_SERVER_VERSION), '8.0.11') >= 0) { - return "set session sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'"; - } - - return "set session sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'"; - } -} diff --git a/vendor/illuminate/database/Connectors/PostgresConnector.php b/vendor/illuminate/database/Connectors/PostgresConnector.php deleted file mode 100644 index 5129b4b..0000000 --- a/vendor/illuminate/database/Connectors/PostgresConnector.php +++ /dev/null @@ -1,174 +0,0 @@ -<?php - -namespace Illuminate\Database\Connectors; - -use PDO; - -class PostgresConnector extends Connector implements ConnectorInterface -{ - /** - * The default PDO connection options. - * - * @var array - */ - protected $options = [ - PDO::ATTR_CASE => PDO::CASE_NATURAL, - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL, - PDO::ATTR_STRINGIFY_FETCHES => false, - ]; - - /** - * Establish a database connection. - * - * @param array $config - * @return \PDO - */ - public function connect(array $config) - { - // First we'll create the basic DSN and connection instance connecting to the - // using the configuration option specified by the developer. We will also - // set the default character set on the connections to UTF-8 by default. - $connection = $this->createConnection( - $this->getDsn($config), $config, $this->getOptions($config) - ); - - $this->configureEncoding($connection, $config); - - // Next, we will check to see if a timezone has been specified in this config - // and if it has we will issue a statement to modify the timezone with the - // database. Setting this DB timezone is an optional configuration item. - $this->configureTimezone($connection, $config); - - $this->configureSchema($connection, $config); - - // Postgres allows an application_name to be set by the user and this name is - // used to when monitoring the application with pg_stat_activity. So we'll - // determine if the option has been specified and run a statement if so. - $this->configureApplicationName($connection, $config); - - return $connection; - } - - /** - * Set the connection character set and collation. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function configureEncoding($connection, $config) - { - $charset = $config['charset']; - - $connection->prepare("set names '$charset'")->execute(); - } - - /** - * Set the timezone on the connection. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function configureTimezone($connection, array $config) - { - if (isset($config['timezone'])) { - $timezone = $config['timezone']; - - $connection->prepare("set time zone '{$timezone}'")->execute(); - } - } - - /** - * Set the schema on the connection. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function configureSchema($connection, $config) - { - if (isset($config['schema'])) { - $schema = $this->formatSchema($config['schema']); - - $connection->prepare("set search_path to {$schema}")->execute(); - } - } - - /** - * Format the schema for the DSN. - * - * @param array|string $schema - * @return string - */ - protected function formatSchema($schema) - { - if (is_array($schema)) { - return '"'.implode('", "', $schema).'"'; - } - - return '"'.$schema.'"'; - } - - /** - * Set the schema on the connection. - * - * @param \PDO $connection - * @param array $config - * @return void - */ - protected function configureApplicationName($connection, $config) - { - if (isset($config['application_name'])) { - $applicationName = $config['application_name']; - - $connection->prepare("set application_name to '$applicationName'")->execute(); - } - } - - /** - * Create a DSN string from a configuration. - * - * @param array $config - * @return string - */ - protected function getDsn(array $config) - { - // First we will create the basic DSN setup as well as the port if it is in - // in the configuration options. This will give us the basic DSN we will - // need to establish the PDO connections and return them back for use. - extract($config, EXTR_SKIP); - - $host = isset($host) ? "host={$host};" : ''; - - $dsn = "pgsql:{$host}dbname={$database}"; - - // If a port was specified, we will add it to this Postgres DSN connections - // format. Once we have done that we are ready to return this connection - // string back out for usage, as this has been fully constructed here. - if (isset($config['port'])) { - $dsn .= ";port={$port}"; - } - - return $this->addSslOptions($dsn, $config); - } - - /** - * Add the SSL options to the DSN. - * - * @param string $dsn - * @param array $config - * @return string - */ - protected function addSslOptions($dsn, array $config) - { - foreach (['sslmode', 'sslcert', 'sslkey', 'sslrootcert'] as $option) { - if (isset($config[$option])) { - $dsn .= ";{$option}={$config[$option]}"; - } - } - - return $dsn; - } -} diff --git a/vendor/illuminate/database/Connectors/SQLiteConnector.php b/vendor/illuminate/database/Connectors/SQLiteConnector.php deleted file mode 100644 index 28f9091..0000000 --- a/vendor/illuminate/database/Connectors/SQLiteConnector.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace Illuminate\Database\Connectors; - -use InvalidArgumentException; - -class SQLiteConnector extends Connector implements ConnectorInterface -{ - /** - * Establish a database connection. - * - * @param array $config - * @return \PDO - * - * @throws \InvalidArgumentException - */ - public function connect(array $config) - { - $options = $this->getOptions($config); - - // SQLite supports "in-memory" databases that only last as long as the owning - // connection does. These are useful for tests or for short lifetime store - // querying. In-memory databases may only have a single open connection. - if ($config['database'] == ':memory:') { - return $this->createConnection('sqlite::memory:', $config, $options); - } - - $path = realpath($config['database']); - - // Here we'll verify that the SQLite database exists before going any further - // as the developer probably wants to know if the database exists and this - // SQLite driver will not throw any exception if it does not by default. - if ($path === false) { - throw new InvalidArgumentException("Database (${config['database']}) does not exist."); - } - - return $this->createConnection("sqlite:{$path}", $config, $options); - } -} diff --git a/vendor/illuminate/database/Connectors/SqlServerConnector.php b/vendor/illuminate/database/Connectors/SqlServerConnector.php deleted file mode 100644 index 87525d1..0000000 --- a/vendor/illuminate/database/Connectors/SqlServerConnector.php +++ /dev/null @@ -1,183 +0,0 @@ -<?php - -namespace Illuminate\Database\Connectors; - -use PDO; -use Illuminate\Support\Arr; - -class SqlServerConnector extends Connector implements ConnectorInterface -{ - /** - * The PDO connection options. - * - * @var array - */ - protected $options = [ - PDO::ATTR_CASE => PDO::CASE_NATURAL, - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL, - PDO::ATTR_STRINGIFY_FETCHES => false, - ]; - - /** - * Establish a database connection. - * - * @param array $config - * @return \PDO - */ - public function connect(array $config) - { - $options = $this->getOptions($config); - - return $this->createConnection($this->getDsn($config), $config, $options); - } - - /** - * Create a DSN string from a configuration. - * - * @param array $config - * @return string - */ - protected function getDsn(array $config) - { - // First we will create the basic DSN setup as well as the port if it is in - // in the configuration options. This will give us the basic DSN we will - // need to establish the PDO connections and return them back for use. - if (in_array('dblib', $this->getAvailableDrivers())) { - return $this->getDblibDsn($config); - } elseif ($this->prefersOdbc($config)) { - return $this->getOdbcDsn($config); - } - - return $this->getSqlSrvDsn($config); - } - - /** - * Determine if the database configuration prefers ODBC. - * - * @param array $config - * @return bool - */ - protected function prefersOdbc(array $config) - { - return in_array('odbc', $this->getAvailableDrivers()) && - ($config['odbc'] ?? null) === true; - } - - /** - * Get the DSN string for a DbLib connection. - * - * @param array $config - * @return string - */ - protected function getDblibDsn(array $config) - { - return $this->buildConnectString('dblib', array_merge([ - 'host' => $this->buildHostString($config, ':'), - 'dbname' => $config['database'], - ], Arr::only($config, ['appname', 'charset', 'version']))); - } - - /** - * Get the DSN string for an ODBC connection. - * - * @param array $config - * @return string - */ - protected function getOdbcDsn(array $config) - { - return isset($config['odbc_datasource_name']) - ? 'odbc:'.$config['odbc_datasource_name'] : ''; - } - - /** - * Get the DSN string for a SqlSrv connection. - * - * @param array $config - * @return string - */ - protected function getSqlSrvDsn(array $config) - { - $arguments = [ - 'Server' => $this->buildHostString($config, ','), - ]; - - if (isset($config['database'])) { - $arguments['Database'] = $config['database']; - } - - if (isset($config['readonly'])) { - $arguments['ApplicationIntent'] = 'ReadOnly'; - } - - if (isset($config['pooling']) && $config['pooling'] === false) { - $arguments['ConnectionPooling'] = '0'; - } - - if (isset($config['appname'])) { - $arguments['APP'] = $config['appname']; - } - - if (isset($config['encrypt'])) { - $arguments['Encrypt'] = $config['encrypt']; - } - - if (isset($config['trust_server_certificate'])) { - $arguments['TrustServerCertificate'] = $config['trust_server_certificate']; - } - - if (isset($config['multiple_active_result_sets']) && $config['multiple_active_result_sets'] === false) { - $arguments['MultipleActiveResultSets'] = 'false'; - } - - if (isset($config['transaction_isolation'])) { - $arguments['TransactionIsolation'] = $config['transaction_isolation']; - } - - if (isset($config['multi_subnet_failover'])) { - $arguments['MultiSubnetFailover'] = $config['multi_subnet_failover']; - } - - return $this->buildConnectString('sqlsrv', $arguments); - } - - /** - * Build a connection string from the given arguments. - * - * @param string $driver - * @param array $arguments - * @return string - */ - protected function buildConnectString($driver, array $arguments) - { - return $driver.':'.implode(';', array_map(function ($key) use ($arguments) { - return sprintf('%s=%s', $key, $arguments[$key]); - }, array_keys($arguments))); - } - - /** - * Build a host string from the given configuration. - * - * @param array $config - * @param string $separator - * @return string - */ - protected function buildHostString(array $config, $separator) - { - if (isset($config['port']) && ! empty($config['port'])) { - return $config['host'].$separator.$config['port']; - } else { - return $config['host']; - } - } - - /** - * Get the available PDO drivers. - * - * @return array - */ - protected function getAvailableDrivers() - { - return PDO::getAvailableDrivers(); - } -} diff --git a/vendor/illuminate/database/Console/Factories/FactoryMakeCommand.php b/vendor/illuminate/database/Console/Factories/FactoryMakeCommand.php deleted file mode 100644 index 8634159..0000000 --- a/vendor/illuminate/database/Console/Factories/FactoryMakeCommand.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php - -namespace Illuminate\Database\Console\Factories; - -use Illuminate\Console\GeneratorCommand; -use Symfony\Component\Console\Input\InputOption; - -class FactoryMakeCommand extends GeneratorCommand -{ - /** - * The console command name. - * - * @var string - */ - protected $name = 'make:factory'; - - /** - * The console command description. - * - * @var string - */ - protected $description = 'Create a new model factory'; - - /** - * The type of class being generated. - * - * @var string - */ - protected $type = 'Factory'; - - /** - * Get the stub file for the generator. - * - * @return string - */ - protected function getStub() - { - return __DIR__.'/stubs/factory.stub'; - } - - /** - * Build the class with the given name. - * - * @param string $name - * @return string - */ - protected function buildClass($name) - { - $model = $this->option('model') - ? $this->qualifyClass($this->option('model')) - : 'Model'; - - return str_replace( - 'DummyModel', $model, parent::buildClass($name) - ); - } - - /** - * Get the destination class path. - * - * @param string $name - * @return string - */ - protected function getPath($name) - { - $name = str_replace( - ['\\', '/'], '', $this->argument('name') - ); - - return $this->laravel->databasePath()."/factories/{$name}.php"; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['model', 'm', InputOption::VALUE_OPTIONAL, 'The name of the model'], - ]; - } -} diff --git a/vendor/illuminate/database/Console/Factories/stubs/factory.stub b/vendor/illuminate/database/Console/Factories/stubs/factory.stub deleted file mode 100644 index 9e3f90b..0000000 --- a/vendor/illuminate/database/Console/Factories/stubs/factory.stub +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -use Faker\Generator as Faker; - -$factory->define(DummyModel::class, function (Faker $faker) { - return [ - // - ]; -}); diff --git a/vendor/illuminate/database/Console/Migrations/BaseCommand.php b/vendor/illuminate/database/Console/Migrations/BaseCommand.php deleted file mode 100644 index 81ca3cc..0000000 --- a/vendor/illuminate/database/Console/Migrations/BaseCommand.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace Illuminate\Database\Console\Migrations; - -use Illuminate\Console\Command; - -class BaseCommand extends Command -{ - /** - * Get all of the migration paths. - * - * @return array - */ - protected function getMigrationPaths() - { - // Here, we will check to see if a path option has been defined. If it has we will - // use the path relative to the root of the installation folder so our database - // migrations may be run for any customized path from within the application. - if ($this->input->hasOption('path') && $this->option('path')) { - return collect($this->option('path'))->map(function ($path) { - return $this->laravel->basePath().'/'.$path; - })->all(); - } - - return array_merge( - [$this->getMigrationPath()], $this->migrator->paths() - ); - } - - /** - * Get the path to the migration directory. - * - * @return string - */ - protected function getMigrationPath() - { - return $this->laravel->databasePath().DIRECTORY_SEPARATOR.'migrations'; - } -} diff --git a/vendor/illuminate/database/Console/Migrations/FreshCommand.php b/vendor/illuminate/database/Console/Migrations/FreshCommand.php deleted file mode 100644 index a9779a7..0000000 --- a/vendor/illuminate/database/Console/Migrations/FreshCommand.php +++ /dev/null @@ -1,112 +0,0 @@ -<?php - -namespace Illuminate\Database\Console\Migrations; - -use Illuminate\Console\Command; -use Illuminate\Console\ConfirmableTrait; -use Symfony\Component\Console\Input\InputOption; - -class FreshCommand extends Command -{ - use ConfirmableTrait; - - /** - * The console command name. - * - * @var string - */ - protected $name = 'migrate:fresh'; - - /** - * The console command description. - * - * @var string - */ - protected $description = 'Drop all tables and re-run all migrations'; - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - if (! $this->confirmToProceed()) { - return; - } - - $this->dropAllTables( - $database = $this->input->getOption('database') - ); - - $this->info('Dropped all tables successfully.'); - - $this->call('migrate', [ - '--database' => $database, - '--path' => $this->input->getOption('path'), - '--force' => true, - ]); - - if ($this->needsSeeding()) { - $this->runSeeder($database); - } - } - - /** - * Drop all of the database tables. - * - * @param string $database - * @return void - */ - protected function dropAllTables($database) - { - $this->laravel['db']->connection($database) - ->getSchemaBuilder() - ->dropAllTables(); - } - - /** - * Determine if the developer has requested database seeding. - * - * @return bool - */ - protected function needsSeeding() - { - return $this->option('seed') || $this->option('seeder'); - } - - /** - * Run the database seeder command. - * - * @param string $database - * @return void - */ - protected function runSeeder($database) - { - $this->call('db:seed', [ - '--database' => $database, - '--class' => $this->option('seeder') ?: 'DatabaseSeeder', - '--force' => $this->option('force'), - ]); - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'], - - ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production.'], - - ['path', null, InputOption::VALUE_OPTIONAL, 'The path of migrations files to be executed.'], - - ['seed', null, InputOption::VALUE_NONE, 'Indicates if the seed task should be re-run.'], - - ['seeder', null, InputOption::VALUE_OPTIONAL, 'The class name of the root seeder.'], - ]; - } -} diff --git a/vendor/illuminate/database/Console/Migrations/InstallCommand.php b/vendor/illuminate/database/Console/Migrations/InstallCommand.php deleted file mode 100644 index d920024..0000000 --- a/vendor/illuminate/database/Console/Migrations/InstallCommand.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -namespace Illuminate\Database\Console\Migrations; - -use Illuminate\Console\Command; -use Symfony\Component\Console\Input\InputOption; -use Illuminate\Database\Migrations\MigrationRepositoryInterface; - -class InstallCommand extends Command -{ - /** - * The console command name. - * - * @var string - */ - protected $name = 'migrate:install'; - - /** - * The console command description. - * - * @var string - */ - protected $description = 'Create the migration repository'; - - /** - * The repository instance. - * - * @var \Illuminate\Database\Migrations\MigrationRepositoryInterface - */ - protected $repository; - - /** - * Create a new migration install command instance. - * - * @param \Illuminate\Database\Migrations\MigrationRepositoryInterface $repository - * @return void - */ - public function __construct(MigrationRepositoryInterface $repository) - { - parent::__construct(); - - $this->repository = $repository; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $this->repository->setSource($this->input->getOption('database')); - - $this->repository->createRepository(); - - $this->info('Migration table created successfully.'); - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'], - ]; - } -} diff --git a/vendor/illuminate/database/Console/Migrations/MigrateCommand.php b/vendor/illuminate/database/Console/Migrations/MigrateCommand.php deleted file mode 100644 index 12fe90a..0000000 --- a/vendor/illuminate/database/Console/Migrations/MigrateCommand.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php - -namespace Illuminate\Database\Console\Migrations; - -use Illuminate\Console\ConfirmableTrait; -use Illuminate\Database\Migrations\Migrator; - -class MigrateCommand extends BaseCommand -{ - use ConfirmableTrait; - - /** - * The name and signature of the console command. - * - * @var string - */ - protected $signature = 'migrate {--database= : The database connection to use.} - {--force : Force the operation to run when in production.} - {--path= : The path of migrations files to be executed.} - {--pretend : Dump the SQL queries that would be run.} - {--seed : Indicates if the seed task should be re-run.} - {--step : Force the migrations to be run so they can be rolled back individually.}'; - - /** - * The console command description. - * - * @var string - */ - protected $description = 'Run the database migrations'; - - /** - * The migrator instance. - * - * @var \Illuminate\Database\Migrations\Migrator - */ - protected $migrator; - - /** - * Create a new migration command instance. - * - * @param \Illuminate\Database\Migrations\Migrator $migrator - * @return void - */ - public function __construct(Migrator $migrator) - { - parent::__construct(); - - $this->migrator = $migrator; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - if (! $this->confirmToProceed()) { - return; - } - - $this->prepareDatabase(); - - // Next, we will check to see if a path option has been defined. If it has - // we will use the path relative to the root of this installation folder - // so that migrations may be run for any path within the applications. - $this->migrator->run($this->getMigrationPaths(), [ - 'pretend' => $this->option('pretend'), - 'step' => $this->option('step'), - ]); - - // Once the migrator has run we will grab the note output and send it out to - // the console screen, since the migrator itself functions without having - // any instances of the OutputInterface contract passed into the class. - foreach ($this->migrator->getNotes() as $note) { - $this->output->writeln($note); - } - - // Finally, if the "seed" option has been given, we will re-run the database - // seed task to re-populate the database, which is convenient when adding - // a migration and a seed at the same time, as it is only this command. - if ($this->option('seed')) { - $this->call('db:seed', ['--force' => true]); - } - } - - /** - * Prepare the migration database for running. - * - * @return void - */ - protected function prepareDatabase() - { - $this->migrator->setConnection($this->option('database')); - - if (! $this->migrator->repositoryExists()) { - $this->call( - 'migrate:install', ['--database' => $this->option('database')] - ); - } - } -} diff --git a/vendor/illuminate/database/Console/Migrations/MigrateMakeCommand.php b/vendor/illuminate/database/Console/Migrations/MigrateMakeCommand.php deleted file mode 100644 index 03995de..0000000 --- a/vendor/illuminate/database/Console/Migrations/MigrateMakeCommand.php +++ /dev/null @@ -1,131 +0,0 @@ -<?php - -namespace Illuminate\Database\Console\Migrations; - -use Illuminate\Support\Str; -use Illuminate\Support\Composer; -use Illuminate\Database\Migrations\MigrationCreator; - -class MigrateMakeCommand extends BaseCommand -{ - /** - * The console command signature. - * - * @var string - */ - protected $signature = 'make:migration {name : The name of the migration.} - {--create= : The table to be created.} - {--table= : The table to migrate.} - {--path= : The location where the migration file should be created.}'; - - /** - * The console command description. - * - * @var string - */ - protected $description = 'Create a new migration file'; - - /** - * The migration creator instance. - * - * @var \Illuminate\Database\Migrations\MigrationCreator - */ - protected $creator; - - /** - * The Composer instance. - * - * @var \Illuminate\Support\Composer - */ - protected $composer; - - /** - * Create a new migration install command instance. - * - * @param \Illuminate\Database\Migrations\MigrationCreator $creator - * @param \Illuminate\Support\Composer $composer - * @return void - */ - public function __construct(MigrationCreator $creator, Composer $composer) - { - parent::__construct(); - - $this->creator = $creator; - $this->composer = $composer; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - // It's possible for the developer to specify the tables to modify in this - // schema operation. The developer may also specify if this table needs - // to be freshly created so we can create the appropriate migrations. - $name = Str::snake(trim($this->input->getArgument('name'))); - - $table = $this->input->getOption('table'); - - $create = $this->input->getOption('create') ?: false; - - // If no table was given as an option but a create option is given then we - // will use the "create" option as the table name. This allows the devs - // to pass a table name into this option as a short-cut for creating. - if (! $table && is_string($create)) { - $table = $create; - - $create = true; - } - - // Next, we will attempt to guess the table name if this the migration has - // "create" in the name. This will allow us to provide a convenient way - // of creating migrations that create new tables for the application. - if (! $table) { - if (preg_match('/^create_(\w+)_table$/', $name, $matches)) { - $table = $matches[1]; - - $create = true; - } - } - - // Now we are ready to write the migration out to disk. Once we've written - // the migration out, we will dump-autoload for the entire framework to - // make sure that the migrations are registered by the class loaders. - $this->writeMigration($name, $table, $create); - - $this->composer->dumpAutoloads(); - } - - /** - * Write the migration file to disk. - * - * @param string $name - * @param string $table - * @param bool $create - * @return string - */ - protected function writeMigration($name, $table, $create) - { - $file = pathinfo($this->creator->create( - $name, $this->getMigrationPath(), $table, $create - ), PATHINFO_FILENAME); - - $this->line("<info>Created Migration:</info> {$file}"); - } - - /** - * Get migration path (either specified by '--path' option or default location). - * - * @return string - */ - protected function getMigrationPath() - { - if (! is_null($targetPath = $this->input->getOption('path'))) { - return $this->laravel->basePath().'/'.$targetPath; - } - - return parent::getMigrationPath(); - } -} diff --git a/vendor/illuminate/database/Console/Migrations/RefreshCommand.php b/vendor/illuminate/database/Console/Migrations/RefreshCommand.php deleted file mode 100644 index dc89091..0000000 --- a/vendor/illuminate/database/Console/Migrations/RefreshCommand.php +++ /dev/null @@ -1,154 +0,0 @@ -<?php - -namespace Illuminate\Database\Console\Migrations; - -use Illuminate\Console\Command; -use Illuminate\Console\ConfirmableTrait; -use Symfony\Component\Console\Input\InputOption; - -class RefreshCommand extends Command -{ - use ConfirmableTrait; - - /** - * The console command name. - * - * @var string - */ - protected $name = 'migrate:refresh'; - - /** - * The console command description. - * - * @var string - */ - protected $description = 'Reset and re-run all migrations'; - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - if (! $this->confirmToProceed()) { - return; - } - - // Next we'll gather some of the options so that we can have the right options - // to pass to the commands. This includes options such as which database to - // use and the path to use for the migration. Then we'll run the command. - $database = $this->input->getOption('database'); - - $path = $this->input->getOption('path'); - - $force = $this->input->getOption('force'); - - // If the "step" option is specified it means we only want to rollback a small - // number of migrations before migrating again. For example, the user might - // only rollback and remigrate the latest four migrations instead of all. - $step = $this->input->getOption('step') ?: 0; - - if ($step > 0) { - $this->runRollback($database, $path, $step, $force); - } else { - $this->runReset($database, $path, $force); - } - - // The refresh command is essentially just a brief aggregate of a few other of - // the migration commands and just provides a convenient wrapper to execute - // them in succession. We'll also see if we need to re-seed the database. - $this->call('migrate', [ - '--database' => $database, - '--path' => $path, - '--force' => $force, - ]); - - if ($this->needsSeeding()) { - $this->runSeeder($database); - } - } - - /** - * Run the rollback command. - * - * @param string $database - * @param string $path - * @param bool $step - * @param bool $force - * @return void - */ - protected function runRollback($database, $path, $step, $force) - { - $this->call('migrate:rollback', [ - '--database' => $database, - '--path' => $path, - '--step' => $step, - '--force' => $force, - ]); - } - - /** - * Run the reset command. - * - * @param string $database - * @param string $path - * @param bool $force - * @return void - */ - protected function runReset($database, $path, $force) - { - $this->call('migrate:reset', [ - '--database' => $database, - '--path' => $path, - '--force' => $force, - ]); - } - - /** - * Determine if the developer has requested database seeding. - * - * @return bool - */ - protected function needsSeeding() - { - return $this->option('seed') || $this->option('seeder'); - } - - /** - * Run the database seeder command. - * - * @param string $database - * @return void - */ - protected function runSeeder($database) - { - $this->call('db:seed', [ - '--database' => $database, - '--class' => $this->option('seeder') ?: 'DatabaseSeeder', - '--force' => $this->option('force'), - ]); - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'], - - ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production.'], - - ['path', null, InputOption::VALUE_OPTIONAL, 'The path of migrations files to be executed.'], - - ['seed', null, InputOption::VALUE_NONE, 'Indicates if the seed task should be re-run.'], - - ['seeder', null, InputOption::VALUE_OPTIONAL, 'The class name of the root seeder.'], - - ['step', null, InputOption::VALUE_OPTIONAL, 'The number of migrations to be reverted & re-run.'], - ]; - } -} diff --git a/vendor/illuminate/database/Console/Migrations/ResetCommand.php b/vendor/illuminate/database/Console/Migrations/ResetCommand.php deleted file mode 100644 index c2efdfa..0000000 --- a/vendor/illuminate/database/Console/Migrations/ResetCommand.php +++ /dev/null @@ -1,96 +0,0 @@ -<?php - -namespace Illuminate\Database\Console\Migrations; - -use Illuminate\Console\ConfirmableTrait; -use Illuminate\Database\Migrations\Migrator; -use Symfony\Component\Console\Input\InputOption; - -class ResetCommand extends BaseCommand -{ - use ConfirmableTrait; - - /** - * The console command name. - * - * @var string - */ - protected $name = 'migrate:reset'; - - /** - * The console command description. - * - * @var string - */ - protected $description = 'Rollback all database migrations'; - - /** - * The migrator instance. - * - * @var \Illuminate\Database\Migrations\Migrator - */ - protected $migrator; - - /** - * Create a new migration rollback command instance. - * - * @param \Illuminate\Database\Migrations\Migrator $migrator - * @return void - */ - public function __construct(Migrator $migrator) - { - parent::__construct(); - - $this->migrator = $migrator; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - if (! $this->confirmToProceed()) { - return; - } - - $this->migrator->setConnection($this->option('database')); - - // First, we'll make sure that the migration table actually exists before we - // start trying to rollback and re-run all of the migrations. If it's not - // present we'll just bail out with an info message for the developers. - if (! $this->migrator->repositoryExists()) { - return $this->comment('Migration table not found.'); - } - - $this->migrator->reset( - $this->getMigrationPaths(), $this->option('pretend') - ); - - // Once the migrator has run we will grab the note output and send it out to - // the console screen, since the migrator itself functions without having - // any instances of the OutputInterface contract passed into the class. - foreach ($this->migrator->getNotes() as $note) { - $this->output->writeln($note); - } - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'], - - ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production.'], - - ['path', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The path(s) of migrations files to be executed.'], - - ['pretend', null, InputOption::VALUE_NONE, 'Dump the SQL queries that would be run.'], - ]; - } -} diff --git a/vendor/illuminate/database/Console/Migrations/RollbackCommand.php b/vendor/illuminate/database/Console/Migrations/RollbackCommand.php deleted file mode 100644 index 3315d64..0000000 --- a/vendor/illuminate/database/Console/Migrations/RollbackCommand.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php - -namespace Illuminate\Database\Console\Migrations; - -use Illuminate\Console\ConfirmableTrait; -use Illuminate\Database\Migrations\Migrator; -use Symfony\Component\Console\Input\InputOption; - -class RollbackCommand extends BaseCommand -{ - use ConfirmableTrait; - - /** - * The console command name. - * - * @var string - */ - protected $name = 'migrate:rollback'; - - /** - * The console command description. - * - * @var string - */ - protected $description = 'Rollback the last database migration'; - - /** - * The migrator instance. - * - * @var \Illuminate\Database\Migrations\Migrator - */ - protected $migrator; - - /** - * Create a new migration rollback command instance. - * - * @param \Illuminate\Database\Migrations\Migrator $migrator - * @return void - */ - public function __construct(Migrator $migrator) - { - parent::__construct(); - - $this->migrator = $migrator; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - if (! $this->confirmToProceed()) { - return; - } - - $this->migrator->setConnection($this->option('database')); - - $this->migrator->rollback( - $this->getMigrationPaths(), [ - 'pretend' => $this->option('pretend'), - 'step' => (int) $this->option('step'), - ] - ); - - // Once the migrator has run we will grab the note output and send it out to - // the console screen, since the migrator itself functions without having - // any instances of the OutputInterface contract passed into the class. - foreach ($this->migrator->getNotes() as $note) { - $this->output->writeln($note); - } - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'], - - ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production.'], - - ['path', null, InputOption::VALUE_OPTIONAL, 'The path of migrations files to be executed.'], - - ['pretend', null, InputOption::VALUE_NONE, 'Dump the SQL queries that would be run.'], - - ['step', null, InputOption::VALUE_OPTIONAL, 'The number of migrations to be reverted.'], - ]; - } -} diff --git a/vendor/illuminate/database/Console/Migrations/StatusCommand.php b/vendor/illuminate/database/Console/Migrations/StatusCommand.php deleted file mode 100644 index df06542..0000000 --- a/vendor/illuminate/database/Console/Migrations/StatusCommand.php +++ /dev/null @@ -1,108 +0,0 @@ -<?php - -namespace Illuminate\Database\Console\Migrations; - -use Illuminate\Support\Collection; -use Illuminate\Database\Migrations\Migrator; -use Symfony\Component\Console\Input\InputOption; - -class StatusCommand extends BaseCommand -{ - /** - * The console command name. - * - * @var string - */ - protected $name = 'migrate:status'; - - /** - * The console command description. - * - * @var string - */ - protected $description = 'Show the status of each migration'; - - /** - * The migrator instance. - * - * @var \Illuminate\Database\Migrations\Migrator - */ - protected $migrator; - - /** - * Create a new migration rollback command instance. - * - * @param \Illuminate\Database\Migrations\Migrator $migrator - * @return void - */ - public function __construct(Migrator $migrator) - { - parent::__construct(); - - $this->migrator = $migrator; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - $this->migrator->setConnection($this->option('database')); - - if (! $this->migrator->repositoryExists()) { - return $this->error('No migrations found.'); - } - - $ran = $this->migrator->getRepository()->getRan(); - - if (count($migrations = $this->getStatusFor($ran)) > 0) { - $this->table(['Ran?', 'Migration'], $migrations); - } else { - $this->error('No migrations found'); - } - } - - /** - * Get the status for the given ran migrations. - * - * @param array $ran - * @return \Illuminate\Support\Collection - */ - protected function getStatusFor(array $ran) - { - return Collection::make($this->getAllMigrationFiles()) - ->map(function ($migration) use ($ran) { - $migrationName = $this->migrator->getMigrationName($migration); - - return in_array($migrationName, $ran) - ? ['<info>Y</info>', $migrationName] - : ['<fg=red>N</fg=red>', $migrationName]; - }); - } - - /** - * Get an array of all of the migration files. - * - * @return array - */ - protected function getAllMigrationFiles() - { - return $this->migrator->getMigrationFiles($this->getMigrationPaths()); - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'], - - ['path', null, InputOption::VALUE_OPTIONAL, 'The path of migrations files to use.'], - ]; - } -} diff --git a/vendor/illuminate/database/Console/Seeds/SeedCommand.php b/vendor/illuminate/database/Console/Seeds/SeedCommand.php deleted file mode 100644 index 2489873..0000000 --- a/vendor/illuminate/database/Console/Seeds/SeedCommand.php +++ /dev/null @@ -1,106 +0,0 @@ -<?php - -namespace Illuminate\Database\Console\Seeds; - -use Illuminate\Console\Command; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Console\ConfirmableTrait; -use Symfony\Component\Console\Input\InputOption; -use Illuminate\Database\ConnectionResolverInterface as Resolver; - -class SeedCommand extends Command -{ - use ConfirmableTrait; - - /** - * The console command name. - * - * @var string - */ - protected $name = 'db:seed'; - - /** - * The console command description. - * - * @var string - */ - protected $description = 'Seed the database with records'; - - /** - * The connection resolver instance. - * - * @var \Illuminate\Database\ConnectionResolverInterface - */ - protected $resolver; - - /** - * Create a new database seed command instance. - * - * @param \Illuminate\Database\ConnectionResolverInterface $resolver - * @return void - */ - public function __construct(Resolver $resolver) - { - parent::__construct(); - - $this->resolver = $resolver; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - if (! $this->confirmToProceed()) { - return; - } - - $this->resolver->setDefaultConnection($this->getDatabase()); - - Model::unguarded(function () { - $this->getSeeder()->__invoke(); - }); - } - - /** - * Get a seeder instance from the container. - * - * @return \Illuminate\Database\Seeder - */ - protected function getSeeder() - { - $class = $this->laravel->make($this->input->getOption('class')); - - return $class->setContainer($this->laravel)->setCommand($this); - } - - /** - * Get the name of the database connection to use. - * - * @return string - */ - protected function getDatabase() - { - $database = $this->input->getOption('database'); - - return $database ?: $this->laravel['config']['database.default']; - } - - /** - * Get the console command options. - * - * @return array - */ - protected function getOptions() - { - return [ - ['class', null, InputOption::VALUE_OPTIONAL, 'The class name of the root seeder', 'DatabaseSeeder'], - - ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to seed'], - - ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production.'], - ]; - } -} diff --git a/vendor/illuminate/database/Console/Seeds/SeederMakeCommand.php b/vendor/illuminate/database/Console/Seeds/SeederMakeCommand.php deleted file mode 100644 index 6e85e3e..0000000 --- a/vendor/illuminate/database/Console/Seeds/SeederMakeCommand.php +++ /dev/null @@ -1,96 +0,0 @@ -<?php - -namespace Illuminate\Database\Console\Seeds; - -use Illuminate\Support\Composer; -use Illuminate\Filesystem\Filesystem; -use Illuminate\Console\GeneratorCommand; - -class SeederMakeCommand extends GeneratorCommand -{ - /** - * The console command name. - * - * @var string - */ - protected $name = 'make:seeder'; - - /** - * The console command description. - * - * @var string - */ - protected $description = 'Create a new seeder class'; - - /** - * The type of class being generated. - * - * @var string - */ - protected $type = 'Seeder'; - - /** - * The Composer instance. - * - * @var \Illuminate\Support\Composer - */ - protected $composer; - - /** - * Create a new command instance. - * - * @param \Illuminate\Filesystem\Filesystem $files - * @param \Illuminate\Support\Composer $composer - * @return void - */ - public function __construct(Filesystem $files, Composer $composer) - { - parent::__construct($files); - - $this->composer = $composer; - } - - /** - * Execute the console command. - * - * @return void - */ - public function handle() - { - parent::handle(); - - $this->composer->dumpAutoloads(); - } - - /** - * Get the stub file for the generator. - * - * @return string - */ - protected function getStub() - { - return __DIR__.'/stubs/seeder.stub'; - } - - /** - * Get the destination class path. - * - * @param string $name - * @return string - */ - protected function getPath($name) - { - return $this->laravel->databasePath().'/seeds/'.$name.'.php'; - } - - /** - * Parse the class name and format according to the root namespace. - * - * @param string $name - * @return string - */ - protected function qualifyClass($name) - { - return $name; - } -} diff --git a/vendor/illuminate/database/Console/Seeds/stubs/seeder.stub b/vendor/illuminate/database/Console/Seeds/stubs/seeder.stub deleted file mode 100644 index 4aa3845..0000000 --- a/vendor/illuminate/database/Console/Seeds/stubs/seeder.stub +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -use Illuminate\Database\Seeder; - -class DummyClass extends Seeder -{ - /** - * Run the database seeds. - * - * @return void - */ - public function run() - { - // - } -} diff --git a/vendor/illuminate/database/DatabaseManager.php b/vendor/illuminate/database/DatabaseManager.php deleted file mode 100644 index 11af5a5..0000000 --- a/vendor/illuminate/database/DatabaseManager.php +++ /dev/null @@ -1,329 +0,0 @@ -<?php - -namespace Illuminate\Database; - -use PDO; -use Illuminate\Support\Arr; -use Illuminate\Support\Str; -use InvalidArgumentException; -use Illuminate\Database\Connectors\ConnectionFactory; - -/** - * @mixin \Illuminate\Database\Connection - */ -class DatabaseManager implements ConnectionResolverInterface -{ - /** - * The application instance. - * - * @var \Illuminate\Foundation\Application - */ - protected $app; - - /** - * The database connection factory instance. - * - * @var \Illuminate\Database\Connectors\ConnectionFactory - */ - protected $factory; - - /** - * The active connection instances. - * - * @var array - */ - protected $connections = []; - - /** - * The custom connection resolvers. - * - * @var array - */ - protected $extensions = []; - - /** - * Create a new database manager instance. - * - * @param \Illuminate\Foundation\Application $app - * @param \Illuminate\Database\Connectors\ConnectionFactory $factory - * @return void - */ - public function __construct($app, ConnectionFactory $factory) - { - $this->app = $app; - $this->factory = $factory; - } - - /** - * Get a database connection instance. - * - * @param string $name - * @return \Illuminate\Database\Connection - */ - public function connection($name = null) - { - list($database, $type) = $this->parseConnectionName($name); - - $name = $name ?: $database; - - // If we haven't created this connection, we'll create it based on the config - // provided in the application. Once we've created the connections we will - // set the "fetch mode" for PDO which determines the query return types. - if (! isset($this->connections[$name])) { - $this->connections[$name] = $this->configure( - $this->makeConnection($database), $type - ); - } - - return $this->connections[$name]; - } - - /** - * Parse the connection into an array of the name and read / write type. - * - * @param string $name - * @return array - */ - protected function parseConnectionName($name) - { - $name = $name ?: $this->getDefaultConnection(); - - return Str::endsWith($name, ['::read', '::write']) - ? explode('::', $name, 2) : [$name, null]; - } - - /** - * Make the database connection instance. - * - * @param string $name - * @return \Illuminate\Database\Connection - */ - protected function makeConnection($name) - { - $config = $this->configuration($name); - - // First we will check by the connection name to see if an extension has been - // registered specifically for that connection. If it has we will call the - // Closure and pass it the config allowing it to resolve the connection. - if (isset($this->extensions[$name])) { - return call_user_func($this->extensions[$name], $config, $name); - } - - // Next we will check to see if an extension has been registered for a driver - // and will call the Closure if so, which allows us to have a more generic - // resolver for the drivers themselves which applies to all connections. - if (isset($this->extensions[$driver = $config['driver']])) { - return call_user_func($this->extensions[$driver], $config, $name); - } - - return $this->factory->make($config, $name); - } - - /** - * Get the configuration for a connection. - * - * @param string $name - * @return array - * - * @throws \InvalidArgumentException - */ - protected function configuration($name) - { - $name = $name ?: $this->getDefaultConnection(); - - // To get the database connection configuration, we will just pull each of the - // connection configurations and get the configurations for the given name. - // If the configuration doesn't exist, we'll throw an exception and bail. - $connections = $this->app['config']['database.connections']; - - if (is_null($config = Arr::get($connections, $name))) { - throw new InvalidArgumentException("Database [$name] not configured."); - } - - return $config; - } - - /** - * Prepare the database connection instance. - * - * @param \Illuminate\Database\Connection $connection - * @param string $type - * @return \Illuminate\Database\Connection - */ - protected function configure(Connection $connection, $type) - { - $connection = $this->setPdoForType($connection, $type); - - // First we'll set the fetch mode and a few other dependencies of the database - // connection. This method basically just configures and prepares it to get - // used by the application. Once we're finished we'll return it back out. - if ($this->app->bound('events')) { - $connection->setEventDispatcher($this->app['events']); - } - - // Here we'll set a reconnector callback. This reconnector can be any callable - // so we will set a Closure to reconnect from this manager with the name of - // the connection, which will allow us to reconnect from the connections. - $connection->setReconnector(function ($connection) { - $this->reconnect($connection->getName()); - }); - - return $connection; - } - - /** - * Prepare the read / write mode for database connection instance. - * - * @param \Illuminate\Database\Connection $connection - * @param string $type - * @return \Illuminate\Database\Connection - */ - protected function setPdoForType(Connection $connection, $type = null) - { - if ($type == 'read') { - $connection->setPdo($connection->getReadPdo()); - } elseif ($type == 'write') { - $connection->setReadPdo($connection->getPdo()); - } - - return $connection; - } - - /** - * Disconnect from the given database and remove from local cache. - * - * @param string $name - * @return void - */ - public function purge($name = null) - { - $name = $name ?: $this->getDefaultConnection(); - - $this->disconnect($name); - - unset($this->connections[$name]); - } - - /** - * Disconnect from the given database. - * - * @param string $name - * @return void - */ - public function disconnect($name = null) - { - if (isset($this->connections[$name = $name ?: $this->getDefaultConnection()])) { - $this->connections[$name]->disconnect(); - } - } - - /** - * Reconnect to the given database. - * - * @param string $name - * @return \Illuminate\Database\Connection - */ - public function reconnect($name = null) - { - $this->disconnect($name = $name ?: $this->getDefaultConnection()); - - if (! isset($this->connections[$name])) { - return $this->connection($name); - } - - return $this->refreshPdoConnections($name); - } - - /** - * Refresh the PDO connections on a given connection. - * - * @param string $name - * @return \Illuminate\Database\Connection - */ - protected function refreshPdoConnections($name) - { - $fresh = $this->makeConnection($name); - - return $this->connections[$name] - ->setPdo($fresh->getPdo()) - ->setReadPdo($fresh->getReadPdo()); - } - - /** - * Get the default connection name. - * - * @return string - */ - public function getDefaultConnection() - { - return $this->app['config']['database.default']; - } - - /** - * Set the default connection name. - * - * @param string $name - * @return void - */ - public function setDefaultConnection($name) - { - $this->app['config']['database.default'] = $name; - } - - /** - * Get all of the support drivers. - * - * @return array - */ - public function supportedDrivers() - { - return ['mysql', 'pgsql', 'sqlite', 'sqlsrv']; - } - - /** - * Get all of the drivers that are actually available. - * - * @return array - */ - public function availableDrivers() - { - return array_intersect( - $this->supportedDrivers(), - str_replace('dblib', 'sqlsrv', PDO::getAvailableDrivers()) - ); - } - - /** - * Register an extension connection resolver. - * - * @param string $name - * @param callable $resolver - * @return void - */ - public function extend($name, callable $resolver) - { - $this->extensions[$name] = $resolver; - } - - /** - * Return all of the created connections. - * - * @return array - */ - public function getConnections() - { - return $this->connections; - } - - /** - * Dynamically pass methods to the default connection. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->connection()->$method(...$parameters); - } -} diff --git a/vendor/illuminate/database/DatabaseServiceProvider.php b/vendor/illuminate/database/DatabaseServiceProvider.php deleted file mode 100644 index a8ee7b0..0000000 --- a/vendor/illuminate/database/DatabaseServiceProvider.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php - -namespace Illuminate\Database; - -use Faker\Factory as FakerFactory; -use Faker\Generator as FakerGenerator; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Support\ServiceProvider; -use Illuminate\Contracts\Queue\EntityResolver; -use Illuminate\Database\Connectors\ConnectionFactory; -use Illuminate\Database\Eloquent\QueueEntityResolver; -use Illuminate\Database\Eloquent\Factory as EloquentFactory; - -class DatabaseServiceProvider extends ServiceProvider -{ - /** - * Bootstrap the application events. - * - * @return void - */ - public function boot() - { - Model::setConnectionResolver($this->app['db']); - - Model::setEventDispatcher($this->app['events']); - } - - /** - * Register the service provider. - * - * @return void - */ - public function register() - { - Model::clearBootedModels(); - - $this->registerConnectionServices(); - - $this->registerEloquentFactory(); - - $this->registerQueueableEntityResolver(); - } - - /** - * Register the primary database bindings. - * - * @return void - */ - protected function registerConnectionServices() - { - // The connection factory is used to create the actual connection instances on - // the database. We will inject the factory into the manager so that it may - // make the connections while they are actually needed and not of before. - $this->app->singleton('db.factory', function ($app) { - return new ConnectionFactory($app); - }); - - // The database manager is used to resolve various connections, since multiple - // connections might be managed. It also implements the connection resolver - // interface which may be used by other components requiring connections. - $this->app->singleton('db', function ($app) { - return new DatabaseManager($app, $app['db.factory']); - }); - - $this->app->bind('db.connection', function ($app) { - return $app['db']->connection(); - }); - } - - /** - * Register the Eloquent factory instance in the container. - * - * @return void - */ - protected function registerEloquentFactory() - { - $this->app->singleton(FakerGenerator::class, function ($app) { - return FakerFactory::create($app['config']->get('app.faker_locale', 'en_US')); - }); - - $this->app->singleton(EloquentFactory::class, function ($app) { - return EloquentFactory::construct( - $app->make(FakerGenerator::class), $this->app->databasePath('factories') - ); - }); - } - - /** - * Register the queueable entity resolver implementation. - * - * @return void - */ - protected function registerQueueableEntityResolver() - { - $this->app->singleton(EntityResolver::class, function () { - return new QueueEntityResolver; - }); - } -} diff --git a/vendor/illuminate/database/DetectsDeadlocks.php b/vendor/illuminate/database/DetectsDeadlocks.php deleted file mode 100644 index a8193ee..0000000 --- a/vendor/illuminate/database/DetectsDeadlocks.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace Illuminate\Database; - -use Exception; -use Illuminate\Support\Str; - -trait DetectsDeadlocks -{ - /** - * Determine if the given exception was caused by a deadlock. - * - * @param \Exception $e - * @return bool - */ - protected function causedByDeadlock(Exception $e) - { - $message = $e->getMessage(); - - return Str::contains($message, [ - 'Deadlock found when trying to get lock', - 'deadlock detected', - 'The database file is locked', - 'database is locked', - 'database table is locked', - 'A table in the database is locked', - 'has been chosen as the deadlock victim', - 'Lock wait timeout exceeded; try restarting transaction', - 'WSREP detected deadlock/conflict and aborted the transaction. Try restarting the transaction', - ]); - } -} diff --git a/vendor/illuminate/database/DetectsLostConnections.php b/vendor/illuminate/database/DetectsLostConnections.php deleted file mode 100644 index 0ce39dd..0000000 --- a/vendor/illuminate/database/DetectsLostConnections.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -namespace Illuminate\Database; - -use Exception; -use Illuminate\Support\Str; - -trait DetectsLostConnections -{ - /** - * Determine if the given exception was caused by a lost connection. - * - * @param \Exception $e - * @return bool - */ - protected function causedByLostConnection(Exception $e) - { - $message = $e->getMessage(); - - return Str::contains($message, [ - 'server has gone away', - 'no connection to the server', - 'Lost connection', - 'is dead or not enabled', - 'Error while sending', - 'decryption failed or bad record mac', - 'server closed the connection unexpectedly', - 'SSL connection has been closed unexpectedly', - 'Error writing data to the connection', - 'Resource deadlock avoided', - 'Transaction() on null', - 'child connection forced to terminate due to client_idle_limit', - 'query_wait_timeout', - 'reset by peer', - 'Physical connection is not usable', - 'TCP Provider: Error code 0x68', - 'Name or service not known', - ]); - } -} diff --git a/vendor/illuminate/database/Eloquent/Builder.php b/vendor/illuminate/database/Eloquent/Builder.php deleted file mode 100644 index fd9919e..0000000 --- a/vendor/illuminate/database/Eloquent/Builder.php +++ /dev/null @@ -1,1328 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent; - -use Closure; -use BadMethodCallException; -use Illuminate\Support\Arr; -use Illuminate\Support\Str; -use Illuminate\Pagination\Paginator; -use Illuminate\Contracts\Support\Arrayable; -use Illuminate\Database\Concerns\BuildsQueries; -use Illuminate\Database\Eloquent\Relations\Relation; -use Illuminate\Database\Query\Builder as QueryBuilder; - -/** - * @mixin \Illuminate\Database\Query\Builder - */ -class Builder -{ - use BuildsQueries, Concerns\QueriesRelationships; - - /** - * The base query builder instance. - * - * @var \Illuminate\Database\Query\Builder - */ - protected $query; - - /** - * The model being queried. - * - * @var \Illuminate\Database\Eloquent\Model - */ - protected $model; - - /** - * The relationships that should be eager loaded. - * - * @var array - */ - protected $eagerLoad = []; - - /** - * All of the globally registered builder macros. - * - * @var array - */ - protected static $macros = []; - - /** - * All of the locally registered builder macros. - * - * @var array - */ - protected $localMacros = []; - - /** - * A replacement for the typical delete function. - * - * @var \Closure - */ - protected $onDelete; - - /** - * The methods that should be returned from query builder. - * - * @var array - */ - protected $passthru = [ - 'insert', 'insertGetId', 'getBindings', 'toSql', - 'exists', 'doesntExist', 'count', 'min', 'max', 'avg', 'sum', 'getConnection', - ]; - - /** - * Applied global scopes. - * - * @var array - */ - protected $scopes = []; - - /** - * Removed global scopes. - * - * @var array - */ - protected $removedScopes = []; - - /** - * Create a new Eloquent query builder instance. - * - * @param \Illuminate\Database\Query\Builder $query - * @return void - */ - public function __construct(QueryBuilder $query) - { - $this->query = $query; - } - - /** - * Create and return an un-saved model instance. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model - */ - public function make(array $attributes = []) - { - return $this->newModelInstance($attributes); - } - - /** - * Register a new global scope. - * - * @param string $identifier - * @param \Illuminate\Database\Eloquent\Scope|\Closure $scope - * @return $this - */ - public function withGlobalScope($identifier, $scope) - { - $this->scopes[$identifier] = $scope; - - if (method_exists($scope, 'extend')) { - $scope->extend($this); - } - - return $this; - } - - /** - * Remove a registered global scope. - * - * @param \Illuminate\Database\Eloquent\Scope|string $scope - * @return $this - */ - public function withoutGlobalScope($scope) - { - if (! is_string($scope)) { - $scope = get_class($scope); - } - - unset($this->scopes[$scope]); - - $this->removedScopes[] = $scope; - - return $this; - } - - /** - * Remove all or passed registered global scopes. - * - * @param array|null $scopes - * @return $this - */ - public function withoutGlobalScopes(array $scopes = null) - { - if (is_array($scopes)) { - foreach ($scopes as $scope) { - $this->withoutGlobalScope($scope); - } - } else { - $this->scopes = []; - } - - return $this; - } - - /** - * Get an array of global scopes that were removed from the query. - * - * @return array - */ - public function removedScopes() - { - return $this->removedScopes; - } - - /** - * Add a where clause on the primary key to the query. - * - * @param mixed $id - * @return $this - */ - public function whereKey($id) - { - if (is_array($id) || $id instanceof Arrayable) { - $this->query->whereIn($this->model->getQualifiedKeyName(), $id); - - return $this; - } - - return $this->where($this->model->getQualifiedKeyName(), '=', $id); - } - - /** - * Add a where clause on the primary key to the query. - * - * @param mixed $id - * @return $this - */ - public function whereKeyNot($id) - { - if (is_array($id) || $id instanceof Arrayable) { - $this->query->whereNotIn($this->model->getQualifiedKeyName(), $id); - - return $this; - } - - return $this->where($this->model->getQualifiedKeyName(), '!=', $id); - } - - /** - * Add a basic where clause to the query. - * - * @param string|array|\Closure $column - * @param string $operator - * @param mixed $value - * @param string $boolean - * @return $this - */ - public function where($column, $operator = null, $value = null, $boolean = 'and') - { - if ($column instanceof Closure) { - $column($query = $this->model->newModelQuery()); - - $this->query->addNestedWhereQuery($query->getQuery(), $boolean); - } else { - $this->query->where(...func_get_args()); - } - - return $this; - } - - /** - * Add an "or where" clause to the query. - * - * @param \Closure|array|string $column - * @param string $operator - * @param mixed $value - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function orWhere($column, $operator = null, $value = null) - { - list($value, $operator) = $this->query->prepareValueAndOperator( - $value, $operator, func_num_args() == 2 - ); - - return $this->where($column, $operator, $value, 'or'); - } - - /** - * Create a collection of models from plain arrays. - * - * @param array $items - * @return \Illuminate\Database\Eloquent\Collection - */ - public function hydrate(array $items) - { - $instance = $this->newModelInstance(); - - return $instance->newCollection(array_map(function ($item) use ($instance) { - return $instance->newFromBuilder($item); - }, $items)); - } - - /** - * Create a collection of models from a raw query. - * - * @param string $query - * @param array $bindings - * @return \Illuminate\Database\Eloquent\Collection - */ - public function fromQuery($query, $bindings = []) - { - return $this->hydrate( - $this->query->getConnection()->select($query, $bindings) - ); - } - - /** - * Find a model by its primary key. - * - * @param mixed $id - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|static[]|static|null - */ - public function find($id, $columns = ['*']) - { - if (is_array($id) || $id instanceof Arrayable) { - return $this->findMany($id, $columns); - } - - return $this->whereKey($id)->first($columns); - } - - /** - * Find multiple models by their primary keys. - * - * @param \Illuminate\Contracts\Support\Arrayable|array $ids - * @param array $columns - * @return \Illuminate\Database\Eloquent\Collection - */ - public function findMany($ids, $columns = ['*']) - { - if (empty($ids)) { - return $this->model->newCollection(); - } - - return $this->whereKey($ids)->get($columns); - } - - /** - * Find a model by its primary key or throw an exception. - * - * @param mixed $id - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException - */ - public function findOrFail($id, $columns = ['*']) - { - $result = $this->find($id, $columns); - - if (is_array($id)) { - if (count($result) == count(array_unique($id))) { - return $result; - } - } elseif (! is_null($result)) { - return $result; - } - - throw (new ModelNotFoundException)->setModel( - get_class($this->model), $id - ); - } - - /** - * Find a model by its primary key or return fresh model instance. - * - * @param mixed $id - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model - */ - public function findOrNew($id, $columns = ['*']) - { - if (! is_null($model = $this->find($id, $columns))) { - return $model; - } - - return $this->newModelInstance(); - } - - /** - * Get the first record matching the attributes or instantiate it. - * - * @param array $attributes - * @param array $values - * @return \Illuminate\Database\Eloquent\Model - */ - public function firstOrNew(array $attributes, array $values = []) - { - if (! is_null($instance = $this->where($attributes)->first())) { - return $instance; - } - - return $this->newModelInstance($attributes + $values); - } - - /** - * Get the first record matching the attributes or create it. - * - * @param array $attributes - * @param array $values - * @return \Illuminate\Database\Eloquent\Model - */ - public function firstOrCreate(array $attributes, array $values = []) - { - if (! is_null($instance = $this->where($attributes)->first())) { - return $instance; - } - - return tap($this->newModelInstance($attributes + $values), function ($instance) { - $instance->save(); - }); - } - - /** - * Create or update a record matching the attributes, and fill it with values. - * - * @param array $attributes - * @param array $values - * @return \Illuminate\Database\Eloquent\Model - */ - public function updateOrCreate(array $attributes, array $values = []) - { - return tap($this->firstOrNew($attributes), function ($instance) use ($values) { - $instance->fill($values)->save(); - }); - } - - /** - * Execute the query and get the first result or throw an exception. - * - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model|static - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException - */ - public function firstOrFail($columns = ['*']) - { - if (! is_null($model = $this->first($columns))) { - return $model; - } - - throw (new ModelNotFoundException)->setModel(get_class($this->model)); - } - - /** - * Execute the query and get the first result or call a callback. - * - * @param \Closure|array $columns - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Model|static|mixed - */ - public function firstOr($columns = ['*'], Closure $callback = null) - { - if ($columns instanceof Closure) { - $callback = $columns; - - $columns = ['*']; - } - - if (! is_null($model = $this->first($columns))) { - return $model; - } - - return call_user_func($callback); - } - - /** - * Get a single column's value from the first result of a query. - * - * @param string $column - * @return mixed - */ - public function value($column) - { - if ($result = $this->first([$column])) { - return $result->{$column}; - } - } - - /** - * Execute the query as a "select" statement. - * - * @param array $columns - * @return \Illuminate\Database\Eloquent\Collection|static[] - */ - public function get($columns = ['*']) - { - $builder = $this->applyScopes(); - - // If we actually found models we will also eager load any relationships that - // have been specified as needing to be eager loaded, which will solve the - // n+1 query issue for the developers to avoid running a lot of queries. - if (count($models = $builder->getModels($columns)) > 0) { - $models = $builder->eagerLoadRelations($models); - } - - return $builder->getModel()->newCollection($models); - } - - /** - * Get the hydrated models without eager loading. - * - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model[] - */ - public function getModels($columns = ['*']) - { - return $this->model->hydrate( - $this->query->get($columns)->all() - )->all(); - } - - /** - * Eager load the relationships for the models. - * - * @param array $models - * @return array - */ - public function eagerLoadRelations(array $models) - { - foreach ($this->eagerLoad as $name => $constraints) { - // For nested eager loads we'll skip loading them here and they will be set as an - // eager load on the query to retrieve the relation so that they will be eager - // loaded on that query, because that is where they get hydrated as models. - if (strpos($name, '.') === false) { - $models = $this->eagerLoadRelation($models, $name, $constraints); - } - } - - return $models; - } - - /** - * Eagerly load the relationship on a set of models. - * - * @param array $models - * @param string $name - * @param \Closure $constraints - * @return array - */ - protected function eagerLoadRelation(array $models, $name, Closure $constraints) - { - // First we will "back up" the existing where conditions on the query so we can - // add our eager constraints. Then we will merge the wheres that were on the - // query back to it in order that any where conditions might be specified. - $relation = $this->getRelation($name); - - $relation->addEagerConstraints($models); - - $constraints($relation); - - // Once we have the results, we just match those back up to their parent models - // using the relationship instance. Then we just return the finished arrays - // of models which have been eagerly hydrated and are readied for return. - return $relation->match( - $relation->initRelation($models, $name), - $relation->getEager(), $name - ); - } - - /** - * Get the relation instance for the given relation name. - * - * @param string $name - * @return \Illuminate\Database\Eloquent\Relations\Relation - */ - public function getRelation($name) - { - // We want to run a relationship query without any constrains so that we will - // not have to remove these where clauses manually which gets really hacky - // and error prone. We don't want constraints because we add eager ones. - $relation = Relation::noConstraints(function () use ($name) { - try { - return $this->getModel()->newInstance()->$name(); - } catch (BadMethodCallException $e) { - throw RelationNotFoundException::make($this->getModel(), $name); - } - }); - - $nested = $this->relationsNestedUnder($name); - - // If there are nested relationships set on the query, we will put those onto - // the query instances so that they can be handled after this relationship - // is loaded. In this way they will all trickle down as they are loaded. - if (count($nested) > 0) { - $relation->getQuery()->with($nested); - } - - return $relation; - } - - /** - * Get the deeply nested relations for a given top-level relation. - * - * @param string $relation - * @return array - */ - protected function relationsNestedUnder($relation) - { - $nested = []; - - // We are basically looking for any relationships that are nested deeper than - // the given top-level relationship. We will just check for any relations - // that start with the given top relations and adds them to our arrays. - foreach ($this->eagerLoad as $name => $constraints) { - if ($this->isNestedUnder($relation, $name)) { - $nested[substr($name, strlen($relation.'.'))] = $constraints; - } - } - - return $nested; - } - - /** - * Determine if the relationship is nested. - * - * @param string $relation - * @param string $name - * @return bool - */ - protected function isNestedUnder($relation, $name) - { - return Str::contains($name, '.') && Str::startsWith($name, $relation.'.'); - } - - /** - * Get a generator for the given query. - * - * @return \Generator - */ - public function cursor() - { - foreach ($this->applyScopes()->query->cursor() as $record) { - yield $this->model->newFromBuilder($record); - } - } - - /** - * Chunk the results of a query by comparing numeric IDs. - * - * @param int $count - * @param callable $callback - * @param string $column - * @param string|null $alias - * @return bool - */ - public function chunkById($count, callable $callback, $column = null, $alias = null) - { - $column = is_null($column) ? $this->getModel()->getKeyName() : $column; - - $alias = is_null($alias) ? $column : $alias; - - $lastId = 0; - - do { - $clone = clone $this; - - // We'll execute the query for the given page and get the results. If there are - // no results we can just break and return from here. When there are results - // we will call the callback with the current chunk of these results here. - $results = $clone->forPageAfterId($count, $lastId, $column)->get(); - - $countResults = $results->count(); - - if ($countResults == 0) { - break; - } - - // On each chunk result set, we will pass them to the callback and then let the - // developer take care of everything within the callback, which allows us to - // keep the memory low for spinning through large result sets for working. - if ($callback($results) === false) { - return false; - } - - $lastId = $results->last()->{$alias}; - - unset($results); - } while ($countResults == $count); - - return true; - } - - /** - * Add a generic "order by" clause if the query doesn't already have one. - * - * @return void - */ - protected function enforceOrderBy() - { - if (empty($this->query->orders) && empty($this->query->unionOrders)) { - $this->orderBy($this->model->getQualifiedKeyName(), 'asc'); - } - } - - /** - * Get an array with the values of a given column. - * - * @param string $column - * @param string|null $key - * @return \Illuminate\Support\Collection - */ - public function pluck($column, $key = null) - { - $results = $this->toBase()->pluck($column, $key); - - // If the model has a mutator for the requested column, we will spin through - // the results and mutate the values so that the mutated version of these - // columns are returned as you would expect from these Eloquent models. - if (! $this->model->hasGetMutator($column) && - ! $this->model->hasCast($column) && - ! in_array($column, $this->model->getDates())) { - return $results; - } - - return $results->map(function ($value) use ($column) { - return $this->model->newFromBuilder([$column => $value])->{$column}; - }); - } - - /** - * Paginate the given query. - * - * @param int $perPage - * @param array $columns - * @param string $pageName - * @param int|null $page - * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator - * - * @throws \InvalidArgumentException - */ - public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) - { - $page = $page ?: Paginator::resolveCurrentPage($pageName); - - $perPage = $perPage ?: $this->model->getPerPage(); - - $results = ($total = $this->toBase()->getCountForPagination()) - ? $this->forPage($page, $perPage)->get($columns) - : $this->model->newCollection(); - - return $this->paginator($results, $total, $perPage, $page, [ - 'path' => Paginator::resolveCurrentPath(), - 'pageName' => $pageName, - ]); - } - - /** - * Paginate the given query into a simple paginator. - * - * @param int $perPage - * @param array $columns - * @param string $pageName - * @param int|null $page - * @return \Illuminate\Contracts\Pagination\Paginator - */ - public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) - { - $page = $page ?: Paginator::resolveCurrentPage($pageName); - - $perPage = $perPage ?: $this->model->getPerPage(); - - // Next we will set the limit and offset for this query so that when we get the - // results we get the proper section of results. Then, we'll create the full - // paginator instances for these results with the given page and per page. - $this->skip(($page - 1) * $perPage)->take($perPage + 1); - - return $this->simplePaginator($this->get($columns), $perPage, $page, [ - 'path' => Paginator::resolveCurrentPath(), - 'pageName' => $pageName, - ]); - } - - /** - * Save a new model and return the instance. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model|$this - */ - public function create(array $attributes = []) - { - return tap($this->newModelInstance($attributes), function ($instance) { - $instance->save(); - }); - } - - /** - * Save a new model and return the instance. Allow mass-assignment. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model|$this - */ - public function forceCreate(array $attributes) - { - return $this->model->unguarded(function () use ($attributes) { - return $this->newModelInstance()->create($attributes); - }); - } - - /** - * Update a record in the database. - * - * @param array $values - * @return int - */ - public function update(array $values) - { - return $this->toBase()->update($this->addUpdatedAtColumn($values)); - } - - /** - * Increment a column's value by a given amount. - * - * @param string $column - * @param int $amount - * @param array $extra - * @return int - */ - public function increment($column, $amount = 1, array $extra = []) - { - return $this->toBase()->increment( - $column, $amount, $this->addUpdatedAtColumn($extra) - ); - } - - /** - * Decrement a column's value by a given amount. - * - * @param string $column - * @param int $amount - * @param array $extra - * @return int - */ - public function decrement($column, $amount = 1, array $extra = []) - { - return $this->toBase()->decrement( - $column, $amount, $this->addUpdatedAtColumn($extra) - ); - } - - /** - * Add the "updated at" column to an array of values. - * - * @param array $values - * @return array - */ - protected function addUpdatedAtColumn(array $values) - { - if (! $this->model->usesTimestamps()) { - return $values; - } - - return Arr::add( - $values, $this->model->getUpdatedAtColumn(), - $this->model->freshTimestampString() - ); - } - - /** - * Delete a record from the database. - * - * @return mixed - */ - public function delete() - { - if (isset($this->onDelete)) { - return call_user_func($this->onDelete, $this); - } - - return $this->toBase()->delete(); - } - - /** - * Run the default delete function on the builder. - * - * Since we do not apply scopes here, the row will actually be deleted. - * - * @return mixed - */ - public function forceDelete() - { - return $this->query->delete(); - } - - /** - * Register a replacement for the default delete function. - * - * @param \Closure $callback - * @return void - */ - public function onDelete(Closure $callback) - { - $this->onDelete = $callback; - } - - /** - * Call the given local model scopes. - * - * @param array $scopes - * @return mixed - */ - public function scopes(array $scopes) - { - $builder = $this; - - foreach ($scopes as $scope => $parameters) { - // If the scope key is an integer, then the scope was passed as the value and - // the parameter list is empty, so we will format the scope name and these - // parameters here. Then, we'll be ready to call the scope on the model. - if (is_int($scope)) { - list($scope, $parameters) = [$parameters, []]; - } - - // Next we'll pass the scope callback to the callScope method which will take - // care of grouping the "wheres" properly so the logical order doesn't get - // messed up when adding scopes. Then we'll return back out the builder. - $builder = $builder->callScope( - [$this->model, 'scope'.ucfirst($scope)], - (array) $parameters - ); - } - - return $builder; - } - - /** - * Apply the scopes to the Eloquent builder instance and return it. - * - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function applyScopes() - { - if (! $this->scopes) { - return $this; - } - - $builder = clone $this; - - foreach ($this->scopes as $identifier => $scope) { - if (! isset($builder->scopes[$identifier])) { - continue; - } - - $builder->callScope(function (Builder $builder) use ($scope) { - // If the scope is a Closure we will just go ahead and call the scope with the - // builder instance. The "callScope" method will properly group the clauses - // that are added to this query so "where" clauses maintain proper logic. - if ($scope instanceof Closure) { - $scope($builder); - } - - // If the scope is a scope object, we will call the apply method on this scope - // passing in the builder and the model instance. After we run all of these - // scopes we will return back the builder instance to the outside caller. - if ($scope instanceof Scope) { - $scope->apply($builder, $this->getModel()); - } - }); - } - - return $builder; - } - - /** - * Apply the given scope on the current builder instance. - * - * @param callable $scope - * @param array $parameters - * @return mixed - */ - protected function callScope(callable $scope, $parameters = []) - { - array_unshift($parameters, $this); - - $query = $this->getQuery(); - - // We will keep track of how many wheres are on the query before running the - // scope so that we can properly group the added scope constraints in the - // query as their own isolated nested where statement and avoid issues. - $originalWhereCount = is_null($query->wheres) - ? 0 : count($query->wheres); - - $result = $scope(...array_values($parameters)) ?? $this; - - if (count((array) $query->wheres) > $originalWhereCount) { - $this->addNewWheresWithinGroup($query, $originalWhereCount); - } - - return $result; - } - - /** - * Nest where conditions by slicing them at the given where count. - * - * @param \Illuminate\Database\Query\Builder $query - * @param int $originalWhereCount - * @return void - */ - protected function addNewWheresWithinGroup(QueryBuilder $query, $originalWhereCount) - { - // Here, we totally remove all of the where clauses since we are going to - // rebuild them as nested queries by slicing the groups of wheres into - // their own sections. This is to prevent any confusing logic order. - $allWheres = $query->wheres; - - $query->wheres = []; - - $this->groupWhereSliceForScope( - $query, array_slice($allWheres, 0, $originalWhereCount) - ); - - $this->groupWhereSliceForScope( - $query, array_slice($allWheres, $originalWhereCount) - ); - } - - /** - * Slice where conditions at the given offset and add them to the query as a nested condition. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $whereSlice - * @return void - */ - protected function groupWhereSliceForScope(QueryBuilder $query, $whereSlice) - { - $whereBooleans = collect($whereSlice)->pluck('boolean'); - - // Here we'll check if the given subset of where clauses contains any "or" - // booleans and in this case create a nested where expression. That way - // we don't add any unnecessary nesting thus keeping the query clean. - if ($whereBooleans->contains('or')) { - $query->wheres[] = $this->createNestedWhere( - $whereSlice, $whereBooleans->first() - ); - } else { - $query->wheres = array_merge($query->wheres, $whereSlice); - } - } - - /** - * Create a where array with nested where conditions. - * - * @param array $whereSlice - * @param string $boolean - * @return array - */ - protected function createNestedWhere($whereSlice, $boolean = 'and') - { - $whereGroup = $this->getQuery()->forNestedWhere(); - - $whereGroup->wheres = $whereSlice; - - return ['type' => 'Nested', 'query' => $whereGroup, 'boolean' => $boolean]; - } - - /** - * Set the relationships that should be eager loaded. - * - * @param mixed $relations - * @return $this - */ - public function with($relations) - { - $eagerLoad = $this->parseWithRelations(is_string($relations) ? func_get_args() : $relations); - - $this->eagerLoad = array_merge($this->eagerLoad, $eagerLoad); - - return $this; - } - - /** - * Prevent the specified relations from being eager loaded. - * - * @param mixed $relations - * @return $this - */ - public function without($relations) - { - $this->eagerLoad = array_diff_key($this->eagerLoad, array_flip( - is_string($relations) ? func_get_args() : $relations - )); - - return $this; - } - - /** - * Create a new instance of the model being queried. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model - */ - public function newModelInstance($attributes = []) - { - return $this->model->newInstance($attributes)->setConnection( - $this->query->getConnection()->getName() - ); - } - - /** - * Parse a list of relations into individuals. - * - * @param array $relations - * @return array - */ - protected function parseWithRelations(array $relations) - { - $results = []; - - foreach ($relations as $name => $constraints) { - // If the "relation" value is actually a numeric key, we can assume that no - // constraints have been specified for the eager load and we'll just put - // an empty Closure with the loader so that we can treat all the same. - if (is_numeric($name)) { - $name = $constraints; - - list($name, $constraints) = Str::contains($name, ':') - ? $this->createSelectWithConstraint($name) - : [$name, function () { - // - }]; - } - - // We need to separate out any nested includes. Which allows the developers - // to load deep relationships using "dots" without stating each level of - // the relationship with its own key in the array of eager load names. - $results = $this->addNestedWiths($name, $results); - - $results[$name] = $constraints; - } - - return $results; - } - - /** - * Create a constraint to select the given columns for the relation. - * - * @param string $name - * @return array - */ - protected function createSelectWithConstraint($name) - { - return [explode(':', $name)[0], function ($query) use ($name) { - $query->select(explode(',', explode(':', $name)[1])); - }]; - } - - /** - * Parse the nested relationships in a relation. - * - * @param string $name - * @param array $results - * @return array - */ - protected function addNestedWiths($name, $results) - { - $progress = []; - - // If the relation has already been set on the result array, we will not set it - // again, since that would override any constraints that were already placed - // on the relationships. We will only set the ones that are not specified. - foreach (explode('.', $name) as $segment) { - $progress[] = $segment; - - if (! isset($results[$last = implode('.', $progress)])) { - $results[$last] = function () { - // - }; - } - } - - return $results; - } - - /** - * Get the underlying query builder instance. - * - * @return \Illuminate\Database\Query\Builder - */ - public function getQuery() - { - return $this->query; - } - - /** - * Set the underlying query builder instance. - * - * @param \Illuminate\Database\Query\Builder $query - * @return $this - */ - public function setQuery($query) - { - $this->query = $query; - - return $this; - } - - /** - * Get a base query builder instance. - * - * @return \Illuminate\Database\Query\Builder - */ - public function toBase() - { - return $this->applyScopes()->getQuery(); - } - - /** - * Get the relationships being eagerly loaded. - * - * @return array - */ - public function getEagerLoads() - { - return $this->eagerLoad; - } - - /** - * Set the relationships being eagerly loaded. - * - * @param array $eagerLoad - * @return $this - */ - public function setEagerLoads(array $eagerLoad) - { - $this->eagerLoad = $eagerLoad; - - return $this; - } - - /** - * Get the model instance being queried. - * - * @return \Illuminate\Database\Eloquent\Model - */ - public function getModel() - { - return $this->model; - } - - /** - * Set a model instance for the model being queried. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return $this - */ - public function setModel(Model $model) - { - $this->model = $model; - - $this->query->from($model->getTable()); - - return $this; - } - - /** - * Qualify the given column name by the model's table. - * - * @param string $column - * @return string - */ - public function qualifyColumn($column) - { - return $this->model->qualifyColumn($column); - } - - /** - * Get the given macro by name. - * - * @param string $name - * @return \Closure - */ - public function getMacro($name) - { - return Arr::get($this->localMacros, $name); - } - - /** - * Dynamically handle calls into the query instance. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - if ($method === 'macro') { - $this->localMacros[$parameters[0]] = $parameters[1]; - - return; - } - - if (isset($this->localMacros[$method])) { - array_unshift($parameters, $this); - - return $this->localMacros[$method](...$parameters); - } - - if (isset(static::$macros[$method])) { - if (static::$macros[$method] instanceof Closure) { - return call_user_func_array(static::$macros[$method]->bindTo($this, static::class), $parameters); - } - - return call_user_func_array(static::$macros[$method], $parameters); - } - - if (method_exists($this->model, $scope = 'scope'.ucfirst($method))) { - return $this->callScope([$this->model, $scope], $parameters); - } - - if (in_array($method, $this->passthru)) { - return $this->toBase()->{$method}(...$parameters); - } - - $this->query->{$method}(...$parameters); - - return $this; - } - - /** - * Dynamically handle calls into the query instance. - * - * @param string $method - * @param array $parameters - * @return mixed - * - * @throws \BadMethodCallException - */ - public static function __callStatic($method, $parameters) - { - if ($method === 'macro') { - static::$macros[$parameters[0]] = $parameters[1]; - - return; - } - - if (! isset(static::$macros[$method])) { - throw new BadMethodCallException("Method {$method} does not exist."); - } - - if (static::$macros[$method] instanceof Closure) { - return call_user_func_array(Closure::bind(static::$macros[$method], null, static::class), $parameters); - } - - return call_user_func_array(static::$macros[$method], $parameters); - } - - /** - * Force a clone of the underlying query builder when cloning. - * - * @return void - */ - public function __clone() - { - $this->query = clone $this->query; - } -} diff --git a/vendor/illuminate/database/Eloquent/Collection.php b/vendor/illuminate/database/Eloquent/Collection.php deleted file mode 100644 index bb2789a..0000000 --- a/vendor/illuminate/database/Eloquent/Collection.php +++ /dev/null @@ -1,440 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent; - -use LogicException; -use Illuminate\Support\Arr; -use Illuminate\Contracts\Support\Arrayable; -use Illuminate\Contracts\Queue\QueueableCollection; -use Illuminate\Support\Collection as BaseCollection; - -class Collection extends BaseCollection implements QueueableCollection -{ - /** - * Find a model in the collection by key. - * - * @param mixed $key - * @param mixed $default - * @return \Illuminate\Database\Eloquent\Model|static - */ - public function find($key, $default = null) - { - if ($key instanceof Model) { - $key = $key->getKey(); - } - - if ($key instanceof Arrayable) { - $key = $key->toArray(); - } - - if (is_array($key)) { - if ($this->isEmpty()) { - return new static; - } - - return $this->whereIn($this->first()->getKeyName(), $key); - } - - return Arr::first($this->items, function ($model) use ($key) { - return $model->getKey() == $key; - }, $default); - } - - /** - * Load a set of relationships onto the collection. - * - * @param mixed $relations - * @return $this - */ - public function load($relations) - { - if ($this->isNotEmpty()) { - if (is_string($relations)) { - $relations = func_get_args(); - } - - $query = $this->first()->newQueryWithoutRelationships()->with($relations); - - $this->items = $query->eagerLoadRelations($this->items); - } - - return $this; - } - - /** - * Add an item to the collection. - * - * @param mixed $item - * @return $this - */ - public function add($item) - { - $this->items[] = $item; - - return $this; - } - - /** - * Determine if a key exists in the collection. - * - * @param mixed $key - * @param mixed $operator - * @param mixed $value - * @return bool - */ - public function contains($key, $operator = null, $value = null) - { - if (func_num_args() > 1 || $this->useAsCallable($key)) { - return parent::contains(...func_get_args()); - } - - if ($key instanceof Model) { - return parent::contains(function ($model) use ($key) { - return $model->is($key); - }); - } - - return parent::contains(function ($model) use ($key) { - return $model->getKey() == $key; - }); - } - - /** - * Get the array of primary keys. - * - * @return array - */ - public function modelKeys() - { - return array_map(function ($model) { - return $model->getKey(); - }, $this->items); - } - - /** - * Merge the collection with the given items. - * - * @param \ArrayAccess|array $items - * @return static - */ - public function merge($items) - { - $dictionary = $this->getDictionary(); - - foreach ($items as $item) { - $dictionary[$item->getKey()] = $item; - } - - return new static(array_values($dictionary)); - } - - /** - * Run a map over each of the items. - * - * @param callable $callback - * @return \Illuminate\Support\Collection|static - */ - public function map(callable $callback) - { - $result = parent::map($callback); - - return $result->contains(function ($item) { - return ! $item instanceof Model; - }) ? $result->toBase() : $result; - } - - /** - * Reload a fresh model instance from the database for all the entities. - * - * @param array|string $with - * @return static - */ - public function fresh($with = []) - { - if ($this->isEmpty()) { - return new static; - } - - $model = $this->first(); - - $freshModels = $model->newQueryWithoutScopes() - ->with(is_string($with) ? func_get_args() : $with) - ->whereIn($model->getKeyName(), $this->modelKeys()) - ->get() - ->getDictionary(); - - return $this->map(function ($model) use ($freshModels) { - return $model->exists && isset($freshModels[$model->getKey()]) - ? $freshModels[$model->getKey()] : null; - }); - } - - /** - * Diff the collection with the given items. - * - * @param \ArrayAccess|array $items - * @return static - */ - public function diff($items) - { - $diff = new static; - - $dictionary = $this->getDictionary($items); - - foreach ($this->items as $item) { - if (! isset($dictionary[$item->getKey()])) { - $diff->add($item); - } - } - - return $diff; - } - - /** - * Intersect the collection with the given items. - * - * @param \ArrayAccess|array $items - * @return static - */ - public function intersect($items) - { - $intersect = new static; - - $dictionary = $this->getDictionary($items); - - foreach ($this->items as $item) { - if (isset($dictionary[$item->getKey()])) { - $intersect->add($item); - } - } - - return $intersect; - } - - /** - * Return only unique items from the collection. - * - * @param string|callable|null $key - * @param bool $strict - * @return static|\Illuminate\Support\Collection - */ - public function unique($key = null, $strict = false) - { - if (! is_null($key)) { - return parent::unique($key, $strict); - } - - return new static(array_values($this->getDictionary())); - } - - /** - * Returns only the models from the collection with the specified keys. - * - * @param mixed $keys - * @return static - */ - public function only($keys) - { - if (is_null($keys)) { - return new static($this->items); - } - - $dictionary = Arr::only($this->getDictionary(), $keys); - - return new static(array_values($dictionary)); - } - - /** - * Returns all models in the collection except the models with specified keys. - * - * @param mixed $keys - * @return static - */ - public function except($keys) - { - $dictionary = Arr::except($this->getDictionary(), $keys); - - return new static(array_values($dictionary)); - } - - /** - * Make the given, typically visible, attributes hidden across the entire collection. - * - * @param array|string $attributes - * @return $this - */ - public function makeHidden($attributes) - { - return $this->each(function ($model) use ($attributes) { - $model->addHidden($attributes); - }); - } - - /** - * Make the given, typically hidden, attributes visible across the entire collection. - * - * @param array|string $attributes - * @return $this - */ - public function makeVisible($attributes) - { - return $this->each(function ($model) use ($attributes) { - $model->makeVisible($attributes); - }); - } - - /** - * Get a dictionary keyed by primary keys. - * - * @param \ArrayAccess|array|null $items - * @return array - */ - public function getDictionary($items = null) - { - $items = is_null($items) ? $this->items : $items; - - $dictionary = []; - - foreach ($items as $value) { - $dictionary[$value->getKey()] = $value; - } - - return $dictionary; - } - - /** - * The following methods are intercepted to always return base collections. - */ - - /** - * Get an array with the values of a given key. - * - * @param string $value - * @param string|null $key - * @return \Illuminate\Support\Collection - */ - public function pluck($value, $key = null) - { - return $this->toBase()->pluck($value, $key); - } - - /** - * Get the keys of the collection items. - * - * @return \Illuminate\Support\Collection - */ - public function keys() - { - return $this->toBase()->keys(); - } - - /** - * Zip the collection together with one or more arrays. - * - * @param mixed ...$items - * @return \Illuminate\Support\Collection - */ - public function zip($items) - { - return call_user_func_array([$this->toBase(), 'zip'], func_get_args()); - } - - /** - * Collapse the collection of items into a single array. - * - * @return \Illuminate\Support\Collection - */ - public function collapse() - { - return $this->toBase()->collapse(); - } - - /** - * Get a flattened array of the items in the collection. - * - * @param int $depth - * @return \Illuminate\Support\Collection - */ - public function flatten($depth = INF) - { - return $this->toBase()->flatten($depth); - } - - /** - * Flip the items in the collection. - * - * @return \Illuminate\Support\Collection - */ - public function flip() - { - return $this->toBase()->flip(); - } - - /** - * Pad collection to the specified length with a value. - * - * @param int $size - * @param mixed $value - * @return \Illuminate\Support\Collection - */ - public function pad($size, $value) - { - return $this->toBase()->pad($size, $value); - } - - /** - * Get the type of the entities being queued. - * - * @return string|null - * @throws \LogicException - */ - public function getQueueableClass() - { - if ($this->isEmpty()) { - return; - } - - $class = get_class($this->first()); - - $this->each(function ($model) use ($class) { - if (get_class($model) !== $class) { - throw new LogicException('Queueing collections with multiple model types is not supported.'); - } - }); - - return $class; - } - - /** - * Get the identifiers for all of the entities. - * - * @return array - */ - public function getQueueableIds() - { - return $this->modelKeys(); - } - - /** - * Get the connection of the entities being queued. - * - * @return string|null - * @throws \LogicException - */ - public function getQueueableConnection() - { - if ($this->isEmpty()) { - return; - } - - $connection = $this->first()->getConnectionName(); - - $this->each(function ($model) use ($connection) { - if ($model->getConnectionName() !== $connection) { - throw new LogicException('Queueing collections with multiple model connections is not supported.'); - } - }); - - return $connection; - } -} diff --git a/vendor/illuminate/database/Eloquent/Concerns/GuardsAttributes.php b/vendor/illuminate/database/Eloquent/Concerns/GuardsAttributes.php deleted file mode 100644 index 96317cf..0000000 --- a/vendor/illuminate/database/Eloquent/Concerns/GuardsAttributes.php +++ /dev/null @@ -1,193 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Concerns; - -use Illuminate\Support\Str; - -trait GuardsAttributes -{ - /** - * The attributes that are mass assignable. - * - * @var array - */ - protected $fillable = []; - - /** - * The attributes that aren't mass assignable. - * - * @var array - */ - protected $guarded = ['*']; - - /** - * Indicates if all mass assignment is enabled. - * - * @var bool - */ - protected static $unguarded = false; - - /** - * Get the fillable attributes for the model. - * - * @return array - */ - public function getFillable() - { - return $this->fillable; - } - - /** - * Set the fillable attributes for the model. - * - * @param array $fillable - * @return $this - */ - public function fillable(array $fillable) - { - $this->fillable = $fillable; - - return $this; - } - - /** - * Get the guarded attributes for the model. - * - * @return array - */ - public function getGuarded() - { - return $this->guarded; - } - - /** - * Set the guarded attributes for the model. - * - * @param array $guarded - * @return $this - */ - public function guard(array $guarded) - { - $this->guarded = $guarded; - - return $this; - } - - /** - * Disable all mass assignable restrictions. - * - * @param bool $state - * @return void - */ - public static function unguard($state = true) - { - static::$unguarded = $state; - } - - /** - * Enable the mass assignment restrictions. - * - * @return void - */ - public static function reguard() - { - static::$unguarded = false; - } - - /** - * Determine if current state is "unguarded". - * - * @return bool - */ - public static function isUnguarded() - { - return static::$unguarded; - } - - /** - * Run the given callable while being unguarded. - * - * @param callable $callback - * @return mixed - */ - public static function unguarded(callable $callback) - { - if (static::$unguarded) { - return $callback(); - } - - static::unguard(); - - try { - return $callback(); - } finally { - static::reguard(); - } - } - - /** - * Determine if the given attribute may be mass assigned. - * - * @param string $key - * @return bool - */ - public function isFillable($key) - { - if (static::$unguarded) { - return true; - } - - // If the key is in the "fillable" array, we can of course assume that it's - // a fillable attribute. Otherwise, we will check the guarded array when - // we need to determine if the attribute is black-listed on the model. - if (in_array($key, $this->getFillable())) { - return true; - } - - // If the attribute is explicitly listed in the "guarded" array then we can - // return false immediately. This means this attribute is definitely not - // fillable and there is no point in going any further in this method. - if ($this->isGuarded($key)) { - return false; - } - - return empty($this->getFillable()) && - ! Str::startsWith($key, '_'); - } - - /** - * Determine if the given key is guarded. - * - * @param string $key - * @return bool - */ - public function isGuarded($key) - { - return in_array($key, $this->getGuarded()) || $this->getGuarded() == ['*']; - } - - /** - * Determine if the model is totally guarded. - * - * @return bool - */ - public function totallyGuarded() - { - return count($this->getFillable()) == 0 && $this->getGuarded() == ['*']; - } - - /** - * Get the fillable attributes of a given array. - * - * @param array $attributes - * @return array - */ - protected function fillableFromArray(array $attributes) - { - if (count($this->getFillable()) > 0 && ! static::$unguarded) { - return array_intersect_key($attributes, array_flip($this->getFillable())); - } - - return $attributes; - } -} diff --git a/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php b/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php deleted file mode 100644 index 2893495..0000000 --- a/vendor/illuminate/database/Eloquent/Concerns/HasAttributes.php +++ /dev/null @@ -1,1141 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Concerns; - -use LogicException; -use DateTimeInterface; -use Illuminate\Support\Arr; -use Illuminate\Support\Str; -use Illuminate\Support\Carbon; -use Illuminate\Contracts\Support\Arrayable; -use Illuminate\Database\Eloquent\Relations\Relation; -use Illuminate\Support\Collection as BaseCollection; -use Illuminate\Database\Eloquent\JsonEncodingException; - -trait HasAttributes -{ - /** - * The model's attributes. - * - * @var array - */ - protected $attributes = []; - - /** - * The model attribute's original state. - * - * @var array - */ - protected $original = []; - - /** - * The changed model attributes. - * - * @var array - */ - protected $changes = []; - - /** - * The attributes that should be cast to native types. - * - * @var array - */ - protected $casts = []; - - /** - * The attributes that should be mutated to dates. - * - * @var array - */ - protected $dates = []; - - /** - * The storage format of the model's date columns. - * - * @var string - */ - protected $dateFormat; - - /** - * The accessors to append to the model's array form. - * - * @var array - */ - protected $appends = []; - - /** - * Indicates whether attributes are snake cased on arrays. - * - * @var bool - */ - public static $snakeAttributes = true; - - /** - * The cache of the mutated attributes for each class. - * - * @var array - */ - protected static $mutatorCache = []; - - /** - * Convert the model's attributes to an array. - * - * @return array - */ - public function attributesToArray() - { - // If an attribute is a date, we will cast it to a string after converting it - // to a DateTime / Carbon instance. This is so we will get some consistent - // formatting while accessing attributes vs. arraying / JSONing a model. - $attributes = $this->addDateAttributesToArray( - $attributes = $this->getArrayableAttributes() - ); - - $attributes = $this->addMutatedAttributesToArray( - $attributes, $mutatedAttributes = $this->getMutatedAttributes() - ); - - // Next we will handle any casts that have been setup for this model and cast - // the values to their appropriate type. If the attribute has a mutator we - // will not perform the cast on those attributes to avoid any confusion. - $attributes = $this->addCastAttributesToArray( - $attributes, $mutatedAttributes - ); - - // Here we will grab all of the appended, calculated attributes to this model - // as these attributes are not really in the attributes array, but are run - // when we need to array or JSON the model for convenience to the coder. - foreach ($this->getArrayableAppends() as $key) { - $attributes[$key] = $this->mutateAttributeForArray($key, null); - } - - return $attributes; - } - - /** - * Add the date attributes to the attributes array. - * - * @param array $attributes - * @return array - */ - protected function addDateAttributesToArray(array $attributes) - { - foreach ($this->getDates() as $key) { - if (! isset($attributes[$key])) { - continue; - } - - $attributes[$key] = $this->serializeDate( - $this->asDateTime($attributes[$key]) - ); - } - - return $attributes; - } - - /** - * Add the mutated attributes to the attributes array. - * - * @param array $attributes - * @param array $mutatedAttributes - * @return array - */ - protected function addMutatedAttributesToArray(array $attributes, array $mutatedAttributes) - { - foreach ($mutatedAttributes as $key) { - // We want to spin through all the mutated attributes for this model and call - // the mutator for the attribute. We cache off every mutated attributes so - // we don't have to constantly check on attributes that actually change. - if (! array_key_exists($key, $attributes)) { - continue; - } - - // Next, we will call the mutator for this attribute so that we can get these - // mutated attribute's actual values. After we finish mutating each of the - // attributes we will return this final array of the mutated attributes. - $attributes[$key] = $this->mutateAttributeForArray( - $key, $attributes[$key] - ); - } - - return $attributes; - } - - /** - * Add the casted attributes to the attributes array. - * - * @param array $attributes - * @param array $mutatedAttributes - * @return array - */ - protected function addCastAttributesToArray(array $attributes, array $mutatedAttributes) - { - foreach ($this->getCasts() as $key => $value) { - if (! array_key_exists($key, $attributes) || in_array($key, $mutatedAttributes)) { - continue; - } - - // Here we will cast the attribute. Then, if the cast is a date or datetime cast - // then we will serialize the date for the array. This will convert the dates - // to strings based on the date format specified for these Eloquent models. - $attributes[$key] = $this->castAttribute( - $key, $attributes[$key] - ); - - // If the attribute cast was a date or a datetime, we will serialize the date as - // a string. This allows the developers to customize how dates are serialized - // into an array without affecting how they are persisted into the storage. - if ($attributes[$key] && - ($value === 'date' || $value === 'datetime')) { - $attributes[$key] = $this->serializeDate($attributes[$key]); - } - } - - return $attributes; - } - - /** - * Get an attribute array of all arrayable attributes. - * - * @return array - */ - protected function getArrayableAttributes() - { - return $this->getArrayableItems($this->attributes); - } - - /** - * Get all of the appendable values that are arrayable. - * - * @return array - */ - protected function getArrayableAppends() - { - if (! count($this->appends)) { - return []; - } - - return $this->getArrayableItems( - array_combine($this->appends, $this->appends) - ); - } - - /** - * Get the model's relationships in array form. - * - * @return array - */ - public function relationsToArray() - { - $attributes = []; - - foreach ($this->getArrayableRelations() as $key => $value) { - // If the values implements the Arrayable interface we can just call this - // toArray method on the instances which will convert both models and - // collections to their proper array form and we'll set the values. - if ($value instanceof Arrayable) { - $relation = $value->toArray(); - } - - // If the value is null, we'll still go ahead and set it in this list of - // attributes since null is used to represent empty relationships if - // if it a has one or belongs to type relationships on the models. - elseif (is_null($value)) { - $relation = $value; - } - - // If the relationships snake-casing is enabled, we will snake case this - // key so that the relation attribute is snake cased in this returned - // array to the developers, making this consistent with attributes. - if (static::$snakeAttributes) { - $key = Str::snake($key); - } - - // If the relation value has been set, we will set it on this attributes - // list for returning. If it was not arrayable or null, we'll not set - // the value on the array because it is some type of invalid value. - if (isset($relation) || is_null($value)) { - $attributes[$key] = $relation; - } - - unset($relation); - } - - return $attributes; - } - - /** - * Get an attribute array of all arrayable relations. - * - * @return array - */ - protected function getArrayableRelations() - { - return $this->getArrayableItems($this->relations); - } - - /** - * Get an attribute array of all arrayable values. - * - * @param array $values - * @return array - */ - protected function getArrayableItems(array $values) - { - if (count($this->getVisible()) > 0) { - $values = array_intersect_key($values, array_flip($this->getVisible())); - } - - if (count($this->getHidden()) > 0) { - $values = array_diff_key($values, array_flip($this->getHidden())); - } - - return $values; - } - - /** - * Get an attribute from the model. - * - * @param string $key - * @return mixed - */ - public function getAttribute($key) - { - if (! $key) { - return; - } - - // If the attribute exists in the attribute array or has a "get" mutator we will - // get the attribute's value. Otherwise, we will proceed as if the developers - // are asking for a relationship's value. This covers both types of values. - if (array_key_exists($key, $this->attributes) || - $this->hasGetMutator($key)) { - return $this->getAttributeValue($key); - } - - // Here we will determine if the model base class itself contains this given key - // since we don't want to treat any of those methods as relationships because - // they are all intended as helper methods and none of these are relations. - if (method_exists(self::class, $key)) { - return; - } - - return $this->getRelationValue($key); - } - - /** - * Get a plain attribute (not a relationship). - * - * @param string $key - * @return mixed - */ - public function getAttributeValue($key) - { - $value = $this->getAttributeFromArray($key); - - // If the attribute has a get mutator, we will call that then return what - // it returns as the value, which is useful for transforming values on - // retrieval from the model to a form that is more useful for usage. - if ($this->hasGetMutator($key)) { - return $this->mutateAttribute($key, $value); - } - - // If the attribute exists within the cast array, we will convert it to - // an appropriate native PHP type dependant upon the associated value - // given with the key in the pair. Dayle made this comment line up. - if ($this->hasCast($key)) { - return $this->castAttribute($key, $value); - } - - // If the attribute is listed as a date, we will convert it to a DateTime - // instance on retrieval, which makes it quite convenient to work with - // date fields without having to create a mutator for each property. - if (in_array($key, $this->getDates()) && - ! is_null($value)) { - return $this->asDateTime($value); - } - - return $value; - } - - /** - * Get an attribute from the $attributes array. - * - * @param string $key - * @return mixed - */ - protected function getAttributeFromArray($key) - { - if (isset($this->attributes[$key])) { - return $this->attributes[$key]; - } - } - - /** - * Get a relationship. - * - * @param string $key - * @return mixed - */ - public function getRelationValue($key) - { - // If the key already exists in the relationships array, it just means the - // relationship has already been loaded, so we'll just return it out of - // here because there is no need to query within the relations twice. - if ($this->relationLoaded($key)) { - return $this->relations[$key]; - } - - // If the "attribute" exists as a method on the model, we will just assume - // it is a relationship and will load and return results from the query - // and hydrate the relationship's value on the "relationships" array. - if (method_exists($this, $key)) { - return $this->getRelationshipFromMethod($key); - } - } - - /** - * Get a relationship value from a method. - * - * @param string $method - * @return mixed - * - * @throws \LogicException - */ - protected function getRelationshipFromMethod($method) - { - $relation = $this->$method(); - - if (! $relation instanceof Relation) { - throw new LogicException(get_class($this).'::'.$method.' must return a relationship instance.'); - } - - return tap($relation->getResults(), function ($results) use ($method) { - $this->setRelation($method, $results); - }); - } - - /** - * Determine if a get mutator exists for an attribute. - * - * @param string $key - * @return bool - */ - public function hasGetMutator($key) - { - return method_exists($this, 'get'.Str::studly($key).'Attribute'); - } - - /** - * Get the value of an attribute using its mutator. - * - * @param string $key - * @param mixed $value - * @return mixed - */ - protected function mutateAttribute($key, $value) - { - return $this->{'get'.Str::studly($key).'Attribute'}($value); - } - - /** - * Get the value of an attribute using its mutator for array conversion. - * - * @param string $key - * @param mixed $value - * @return mixed - */ - protected function mutateAttributeForArray($key, $value) - { - $value = $this->mutateAttribute($key, $value); - - return $value instanceof Arrayable ? $value->toArray() : $value; - } - - /** - * Cast an attribute to a native PHP type. - * - * @param string $key - * @param mixed $value - * @return mixed - */ - protected function castAttribute($key, $value) - { - if (is_null($value)) { - return $value; - } - - switch ($this->getCastType($key)) { - case 'int': - case 'integer': - return (int) $value; - case 'real': - case 'float': - case 'double': - return (float) $value; - case 'string': - return (string) $value; - case 'bool': - case 'boolean': - return (bool) $value; - case 'object': - return $this->fromJson($value, true); - case 'array': - case 'json': - return $this->fromJson($value); - case 'collection': - return new BaseCollection($this->fromJson($value)); - case 'date': - return $this->asDate($value); - case 'datetime': - return $this->asDateTime($value); - case 'timestamp': - return $this->asTimestamp($value); - default: - return $value; - } - } - - /** - * Get the type of cast for a model attribute. - * - * @param string $key - * @return string - */ - protected function getCastType($key) - { - return trim(strtolower($this->getCasts()[$key])); - } - - /** - * Set a given attribute on the model. - * - * @param string $key - * @param mixed $value - * @return $this - */ - public function setAttribute($key, $value) - { - // First we will check for the presence of a mutator for the set operation - // which simply lets the developers tweak the attribute as it is set on - // the model, such as "json_encoding" an listing of data for storage. - if ($this->hasSetMutator($key)) { - $method = 'set'.Str::studly($key).'Attribute'; - - return $this->{$method}($value); - } - - // If an attribute is listed as a "date", we'll convert it from a DateTime - // instance into a form proper for storage on the database tables using - // the connection grammar's date format. We will auto set the values. - elseif ($value && $this->isDateAttribute($key)) { - $value = $this->fromDateTime($value); - } - - if ($this->isJsonCastable($key) && ! is_null($value)) { - $value = $this->castAttributeAsJson($key, $value); - } - - // If this attribute contains a JSON ->, we'll set the proper value in the - // attribute's underlying array. This takes care of properly nesting an - // attribute in the array's value in the case of deeply nested items. - if (Str::contains($key, '->')) { - return $this->fillJsonAttribute($key, $value); - } - - $this->attributes[$key] = $value; - - return $this; - } - - /** - * Determine if a set mutator exists for an attribute. - * - * @param string $key - * @return bool - */ - public function hasSetMutator($key) - { - return method_exists($this, 'set'.Str::studly($key).'Attribute'); - } - - /** - * Determine if the given attribute is a date or date castable. - * - * @param string $key - * @return bool - */ - protected function isDateAttribute($key) - { - return in_array($key, $this->getDates()) || - $this->isDateCastable($key); - } - - /** - * Set a given JSON attribute on the model. - * - * @param string $key - * @param mixed $value - * @return $this - */ - public function fillJsonAttribute($key, $value) - { - list($key, $path) = explode('->', $key, 2); - - $this->attributes[$key] = $this->asJson($this->getArrayAttributeWithValue( - $path, $key, $value - )); - - return $this; - } - - /** - * Get an array attribute with the given key and value set. - * - * @param string $path - * @param string $key - * @param mixed $value - * @return $this - */ - protected function getArrayAttributeWithValue($path, $key, $value) - { - return tap($this->getArrayAttributeByKey($key), function (&$array) use ($path, $value) { - Arr::set($array, str_replace('->', '.', $path), $value); - }); - } - - /** - * Get an array attribute or return an empty array if it is not set. - * - * @param string $key - * @return array - */ - protected function getArrayAttributeByKey($key) - { - return isset($this->attributes[$key]) ? - $this->fromJson($this->attributes[$key]) : []; - } - - /** - * Cast the given attribute to JSON. - * - * @param string $key - * @param mixed $value - * @return string - */ - protected function castAttributeAsJson($key, $value) - { - $value = $this->asJson($value); - - if ($value === false) { - throw JsonEncodingException::forAttribute( - $this, $key, json_last_error_msg() - ); - } - - return $value; - } - - /** - * Encode the given value as JSON. - * - * @param mixed $value - * @return string - */ - protected function asJson($value) - { - return json_encode($value); - } - - /** - * Decode the given JSON back into an array or object. - * - * @param string $value - * @param bool $asObject - * @return mixed - */ - public function fromJson($value, $asObject = false) - { - return json_decode($value, ! $asObject); - } - - /** - * Return a timestamp as DateTime object with time set to 00:00:00. - * - * @param mixed $value - * @return \Illuminate\Support\Carbon - */ - protected function asDate($value) - { - return $this->asDateTime($value)->startOfDay(); - } - - /** - * Return a timestamp as DateTime object. - * - * @param mixed $value - * @return \Illuminate\Support\Carbon - */ - protected function asDateTime($value) - { - // If this value is already a Carbon instance, we shall just return it as is. - // This prevents us having to re-instantiate a Carbon instance when we know - // it already is one, which wouldn't be fulfilled by the DateTime check. - if ($value instanceof Carbon) { - return $value; - } - - // If the value is already a DateTime instance, we will just skip the rest of - // these checks since they will be a waste of time, and hinder performance - // when checking the field. We will just return the DateTime right away. - if ($value instanceof DateTimeInterface) { - return new Carbon( - $value->format('Y-m-d H:i:s.u'), $value->getTimezone() - ); - } - - // If this value is an integer, we will assume it is a UNIX timestamp's value - // and format a Carbon object from this timestamp. This allows flexibility - // when defining your date fields as they might be UNIX timestamps here. - if (is_numeric($value)) { - return Carbon::createFromTimestamp($value); - } - - // If the value is in simply year, month, day format, we will instantiate the - // Carbon instances from that format. Again, this provides for simple date - // fields on the database, while still supporting Carbonized conversion. - if ($this->isStandardDateFormat($value)) { - return Carbon::createFromFormat('Y-m-d', $value)->startOfDay(); - } - - // Finally, we will just assume this date is in the format used by default on - // the database connection and use that format to create the Carbon object - // that is returned back out to the developers after we convert it here. - return Carbon::createFromFormat( - str_replace('.v', '.u', $this->getDateFormat()), $value - ); - } - - /** - * Determine if the given value is a standard date format. - * - * @param string $value - * @return bool - */ - protected function isStandardDateFormat($value) - { - return preg_match('/^(\d{4})-(\d{1,2})-(\d{1,2})$/', $value); - } - - /** - * Convert a DateTime to a storable string. - * - * @param \DateTime|int $value - * @return string - */ - public function fromDateTime($value) - { - return empty($value) ? $value : $this->asDateTime($value)->format( - $this->getDateFormat() - ); - } - - /** - * Return a timestamp as unix timestamp. - * - * @param mixed $value - * @return int - */ - protected function asTimestamp($value) - { - return $this->asDateTime($value)->getTimestamp(); - } - - /** - * Prepare a date for array / JSON serialization. - * - * @param \DateTimeInterface $date - * @return string - */ - protected function serializeDate(DateTimeInterface $date) - { - return $date->format($this->getDateFormat()); - } - - /** - * Get the attributes that should be converted to dates. - * - * @return array - */ - public function getDates() - { - $defaults = [static::CREATED_AT, static::UPDATED_AT]; - - return $this->usesTimestamps() - ? array_unique(array_merge($this->dates, $defaults)) - : $this->dates; - } - - /** - * Get the format for database stored dates. - * - * @return string - */ - protected function getDateFormat() - { - return $this->dateFormat ?: $this->getConnection()->getQueryGrammar()->getDateFormat(); - } - - /** - * Set the date format used by the model. - * - * @param string $format - * @return $this - */ - public function setDateFormat($format) - { - $this->dateFormat = $format; - - return $this; - } - - /** - * Determine whether an attribute should be cast to a native type. - * - * @param string $key - * @param array|string|null $types - * @return bool - */ - public function hasCast($key, $types = null) - { - if (array_key_exists($key, $this->getCasts())) { - return $types ? in_array($this->getCastType($key), (array) $types, true) : true; - } - - return false; - } - - /** - * Get the casts array. - * - * @return array - */ - public function getCasts() - { - if ($this->getIncrementing()) { - return array_merge([$this->getKeyName() => $this->getKeyType()], $this->casts); - } - - return $this->casts; - } - - /** - * Determine whether a value is Date / DateTime castable for inbound manipulation. - * - * @param string $key - * @return bool - */ - protected function isDateCastable($key) - { - return $this->hasCast($key, ['date', 'datetime']); - } - - /** - * Determine whether a value is JSON castable for inbound manipulation. - * - * @param string $key - * @return bool - */ - protected function isJsonCastable($key) - { - return $this->hasCast($key, ['array', 'json', 'object', 'collection']); - } - - /** - * Get all of the current attributes on the model. - * - * @return array - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * Set the array of model attributes. No checking is done. - * - * @param array $attributes - * @param bool $sync - * @return $this - */ - public function setRawAttributes(array $attributes, $sync = false) - { - $this->attributes = $attributes; - - if ($sync) { - $this->syncOriginal(); - } - - return $this; - } - - /** - * Get the model's original attribute values. - * - * @param string|null $key - * @param mixed $default - * @return mixed|array - */ - public function getOriginal($key = null, $default = null) - { - return Arr::get($this->original, $key, $default); - } - - /** - * Get a subset of the model's attributes. - * - * @param array|mixed $attributes - * @return array - */ - public function only($attributes) - { - $results = []; - - foreach (is_array($attributes) ? $attributes : func_get_args() as $attribute) { - $results[$attribute] = $this->getAttribute($attribute); - } - - return $results; - } - - /** - * Sync the original attributes with the current. - * - * @return $this - */ - public function syncOriginal() - { - $this->original = $this->attributes; - - return $this; - } - - /** - * Sync a single original attribute with its current value. - * - * @param string $attribute - * @return $this - */ - public function syncOriginalAttribute($attribute) - { - $this->original[$attribute] = $this->attributes[$attribute]; - - return $this; - } - - /** - * Sync the changed attributes. - * - * @return $this - */ - public function syncChanges() - { - $this->changes = $this->getDirty(); - - return $this; - } - - /** - * Determine if the model or given attribute(s) have been modified. - * - * @param array|string|null $attributes - * @return bool - */ - public function isDirty($attributes = null) - { - return $this->hasChanges( - $this->getDirty(), is_array($attributes) ? $attributes : func_get_args() - ); - } - - /** - * Determine if the model or given attribute(s) have remained the same. - * - * @param array|string|null $attributes - * @return bool - */ - public function isClean($attributes = null) - { - return ! $this->isDirty(...func_get_args()); - } - - /** - * Determine if the model or given attribute(s) have been modified. - * - * @param array|string|null $attributes - * @return bool - */ - public function wasChanged($attributes = null) - { - return $this->hasChanges( - $this->getChanges(), is_array($attributes) ? $attributes : func_get_args() - ); - } - - /** - * Determine if the given attributes were changed. - * - * @param array $changes - * @param array|string|null $attributes - * @return bool - */ - protected function hasChanges($changes, $attributes = null) - { - // If no specific attributes were provided, we will just see if the dirty array - // already contains any attributes. If it does we will just return that this - // count is greater than zero. Else, we need to check specific attributes. - if (empty($attributes)) { - return count($changes) > 0; - } - - // Here we will spin through every attribute and see if this is in the array of - // dirty attributes. If it is, we will return true and if we make it through - // all of the attributes for the entire array we will return false at end. - foreach (Arr::wrap($attributes) as $attribute) { - if (array_key_exists($attribute, $changes)) { - return true; - } - } - - return false; - } - - /** - * Get the attributes that have been changed since last sync. - * - * @return array - */ - public function getDirty() - { - $dirty = []; - - foreach ($this->getAttributes() as $key => $value) { - if (! $this->originalIsEquivalent($key, $value)) { - $dirty[$key] = $value; - } - } - - return $dirty; - } - - /** - * Get the attributes that were changed. - * - * @return array - */ - public function getChanges() - { - return $this->changes; - } - - /** - * Determine if the new and old values for a given key are equivalent. - * - * @param string $key - * @param mixed $current - * @return bool - */ - protected function originalIsEquivalent($key, $current) - { - if (! array_key_exists($key, $this->original)) { - return false; - } - - $original = $this->getOriginal($key); - - if ($current === $original) { - return true; - } elseif (is_null($current)) { - return false; - } elseif ($this->isDateAttribute($key)) { - return $this->fromDateTime($current) === - $this->fromDateTime($original); - } elseif ($this->hasCast($key)) { - return $this->castAttribute($key, $current) === - $this->castAttribute($key, $original); - } - - return is_numeric($current) && is_numeric($original) - && strcmp((string) $current, (string) $original) === 0; - } - - /** - * Append attributes to query when building a query. - * - * @param array|string $attributes - * @return $this - */ - public function append($attributes) - { - $this->appends = array_unique( - array_merge($this->appends, is_string($attributes) ? func_get_args() : $attributes) - ); - - return $this; - } - - /** - * Set the accessors to append to model arrays. - * - * @param array $appends - * @return $this - */ - public function setAppends(array $appends) - { - $this->appends = $appends; - - return $this; - } - - /** - * Get the mutated attributes for a given instance. - * - * @return array - */ - public function getMutatedAttributes() - { - $class = static::class; - - if (! isset(static::$mutatorCache[$class])) { - static::cacheMutatedAttributes($class); - } - - return static::$mutatorCache[$class]; - } - - /** - * Extract and cache all the mutated attributes of a class. - * - * @param string $class - * @return void - */ - public static function cacheMutatedAttributes($class) - { - static::$mutatorCache[$class] = collect(static::getMutatorMethods($class))->map(function ($match) { - return lcfirst(static::$snakeAttributes ? Str::snake($match) : $match); - })->all(); - } - - /** - * Get all of the attribute mutator methods. - * - * @param mixed $class - * @return array - */ - protected static function getMutatorMethods($class) - { - preg_match_all('/(?<=^|;)get([^;]+?)Attribute(;|$)/', implode(';', get_class_methods($class)), $matches); - - return $matches[1]; - } -} diff --git a/vendor/illuminate/database/Eloquent/Concerns/HasEvents.php b/vendor/illuminate/database/Eloquent/Concerns/HasEvents.php deleted file mode 100644 index 0972bd6..0000000 --- a/vendor/illuminate/database/Eloquent/Concerns/HasEvents.php +++ /dev/null @@ -1,340 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Concerns; - -use Illuminate\Contracts\Events\Dispatcher; - -trait HasEvents -{ - /** - * The event map for the model. - * - * Allows for object-based events for native Eloquent events. - * - * @var array - */ - protected $dispatchesEvents = []; - - /** - * User exposed observable events. - * - * These are extra user-defined events observers may subscribe to. - * - * @var array - */ - protected $observables = []; - - /** - * Register an observer with the Model. - * - * @param object|string $class - * @return void - */ - public static function observe($class) - { - $instance = new static; - - $className = is_string($class) ? $class : get_class($class); - - // When registering a model observer, we will spin through the possible events - // and determine if this observer has that method. If it does, we will hook - // it into the model's event system, making it convenient to watch these. - foreach ($instance->getObservableEvents() as $event) { - if (method_exists($class, $event)) { - static::registerModelEvent($event, $className.'@'.$event); - } - } - } - - /** - * Get the observable event names. - * - * @return array - */ - public function getObservableEvents() - { - return array_merge( - [ - 'retrieved', 'creating', 'created', 'updating', - 'updated', 'deleting', 'deleted', 'saving', - 'saved', 'restoring', 'restored', - ], - $this->observables - ); - } - - /** - * Set the observable event names. - * - * @param array $observables - * @return $this - */ - public function setObservableEvents(array $observables) - { - $this->observables = $observables; - - return $this; - } - - /** - * Add an observable event name. - * - * @param array|mixed $observables - * @return void - */ - public function addObservableEvents($observables) - { - $this->observables = array_unique(array_merge( - $this->observables, is_array($observables) ? $observables : func_get_args() - )); - } - - /** - * Remove an observable event name. - * - * @param array|mixed $observables - * @return void - */ - public function removeObservableEvents($observables) - { - $this->observables = array_diff( - $this->observables, is_array($observables) ? $observables : func_get_args() - ); - } - - /** - * Register a model event with the dispatcher. - * - * @param string $event - * @param \Closure|string $callback - * @return void - */ - protected static function registerModelEvent($event, $callback) - { - if (isset(static::$dispatcher)) { - $name = static::class; - - static::$dispatcher->listen("eloquent.{$event}: {$name}", $callback); - } - } - - /** - * Fire the given event for the model. - * - * @param string $event - * @param bool $halt - * @return mixed - */ - protected function fireModelEvent($event, $halt = true) - { - if (! isset(static::$dispatcher)) { - return true; - } - - // First, we will get the proper method to call on the event dispatcher, and then we - // will attempt to fire a custom, object based event for the given event. If that - // returns a result we can return that result, or we'll call the string events. - $method = $halt ? 'until' : 'fire'; - - $result = $this->filterModelEventResults( - $this->fireCustomModelEvent($event, $method) - ); - - if ($result === false) { - return false; - } - - return ! empty($result) ? $result : static::$dispatcher->{$method}( - "eloquent.{$event}: ".static::class, $this - ); - } - - /** - * Fire a custom model event for the given event. - * - * @param string $event - * @param string $method - * @return mixed|null - */ - protected function fireCustomModelEvent($event, $method) - { - if (! isset($this->dispatchesEvents[$event])) { - return; - } - - $result = static::$dispatcher->$method(new $this->dispatchesEvents[$event]($this)); - - if (! is_null($result)) { - return $result; - } - } - - /** - * Filter the model event results. - * - * @param mixed $result - * @return mixed - */ - protected function filterModelEventResults($result) - { - if (is_array($result)) { - $result = array_filter($result, function ($response) { - return ! is_null($response); - }); - } - - return $result; - } - - /** - * Register a retrieved model event with the dispatcher. - * - * @param \Closure|string $callback - * @return void - */ - public static function retrieved($callback) - { - static::registerModelEvent('retrieved', $callback); - } - - /** - * Register a saving model event with the dispatcher. - * - * @param \Closure|string $callback - * @return void - */ - public static function saving($callback) - { - static::registerModelEvent('saving', $callback); - } - - /** - * Register a saved model event with the dispatcher. - * - * @param \Closure|string $callback - * @return void - */ - public static function saved($callback) - { - static::registerModelEvent('saved', $callback); - } - - /** - * Register an updating model event with the dispatcher. - * - * @param \Closure|string $callback - * @return void - */ - public static function updating($callback) - { - static::registerModelEvent('updating', $callback); - } - - /** - * Register an updated model event with the dispatcher. - * - * @param \Closure|string $callback - * @return void - */ - public static function updated($callback) - { - static::registerModelEvent('updated', $callback); - } - - /** - * Register a creating model event with the dispatcher. - * - * @param \Closure|string $callback - * @return void - */ - public static function creating($callback) - { - static::registerModelEvent('creating', $callback); - } - - /** - * Register a created model event with the dispatcher. - * - * @param \Closure|string $callback - * @return void - */ - public static function created($callback) - { - static::registerModelEvent('created', $callback); - } - - /** - * Register a deleting model event with the dispatcher. - * - * @param \Closure|string $callback - * @return void - */ - public static function deleting($callback) - { - static::registerModelEvent('deleting', $callback); - } - - /** - * Register a deleted model event with the dispatcher. - * - * @param \Closure|string $callback - * @return void - */ - public static function deleted($callback) - { - static::registerModelEvent('deleted', $callback); - } - - /** - * Remove all of the event listeners for the model. - * - * @return void - */ - public static function flushEventListeners() - { - if (! isset(static::$dispatcher)) { - return; - } - - $instance = new static; - - foreach ($instance->getObservableEvents() as $event) { - static::$dispatcher->forget("eloquent.{$event}: ".static::class); - } - - foreach (array_values($instance->dispatchesEvents) as $event) { - static::$dispatcher->forget($event); - } - } - - /** - * Get the event dispatcher instance. - * - * @return \Illuminate\Contracts\Events\Dispatcher - */ - public static function getEventDispatcher() - { - return static::$dispatcher; - } - - /** - * Set the event dispatcher instance. - * - * @param \Illuminate\Contracts\Events\Dispatcher $dispatcher - * @return void - */ - public static function setEventDispatcher(Dispatcher $dispatcher) - { - static::$dispatcher = $dispatcher; - } - - /** - * Unset the event dispatcher for models. - * - * @return void - */ - public static function unsetEventDispatcher() - { - static::$dispatcher = null; - } -} diff --git a/vendor/illuminate/database/Eloquent/Concerns/HasGlobalScopes.php b/vendor/illuminate/database/Eloquent/Concerns/HasGlobalScopes.php deleted file mode 100644 index 97a549f..0000000 --- a/vendor/illuminate/database/Eloquent/Concerns/HasGlobalScopes.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Concerns; - -use Closure; -use Illuminate\Support\Arr; -use InvalidArgumentException; -use Illuminate\Database\Eloquent\Scope; - -trait HasGlobalScopes -{ - /** - * Register a new global scope on the model. - * - * @param \Illuminate\Database\Eloquent\Scope|\Closure|string $scope - * @param \Closure|null $implementation - * @return mixed - * - * @throws \InvalidArgumentException - */ - public static function addGlobalScope($scope, Closure $implementation = null) - { - if (is_string($scope) && ! is_null($implementation)) { - return static::$globalScopes[static::class][$scope] = $implementation; - } elseif ($scope instanceof Closure) { - return static::$globalScopes[static::class][spl_object_hash($scope)] = $scope; - } elseif ($scope instanceof Scope) { - return static::$globalScopes[static::class][get_class($scope)] = $scope; - } - - throw new InvalidArgumentException('Global scope must be an instance of Closure or Scope.'); - } - - /** - * Determine if a model has a global scope. - * - * @param \Illuminate\Database\Eloquent\Scope|string $scope - * @return bool - */ - public static function hasGlobalScope($scope) - { - return ! is_null(static::getGlobalScope($scope)); - } - - /** - * Get a global scope registered with the model. - * - * @param \Illuminate\Database\Eloquent\Scope|string $scope - * @return \Illuminate\Database\Eloquent\Scope|\Closure|null - */ - public static function getGlobalScope($scope) - { - if (is_string($scope)) { - return Arr::get(static::$globalScopes, static::class.'.'.$scope); - } - - return Arr::get( - static::$globalScopes, static::class.'.'.get_class($scope) - ); - } - - /** - * Get the global scopes for this class instance. - * - * @return array - */ - public function getGlobalScopes() - { - return Arr::get(static::$globalScopes, static::class, []); - } -} diff --git a/vendor/illuminate/database/Eloquent/Concerns/HasRelationships.php b/vendor/illuminate/database/Eloquent/Concerns/HasRelationships.php deleted file mode 100644 index c6affcd..0000000 --- a/vendor/illuminate/database/Eloquent/Concerns/HasRelationships.php +++ /dev/null @@ -1,741 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Concerns; - -use Illuminate\Support\Arr; -use Illuminate\Support\Str; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Builder; -use Illuminate\Database\Eloquent\Collection; -use Illuminate\Database\Eloquent\Relations\HasOne; -use Illuminate\Database\Eloquent\Relations\HasMany; -use Illuminate\Database\Eloquent\Relations\MorphTo; -use Illuminate\Database\Eloquent\Relations\MorphOne; -use Illuminate\Database\Eloquent\Relations\Relation; -use Illuminate\Database\Eloquent\Relations\BelongsTo; -use Illuminate\Database\Eloquent\Relations\MorphMany; -use Illuminate\Database\Eloquent\Relations\MorphToMany; -use Illuminate\Database\Eloquent\Relations\BelongsToMany; -use Illuminate\Database\Eloquent\Relations\HasManyThrough; - -trait HasRelationships -{ - /** - * The loaded relationships for the model. - * - * @var array - */ - protected $relations = []; - - /** - * The relationships that should be touched on save. - * - * @var array - */ - protected $touches = []; - - /** - * The many to many relationship methods. - * - * @var array - */ - public static $manyMethods = [ - 'belongsToMany', 'morphToMany', 'morphedByMany', - 'guessBelongsToManyRelation', 'findFirstMethodThatIsntRelation', - ]; - - /** - * Define a one-to-one relationship. - * - * @param string $related - * @param string $foreignKey - * @param string $localKey - * @return \Illuminate\Database\Eloquent\Relations\HasOne - */ - public function hasOne($related, $foreignKey = null, $localKey = null) - { - $instance = $this->newRelatedInstance($related); - - $foreignKey = $foreignKey ?: $this->getForeignKey(); - - $localKey = $localKey ?: $this->getKeyName(); - - return $this->newHasOne($instance->newQuery(), $this, $instance->getTable().'.'.$foreignKey, $localKey); - } - - /** - * Instantiate a new HasOne relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $foreignKey - * @param string $localKey - * @return \Illuminate\Database\Eloquent\Relations\HasOne - */ - protected function newHasOne(Builder $query, Model $parent, $foreignKey, $localKey) - { - return new HasOne($query, $parent, $foreignKey, $localKey); - } - - /** - * Define a polymorphic one-to-one relationship. - * - * @param string $related - * @param string $name - * @param string $type - * @param string $id - * @param string $localKey - * @return \Illuminate\Database\Eloquent\Relations\MorphOne - */ - public function morphOne($related, $name, $type = null, $id = null, $localKey = null) - { - $instance = $this->newRelatedInstance($related); - - list($type, $id) = $this->getMorphs($name, $type, $id); - - $table = $instance->getTable(); - - $localKey = $localKey ?: $this->getKeyName(); - - return $this->newMorphOne($instance->newQuery(), $this, $table.'.'.$type, $table.'.'.$id, $localKey); - } - - /** - * Instantiate a new MorphOne relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $type - * @param string $id - * @param string $localKey - * @return \Illuminate\Database\Eloquent\Relations\MorphOne - */ - protected function newMorphOne(Builder $query, Model $parent, $type, $id, $localKey) - { - return new MorphOne($query, $parent, $type, $id, $localKey); - } - - /** - * Define an inverse one-to-one or many relationship. - * - * @param string $related - * @param string $foreignKey - * @param string $ownerKey - * @param string $relation - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - public function belongsTo($related, $foreignKey = null, $ownerKey = null, $relation = null) - { - // If no relation name was given, we will use this debug backtrace to extract - // the calling method's name and use that as the relationship name as most - // of the time this will be what we desire to use for the relationships. - if (is_null($relation)) { - $relation = $this->guessBelongsToRelation(); - } - - $instance = $this->newRelatedInstance($related); - - // If no foreign key was supplied, we can use a backtrace to guess the proper - // foreign key name by using the name of the relationship function, which - // when combined with an "_id" should conventionally match the columns. - if (is_null($foreignKey)) { - $foreignKey = Str::snake($relation).'_'.$instance->getKeyName(); - } - - // Once we have the foreign key names, we'll just create a new Eloquent query - // for the related models and returns the relationship instance which will - // actually be responsible for retrieving and hydrating every relations. - $ownerKey = $ownerKey ?: $instance->getKeyName(); - - return $this->newBelongsTo( - $instance->newQuery(), $this, $foreignKey, $ownerKey, $relation - ); - } - - /** - * Instantiate a new BelongsTo relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $child - * @param string $foreignKey - * @param string $ownerKey - * @param string $relation - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo - */ - protected function newBelongsTo(Builder $query, Model $child, $foreignKey, $ownerKey, $relation) - { - return new BelongsTo($query, $child, $foreignKey, $ownerKey, $relation); - } - - /** - * Define a polymorphic, inverse one-to-one or many relationship. - * - * @param string $name - * @param string $type - * @param string $id - * @return \Illuminate\Database\Eloquent\Relations\MorphTo - */ - public function morphTo($name = null, $type = null, $id = null) - { - // If no name is provided, we will use the backtrace to get the function name - // since that is most likely the name of the polymorphic interface. We can - // use that to get both the class and foreign key that will be utilized. - $name = $name ?: $this->guessBelongsToRelation(); - - list($type, $id) = $this->getMorphs( - Str::snake($name), $type, $id - ); - - // If the type value is null it is probably safe to assume we're eager loading - // the relationship. In this case we'll just pass in a dummy query where we - // need to remove any eager loads that may already be defined on a model. - return empty($class = $this->{$type}) - ? $this->morphEagerTo($name, $type, $id) - : $this->morphInstanceTo($class, $name, $type, $id); - } - - /** - * Define a polymorphic, inverse one-to-one or many relationship. - * - * @param string $name - * @param string $type - * @param string $id - * @return \Illuminate\Database\Eloquent\Relations\MorphTo - */ - protected function morphEagerTo($name, $type, $id) - { - return $this->newMorphTo( - $this->newQuery()->setEagerLoads([]), $this, $id, null, $type, $name - ); - } - - /** - * Define a polymorphic, inverse one-to-one or many relationship. - * - * @param string $target - * @param string $name - * @param string $type - * @param string $id - * @return \Illuminate\Database\Eloquent\Relations\MorphTo - */ - protected function morphInstanceTo($target, $name, $type, $id) - { - $instance = $this->newRelatedInstance( - static::getActualClassNameForMorph($target) - ); - - return $this->newMorphTo( - $instance->newQuery(), $this, $id, $instance->getKeyName(), $type, $name - ); - } - - /** - * Instantiate a new MorphTo relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $foreignKey - * @param string $ownerKey - * @param string $type - * @param string $relation - * @return \Illuminate\Database\Eloquent\Relations\MorphTo - */ - protected function newMorphTo(Builder $query, Model $parent, $foreignKey, $ownerKey, $type, $relation) - { - return new MorphTo($query, $parent, $foreignKey, $ownerKey, $type, $relation); - } - - /** - * Retrieve the actual class name for a given morph class. - * - * @param string $class - * @return string - */ - public static function getActualClassNameForMorph($class) - { - return Arr::get(Relation::morphMap() ?: [], $class, $class); - } - - /** - * Guess the "belongs to" relationship name. - * - * @return string - */ - protected function guessBelongsToRelation() - { - list($one, $two, $caller) = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3); - - return $caller['function']; - } - - /** - * Define a one-to-many relationship. - * - * @param string $related - * @param string $foreignKey - * @param string $localKey - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - public function hasMany($related, $foreignKey = null, $localKey = null) - { - $instance = $this->newRelatedInstance($related); - - $foreignKey = $foreignKey ?: $this->getForeignKey(); - - $localKey = $localKey ?: $this->getKeyName(); - - return $this->newHasMany( - $instance->newQuery(), $this, $instance->getTable().'.'.$foreignKey, $localKey - ); - } - - /** - * Instantiate a new HasMany relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $foreignKey - * @param string $localKey - * @return \Illuminate\Database\Eloquent\Relations\HasMany - */ - protected function newHasMany(Builder $query, Model $parent, $foreignKey, $localKey) - { - return new HasMany($query, $parent, $foreignKey, $localKey); - } - - /** - * Define a has-many-through relationship. - * - * @param string $related - * @param string $through - * @param string|null $firstKey - * @param string|null $secondKey - * @param string|null $localKey - * @param string|null $secondLocalKey - * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough - */ - public function hasManyThrough($related, $through, $firstKey = null, $secondKey = null, $localKey = null, $secondLocalKey = null) - { - $through = new $through; - - $firstKey = $firstKey ?: $this->getForeignKey(); - - $secondKey = $secondKey ?: $through->getForeignKey(); - - return $this->newHasManyThrough( - $this->newRelatedInstance($related)->newQuery(), $this, $through, - $firstKey, $secondKey, $localKey ?: $this->getKeyName(), - $secondLocalKey ?: $through->getKeyName() - ); - } - - /** - * Instantiate a new HasManyThrough relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $farParent - * @param \Illuminate\Database\Eloquent\Model $throughParent - * @param string $firstKey - * @param string $secondKey - * @param string $localKey - * @param string $secondLocalKey - * @return \Illuminate\Database\Eloquent\Relations\HasManyThrough - */ - protected function newHasManyThrough(Builder $query, Model $farParent, Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey) - { - return new HasManyThrough($query, $farParent, $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey); - } - - /** - * Define a polymorphic one-to-many relationship. - * - * @param string $related - * @param string $name - * @param string $type - * @param string $id - * @param string $localKey - * @return \Illuminate\Database\Eloquent\Relations\MorphMany - */ - public function morphMany($related, $name, $type = null, $id = null, $localKey = null) - { - $instance = $this->newRelatedInstance($related); - - // Here we will gather up the morph type and ID for the relationship so that we - // can properly query the intermediate table of a relation. Finally, we will - // get the table and create the relationship instances for the developers. - list($type, $id) = $this->getMorphs($name, $type, $id); - - $table = $instance->getTable(); - - $localKey = $localKey ?: $this->getKeyName(); - - return $this->newMorphMany($instance->newQuery(), $this, $table.'.'.$type, $table.'.'.$id, $localKey); - } - - /** - * Instantiate a new MorphMany relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $type - * @param string $id - * @param string $localKey - * @return \Illuminate\Database\Eloquent\Relations\MorphMany - */ - protected function newMorphMany(Builder $query, Model $parent, $type, $id, $localKey) - { - return new MorphMany($query, $parent, $type, $id, $localKey); - } - - /** - * Define a many-to-many relationship. - * - * @param string $related - * @param string $table - * @param string $foreignPivotKey - * @param string $relatedPivotKey - * @param string $parentKey - * @param string $relatedKey - * @param string $relation - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - public function belongsToMany($related, $table = null, $foreignPivotKey = null, $relatedPivotKey = null, - $parentKey = null, $relatedKey = null, $relation = null) - { - // If no relationship name was passed, we will pull backtraces to get the - // name of the calling function. We will use that function name as the - // title of this relation since that is a great convention to apply. - if (is_null($relation)) { - $relation = $this->guessBelongsToManyRelation(); - } - - // First, we'll need to determine the foreign key and "other key" for the - // relationship. Once we have determined the keys we'll make the query - // instances as well as the relationship instances we need for this. - $instance = $this->newRelatedInstance($related); - - $foreignPivotKey = $foreignPivotKey ?: $this->getForeignKey(); - - $relatedPivotKey = $relatedPivotKey ?: $instance->getForeignKey(); - - // If no table name was provided, we can guess it by concatenating the two - // models using underscores in alphabetical order. The two model names - // are transformed to snake case from their default CamelCase also. - if (is_null($table)) { - $table = $this->joiningTable($related); - } - - return $this->newBelongsToMany( - $instance->newQuery(), $this, $table, $foreignPivotKey, - $relatedPivotKey, $parentKey ?: $this->getKeyName(), - $relatedKey ?: $instance->getKeyName(), $relation - ); - } - - /** - * Instantiate a new BelongsToMany relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $table - * @param string $foreignPivotKey - * @param string $relatedPivotKey - * @param string $parentKey - * @param string $relatedKey - * @param string $relationName - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - protected function newBelongsToMany(Builder $query, Model $parent, $table, $foreignPivotKey, $relatedPivotKey, - $parentKey, $relatedKey, $relationName = null) - { - return new BelongsToMany($query, $parent, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, $relationName); - } - - /** - * Define a polymorphic many-to-many relationship. - * - * @param string $related - * @param string $name - * @param string $table - * @param string $foreignPivotKey - * @param string $relatedPivotKey - * @param string $parentKey - * @param string $relatedKey - * @param bool $inverse - * @return \Illuminate\Database\Eloquent\Relations\MorphToMany - */ - public function morphToMany($related, $name, $table = null, $foreignPivotKey = null, - $relatedPivotKey = null, $parentKey = null, - $relatedKey = null, $inverse = false) - { - $caller = $this->guessBelongsToManyRelation(); - - // First, we will need to determine the foreign key and "other key" for the - // relationship. Once we have determined the keys we will make the query - // instances, as well as the relationship instances we need for these. - $instance = $this->newRelatedInstance($related); - - $foreignPivotKey = $foreignPivotKey ?: $name.'_id'; - - $relatedPivotKey = $relatedPivotKey ?: $instance->getForeignKey(); - - // Now we're ready to create a new query builder for this related model and - // the relationship instances for this relation. This relations will set - // appropriate query constraints then entirely manages the hydrations. - $table = $table ?: Str::plural($name); - - return $this->newMorphToMany( - $instance->newQuery(), $this, $name, $table, - $foreignPivotKey, $relatedPivotKey, $parentKey ?: $this->getKeyName(), - $relatedKey ?: $instance->getKeyName(), $caller, $inverse - ); - } - - /** - * Instantiate a new HasManyThrough relationship. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $name - * @param string $table - * @param string $foreignPivotKey - * @param string $relatedPivotKey - * @param string $parentKey - * @param string $relatedKey - * @param string $relationName - * @param bool $inverse - * @return \Illuminate\Database\Eloquent\Relations\MorphToMany - */ - protected function newMorphToMany(Builder $query, Model $parent, $name, $table, $foreignPivotKey, - $relatedPivotKey, $parentKey, $relatedKey, - $relationName = null, $inverse = false) - { - return new MorphToMany($query, $parent, $name, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, - $relationName, $inverse); - } - - /** - * Define a polymorphic, inverse many-to-many relationship. - * - * @param string $related - * @param string $name - * @param string $table - * @param string $foreignPivotKey - * @param string $relatedPivotKey - * @param string $parentKey - * @param string $relatedKey - * @return \Illuminate\Database\Eloquent\Relations\MorphToMany - */ - public function morphedByMany($related, $name, $table = null, $foreignPivotKey = null, - $relatedPivotKey = null, $parentKey = null, $relatedKey = null) - { - $foreignPivotKey = $foreignPivotKey ?: $this->getForeignKey(); - - // For the inverse of the polymorphic many-to-many relations, we will change - // the way we determine the foreign and other keys, as it is the opposite - // of the morph-to-many method since we're figuring out these inverses. - $relatedPivotKey = $relatedPivotKey ?: $name.'_id'; - - return $this->morphToMany( - $related, $name, $table, $foreignPivotKey, - $relatedPivotKey, $parentKey, $relatedKey, true - ); - } - - /** - * Get the relationship name of the belongs to many. - * - * @return string - */ - protected function guessBelongsToManyRelation() - { - $caller = Arr::first(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), function ($trace) { - return ! in_array($trace['function'], Model::$manyMethods); - }); - - return ! is_null($caller) ? $caller['function'] : null; - } - - /** - * Get the joining table name for a many-to-many relation. - * - * @param string $related - * @return string - */ - public function joiningTable($related) - { - // The joining table name, by convention, is simply the snake cased models - // sorted alphabetically and concatenated with an underscore, so we can - // just sort the models and join them together to get the table name. - $models = [ - Str::snake(class_basename($related)), - Str::snake(class_basename($this)), - ]; - - // Now that we have the model names in an array we can just sort them and - // use the implode function to join them together with an underscores, - // which is typically used by convention within the database system. - sort($models); - - return strtolower(implode('_', $models)); - } - - /** - * Determine if the model touches a given relation. - * - * @param string $relation - * @return bool - */ - public function touches($relation) - { - return in_array($relation, $this->touches); - } - - /** - * Touch the owning relations of the model. - * - * @return void - */ - public function touchOwners() - { - foreach ($this->touches as $relation) { - $this->$relation()->touch(); - - if ($this->$relation instanceof self) { - $this->$relation->fireModelEvent('saved', false); - - $this->$relation->touchOwners(); - } elseif ($this->$relation instanceof Collection) { - $this->$relation->each(function (Model $relation) { - $relation->touchOwners(); - }); - } - } - } - - /** - * Get the polymorphic relationship columns. - * - * @param string $name - * @param string $type - * @param string $id - * @return array - */ - protected function getMorphs($name, $type, $id) - { - return [$type ?: $name.'_type', $id ?: $name.'_id']; - } - - /** - * Get the class name for polymorphic relations. - * - * @return string - */ - public function getMorphClass() - { - $morphMap = Relation::morphMap(); - - if (! empty($morphMap) && in_array(static::class, $morphMap)) { - return array_search(static::class, $morphMap, true); - } - - return static::class; - } - - /** - * Create a new model instance for a related model. - * - * @param string $class - * @return mixed - */ - protected function newRelatedInstance($class) - { - return tap(new $class, function ($instance) { - if (! $instance->getConnectionName()) { - $instance->setConnection($this->connection); - } - }); - } - - /** - * Get all the loaded relations for the instance. - * - * @return array - */ - public function getRelations() - { - return $this->relations; - } - - /** - * Get a specified relationship. - * - * @param string $relation - * @return mixed - */ - public function getRelation($relation) - { - return $this->relations[$relation]; - } - - /** - * Determine if the given relation is loaded. - * - * @param string $key - * @return bool - */ - public function relationLoaded($key) - { - return array_key_exists($key, $this->relations); - } - - /** - * Set the specific relationship in the model. - * - * @param string $relation - * @param mixed $value - * @return $this - */ - public function setRelation($relation, $value) - { - $this->relations[$relation] = $value; - - return $this; - } - - /** - * Set the entire relations array on the model. - * - * @param array $relations - * @return $this - */ - public function setRelations(array $relations) - { - $this->relations = $relations; - - return $this; - } - - /** - * Get the relationships that are touched on save. - * - * @return array - */ - public function getTouchedRelations() - { - return $this->touches; - } - - /** - * Set the relationships that are touched on save. - * - * @param array $touches - * @return $this - */ - public function setTouchedRelations(array $touches) - { - $this->touches = $touches; - - return $this; - } -} diff --git a/vendor/illuminate/database/Eloquent/Concerns/HasTimestamps.php b/vendor/illuminate/database/Eloquent/Concerns/HasTimestamps.php deleted file mode 100644 index ce3e080..0000000 --- a/vendor/illuminate/database/Eloquent/Concerns/HasTimestamps.php +++ /dev/null @@ -1,125 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Concerns; - -use Illuminate\Support\Carbon; - -trait HasTimestamps -{ - /** - * Indicates if the model should be timestamped. - * - * @var bool - */ - public $timestamps = true; - - /** - * Update the model's update timestamp. - * - * @return bool - */ - public function touch() - { - if (! $this->usesTimestamps()) { - return false; - } - - $this->updateTimestamps(); - - return $this->save(); - } - - /** - * Update the creation and update timestamps. - * - * @return void - */ - protected function updateTimestamps() - { - $time = $this->freshTimestamp(); - - if (! is_null(static::UPDATED_AT) && ! $this->isDirty(static::UPDATED_AT)) { - $this->setUpdatedAt($time); - } - - if (! $this->exists && ! $this->isDirty(static::CREATED_AT)) { - $this->setCreatedAt($time); - } - } - - /** - * Set the value of the "created at" attribute. - * - * @param mixed $value - * @return $this - */ - public function setCreatedAt($value) - { - $this->{static::CREATED_AT} = $value; - - return $this; - } - - /** - * Set the value of the "updated at" attribute. - * - * @param mixed $value - * @return $this - */ - public function setUpdatedAt($value) - { - $this->{static::UPDATED_AT} = $value; - - return $this; - } - - /** - * Get a fresh timestamp for the model. - * - * @return \Illuminate\Support\Carbon - */ - public function freshTimestamp() - { - return new Carbon; - } - - /** - * Get a fresh timestamp for the model. - * - * @return string - */ - public function freshTimestampString() - { - return $this->fromDateTime($this->freshTimestamp()); - } - - /** - * Determine if the model uses timestamps. - * - * @return bool - */ - public function usesTimestamps() - { - return $this->timestamps; - } - - /** - * Get the name of the "created at" column. - * - * @return string - */ - public function getCreatedAtColumn() - { - return static::CREATED_AT; - } - - /** - * Get the name of the "updated at" column. - * - * @return string - */ - public function getUpdatedAtColumn() - { - return static::UPDATED_AT; - } -} diff --git a/vendor/illuminate/database/Eloquent/Concerns/HidesAttributes.php b/vendor/illuminate/database/Eloquent/Concerns/HidesAttributes.php deleted file mode 100644 index 7bd9ef9..0000000 --- a/vendor/illuminate/database/Eloquent/Concerns/HidesAttributes.php +++ /dev/null @@ -1,126 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Concerns; - -trait HidesAttributes -{ - /** - * The attributes that should be hidden for serialization. - * - * @var array - */ - protected $hidden = []; - - /** - * The attributes that should be visible in serialization. - * - * @var array - */ - protected $visible = []; - - /** - * Get the hidden attributes for the model. - * - * @return array - */ - public function getHidden() - { - return $this->hidden; - } - - /** - * Set the hidden attributes for the model. - * - * @param array $hidden - * @return $this - */ - public function setHidden(array $hidden) - { - $this->hidden = $hidden; - - return $this; - } - - /** - * Add hidden attributes for the model. - * - * @param array|string|null $attributes - * @return void - */ - public function addHidden($attributes = null) - { - $this->hidden = array_merge( - $this->hidden, is_array($attributes) ? $attributes : func_get_args() - ); - } - - /** - * Get the visible attributes for the model. - * - * @return array - */ - public function getVisible() - { - return $this->visible; - } - - /** - * Set the visible attributes for the model. - * - * @param array $visible - * @return $this - */ - public function setVisible(array $visible) - { - $this->visible = $visible; - - return $this; - } - - /** - * Add visible attributes for the model. - * - * @param array|string|null $attributes - * @return void - */ - public function addVisible($attributes = null) - { - $this->visible = array_merge( - $this->visible, is_array($attributes) ? $attributes : func_get_args() - ); - } - - /** - * Make the given, typically hidden, attributes visible. - * - * @param array|string $attributes - * @return $this - */ - public function makeVisible($attributes) - { - $this->hidden = array_diff($this->hidden, (array) $attributes); - - if (! empty($this->visible)) { - $this->addVisible($attributes); - } - - return $this; - } - - /** - * Make the given, typically visible, attributes hidden. - * - * @param array|string $attributes - * @return $this - */ - public function makeHidden($attributes) - { - $attributes = (array) $attributes; - - $this->visible = array_diff($this->visible, $attributes); - - $this->hidden = array_unique(array_merge($this->hidden, $attributes)); - - return $this; - } -} diff --git a/vendor/illuminate/database/Eloquent/Concerns/QueriesRelationships.php b/vendor/illuminate/database/Eloquent/Concerns/QueriesRelationships.php deleted file mode 100644 index 2897703..0000000 --- a/vendor/illuminate/database/Eloquent/Concerns/QueriesRelationships.php +++ /dev/null @@ -1,310 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Concerns; - -use Closure; -use Illuminate\Support\Str; -use Illuminate\Database\Eloquent\Builder; -use Illuminate\Database\Query\Expression; -use Illuminate\Database\Eloquent\Relations\Relation; -use Illuminate\Database\Query\Builder as QueryBuilder; - -trait QueriesRelationships -{ - /** - * Add a relationship count / exists condition to the query. - * - * @param string $relation - * @param string $operator - * @param int $count - * @param string $boolean - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', Closure $callback = null) - { - if (strpos($relation, '.') !== false) { - return $this->hasNested($relation, $operator, $count, $boolean, $callback); - } - - $relation = $this->getRelationWithoutConstraints($relation); - - // If we only need to check for the existence of the relation, then we can optimize - // the subquery to only run a "where exists" clause instead of this full "count" - // clause. This will make these queries run much faster compared with a count. - $method = $this->canUseExistsForExistenceCheck($operator, $count) - ? 'getRelationExistenceQuery' - : 'getRelationExistenceCountQuery'; - - $hasQuery = $relation->{$method}( - $relation->getRelated()->newQuery(), $this - ); - - // Next we will call any given callback as an "anonymous" scope so they can get the - // proper logical grouping of the where clauses if needed by this Eloquent query - // builder. Then, we will be ready to finalize and return this query instance. - if ($callback) { - $hasQuery->callScope($callback); - } - - return $this->addHasWhere( - $hasQuery, $relation, $operator, $count, $boolean - ); - } - - /** - * Add nested relationship count / exists conditions to the query. - * - * Sets up recursive call to whereHas until we finish the nested relation. - * - * @param string $relations - * @param string $operator - * @param int $count - * @param string $boolean - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Builder|static - */ - protected function hasNested($relations, $operator = '>=', $count = 1, $boolean = 'and', $callback = null) - { - $relations = explode('.', $relations); - - $closure = function ($q) use (&$closure, &$relations, $operator, $count, $callback) { - // In order to nest "has", we need to add count relation constraints on the - // callback Closure. We'll do this by simply passing the Closure its own - // reference to itself so it calls itself recursively on each segment. - count($relations) > 1 - ? $q->whereHas(array_shift($relations), $closure) - : $q->has(array_shift($relations), $operator, $count, 'and', $callback); - }; - - return $this->has(array_shift($relations), '>=', 1, $boolean, $closure); - } - - /** - * Add a relationship count / exists condition to the query with an "or". - * - * @param string $relation - * @param string $operator - * @param int $count - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function orHas($relation, $operator = '>=', $count = 1) - { - return $this->has($relation, $operator, $count, 'or'); - } - - /** - * Add a relationship count / exists condition to the query. - * - * @param string $relation - * @param string $boolean - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function doesntHave($relation, $boolean = 'and', Closure $callback = null) - { - return $this->has($relation, '<', 1, $boolean, $callback); - } - - /** - * Add a relationship count / exists condition to the query with an "or". - * - * @param string $relation - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function orDoesntHave($relation) - { - return $this->doesntHave($relation, 'or'); - } - - /** - * Add a relationship count / exists condition to the query with where clauses. - * - * @param string $relation - * @param \Closure|null $callback - * @param string $operator - * @param int $count - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function whereHas($relation, Closure $callback = null, $operator = '>=', $count = 1) - { - return $this->has($relation, $operator, $count, 'and', $callback); - } - - /** - * Add a relationship count / exists condition to the query with where clauses and an "or". - * - * @param string $relation - * @param \Closure $callback - * @param string $operator - * @param int $count - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function orWhereHas($relation, Closure $callback = null, $operator = '>=', $count = 1) - { - return $this->has($relation, $operator, $count, 'or', $callback); - } - - /** - * Add a relationship count / exists condition to the query with where clauses. - * - * @param string $relation - * @param \Closure|null $callback - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function whereDoesntHave($relation, Closure $callback = null) - { - return $this->doesntHave($relation, 'and', $callback); - } - - /** - * Add a relationship count / exists condition to the query with where clauses and an "or". - * - * @param string $relation - * @param \Closure $callback - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function orWhereDoesntHave($relation, Closure $callback = null) - { - return $this->doesntHave($relation, 'or', $callback); - } - - /** - * Add subselect queries to count the relations. - * - * @param mixed $relations - * @return $this - */ - public function withCount($relations) - { - if (empty($relations)) { - return $this; - } - - if (is_null($this->query->columns)) { - $this->query->select([$this->query->from.'.*']); - } - - $relations = is_array($relations) ? $relations : func_get_args(); - - foreach ($this->parseWithRelations($relations) as $name => $constraints) { - // First we will determine if the name has been aliased using an "as" clause on the name - // and if it has we will extract the actual relationship name and the desired name of - // the resulting column. This allows multiple counts on the same relationship name. - $segments = explode(' ', $name); - - unset($alias); - - if (count($segments) == 3 && Str::lower($segments[1]) == 'as') { - list($name, $alias) = [$segments[0], $segments[2]]; - } - - $relation = $this->getRelationWithoutConstraints($name); - - // Here we will get the relationship count query and prepare to add it to the main query - // as a sub-select. First, we'll get the "has" query and use that to get the relation - // count query. We will normalize the relation name then append _count as the name. - $query = $relation->getRelationExistenceCountQuery( - $relation->getRelated()->newQuery(), $this - ); - - $query->callScope($constraints); - - $query->mergeConstraintsFrom($relation->getQuery()); - - // Finally we will add the proper result column alias to the query and run the subselect - // statement against the query builder. Then we will return the builder instance back - // to the developer for further constraint chaining that needs to take place on it. - $column = $alias ?? Str::snake($name.'_count'); - - $this->selectSub($query->toBase(), $column); - } - - return $this; - } - - /** - * Add the "has" condition where clause to the query. - * - * @param \Illuminate\Database\Eloquent\Builder $hasQuery - * @param \Illuminate\Database\Eloquent\Relations\Relation $relation - * @param string $operator - * @param int $count - * @param string $boolean - * @return \Illuminate\Database\Eloquent\Builder|static - */ - protected function addHasWhere(Builder $hasQuery, Relation $relation, $operator, $count, $boolean) - { - $hasQuery->mergeConstraintsFrom($relation->getQuery()); - - return $this->canUseExistsForExistenceCheck($operator, $count) - ? $this->addWhereExistsQuery($hasQuery->toBase(), $boolean, $operator === '<' && $count === 1) - : $this->addWhereCountQuery($hasQuery->toBase(), $operator, $count, $boolean); - } - - /** - * Merge the where constraints from another query to the current query. - * - * @param \Illuminate\Database\Eloquent\Builder $from - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function mergeConstraintsFrom(Builder $from) - { - $whereBindings = $from->getQuery()->getRawBindings()['where'] ?? []; - - // Here we have some other query that we want to merge the where constraints from. We will - // copy over any where constraints on the query as well as remove any global scopes the - // query might have removed. Then we will return ourselves with the finished merging. - return $this->withoutGlobalScopes( - $from->removedScopes() - )->mergeWheres( - $from->getQuery()->wheres, $whereBindings - ); - } - - /** - * Add a sub-query count clause to this query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $operator - * @param int $count - * @param string $boolean - * @return $this - */ - protected function addWhereCountQuery(QueryBuilder $query, $operator = '>=', $count = 1, $boolean = 'and') - { - $this->query->addBinding($query->getBindings(), 'where'); - - return $this->where( - new Expression('('.$query->toSql().')'), - $operator, - is_numeric($count) ? new Expression($count) : $count, - $boolean - ); - } - - /** - * Get the "has relation" base query instance. - * - * @param string $relation - * @return \Illuminate\Database\Eloquent\Relations\Relation - */ - protected function getRelationWithoutConstraints($relation) - { - return Relation::noConstraints(function () use ($relation) { - return $this->getModel()->{$relation}(); - }); - } - - /** - * Check if we can run an "exists" query to optimize performance. - * - * @param string $operator - * @param int $count - * @return bool - */ - protected function canUseExistsForExistenceCheck($operator, $count) - { - return ($operator === '>=' || $operator === '<') && $count === 1; - } -} diff --git a/vendor/illuminate/database/Eloquent/Factory.php b/vendor/illuminate/database/Eloquent/Factory.php deleted file mode 100644 index 8b6104c..0000000 --- a/vendor/illuminate/database/Eloquent/Factory.php +++ /dev/null @@ -1,253 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent; - -use ArrayAccess; -use Faker\Generator as Faker; -use Symfony\Component\Finder\Finder; - -class Factory implements ArrayAccess -{ - /** - * The model definitions in the container. - * - * @var array - */ - protected $definitions = []; - - /** - * The registered model states. - * - * @var array - */ - protected $states = []; - - /** - * The Faker instance for the builder. - * - * @var \Faker\Generator - */ - protected $faker; - - /** - * Create a new factory instance. - * - * @param \Faker\Generator $faker - * @return void - */ - public function __construct(Faker $faker) - { - $this->faker = $faker; - } - - /** - * Create a new factory container. - * - * @param \Faker\Generator $faker - * @param string|null $pathToFactories - * @return static - */ - public static function construct(Faker $faker, $pathToFactories = null) - { - $pathToFactories = $pathToFactories ?: database_path('factories'); - - return (new static($faker))->load($pathToFactories); - } - - /** - * Define a class with a given short-name. - * - * @param string $class - * @param string $name - * @param callable $attributes - * @return $this - */ - public function defineAs($class, $name, callable $attributes) - { - return $this->define($class, $attributes, $name); - } - - /** - * Define a class with a given set of attributes. - * - * @param string $class - * @param callable $attributes - * @param string $name - * @return $this - */ - public function define($class, callable $attributes, $name = 'default') - { - $this->definitions[$class][$name] = $attributes; - - return $this; - } - - /** - * Define a state with a given set of attributes. - * - * @param string $class - * @param string $state - * @param callable|array $attributes - * @return $this - */ - public function state($class, $state, $attributes) - { - $this->states[$class][$state] = $attributes; - - return $this; - } - - /** - * Create an instance of the given model and persist it to the database. - * - * @param string $class - * @param array $attributes - * @return mixed - */ - public function create($class, array $attributes = []) - { - return $this->of($class)->create($attributes); - } - - /** - * Create an instance of the given model and type and persist it to the database. - * - * @param string $class - * @param string $name - * @param array $attributes - * @return mixed - */ - public function createAs($class, $name, array $attributes = []) - { - return $this->of($class, $name)->create($attributes); - } - - /** - * Create an instance of the given model. - * - * @param string $class - * @param array $attributes - * @return mixed - */ - public function make($class, array $attributes = []) - { - return $this->of($class)->make($attributes); - } - - /** - * Create an instance of the given model and type. - * - * @param string $class - * @param string $name - * @param array $attributes - * @return mixed - */ - public function makeAs($class, $name, array $attributes = []) - { - return $this->of($class, $name)->make($attributes); - } - - /** - * Get the raw attribute array for a given named model. - * - * @param string $class - * @param string $name - * @param array $attributes - * @return array - */ - public function rawOf($class, $name, array $attributes = []) - { - return $this->raw($class, $attributes, $name); - } - - /** - * Get the raw attribute array for a given model. - * - * @param string $class - * @param array $attributes - * @param string $name - * @return array - */ - public function raw($class, array $attributes = [], $name = 'default') - { - return array_merge( - call_user_func($this->definitions[$class][$name], $this->faker), $attributes - ); - } - - /** - * Create a builder for the given model. - * - * @param string $class - * @param string $name - * @return \Illuminate\Database\Eloquent\FactoryBuilder - */ - public function of($class, $name = 'default') - { - return new FactoryBuilder($class, $name, $this->definitions, $this->states, $this->faker); - } - - /** - * Load factories from path. - * - * @param string $path - * @return $this - */ - public function load($path) - { - $factory = $this; - - if (is_dir($path)) { - foreach (Finder::create()->files()->name('*.php')->in($path) as $file) { - require $file->getRealPath(); - } - } - - return $factory; - } - - /** - * Determine if the given offset exists. - * - * @param string $offset - * @return bool - */ - public function offsetExists($offset) - { - return isset($this->definitions[$offset]); - } - - /** - * Get the value of the given offset. - * - * @param string $offset - * @return mixed - */ - public function offsetGet($offset) - { - return $this->make($offset); - } - - /** - * Set the given offset to the given value. - * - * @param string $offset - * @param callable $value - * @return void - */ - public function offsetSet($offset, $value) - { - return $this->define($offset, $value); - } - - /** - * Unset the value at the given offset. - * - * @param string $offset - * @return void - */ - public function offsetUnset($offset) - { - unset($this->definitions[$offset]); - } -} diff --git a/vendor/illuminate/database/Eloquent/FactoryBuilder.php b/vendor/illuminate/database/Eloquent/FactoryBuilder.php deleted file mode 100644 index 7a3b023..0000000 --- a/vendor/illuminate/database/Eloquent/FactoryBuilder.php +++ /dev/null @@ -1,331 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent; - -use Faker\Generator as Faker; -use InvalidArgumentException; -use Illuminate\Support\Traits\Macroable; - -class FactoryBuilder -{ - use Macroable; - - /** - * The model definitions in the container. - * - * @var array - */ - protected $definitions; - - /** - * The model being built. - * - * @var string - */ - protected $class; - - /** - * The name of the model being built. - * - * @var string - */ - protected $name = 'default'; - - /** - * The database connection on which the model instance should be persisted. - * - * @var string - */ - protected $connection; - - /** - * The model states. - * - * @var array - */ - protected $states; - - /** - * The states to apply. - * - * @var array - */ - protected $activeStates = []; - - /** - * The Faker instance for the builder. - * - * @var \Faker\Generator - */ - protected $faker; - - /** - * The number of models to build. - * - * @var int|null - */ - protected $amount = null; - - /** - * Create an new builder instance. - * - * @param string $class - * @param string $name - * @param array $definitions - * @param array $states - * @param \Faker\Generator $faker - * @return void - */ - public function __construct($class, $name, array $definitions, array $states, Faker $faker) - { - $this->name = $name; - $this->class = $class; - $this->faker = $faker; - $this->states = $states; - $this->definitions = $definitions; - } - - /** - * Set the amount of models you wish to create / make. - * - * @param int $amount - * @return $this - */ - public function times($amount) - { - $this->amount = $amount; - - return $this; - } - - /** - * Set the states to be applied to the model. - * - * @param array|mixed $states - * @return $this - */ - public function states($states) - { - $this->activeStates = is_array($states) ? $states : func_get_args(); - - return $this; - } - - /** - * Set the database connection on which the model instance should be persisted. - * - * @param string $name - * @return $this - */ - public function connection($name) - { - $this->connection = $name; - - return $this; - } - - /** - * Create a model and persist it in the database if requested. - * - * @param array $attributes - * @return \Closure - */ - public function lazy(array $attributes = []) - { - return function () use ($attributes) { - return $this->create($attributes); - }; - } - - /** - * Create a collection of models and persist them to the database. - * - * @param array $attributes - * @return mixed - */ - public function create(array $attributes = []) - { - $results = $this->make($attributes); - - if ($results instanceof Model) { - $this->store(collect([$results])); - } else { - $this->store($results); - } - - return $results; - } - - /** - * Set the connection name on the results and store them. - * - * @param \Illuminate\Support\Collection $results - * @return void - */ - protected function store($results) - { - $results->each(function ($model) { - if (! isset($this->connection)) { - $model->setConnection($model->newQueryWithoutScopes()->getConnection()->getName()); - } - - $model->save(); - }); - } - - /** - * Create a collection of models. - * - * @param array $attributes - * @return mixed - */ - public function make(array $attributes = []) - { - if ($this->amount === null) { - return $this->makeInstance($attributes); - } - - if ($this->amount < 1) { - return (new $this->class)->newCollection(); - } - - return (new $this->class)->newCollection(array_map(function () use ($attributes) { - return $this->makeInstance($attributes); - }, range(1, $this->amount))); - } - - /** - * Create an array of raw attribute arrays. - * - * @param array $attributes - * @return mixed - */ - public function raw(array $attributes = []) - { - if ($this->amount === null) { - return $this->getRawAttributes($attributes); - } - - if ($this->amount < 1) { - return []; - } - - return array_map(function () use ($attributes) { - return $this->getRawAttributes($attributes); - }, range(1, $this->amount)); - } - - /** - * Get a raw attributes array for the model. - * - * @param array $attributes - * @return mixed - */ - protected function getRawAttributes(array $attributes = []) - { - $definition = call_user_func( - $this->definitions[$this->class][$this->name], - $this->faker, $attributes - ); - - return $this->expandAttributes( - array_merge($this->applyStates($definition, $attributes), $attributes) - ); - } - - /** - * Make an instance of the model with the given attributes. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model - * - * @throws \InvalidArgumentException - */ - protected function makeInstance(array $attributes = []) - { - return Model::unguarded(function () use ($attributes) { - if (! isset($this->definitions[$this->class][$this->name])) { - throw new InvalidArgumentException("Unable to locate factory with name [{$this->name}] [{$this->class}]."); - } - - $instance = new $this->class( - $this->getRawAttributes($attributes) - ); - - if (isset($this->connection)) { - $instance->setConnection($this->connection); - } - - return $instance; - }); - } - - /** - * Apply the active states to the model definition array. - * - * @param array $definition - * @param array $attributes - * @return array - */ - protected function applyStates(array $definition, array $attributes = []) - { - foreach ($this->activeStates as $state) { - if (! isset($this->states[$this->class][$state])) { - throw new InvalidArgumentException("Unable to locate [{$state}] state for [{$this->class}]."); - } - - $definition = array_merge( - $definition, - $this->stateAttributes($state, $attributes) - ); - } - - return $definition; - } - - /** - * Get the state attributes. - * - * @param string $state - * @param array $attributes - * @return array - */ - protected function stateAttributes($state, array $attributes) - { - $stateAttributes = $this->states[$this->class][$state]; - - if (! is_callable($stateAttributes)) { - return $stateAttributes; - } - - return call_user_func( - $stateAttributes, - $this->faker, $attributes - ); - } - - /** - * Expand all attributes to their underlying values. - * - * @param array $attributes - * @return array - */ - protected function expandAttributes(array $attributes) - { - foreach ($attributes as &$attribute) { - if (is_callable($attribute) && ! is_string($attribute)) { - $attribute = $attribute($attributes); - } - - if ($attribute instanceof static) { - $attribute = $attribute->create()->getKey(); - } - - if ($attribute instanceof Model) { - $attribute = $attribute->getKey(); - } - } - - return $attributes; - } -} diff --git a/vendor/illuminate/database/Eloquent/JsonEncodingException.php b/vendor/illuminate/database/Eloquent/JsonEncodingException.php deleted file mode 100644 index 5878b0f..0000000 --- a/vendor/illuminate/database/Eloquent/JsonEncodingException.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent; - -use RuntimeException; - -class JsonEncodingException extends RuntimeException -{ - /** - * Create a new JSON encoding exception for the model. - * - * @param mixed $model - * @param string $message - * @return static - */ - public static function forModel($model, $message) - { - return new static('Error encoding model ['.get_class($model).'] with ID ['.$model->getKey().'] to JSON: '.$message); - } - - /** - * Create a new JSON encoding exception for an attribute. - * - * @param mixed $model - * @param mixed $key - * @param string $message - * @return static - */ - public static function forAttribute($model, $key, $message) - { - $class = get_class($model); - - return new static("Unable to encode attribute [{$key}] for model [{$class}] to JSON: {$message}."); - } -} diff --git a/vendor/illuminate/database/Eloquent/MassAssignmentException.php b/vendor/illuminate/database/Eloquent/MassAssignmentException.php deleted file mode 100644 index 7c81aae..0000000 --- a/vendor/illuminate/database/Eloquent/MassAssignmentException.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent; - -use RuntimeException; - -class MassAssignmentException extends RuntimeException -{ - // -} diff --git a/vendor/illuminate/database/Eloquent/Model.php b/vendor/illuminate/database/Eloquent/Model.php deleted file mode 100644 index 600eda8..0000000 --- a/vendor/illuminate/database/Eloquent/Model.php +++ /dev/null @@ -1,1511 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent; - -use Exception; -use ArrayAccess; -use JsonSerializable; -use Illuminate\Support\Arr; -use Illuminate\Support\Str; -use Illuminate\Contracts\Support\Jsonable; -use Illuminate\Contracts\Support\Arrayable; -use Illuminate\Contracts\Routing\UrlRoutable; -use Illuminate\Contracts\Queue\QueueableEntity; -use Illuminate\Database\Eloquent\Relations\Pivot; -use Illuminate\Database\Query\Builder as QueryBuilder; -use Illuminate\Database\ConnectionResolverInterface as Resolver; - -abstract class Model implements ArrayAccess, Arrayable, Jsonable, JsonSerializable, QueueableEntity, UrlRoutable -{ - use Concerns\HasAttributes, - Concerns\HasEvents, - Concerns\HasGlobalScopes, - Concerns\HasRelationships, - Concerns\HasTimestamps, - Concerns\HidesAttributes, - Concerns\GuardsAttributes; - - /** - * The connection name for the model. - * - * @var string - */ - protected $connection; - - /** - * The table associated with the model. - * - * @var string - */ - protected $table; - - /** - * The primary key for the model. - * - * @var string - */ - protected $primaryKey = 'id'; - - /** - * The "type" of the auto-incrementing ID. - * - * @var string - */ - protected $keyType = 'int'; - - /** - * Indicates if the IDs are auto-incrementing. - * - * @var bool - */ - public $incrementing = true; - - /** - * The relations to eager load on every query. - * - * @var array - */ - protected $with = []; - - /** - * The relationship counts that should be eager loaded on every query. - * - * @var array - */ - protected $withCount = []; - - /** - * The number of models to return for pagination. - * - * @var int - */ - protected $perPage = 15; - - /** - * Indicates if the model exists. - * - * @var bool - */ - public $exists = false; - - /** - * Indicates if the model was inserted during the current request lifecycle. - * - * @var bool - */ - public $wasRecentlyCreated = false; - - /** - * The connection resolver instance. - * - * @var \Illuminate\Database\ConnectionResolverInterface - */ - protected static $resolver; - - /** - * The event dispatcher instance. - * - * @var \Illuminate\Contracts\Events\Dispatcher - */ - protected static $dispatcher; - - /** - * The array of booted models. - * - * @var array - */ - protected static $booted = []; - - /** - * The array of global scopes on the model. - * - * @var array - */ - protected static $globalScopes = []; - - /** - * The name of the "created at" column. - * - * @var string - */ - const CREATED_AT = 'created_at'; - - /** - * The name of the "updated at" column. - * - * @var string - */ - const UPDATED_AT = 'updated_at'; - - /** - * Create a new Eloquent model instance. - * - * @param array $attributes - * @return void - */ - public function __construct(array $attributes = []) - { - $this->bootIfNotBooted(); - - $this->syncOriginal(); - - $this->fill($attributes); - } - - /** - * Check if the model needs to be booted and if so, do it. - * - * @return void - */ - protected function bootIfNotBooted() - { - if (! isset(static::$booted[static::class])) { - static::$booted[static::class] = true; - - $this->fireModelEvent('booting', false); - - static::boot(); - - $this->fireModelEvent('booted', false); - } - } - - /** - * The "booting" method of the model. - * - * @return void - */ - protected static function boot() - { - static::bootTraits(); - } - - /** - * Boot all of the bootable traits on the model. - * - * @return void - */ - protected static function bootTraits() - { - $class = static::class; - - foreach (class_uses_recursive($class) as $trait) { - if (method_exists($class, $method = 'boot'.class_basename($trait))) { - forward_static_call([$class, $method]); - } - } - } - - /** - * Clear the list of booted models so they will be re-booted. - * - * @return void - */ - public static function clearBootedModels() - { - static::$booted = []; - - static::$globalScopes = []; - } - - /** - * Fill the model with an array of attributes. - * - * @param array $attributes - * @return $this - * - * @throws \Illuminate\Database\Eloquent\MassAssignmentException - */ - public function fill(array $attributes) - { - $totallyGuarded = $this->totallyGuarded(); - - foreach ($this->fillableFromArray($attributes) as $key => $value) { - $key = $this->removeTableFromKey($key); - - // The developers may choose to place some attributes in the "fillable" array - // which means only those attributes may be set through mass assignment to - // the model, and all others will just get ignored for security reasons. - if ($this->isFillable($key)) { - $this->setAttribute($key, $value); - } elseif ($totallyGuarded) { - throw new MassAssignmentException($key); - } - } - - return $this; - } - - /** - * Fill the model with an array of attributes. Force mass assignment. - * - * @param array $attributes - * @return $this - */ - public function forceFill(array $attributes) - { - return static::unguarded(function () use ($attributes) { - return $this->fill($attributes); - }); - } - - /** - * Qualify the given column name by the model's table. - * - * @param string $column - * @return string - */ - public function qualifyColumn($column) - { - if (Str::contains($column, '.')) { - return $column; - } - - return $this->getTable().'.'.$column; - } - - /** - * Remove the table name from a given key. - * - * @param string $key - * @return string - */ - protected function removeTableFromKey($key) - { - return Str::contains($key, '.') ? last(explode('.', $key)) : $key; - } - - /** - * Create a new instance of the given model. - * - * @param array $attributes - * @param bool $exists - * @return static - */ - public function newInstance($attributes = [], $exists = false) - { - // This method just provides a convenient way for us to generate fresh model - // instances of this current model. It is particularly useful during the - // hydration of new objects via the Eloquent query builder instances. - $model = new static((array) $attributes); - - $model->exists = $exists; - - $model->setConnection( - $this->getConnectionName() - ); - - return $model; - } - - /** - * Create a new model instance that is existing. - * - * @param array $attributes - * @param string|null $connection - * @return static - */ - public function newFromBuilder($attributes = [], $connection = null) - { - $model = $this->newInstance([], true); - - $model->setRawAttributes((array) $attributes, true); - - $model->setConnection($connection ?: $this->getConnectionName()); - - $model->fireModelEvent('retrieved', false); - - return $model; - } - - /** - * Begin querying the model on a given connection. - * - * @param string|null $connection - * @return \Illuminate\Database\Eloquent\Builder - */ - public static function on($connection = null) - { - // First we will just create a fresh instance of this model, and then we can - // set the connection on the model so that it is be used for the queries - // we execute, as well as being set on each relationship we retrieve. - $instance = new static; - - $instance->setConnection($connection); - - return $instance->newQuery(); - } - - /** - * Begin querying the model on the write connection. - * - * @return \Illuminate\Database\Query\Builder - */ - public static function onWriteConnection() - { - $instance = new static; - - return $instance->newQuery()->useWritePdo(); - } - - /** - * Get all of the models from the database. - * - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Collection|static[] - */ - public static function all($columns = ['*']) - { - return (new static)->newQuery()->get( - is_array($columns) ? $columns : func_get_args() - ); - } - - /** - * Begin querying a model with eager loading. - * - * @param array|string $relations - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public static function with($relations) - { - return (new static)->newQuery()->with( - is_string($relations) ? func_get_args() : $relations - ); - } - - /** - * Eager load relations on the model. - * - * @param array|string $relations - * @return $this - */ - public function load($relations) - { - $query = $this->newQueryWithoutRelationships()->with( - is_string($relations) ? func_get_args() : $relations - ); - - $query->eagerLoadRelations([$this]); - - return $this; - } - - /** - * Eager load relations on the model if they are not already eager loaded. - * - * @param array|string $relations - * @return $this - */ - public function loadMissing($relations) - { - $relations = is_string($relations) ? func_get_args() : $relations; - - return $this->load(array_filter($relations, function ($relation) { - return ! $this->relationLoaded($relation); - })); - } - - /** - * Increment a column's value by a given amount. - * - * @param string $column - * @param int $amount - * @param array $extra - * @return int - */ - protected function increment($column, $amount = 1, array $extra = []) - { - return $this->incrementOrDecrement($column, $amount, $extra, 'increment'); - } - - /** - * Decrement a column's value by a given amount. - * - * @param string $column - * @param int $amount - * @param array $extra - * @return int - */ - protected function decrement($column, $amount = 1, array $extra = []) - { - return $this->incrementOrDecrement($column, $amount, $extra, 'decrement'); - } - - /** - * Run the increment or decrement method on the model. - * - * @param string $column - * @param int $amount - * @param array $extra - * @param string $method - * @return int - */ - protected function incrementOrDecrement($column, $amount, $extra, $method) - { - $query = $this->newQuery(); - - if (! $this->exists) { - return $query->{$method}($column, $amount, $extra); - } - - $this->incrementOrDecrementAttributeValue($column, $amount, $extra, $method); - - return $query->where( - $this->getKeyName(), $this->getKey() - )->{$method}($column, $amount, $extra); - } - - /** - * Increment the underlying attribute value and sync with original. - * - * @param string $column - * @param int $amount - * @param array $extra - * @param string $method - * @return void - */ - protected function incrementOrDecrementAttributeValue($column, $amount, $extra, $method) - { - $this->{$column} = $this->{$column} + ($method == 'increment' ? $amount : $amount * -1); - - $this->forceFill($extra); - - $this->syncOriginalAttribute($column); - } - - /** - * Update the model in the database. - * - * @param array $attributes - * @param array $options - * @return bool - */ - public function update(array $attributes = [], array $options = []) - { - if (! $this->exists) { - return false; - } - - return $this->fill($attributes)->save($options); - } - - /** - * Save the model and all of its relationships. - * - * @return bool - */ - public function push() - { - if (! $this->save()) { - return false; - } - - // To sync all of the relationships to the database, we will simply spin through - // the relationships and save each model via this "push" method, which allows - // us to recurse into all of these nested relations for the model instance. - foreach ($this->relations as $models) { - $models = $models instanceof Collection - ? $models->all() : [$models]; - - foreach (array_filter($models) as $model) { - if (! $model->push()) { - return false; - } - } - } - - return true; - } - - /** - * Save the model to the database. - * - * @param array $options - * @return bool - */ - public function save(array $options = []) - { - $query = $this->newModelQuery(); - - // If the "saving" event returns false we'll bail out of the save and return - // false, indicating that the save failed. This provides a chance for any - // listeners to cancel save operations if validations fail or whatever. - if ($this->fireModelEvent('saving') === false) { - return false; - } - - // If the model already exists in the database we can just update our record - // that is already in this database using the current IDs in this "where" - // clause to only update this model. Otherwise, we'll just insert them. - if ($this->exists) { - $saved = $this->isDirty() ? - $this->performUpdate($query) : true; - } - - // If the model is brand new, we'll insert it into our database and set the - // ID attribute on the model to the value of the newly inserted row's ID - // which is typically an auto-increment value managed by the database. - else { - $saved = $this->performInsert($query); - - if (! $this->getConnectionName() && - $connection = $query->getConnection()) { - $this->setConnection($connection->getName()); - } - } - - // If the model is successfully saved, we need to do a few more things once - // that is done. We will call the "saved" method here to run any actions - // we need to happen after a model gets successfully saved right here. - if ($saved) { - $this->finishSave($options); - } - - return $saved; - } - - /** - * Save the model to the database using transaction. - * - * @param array $options - * @return bool - * - * @throws \Throwable - */ - public function saveOrFail(array $options = []) - { - return $this->getConnection()->transaction(function () use ($options) { - return $this->save($options); - }); - } - - /** - * Perform any actions that are necessary after the model is saved. - * - * @param array $options - * @return void - */ - protected function finishSave(array $options) - { - $this->fireModelEvent('saved', false); - - if ($this->isDirty() && ($options['touch'] ?? true)) { - $this->touchOwners(); - } - - $this->syncOriginal(); - } - - /** - * Perform a model update operation. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return bool - */ - protected function performUpdate(Builder $query) - { - // If the updating event returns false, we will cancel the update operation so - // developers can hook Validation systems into their models and cancel this - // operation if the model does not pass validation. Otherwise, we update. - if ($this->fireModelEvent('updating') === false) { - return false; - } - - // First we need to create a fresh query instance and touch the creation and - // update timestamp on the model which are maintained by us for developer - // convenience. Then we will just continue saving the model instances. - if ($this->usesTimestamps()) { - $this->updateTimestamps(); - } - - // Once we have run the update operation, we will fire the "updated" event for - // this model instance. This will allow developers to hook into these after - // models are updated, giving them a chance to do any special processing. - $dirty = $this->getDirty(); - - if (count($dirty) > 0) { - $this->setKeysForSaveQuery($query)->update($dirty); - - $this->fireModelEvent('updated', false); - - $this->syncChanges(); - } - - return true; - } - - /** - * Set the keys for a save update query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function setKeysForSaveQuery(Builder $query) - { - $query->where($this->getKeyName(), '=', $this->getKeyForSaveQuery()); - - return $query; - } - - /** - * Get the primary key value for a save query. - * - * @return mixed - */ - protected function getKeyForSaveQuery() - { - return $this->original[$this->getKeyName()] - ?? $this->getKey(); - } - - /** - * Perform a model insert operation. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return bool - */ - protected function performInsert(Builder $query) - { - if ($this->fireModelEvent('creating') === false) { - return false; - } - - // First we'll need to create a fresh query instance and touch the creation and - // update timestamps on this model, which are maintained by us for developer - // convenience. After, we will just continue saving these model instances. - if ($this->usesTimestamps()) { - $this->updateTimestamps(); - } - - // If the model has an incrementing key, we can use the "insertGetId" method on - // the query builder, which will give us back the final inserted ID for this - // table from the database. Not all tables have to be incrementing though. - $attributes = $this->getAttributes(); - - if ($this->getIncrementing()) { - $this->insertAndSetId($query, $attributes); - } - - // If the table isn't incrementing we'll simply insert these attributes as they - // are. These attribute arrays must contain an "id" column previously placed - // there by the developer as the manually determined key for these models. - else { - if (empty($attributes)) { - return true; - } - - $query->insert($attributes); - } - - // We will go ahead and set the exists property to true, so that it is set when - // the created event is fired, just in case the developer tries to update it - // during the event. This will allow them to do so and run an update here. - $this->exists = true; - - $this->wasRecentlyCreated = true; - - $this->fireModelEvent('created', false); - - return true; - } - - /** - * Insert the given attributes and set the ID on the model. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param array $attributes - * @return void - */ - protected function insertAndSetId(Builder $query, $attributes) - { - $id = $query->insertGetId($attributes, $keyName = $this->getKeyName()); - - $this->setAttribute($keyName, $id); - } - - /** - * Destroy the models for the given IDs. - * - * @param array|int $ids - * @return int - */ - public static function destroy($ids) - { - // We'll initialize a count here so we will return the total number of deletes - // for the operation. The developers can then check this number as a boolean - // type value or get this total count of records deleted for logging, etc. - $count = 0; - - $ids = is_array($ids) ? $ids : func_get_args(); - - // We will actually pull the models from the database table and call delete on - // each of them individually so that their events get fired properly with a - // correct set of attributes in case the developers wants to check these. - $key = ($instance = new static)->getKeyName(); - - foreach ($instance->whereIn($key, $ids)->get() as $model) { - if ($model->delete()) { - $count++; - } - } - - return $count; - } - - /** - * Delete the model from the database. - * - * @return bool|null - * - * @throws \Exception - */ - public function delete() - { - if (is_null($this->getKeyName())) { - throw new Exception('No primary key defined on model.'); - } - - // If the model doesn't exist, there is nothing to delete so we'll just return - // immediately and not do anything else. Otherwise, we will continue with a - // deletion process on the model, firing the proper events, and so forth. - if (! $this->exists) { - return; - } - - if ($this->fireModelEvent('deleting') === false) { - return false; - } - - // Here, we'll touch the owning models, verifying these timestamps get updated - // for the models. This will allow any caching to get broken on the parents - // by the timestamp. Then we will go ahead and delete the model instance. - $this->touchOwners(); - - $this->performDeleteOnModel(); - - // Once the model has been deleted, we will fire off the deleted event so that - // the developers may hook into post-delete operations. We will then return - // a boolean true as the delete is presumably successful on the database. - $this->fireModelEvent('deleted', false); - - return true; - } - - /** - * Force a hard delete on a soft deleted model. - * - * This method protects developers from running forceDelete when trait is missing. - * - * @return bool|null - */ - public function forceDelete() - { - return $this->delete(); - } - - /** - * Perform the actual delete query on this model instance. - * - * @return void - */ - protected function performDeleteOnModel() - { - $this->setKeysForSaveQuery($this->newModelQuery())->delete(); - - $this->exists = false; - } - - /** - * Begin querying the model. - * - * @return \Illuminate\Database\Eloquent\Builder - */ - public static function query() - { - return (new static)->newQuery(); - } - - /** - * Get a new query builder for the model's table. - * - * @return \Illuminate\Database\Eloquent\Builder - */ - public function newQuery() - { - return $this->registerGlobalScopes($this->newQueryWithoutScopes()); - } - - /** - * Get a new query builder that doesn't have any global scopes or eager loading. - * - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function newModelQuery() - { - return $this->newEloquentBuilder( - $this->newBaseQueryBuilder() - )->setModel($this); - } - - /** - * Get a new query builder with no relationships loaded. - * - * @return \Illuminate\Database\Eloquent\Builder - */ - public function newQueryWithoutRelationships() - { - return $this->registerGlobalScopes( - $this->newEloquentBuilder($this->newBaseQueryBuilder())->setModel($this) - ); - } - - /** - * Register the global scopes for this builder instance. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @return \Illuminate\Database\Eloquent\Builder - */ - public function registerGlobalScopes($builder) - { - foreach ($this->getGlobalScopes() as $identifier => $scope) { - $builder->withGlobalScope($identifier, $scope); - } - - return $builder; - } - - /** - * Get a new query builder that doesn't have any global scopes. - * - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function newQueryWithoutScopes() - { - return $this->newModelQuery() - ->with($this->with) - ->withCount($this->withCount); - } - - /** - * Get a new query instance without a given scope. - * - * @param \Illuminate\Database\Eloquent\Scope|string $scope - * @return \Illuminate\Database\Eloquent\Builder - */ - public function newQueryWithoutScope($scope) - { - $builder = $this->newQuery(); - - return $builder->withoutGlobalScope($scope); - } - - /** - * Get a new query to restore one or more models by their queueable IDs. - * - * @param array|int $ids - * @return \Illuminate\Database\Eloquent\Builder - */ - public function newQueryForRestoration($ids) - { - if (is_array($ids)) { - return $this->newQueryWithoutScopes()->whereIn($this->getQualifiedKeyName(), $ids); - } - - return $this->newQueryWithoutScopes()->whereKey($ids); - } - - /** - * Create a new Eloquent query builder for the model. - * - * @param \Illuminate\Database\Query\Builder $query - * @return \Illuminate\Database\Eloquent\Builder|static - */ - public function newEloquentBuilder($query) - { - return new Builder($query); - } - - /** - * Get a new query builder instance for the connection. - * - * @return \Illuminate\Database\Query\Builder - */ - protected function newBaseQueryBuilder() - { - $connection = $this->getConnection(); - - return new QueryBuilder( - $connection, $connection->getQueryGrammar(), $connection->getPostProcessor() - ); - } - - /** - * Create a new Eloquent Collection instance. - * - * @param array $models - * @return \Illuminate\Database\Eloquent\Collection - */ - public function newCollection(array $models = []) - { - return new Collection($models); - } - - /** - * Create a new pivot model instance. - * - * @param \Illuminate\Database\Eloquent\Model $parent - * @param array $attributes - * @param string $table - * @param bool $exists - * @param string|null $using - * @return \Illuminate\Database\Eloquent\Relations\Pivot - */ - public function newPivot(self $parent, array $attributes, $table, $exists, $using = null) - { - return $using ? $using::fromRawAttributes($parent, $attributes, $table, $exists) - : Pivot::fromAttributes($parent, $attributes, $table, $exists); - } - - /** - * Convert the model instance to an array. - * - * @return array - */ - public function toArray() - { - return array_merge($this->attributesToArray(), $this->relationsToArray()); - } - - /** - * Convert the model instance to JSON. - * - * @param int $options - * @return string - * - * @throws \Illuminate\Database\Eloquent\JsonEncodingException - */ - public function toJson($options = 0) - { - $json = json_encode($this->jsonSerialize(), $options); - - if (JSON_ERROR_NONE !== json_last_error()) { - throw JsonEncodingException::forModel($this, json_last_error_msg()); - } - - return $json; - } - - /** - * Convert the object into something JSON serializable. - * - * @return array - */ - public function jsonSerialize() - { - return $this->toArray(); - } - - /** - * Reload a fresh model instance from the database. - * - * @param array|string $with - * @return static|null - */ - public function fresh($with = []) - { - if (! $this->exists) { - return; - } - - return static::newQueryWithoutScopes() - ->with(is_string($with) ? func_get_args() : $with) - ->where($this->getKeyName(), $this->getKey()) - ->first(); - } - - /** - * Reload the current model instance with fresh attributes from the database. - * - * @return $this - */ - public function refresh() - { - if (! $this->exists) { - return $this; - } - - $this->setRawAttributes( - static::newQueryWithoutScopes()->findOrFail($this->getKey())->attributes - ); - - $this->load(collect($this->relations)->except('pivot')->keys()->toArray()); - - return $this; - } - - /** - * Clone the model into a new, non-existing instance. - * - * @param array|null $except - * @return \Illuminate\Database\Eloquent\Model - */ - public function replicate(array $except = null) - { - $defaults = [ - $this->getKeyName(), - $this->getCreatedAtColumn(), - $this->getUpdatedAtColumn(), - ]; - - $attributes = Arr::except( - $this->attributes, $except ? array_unique(array_merge($except, $defaults)) : $defaults - ); - - return tap(new static, function ($instance) use ($attributes) { - $instance->setRawAttributes($attributes); - - $instance->setRelations($this->relations); - }); - } - - /** - * Determine if two models have the same ID and belong to the same table. - * - * @param \Illuminate\Database\Eloquent\Model|null $model - * @return bool - */ - public function is($model) - { - return ! is_null($model) && - $this->getKey() === $model->getKey() && - $this->getTable() === $model->getTable() && - $this->getConnectionName() === $model->getConnectionName(); - } - - /** - * Determine if two models are not the same. - * - * @param \Illuminate\Database\Eloquent\Model|null $model - * @return bool - */ - public function isNot($model) - { - return ! $this->is($model); - } - - /** - * Get the database connection for the model. - * - * @return \Illuminate\Database\Connection - */ - public function getConnection() - { - return static::resolveConnection($this->getConnectionName()); - } - - /** - * Get the current connection name for the model. - * - * @return string - */ - public function getConnectionName() - { - return $this->connection; - } - - /** - * Set the connection associated with the model. - * - * @param string $name - * @return $this - */ - public function setConnection($name) - { - $this->connection = $name; - - return $this; - } - - /** - * Resolve a connection instance. - * - * @param string|null $connection - * @return \Illuminate\Database\Connection - */ - public static function resolveConnection($connection = null) - { - return static::$resolver->connection($connection); - } - - /** - * Get the connection resolver instance. - * - * @return \Illuminate\Database\ConnectionResolverInterface - */ - public static function getConnectionResolver() - { - return static::$resolver; - } - - /** - * Set the connection resolver instance. - * - * @param \Illuminate\Database\ConnectionResolverInterface $resolver - * @return void - */ - public static function setConnectionResolver(Resolver $resolver) - { - static::$resolver = $resolver; - } - - /** - * Unset the connection resolver for models. - * - * @return void - */ - public static function unsetConnectionResolver() - { - static::$resolver = null; - } - - /** - * Get the table associated with the model. - * - * @return string - */ - public function getTable() - { - if (! isset($this->table)) { - return str_replace( - '\\', '', Str::snake(Str::plural(class_basename($this))) - ); - } - - return $this->table; - } - - /** - * Set the table associated with the model. - * - * @param string $table - * @return $this - */ - public function setTable($table) - { - $this->table = $table; - - return $this; - } - - /** - * Get the primary key for the model. - * - * @return string - */ - public function getKeyName() - { - return $this->primaryKey; - } - - /** - * Set the primary key for the model. - * - * @param string $key - * @return $this - */ - public function setKeyName($key) - { - $this->primaryKey = $key; - - return $this; - } - - /** - * Get the table qualified key name. - * - * @return string - */ - public function getQualifiedKeyName() - { - return $this->qualifyColumn($this->getKeyName()); - } - - /** - * Get the auto-incrementing key type. - * - * @return string - */ - public function getKeyType() - { - return $this->keyType; - } - - /** - * Set the data type for the primary key. - * - * @param string $type - * @return $this - */ - public function setKeyType($type) - { - $this->keyType = $type; - - return $this; - } - - /** - * Get the value indicating whether the IDs are incrementing. - * - * @return bool - */ - public function getIncrementing() - { - return $this->incrementing; - } - - /** - * Set whether IDs are incrementing. - * - * @param bool $value - * @return $this - */ - public function setIncrementing($value) - { - $this->incrementing = $value; - - return $this; - } - - /** - * Get the value of the model's primary key. - * - * @return mixed - */ - public function getKey() - { - return $this->getAttribute($this->getKeyName()); - } - - /** - * Get the queueable identity for the entity. - * - * @return mixed - */ - public function getQueueableId() - { - return $this->getKey(); - } - - /** - * Get the queueable connection for the entity. - * - * @return mixed - */ - public function getQueueableConnection() - { - return $this->getConnectionName(); - } - - /** - * Get the value of the model's route key. - * - * @return mixed - */ - public function getRouteKey() - { - return $this->getAttribute($this->getRouteKeyName()); - } - - /** - * Get the route key for the model. - * - * @return string - */ - public function getRouteKeyName() - { - return $this->getKeyName(); - } - - /** - * Retrieve the model for a bound value. - * - * @param mixed $value - * @return \Illuminate\Database\Eloquent\Model|null - */ - public function resolveRouteBinding($value) - { - return $this->where($this->getRouteKeyName(), $value)->first(); - } - - /** - * Get the default foreign key name for the model. - * - * @return string - */ - public function getForeignKey() - { - return Str::snake(class_basename($this)).'_'.$this->getKeyName(); - } - - /** - * Get the number of models to return per page. - * - * @return int - */ - public function getPerPage() - { - return $this->perPage; - } - - /** - * Set the number of models to return per page. - * - * @param int $perPage - * @return $this - */ - public function setPerPage($perPage) - { - $this->perPage = $perPage; - - return $this; - } - - /** - * Dynamically retrieve attributes on the model. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - return $this->getAttribute($key); - } - - /** - * Dynamically set attributes on the model. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function __set($key, $value) - { - $this->setAttribute($key, $value); - } - - /** - * Determine if the given attribute exists. - * - * @param mixed $offset - * @return bool - */ - public function offsetExists($offset) - { - return ! is_null($this->getAttribute($offset)); - } - - /** - * Get the value for a given offset. - * - * @param mixed $offset - * @return mixed - */ - public function offsetGet($offset) - { - return $this->getAttribute($offset); - } - - /** - * Set the value for a given offset. - * - * @param mixed $offset - * @param mixed $value - * @return void - */ - public function offsetSet($offset, $value) - { - $this->setAttribute($offset, $value); - } - - /** - * Unset the value for a given offset. - * - * @param mixed $offset - * @return void - */ - public function offsetUnset($offset) - { - unset($this->attributes[$offset], $this->relations[$offset]); - } - - /** - * Determine if an attribute or relation exists on the model. - * - * @param string $key - * @return bool - */ - public function __isset($key) - { - return $this->offsetExists($key); - } - - /** - * Unset an attribute on the model. - * - * @param string $key - * @return void - */ - public function __unset($key) - { - $this->offsetUnset($key); - } - - /** - * Handle dynamic method calls into the model. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - if (in_array($method, ['increment', 'decrement'])) { - return $this->$method(...$parameters); - } - - return $this->newQuery()->$method(...$parameters); - } - - /** - * Handle dynamic static method calls into the method. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public static function __callStatic($method, $parameters) - { - return (new static)->$method(...$parameters); - } - - /** - * Convert the model to its string representation. - * - * @return string - */ - public function __toString() - { - return $this->toJson(); - } - - /** - * When a model is being unserialized, check if it needs to be booted. - * - * @return void - */ - public function __wakeup() - { - $this->bootIfNotBooted(); - } -} diff --git a/vendor/illuminate/database/Eloquent/ModelNotFoundException.php b/vendor/illuminate/database/Eloquent/ModelNotFoundException.php deleted file mode 100644 index c3db824..0000000 --- a/vendor/illuminate/database/Eloquent/ModelNotFoundException.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent; - -use RuntimeException; -use Illuminate\Support\Arr; - -class ModelNotFoundException extends RuntimeException -{ - /** - * Name of the affected Eloquent model. - * - * @var string - */ - protected $model; - - /** - * The affected model IDs. - * - * @var int|array - */ - protected $ids; - - /** - * Set the affected Eloquent model and instance ids. - * - * @param string $model - * @param int|array $ids - * @return $this - */ - public function setModel($model, $ids = []) - { - $this->model = $model; - $this->ids = Arr::wrap($ids); - - $this->message = "No query results for model [{$model}]"; - - if (count($this->ids) > 0) { - $this->message .= ' '.implode(', ', $this->ids); - } else { - $this->message .= '.'; - } - - return $this; - } - - /** - * Get the affected Eloquent model. - * - * @return string - */ - public function getModel() - { - return $this->model; - } - - /** - * Get the affected Eloquent model IDs. - * - * @return int|array - */ - public function getIds() - { - return $this->ids; - } -} diff --git a/vendor/illuminate/database/Eloquent/QueueEntityResolver.php b/vendor/illuminate/database/Eloquent/QueueEntityResolver.php deleted file mode 100644 index 22fccf2..0000000 --- a/vendor/illuminate/database/Eloquent/QueueEntityResolver.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent; - -use Illuminate\Contracts\Queue\EntityNotFoundException; -use Illuminate\Contracts\Queue\EntityResolver as EntityResolverContract; - -class QueueEntityResolver implements EntityResolverContract -{ - /** - * Resolve the entity for the given ID. - * - * @param string $type - * @param mixed $id - * @return mixed - * - * @throws \Illuminate\Contracts\Queue\EntityNotFoundException - */ - public function resolve($type, $id) - { - $instance = (new $type)->find($id); - - if ($instance) { - return $instance; - } - - throw new EntityNotFoundException($type, $id); - } -} diff --git a/vendor/illuminate/database/Eloquent/RelationNotFoundException.php b/vendor/illuminate/database/Eloquent/RelationNotFoundException.php deleted file mode 100644 index 088429c..0000000 --- a/vendor/illuminate/database/Eloquent/RelationNotFoundException.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent; - -use RuntimeException; - -class RelationNotFoundException extends RuntimeException -{ - /** - * The name of the affected Eloquent model. - * - * @var string - */ - public $model; - - /** - * The name of the relation. - * - * @var string - */ - public $relation; - - /** - * Create a new exception instance. - * - * @param mixed $model - * @param string $relation - * @return static - */ - public static function make($model, $relation) - { - $class = get_class($model); - - $instance = new static("Call to undefined relationship [{$relation}] on model [{$class}]."); - - $instance->model = $model; - $instance->relation = $relation; - - return $instance; - } -} diff --git a/vendor/illuminate/database/Eloquent/Relations/BelongsTo.php b/vendor/illuminate/database/Eloquent/Relations/BelongsTo.php deleted file mode 100644 index 7ba395b..0000000 --- a/vendor/illuminate/database/Eloquent/Relations/BelongsTo.php +++ /dev/null @@ -1,362 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Relations; - -use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Builder; -use Illuminate\Database\Eloquent\Collection; -use Illuminate\Database\Eloquent\Relations\Concerns\SupportsDefaultModels; - -/** - * @mixin \Illuminate\Database\Eloquent\Builder - */ -class BelongsTo extends Relation -{ - use SupportsDefaultModels; - - /** - * The child model instance of the relation. - */ - protected $child; - - /** - * The foreign key of the parent model. - * - * @var string - */ - protected $foreignKey; - - /** - * The associated key on the parent model. - * - * @var string - */ - protected $ownerKey; - - /** - * The name of the relationship. - * - * @var string - */ - protected $relation; - - /** - * The count of self joins. - * - * @var int - */ - protected static $selfJoinCount = 0; - - /** - * Create a new belongs to relationship instance. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $child - * @param string $foreignKey - * @param string $ownerKey - * @param string $relation - * @return void - */ - public function __construct(Builder $query, Model $child, $foreignKey, $ownerKey, $relation) - { - $this->ownerKey = $ownerKey; - $this->relation = $relation; - $this->foreignKey = $foreignKey; - - // In the underlying base relationship class, this variable is referred to as - // the "parent" since most relationships are not inversed. But, since this - // one is we will create a "child" variable for much better readability. - $this->child = $child; - - parent::__construct($query, $child); - } - - /** - * Get the results of the relationship. - * - * @return mixed - */ - public function getResults() - { - return $this->query->first() ?: $this->getDefaultFor($this->parent); - } - - /** - * Set the base constraints on the relation query. - * - * @return void - */ - public function addConstraints() - { - if (static::$constraints) { - // For belongs to relationships, which are essentially the inverse of has one - // or has many relationships, we need to actually query on the primary key - // of the related models matching on the foreign key that's on a parent. - $table = $this->related->getTable(); - - $this->query->where($table.'.'.$this->ownerKey, '=', $this->child->{$this->foreignKey}); - } - } - - /** - * Set the constraints for an eager load of the relation. - * - * @param array $models - * @return void - */ - public function addEagerConstraints(array $models) - { - // We'll grab the primary key name of the related models since it could be set to - // a non-standard name and not "id". We will then construct the constraint for - // our eagerly loading query so it returns the proper models from execution. - $key = $this->related->getTable().'.'.$this->ownerKey; - - $this->query->whereIn($key, $this->getEagerModelKeys($models)); - } - - /** - * Gather the keys from an array of related models. - * - * @param array $models - * @return array - */ - protected function getEagerModelKeys(array $models) - { - $keys = []; - - // First we need to gather all of the keys from the parent models so we know what - // to query for via the eager loading query. We will add them to an array then - // execute a "where in" statement to gather up all of those related records. - foreach ($models as $model) { - if (! is_null($value = $model->{$this->foreignKey})) { - $keys[] = $value; - } - } - - // If there are no keys that were not null we will just return an array with null - // so this query wont fail plus returns zero results, which should be what the - // developer expects to happen in this situation. Otherwise we'll sort them. - if (count($keys) === 0) { - return [null]; - } - - sort($keys); - - return array_values(array_unique($keys)); - } - - /** - * Initialize the relation on a set of models. - * - * @param array $models - * @param string $relation - * @return array - */ - public function initRelation(array $models, $relation) - { - foreach ($models as $model) { - $model->setRelation($relation, $this->getDefaultFor($model)); - } - - return $models; - } - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function match(array $models, Collection $results, $relation) - { - $foreign = $this->foreignKey; - - $owner = $this->ownerKey; - - // First we will get to build a dictionary of the child models by their primary - // key of the relationship, then we can easily match the children back onto - // the parents using that dictionary and the primary key of the children. - $dictionary = []; - - foreach ($results as $result) { - $dictionary[$result->getAttribute($owner)] = $result; - } - - // Once we have the dictionary constructed, we can loop through all the parents - // and match back onto their children using these keys of the dictionary and - // the primary key of the children to map them onto the correct instances. - foreach ($models as $model) { - if (isset($dictionary[$model->{$foreign}])) { - $model->setRelation($relation, $dictionary[$model->{$foreign}]); - } - } - - return $models; - } - - /** - * Update the parent model on the relationship. - * - * @param array $attributes - * @return mixed - */ - public function update(array $attributes) - { - return $this->getResults()->fill($attributes)->save(); - } - - /** - * Associate the model instance to the given parent. - * - * @param \Illuminate\Database\Eloquent\Model|int|string $model - * @return \Illuminate\Database\Eloquent\Model - */ - public function associate($model) - { - $ownerKey = $model instanceof Model ? $model->getAttribute($this->ownerKey) : $model; - - $this->child->setAttribute($this->foreignKey, $ownerKey); - - if ($model instanceof Model) { - $this->child->setRelation($this->relation, $model); - } - - return $this->child; - } - - /** - * Dissociate previously associated model from the given parent. - * - * @return \Illuminate\Database\Eloquent\Model - */ - public function dissociate() - { - $this->child->setAttribute($this->foreignKey, null); - - return $this->child->setRelation($this->relation, null); - } - - /** - * Add the constraints for a relationship query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) - { - if ($parentQuery->getQuery()->from == $query->getQuery()->from) { - return $this->getRelationExistenceQueryForSelfRelation($query, $parentQuery, $columns); - } - - return $query->select($columns)->whereColumn( - $this->getQualifiedForeignKey(), '=', $query->qualifyColumn($this->ownerKey) - ); - } - - /** - * Add the constraints for a relationship query on the same table. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQueryForSelfRelation(Builder $query, Builder $parentQuery, $columns = ['*']) - { - $query->select($columns)->from( - $query->getModel()->getTable().' as '.$hash = $this->getRelationCountHash() - ); - - $query->getModel()->setTable($hash); - - return $query->whereColumn( - $hash.'.'.$query->getModel()->getKeyName(), '=', $this->getQualifiedForeignKey() - ); - } - - /** - * Get a relationship join table hash. - * - * @return string - */ - public function getRelationCountHash() - { - return 'laravel_reserved_'.static::$selfJoinCount++; - } - - /** - * Determine if the related model has an auto-incrementing ID. - * - * @return bool - */ - protected function relationHasIncrementingId() - { - return $this->related->getIncrementing() && - $this->related->getKeyType() === 'int'; - } - - /** - * Make a new related instance for the given model. - * - * @param \Illuminate\Database\Eloquent\Model $parent - * @return \Illuminate\Database\Eloquent\Model - */ - protected function newRelatedInstanceFor(Model $parent) - { - return $this->related->newInstance(); - } - - /** - * Get the foreign key of the relationship. - * - * @return string - */ - public function getForeignKey() - { - return $this->foreignKey; - } - - /** - * Get the fully qualified foreign key of the relationship. - * - * @return string - */ - public function getQualifiedForeignKey() - { - return $this->child->qualifyColumn($this->foreignKey); - } - - /** - * Get the associated key of the relationship. - * - * @return string - */ - public function getOwnerKey() - { - return $this->ownerKey; - } - - /** - * Get the fully qualified associated key of the relationship. - * - * @return string - */ - public function getQualifiedOwnerKeyName() - { - return $this->related->qualifyColumn($this->ownerKey); - } - - /** - * Get the name of the relationship. - * - * @return string - */ - public function getRelation() - { - return $this->relation; - } -} diff --git a/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php b/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php deleted file mode 100644 index 7a1652e..0000000 --- a/vendor/illuminate/database/Eloquent/Relations/BelongsToMany.php +++ /dev/null @@ -1,994 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Relations; - -use Illuminate\Support\Str; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Builder; -use Illuminate\Database\Eloquent\Collection; -use Illuminate\Database\Eloquent\ModelNotFoundException; - -class BelongsToMany extends Relation -{ - use Concerns\InteractsWithPivotTable; - - /** - * The intermediate table for the relation. - * - * @var string - */ - protected $table; - - /** - * The foreign key of the parent model. - * - * @var string - */ - protected $foreignPivotKey; - - /** - * The associated key of the relation. - * - * @var string - */ - protected $relatedPivotKey; - - /** - * The key name of the parent model. - * - * @var string - */ - protected $parentKey; - - /** - * The key name of the related model. - * - * @var string - */ - protected $relatedKey; - - /** - * The "name" of the relationship. - * - * @var string - */ - protected $relationName; - - /** - * The pivot table columns to retrieve. - * - * @var array - */ - protected $pivotColumns = []; - - /** - * Any pivot table restrictions for where clauses. - * - * @var array - */ - protected $pivotWheres = []; - - /** - * Any pivot table restrictions for whereIn clauses. - * - * @var array - */ - protected $pivotWhereIns = []; - - /** - * Indicates if timestamps are available on the pivot table. - * - * @var bool - */ - public $withTimestamps = false; - - /** - * The custom pivot table column for the created_at timestamp. - * - * @var string - */ - protected $pivotCreatedAt; - - /** - * The custom pivot table column for the updated_at timestamp. - * - * @var string - */ - protected $pivotUpdatedAt; - - /** - * The class name of the custom pivot model to use for the relationship. - * - * @var string - */ - protected $using; - - /** - * The name of the accessor to use for the "pivot" relationship. - * - * @var string - */ - protected $accessor = 'pivot'; - - /** - * The count of self joins. - * - * @var int - */ - protected static $selfJoinCount = 0; - - /** - * Create a new belongs to many relationship instance. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $table - * @param string $foreignPivotKey - * @param string $relatedPivotKey - * @param string $parentKey - * @param string $relatedKey - * @param string $relationName - * @return void - */ - public function __construct(Builder $query, Model $parent, $table, $foreignPivotKey, - $relatedPivotKey, $parentKey, $relatedKey, $relationName = null) - { - $this->table = $table; - $this->parentKey = $parentKey; - $this->relatedKey = $relatedKey; - $this->relationName = $relationName; - $this->relatedPivotKey = $relatedPivotKey; - $this->foreignPivotKey = $foreignPivotKey; - - parent::__construct($query, $parent); - } - - /** - * Set the base constraints on the relation query. - * - * @return void - */ - public function addConstraints() - { - $this->performJoin(); - - if (static::$constraints) { - $this->addWhereConstraints(); - } - } - - /** - * Set the join clause for the relation query. - * - * @param \Illuminate\Database\Eloquent\Builder|null $query - * @return $this - */ - protected function performJoin($query = null) - { - $query = $query ?: $this->query; - - // We need to join to the intermediate table on the related model's primary - // key column with the intermediate table's foreign key for the related - // model instance. Then we can set the "where" for the parent models. - $baseTable = $this->related->getTable(); - - $key = $baseTable.'.'.$this->relatedKey; - - $query->join($this->table, $key, '=', $this->getQualifiedRelatedPivotKeyName()); - - return $this; - } - - /** - * Set the where clause for the relation query. - * - * @return $this - */ - protected function addWhereConstraints() - { - $this->query->where( - $this->getQualifiedForeignPivotKeyName(), '=', $this->parent->{$this->parentKey} - ); - - return $this; - } - - /** - * Set the constraints for an eager load of the relation. - * - * @param array $models - * @return void - */ - public function addEagerConstraints(array $models) - { - $this->query->whereIn($this->getQualifiedForeignPivotKeyName(), $this->getKeys($models, $this->parentKey)); - } - - /** - * Initialize the relation on a set of models. - * - * @param array $models - * @param string $relation - * @return array - */ - public function initRelation(array $models, $relation) - { - foreach ($models as $model) { - $model->setRelation($relation, $this->related->newCollection()); - } - - return $models; - } - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function match(array $models, Collection $results, $relation) - { - $dictionary = $this->buildDictionary($results); - - // Once we have an array dictionary of child objects we can easily match the - // children back to their parent using the dictionary and the keys on the - // the parent models. Then we will return the hydrated models back out. - foreach ($models as $model) { - if (isset($dictionary[$key = $model->{$this->parentKey}])) { - $model->setRelation( - $relation, $this->related->newCollection($dictionary[$key]) - ); - } - } - - return $models; - } - - /** - * Build model dictionary keyed by the relation's foreign key. - * - * @param \Illuminate\Database\Eloquent\Collection $results - * @return array - */ - protected function buildDictionary(Collection $results) - { - // First we will build a dictionary of child models keyed by the foreign key - // of the relation so that we will easily and quickly match them to their - // parents without having a possibly slow inner loops for every models. - $dictionary = []; - - foreach ($results as $result) { - $dictionary[$result->{$this->accessor}->{$this->foreignPivotKey}][] = $result; - } - - return $dictionary; - } - - /** - * Specify the custom pivot model to use for the relationship. - * - * @param string $class - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - public function using($class) - { - $this->using = $class; - - return $this; - } - - /** - * Specify the custom pivot accessor to use for the relationship. - * - * @param string $accessor - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - public function as($accessor) - { - $this->accessor = $accessor; - - return $this; - } - - /** - * Set a where clause for a pivot table column. - * - * @param string $column - * @param string $operator - * @param mixed $value - * @param string $boolean - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - public function wherePivot($column, $operator = null, $value = null, $boolean = 'and') - { - $this->pivotWheres[] = func_get_args(); - - return $this->where($this->table.'.'.$column, $operator, $value, $boolean); - } - - /** - * Set a "where in" clause for a pivot table column. - * - * @param string $column - * @param mixed $values - * @param string $boolean - * @param bool $not - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - public function wherePivotIn($column, $values, $boolean = 'and', $not = false) - { - $this->pivotWhereIns[] = func_get_args(); - - return $this->whereIn($this->table.'.'.$column, $values, $boolean, $not); - } - - /** - * Set an "or where" clause for a pivot table column. - * - * @param string $column - * @param string $operator - * @param mixed $value - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - public function orWherePivot($column, $operator = null, $value = null) - { - return $this->wherePivot($column, $operator, $value, 'or'); - } - - /** - * Set an "or where in" clause for a pivot table column. - * - * @param string $column - * @param mixed $values - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - public function orWherePivotIn($column, $values) - { - return $this->wherePivotIn($column, $values, 'or'); - } - - /** - * Find a related model by its primary key or return new instance of the related model. - * - * @param mixed $id - * @param array $columns - * @return \Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model - */ - public function findOrNew($id, $columns = ['*']) - { - if (is_null($instance = $this->find($id, $columns))) { - $instance = $this->related->newInstance(); - } - - return $instance; - } - - /** - * Get the first related model record matching the attributes or instantiate it. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model - */ - public function firstOrNew(array $attributes) - { - if (is_null($instance = $this->where($attributes)->first())) { - $instance = $this->related->newInstance($attributes); - } - - return $instance; - } - - /** - * Get the first related record matching the attributes or create it. - * - * @param array $attributes - * @param array $joining - * @param bool $touch - * @return \Illuminate\Database\Eloquent\Model - */ - public function firstOrCreate(array $attributes, array $joining = [], $touch = true) - { - if (is_null($instance = $this->where($attributes)->first())) { - $instance = $this->create($attributes, $joining, $touch); - } - - return $instance; - } - - /** - * Create or update a related record matching the attributes, and fill it with values. - * - * @param array $attributes - * @param array $values - * @param array $joining - * @param bool $touch - * @return \Illuminate\Database\Eloquent\Model - */ - public function updateOrCreate(array $attributes, array $values = [], array $joining = [], $touch = true) - { - if (is_null($instance = $this->where($attributes)->first())) { - return $this->create($values, $joining, $touch); - } - - $instance->fill($values); - - $instance->save(['touch' => false]); - - return $instance; - } - - /** - * Find a related model by its primary key. - * - * @param mixed $id - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|null - */ - public function find($id, $columns = ['*']) - { - return is_array($id) ? $this->findMany($id, $columns) : $this->where( - $this->getRelated()->getQualifiedKeyName(), '=', $id - )->first($columns); - } - - /** - * Find multiple related models by their primary keys. - * - * @param mixed $ids - * @param array $columns - * @return \Illuminate\Database\Eloquent\Collection - */ - public function findMany($ids, $columns = ['*']) - { - return empty($ids) ? $this->getRelated()->newCollection() : $this->whereIn( - $this->getRelated()->getQualifiedKeyName(), $ids - )->get($columns); - } - - /** - * Find a related model by its primary key or throw an exception. - * - * @param mixed $id - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException - */ - public function findOrFail($id, $columns = ['*']) - { - $result = $this->find($id, $columns); - - if (is_array($id)) { - if (count($result) == count(array_unique($id))) { - return $result; - } - } elseif (! is_null($result)) { - return $result; - } - - throw (new ModelNotFoundException)->setModel(get_class($this->related)); - } - - /** - * Execute the query and get the first result. - * - * @param array $columns - * @return mixed - */ - public function first($columns = ['*']) - { - $results = $this->take(1)->get($columns); - - return count($results) > 0 ? $results->first() : null; - } - - /** - * Execute the query and get the first result or throw an exception. - * - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model|static - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException - */ - public function firstOrFail($columns = ['*']) - { - if (! is_null($model = $this->first($columns))) { - return $model; - } - - throw (new ModelNotFoundException)->setModel(get_class($this->related)); - } - - /** - * Get the results of the relationship. - * - * @return mixed - */ - public function getResults() - { - return $this->get(); - } - - /** - * Execute the query as a "select" statement. - * - * @param array $columns - * @return \Illuminate\Database\Eloquent\Collection - */ - public function get($columns = ['*']) - { - // First we'll add the proper select columns onto the query so it is run with - // the proper columns. Then, we will get the results and hydrate out pivot - // models with the result of those columns as a separate model relation. - $columns = $this->query->getQuery()->columns ? [] : $columns; - - $builder = $this->query->applyScopes(); - - $models = $builder->addSelect( - $this->shouldSelect($columns) - )->getModels(); - - $this->hydratePivotRelation($models); - - // If we actually found models we will also eager load any relationships that - // have been specified as needing to be eager loaded. This will solve the - // n + 1 query problem for the developer and also increase performance. - if (count($models) > 0) { - $models = $builder->eagerLoadRelations($models); - } - - return $this->related->newCollection($models); - } - - /** - * Get the select columns for the relation query. - * - * @param array $columns - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - protected function shouldSelect(array $columns = ['*']) - { - if ($columns == ['*']) { - $columns = [$this->related->getTable().'.*']; - } - - return array_merge($columns, $this->aliasedPivotColumns()); - } - - /** - * Get the pivot columns for the relation. - * - * "pivot_" is prefixed ot each column for easy removal later. - * - * @return array - */ - protected function aliasedPivotColumns() - { - $defaults = [$this->foreignPivotKey, $this->relatedPivotKey]; - - return collect(array_merge($defaults, $this->pivotColumns))->map(function ($column) { - return $this->table.'.'.$column.' as pivot_'.$column; - })->unique()->all(); - } - - /** - * Get a paginator for the "select" statement. - * - * @param int $perPage - * @param array $columns - * @param string $pageName - * @param int|null $page - * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator - */ - public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) - { - $this->query->addSelect($this->shouldSelect($columns)); - - return tap($this->query->paginate($perPage, $columns, $pageName, $page), function ($paginator) { - $this->hydratePivotRelation($paginator->items()); - }); - } - - /** - * Paginate the given query into a simple paginator. - * - * @param int $perPage - * @param array $columns - * @param string $pageName - * @param int|null $page - * @return \Illuminate\Contracts\Pagination\Paginator - */ - public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) - { - $this->query->addSelect($this->shouldSelect($columns)); - - return tap($this->query->simplePaginate($perPage, $columns, $pageName, $page), function ($paginator) { - $this->hydratePivotRelation($paginator->items()); - }); - } - - /** - * Chunk the results of the query. - * - * @param int $count - * @param callable $callback - * @return bool - */ - public function chunk($count, callable $callback) - { - $this->query->addSelect($this->shouldSelect()); - - return $this->query->chunk($count, function ($results) use ($callback) { - $this->hydratePivotRelation($results->all()); - - return $callback($results); - }); - } - - /** - * Hydrate the pivot table relationship on the models. - * - * @param array $models - * @return void - */ - protected function hydratePivotRelation(array $models) - { - // To hydrate the pivot relationship, we will just gather the pivot attributes - // and create a new Pivot model, which is basically a dynamic model that we - // will set the attributes, table, and connections on it so it will work. - foreach ($models as $model) { - $model->setRelation($this->accessor, $this->newExistingPivot( - $this->migratePivotAttributes($model) - )); - } - } - - /** - * Get the pivot attributes from a model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return array - */ - protected function migratePivotAttributes(Model $model) - { - $values = []; - - foreach ($model->getAttributes() as $key => $value) { - // To get the pivots attributes we will just take any of the attributes which - // begin with "pivot_" and add those to this arrays, as well as unsetting - // them from the parent's models since they exist in a different table. - if (strpos($key, 'pivot_') === 0) { - $values[substr($key, 6)] = $value; - - unset($model->$key); - } - } - - return $values; - } - - /** - * If we're touching the parent model, touch. - * - * @return void - */ - public function touchIfTouching() - { - if ($this->touchingParent()) { - $this->getParent()->touch(); - } - - if ($this->getParent()->touches($this->relationName)) { - $this->touch(); - } - } - - /** - * Determine if we should touch the parent on sync. - * - * @return bool - */ - protected function touchingParent() - { - return $this->getRelated()->touches($this->guessInverseRelation()); - } - - /** - * Attempt to guess the name of the inverse of the relation. - * - * @return string - */ - protected function guessInverseRelation() - { - return Str::camel(Str::plural(class_basename($this->getParent()))); - } - - /** - * Touch all of the related models for the relationship. - * - * E.g.: Touch all roles associated with this user. - * - * @return void - */ - public function touch() - { - $key = $this->getRelated()->getKeyName(); - - $columns = [ - $this->related->getUpdatedAtColumn() => $this->related->freshTimestampString(), - ]; - - // If we actually have IDs for the relation, we will run the query to update all - // the related model's timestamps, to make sure these all reflect the changes - // to the parent models. This will help us keep any caching synced up here. - if (count($ids = $this->allRelatedIds()) > 0) { - $this->getRelated()->newQuery()->whereIn($key, $ids)->update($columns); - } - } - - /** - * Get all of the IDs for the related models. - * - * @return \Illuminate\Support\Collection - */ - public function allRelatedIds() - { - return $this->newPivotQuery()->pluck($this->relatedPivotKey); - } - - /** - * Save a new model and attach it to the parent model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @param array $pivotAttributes - * @param bool $touch - * @return \Illuminate\Database\Eloquent\Model - */ - public function save(Model $model, array $pivotAttributes = [], $touch = true) - { - $model->save(['touch' => false]); - - $this->attach($model, $pivotAttributes, $touch); - - return $model; - } - - /** - * Save an array of new models and attach them to the parent model. - * - * @param \Illuminate\Support\Collection|array $models - * @param array $pivotAttributes - * @return array - */ - public function saveMany($models, array $pivotAttributes = []) - { - foreach ($models as $key => $model) { - $this->save($model, (array) ($pivotAttributes[$key] ?? []), false); - } - - $this->touchIfTouching(); - - return $models; - } - - /** - * Create a new instance of the related model. - * - * @param array $attributes - * @param array $joining - * @param bool $touch - * @return \Illuminate\Database\Eloquent\Model - */ - public function create(array $attributes = [], array $joining = [], $touch = true) - { - $instance = $this->related->newInstance($attributes); - - // Once we save the related model, we need to attach it to the base model via - // through intermediate table so we'll use the existing "attach" method to - // accomplish this which will insert the record and any more attributes. - $instance->save(['touch' => false]); - - $this->attach($instance, $joining, $touch); - - return $instance; - } - - /** - * Create an array of new instances of the related models. - * - * @param array $records - * @param array $joinings - * @return array - */ - public function createMany(array $records, array $joinings = []) - { - $instances = []; - - foreach ($records as $key => $record) { - $instances[] = $this->create($record, (array) ($joinings[$key] ?? []), false); - } - - $this->touchIfTouching(); - - return $instances; - } - - /** - * Add the constraints for a relationship query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) - { - if ($parentQuery->getQuery()->from == $query->getQuery()->from) { - return $this->getRelationExistenceQueryForSelfJoin($query, $parentQuery, $columns); - } - - $this->performJoin($query); - - return parent::getRelationExistenceQuery($query, $parentQuery, $columns); - } - - /** - * Add the constraints for a relationship query on the same table. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQueryForSelfJoin(Builder $query, Builder $parentQuery, $columns = ['*']) - { - $query->select($columns); - - $query->from($this->related->getTable().' as '.$hash = $this->getRelationCountHash()); - - $this->related->setTable($hash); - - $this->performJoin($query); - - return parent::getRelationExistenceQuery($query, $parentQuery, $columns); - } - - /** - * Get the key for comparing against the parent key in "has" query. - * - * @return string - */ - public function getExistenceCompareKey() - { - return $this->getQualifiedForeignPivotKeyName(); - } - - /** - * Get a relationship join table hash. - * - * @return string - */ - public function getRelationCountHash() - { - return 'laravel_reserved_'.static::$selfJoinCount++; - } - - /** - * Specify that the pivot table has creation and update timestamps. - * - * @param mixed $createdAt - * @param mixed $updatedAt - * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany - */ - public function withTimestamps($createdAt = null, $updatedAt = null) - { - $this->withTimestamps = true; - - $this->pivotCreatedAt = $createdAt; - $this->pivotUpdatedAt = $updatedAt; - - return $this->withPivot($this->createdAt(), $this->updatedAt()); - } - - /** - * Get the name of the "created at" column. - * - * @return string - */ - public function createdAt() - { - return $this->pivotCreatedAt ?: $this->parent->getCreatedAtColumn(); - } - - /** - * Get the name of the "updated at" column. - * - * @return string - */ - public function updatedAt() - { - return $this->pivotUpdatedAt ?: $this->parent->getUpdatedAtColumn(); - } - - /** - * Get the foreign key for the relation. - * - * @return string - */ - public function getForeignPivotKeyName() - { - return $this->foreignPivotKey; - } - - /** - * Get the fully qualified foreign key for the relation. - * - * @return string - */ - public function getQualifiedForeignPivotKeyName() - { - return $this->table.'.'.$this->foreignPivotKey; - } - - /** - * Get the "related key" for the relation. - * - * @return string - */ - public function getRelatedPivotKeyName() - { - return $this->relatedPivotKey; - } - - /** - * Get the fully qualified "related key" for the relation. - * - * @return string - */ - public function getQualifiedRelatedPivotKeyName() - { - return $this->table.'.'.$this->relatedPivotKey; - } - - /** - * Get the fully qualified parent key name for the relation. - * - * @return string - */ - public function getQualifiedParentKeyName() - { - return $this->parent->qualifyColumn($this->parentKey); - } - - /** - * Get the intermediate table for the relationship. - * - * @return string - */ - public function getTable() - { - return $this->table; - } - - /** - * Get the relationship name for the relationship. - * - * @return string - */ - public function getRelationName() - { - return $this->relationName; - } - - /** - * Get the name of the pivot accessor for this relationship. - * - * @return string - */ - public function getPivotAccessor() - { - return $this->accessor; - } -} diff --git a/vendor/illuminate/database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php b/vendor/illuminate/database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php deleted file mode 100644 index 0a6f7cf..0000000 --- a/vendor/illuminate/database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php +++ /dev/null @@ -1,517 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Relations\Concerns; - -use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Collection; -use Illuminate\Support\Collection as BaseCollection; - -trait InteractsWithPivotTable -{ - /** - * Toggles a model (or models) from the parent. - * - * Each existing model is detached, and non existing ones are attached. - * - * @param mixed $ids - * @param bool $touch - * @return array - */ - public function toggle($ids, $touch = true) - { - $changes = [ - 'attached' => [], 'detached' => [], - ]; - - $records = $this->formatRecordsList($this->parseIds($ids)); - - // Next, we will determine which IDs should get removed from the join table by - // checking which of the given ID/records is in the list of current records - // and removing all of those rows from this "intermediate" joining table. - $detach = array_values(array_intersect( - $this->newPivotQuery()->pluck($this->relatedPivotKey)->all(), - array_keys($records) - )); - - if (count($detach) > 0) { - $this->detach($detach, false); - - $changes['detached'] = $this->castKeys($detach); - } - - // Finally, for all of the records which were not "detached", we'll attach the - // records into the intermediate table. Then, we will add those attaches to - // this change list and get ready to return these results to the callers. - $attach = array_diff_key($records, array_flip($detach)); - - if (count($attach) > 0) { - $this->attach($attach, [], false); - - $changes['attached'] = array_keys($attach); - } - - // Once we have finished attaching or detaching the records, we will see if we - // have done any attaching or detaching, and if we have we will touch these - // relationships if they are configured to touch on any database updates. - if ($touch && (count($changes['attached']) || - count($changes['detached']))) { - $this->touchIfTouching(); - } - - return $changes; - } - - /** - * Sync the intermediate tables with a list of IDs without detaching. - * - * @param \Illuminate\Database\Eloquent\Collection|\Illuminate\Support\Collection|array $ids - * @return array - */ - public function syncWithoutDetaching($ids) - { - return $this->sync($ids, false); - } - - /** - * Sync the intermediate tables with a list of IDs or collection of models. - * - * @param \Illuminate\Database\Eloquent\Collection|\Illuminate\Support\Collection|array $ids - * @param bool $detaching - * @return array - */ - public function sync($ids, $detaching = true) - { - $changes = [ - 'attached' => [], 'detached' => [], 'updated' => [], - ]; - - // First we need to attach any of the associated models that are not currently - // in this joining table. We'll spin through the given IDs, checking to see - // if they exist in the array of current ones, and if not we will insert. - $current = $this->newPivotQuery()->pluck( - $this->relatedPivotKey - )->all(); - - $detach = array_diff($current, array_keys( - $records = $this->formatRecordsList($this->parseIds($ids)) - )); - - // Next, we will take the differences of the currents and given IDs and detach - // all of the entities that exist in the "current" array but are not in the - // array of the new IDs given to the method which will complete the sync. - if ($detaching && count($detach) > 0) { - $this->detach($detach); - - $changes['detached'] = $this->castKeys($detach); - } - - // Now we are finally ready to attach the new records. Note that we'll disable - // touching until after the entire operation is complete so we don't fire a - // ton of touch operations until we are totally done syncing the records. - $changes = array_merge( - $changes, $this->attachNew($records, $current, false) - ); - - // Once we have finished attaching or detaching the records, we will see if we - // have done any attaching or detaching, and if we have we will touch these - // relationships if they are configured to touch on any database updates. - if (count($changes['attached']) || - count($changes['updated'])) { - $this->touchIfTouching(); - } - - return $changes; - } - - /** - * Format the sync / toggle record list so that it is keyed by ID. - * - * @param array $records - * @return array - */ - protected function formatRecordsList(array $records) - { - return collect($records)->mapWithKeys(function ($attributes, $id) { - if (! is_array($attributes)) { - list($id, $attributes) = [$attributes, []]; - } - - return [$id => $attributes]; - })->all(); - } - - /** - * Attach all of the records that aren't in the given current records. - * - * @param array $records - * @param array $current - * @param bool $touch - * @return array - */ - protected function attachNew(array $records, array $current, $touch = true) - { - $changes = ['attached' => [], 'updated' => []]; - - foreach ($records as $id => $attributes) { - // If the ID is not in the list of existing pivot IDs, we will insert a new pivot - // record, otherwise, we will just update this existing record on this joining - // table, so that the developers will easily update these records pain free. - if (! in_array($id, $current)) { - $this->attach($id, $attributes, $touch); - - $changes['attached'][] = $this->castKey($id); - } - - // Now we'll try to update an existing pivot record with the attributes that were - // given to the method. If the model is actually updated we will add it to the - // list of updated pivot records so we return them back out to the consumer. - elseif (count($attributes) > 0 && - $this->updateExistingPivot($id, $attributes, $touch)) { - $changes['updated'][] = $this->castKey($id); - } - } - - return $changes; - } - - /** - * Update an existing pivot record on the table. - * - * @param mixed $id - * @param array $attributes - * @param bool $touch - * @return int - */ - public function updateExistingPivot($id, array $attributes, $touch = true) - { - if (in_array($this->updatedAt(), $this->pivotColumns)) { - $attributes = $this->addTimestampsToAttachment($attributes, true); - } - - $updated = $this->newPivotStatementForId($id)->update( - $this->castAttributes($attributes) - ); - - if ($touch) { - $this->touchIfTouching(); - } - - return $updated; - } - - /** - * Attach a model to the parent. - * - * @param mixed $id - * @param array $attributes - * @param bool $touch - * @return void - */ - public function attach($id, array $attributes = [], $touch = true) - { - // Here we will insert the attachment records into the pivot table. Once we have - // inserted the records, we will touch the relationships if necessary and the - // function will return. We can parse the IDs before inserting the records. - $this->newPivotStatement()->insert($this->formatAttachRecords( - $this->parseIds($id), $attributes - )); - - if ($touch) { - $this->touchIfTouching(); - } - } - - /** - * Create an array of records to insert into the pivot table. - * - * @param array $ids - * @param array $attributes - * @return array - */ - protected function formatAttachRecords($ids, array $attributes) - { - $records = []; - - $hasTimestamps = ($this->hasPivotColumn($this->createdAt()) || - $this->hasPivotColumn($this->updatedAt())); - - // To create the attachment records, we will simply spin through the IDs given - // and create a new record to insert for each ID. Each ID may actually be a - // key in the array, with extra attributes to be placed in other columns. - foreach ($ids as $key => $value) { - $records[] = $this->formatAttachRecord( - $key, $value, $attributes, $hasTimestamps - ); - } - - return $records; - } - - /** - * Create a full attachment record payload. - * - * @param int $key - * @param mixed $value - * @param array $attributes - * @param bool $hasTimestamps - * @return array - */ - protected function formatAttachRecord($key, $value, $attributes, $hasTimestamps) - { - list($id, $attributes) = $this->extractAttachIdAndAttributes($key, $value, $attributes); - - return array_merge( - $this->baseAttachRecord($id, $hasTimestamps), $this->castAttributes($attributes) - ); - } - - /** - * Get the attach record ID and extra attributes. - * - * @param mixed $key - * @param mixed $value - * @param array $attributes - * @return array - */ - protected function extractAttachIdAndAttributes($key, $value, array $attributes) - { - return is_array($value) - ? [$key, array_merge($value, $attributes)] - : [$value, $attributes]; - } - - /** - * Create a new pivot attachment record. - * - * @param int $id - * @param bool $timed - * @return array - */ - protected function baseAttachRecord($id, $timed) - { - $record[$this->relatedPivotKey] = $id; - - $record[$this->foreignPivotKey] = $this->parent->{$this->parentKey}; - - // If the record needs to have creation and update timestamps, we will make - // them by calling the parent model's "freshTimestamp" method which will - // provide us with a fresh timestamp in this model's preferred format. - if ($timed) { - $record = $this->addTimestampsToAttachment($record); - } - - return $record; - } - - /** - * Set the creation and update timestamps on an attach record. - * - * @param array $record - * @param bool $exists - * @return array - */ - protected function addTimestampsToAttachment(array $record, $exists = false) - { - $fresh = $this->parent->freshTimestamp(); - - if (! $exists && $this->hasPivotColumn($this->createdAt())) { - $record[$this->createdAt()] = $fresh; - } - - if ($this->hasPivotColumn($this->updatedAt())) { - $record[$this->updatedAt()] = $fresh; - } - - return $record; - } - - /** - * Determine whether the given column is defined as a pivot column. - * - * @param string $column - * @return bool - */ - protected function hasPivotColumn($column) - { - return in_array($column, $this->pivotColumns); - } - - /** - * Detach models from the relationship. - * - * @param mixed $ids - * @param bool $touch - * @return int - */ - public function detach($ids = null, $touch = true) - { - $query = $this->newPivotQuery(); - - // If associated IDs were passed to the method we will only delete those - // associations, otherwise all of the association ties will be broken. - // We'll return the numbers of affected rows when we do the deletes. - if (! is_null($ids)) { - $ids = $this->parseIds($ids); - - if (empty($ids)) { - return 0; - } - - $query->whereIn($this->relatedPivotKey, (array) $ids); - } - - // Once we have all of the conditions set on the statement, we are ready - // to run the delete on the pivot table. Then, if the touch parameter - // is true, we will go ahead and touch all related models to sync. - $results = $query->delete(); - - if ($touch) { - $this->touchIfTouching(); - } - - return $results; - } - - /** - * Create a new pivot model instance. - * - * @param array $attributes - * @param bool $exists - * @return \Illuminate\Database\Eloquent\Relations\Pivot - */ - public function newPivot(array $attributes = [], $exists = false) - { - $pivot = $this->related->newPivot( - $this->parent, $attributes, $this->table, $exists, $this->using - ); - - return $pivot->setPivotKeys($this->foreignPivotKey, $this->relatedPivotKey); - } - - /** - * Create a new existing pivot model instance. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Relations\Pivot - */ - public function newExistingPivot(array $attributes = []) - { - return $this->newPivot($attributes, true); - } - - /** - * Get a new plain query builder for the pivot table. - * - * @return \Illuminate\Database\Query\Builder - */ - public function newPivotStatement() - { - return $this->query->getQuery()->newQuery()->from($this->table); - } - - /** - * Get a new pivot statement for a given "other" ID. - * - * @param mixed $id - * @return \Illuminate\Database\Query\Builder - */ - public function newPivotStatementForId($id) - { - return $this->newPivotQuery()->where($this->relatedPivotKey, $id); - } - - /** - * Create a new query builder for the pivot table. - * - * @return \Illuminate\Database\Query\Builder - */ - protected function newPivotQuery() - { - $query = $this->newPivotStatement(); - - foreach ($this->pivotWheres as $arguments) { - call_user_func_array([$query, 'where'], $arguments); - } - - foreach ($this->pivotWhereIns as $arguments) { - call_user_func_array([$query, 'whereIn'], $arguments); - } - - return $query->where($this->foreignPivotKey, $this->parent->{$this->parentKey}); - } - - /** - * Set the columns on the pivot table to retrieve. - * - * @param array|mixed $columns - * @return $this - */ - public function withPivot($columns) - { - $this->pivotColumns = array_merge( - $this->pivotColumns, is_array($columns) ? $columns : func_get_args() - ); - - return $this; - } - - /** - * Get all of the IDs from the given mixed value. - * - * @param mixed $value - * @return array - */ - protected function parseIds($value) - { - if ($value instanceof Model) { - return [$value->{$this->relatedKey}]; - } - - if ($value instanceof Collection) { - return $value->pluck($this->relatedKey)->all(); - } - - if ($value instanceof BaseCollection) { - return $value->toArray(); - } - - return (array) $value; - } - - /** - * Cast the given keys to integers if they are numeric and string otherwise. - * - * @param array $keys - * @return array - */ - protected function castKeys(array $keys) - { - return (array) array_map(function ($v) { - return $this->castKey($v); - }, $keys); - } - - /** - * Cast the given key to an integer if it is numeric. - * - * @param mixed $key - * @return mixed - */ - protected function castKey($key) - { - return is_numeric($key) ? (int) $key : (string) $key; - } - - /** - * Cast the given pivot attributes. - * - * @param array $attributes - * @return array - */ - protected function castAttributes($attributes) - { - return $this->using - ? $this->newPivot()->fill($attributes)->getAttributes() - : $attributes; - } -} diff --git a/vendor/illuminate/database/Eloquent/Relations/Concerns/SupportsDefaultModels.php b/vendor/illuminate/database/Eloquent/Relations/Concerns/SupportsDefaultModels.php deleted file mode 100644 index 00efd50..0000000 --- a/vendor/illuminate/database/Eloquent/Relations/Concerns/SupportsDefaultModels.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Relations\Concerns; - -use Illuminate\Database\Eloquent\Model; - -trait SupportsDefaultModels -{ - /** - * Indicates if a default model instance should be used. - * - * Alternatively, may be a Closure or array. - * - * @var \Closure|array|bool - */ - protected $withDefault; - - /** - * Make a new related instance for the given model. - * - * @param \Illuminate\Database\Eloquent\Model $parent - * @return \Illuminate\Database\Eloquent\Model - */ - abstract protected function newRelatedInstanceFor(Model $parent); - - /** - * Return a new model instance in case the relationship does not exist. - * - * @param \Closure|array|bool $callback - * @return $this - */ - public function withDefault($callback = true) - { - $this->withDefault = $callback; - - return $this; - } - - /** - * Get the default value for this relation. - * - * @param \Illuminate\Database\Eloquent\Model $parent - * @return \Illuminate\Database\Eloquent\Model|null - */ - protected function getDefaultFor(Model $parent) - { - if (! $this->withDefault) { - return; - } - - $instance = $this->newRelatedInstanceFor($parent); - - if (is_callable($this->withDefault)) { - return call_user_func($this->withDefault, $instance) ?: $instance; - } - - if (is_array($this->withDefault)) { - $instance->forceFill($this->withDefault); - } - - return $instance; - } -} diff --git a/vendor/illuminate/database/Eloquent/Relations/HasMany.php b/vendor/illuminate/database/Eloquent/Relations/HasMany.php deleted file mode 100644 index 6149e47..0000000 --- a/vendor/illuminate/database/Eloquent/Relations/HasMany.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Relations; - -use Illuminate\Database\Eloquent\Collection; - -class HasMany extends HasOneOrMany -{ - /** - * Get the results of the relationship. - * - * @return mixed - */ - public function getResults() - { - return $this->query->get(); - } - - /** - * Initialize the relation on a set of models. - * - * @param array $models - * @param string $relation - * @return array - */ - public function initRelation(array $models, $relation) - { - foreach ($models as $model) { - $model->setRelation($relation, $this->related->newCollection()); - } - - return $models; - } - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function match(array $models, Collection $results, $relation) - { - return $this->matchMany($models, $results, $relation); - } -} diff --git a/vendor/illuminate/database/Eloquent/Relations/HasManyThrough.php b/vendor/illuminate/database/Eloquent/Relations/HasManyThrough.php deleted file mode 100644 index 408e42f..0000000 --- a/vendor/illuminate/database/Eloquent/Relations/HasManyThrough.php +++ /dev/null @@ -1,520 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Relations; - -use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Builder; -use Illuminate\Database\Eloquent\Collection; -use Illuminate\Database\Eloquent\SoftDeletes; -use Illuminate\Database\Eloquent\ModelNotFoundException; - -class HasManyThrough extends Relation -{ - /** - * The "through" parent model instance. - * - * @var \Illuminate\Database\Eloquent\Model - */ - protected $throughParent; - - /** - * The far parent model instance. - * - * @var \Illuminate\Database\Eloquent\Model - */ - protected $farParent; - - /** - * The near key on the relationship. - * - * @var string - */ - protected $firstKey; - - /** - * The far key on the relationship. - * - * @var string - */ - protected $secondKey; - - /** - * The local key on the relationship. - * - * @var string - */ - protected $localKey; - - /** - * The local key on the intermediary model. - * - * @var string - */ - protected $secondLocalKey; - - /** - * The count of self joins. - * - * @var int - */ - protected static $selfJoinCount = 0; - - /** - * Create a new has many through relationship instance. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $farParent - * @param \Illuminate\Database\Eloquent\Model $throughParent - * @param string $firstKey - * @param string $secondKey - * @param string $localKey - * @param string $secondLocalKey - * @return void - */ - public function __construct(Builder $query, Model $farParent, Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey) - { - $this->localKey = $localKey; - $this->firstKey = $firstKey; - $this->secondKey = $secondKey; - $this->farParent = $farParent; - $this->throughParent = $throughParent; - $this->secondLocalKey = $secondLocalKey; - - parent::__construct($query, $throughParent); - } - - /** - * Set the base constraints on the relation query. - * - * @return void - */ - public function addConstraints() - { - $localValue = $this->farParent[$this->localKey]; - - $this->performJoin(); - - if (static::$constraints) { - $this->query->where($this->getQualifiedFirstKeyName(), '=', $localValue); - } - } - - /** - * Set the join clause on the query. - * - * @param \Illuminate\Database\Eloquent\Builder|null $query - * @return void - */ - protected function performJoin(Builder $query = null) - { - $query = $query ?: $this->query; - - $farKey = $this->getQualifiedFarKeyName(); - - $query->join($this->throughParent->getTable(), $this->getQualifiedParentKeyName(), '=', $farKey); - - if ($this->throughParentSoftDeletes()) { - $query->whereNull($this->throughParent->getQualifiedDeletedAtColumn()); - } - } - - /** - * Get the fully qualified parent key name. - * - * @return string - */ - public function getQualifiedParentKeyName() - { - return $this->parent->qualifyColumn($this->secondLocalKey); - } - - /** - * Determine whether "through" parent of the relation uses Soft Deletes. - * - * @return bool - */ - public function throughParentSoftDeletes() - { - return in_array(SoftDeletes::class, class_uses_recursive( - get_class($this->throughParent) - )); - } - - /** - * Set the constraints for an eager load of the relation. - * - * @param array $models - * @return void - */ - public function addEagerConstraints(array $models) - { - $this->query->whereIn( - $this->getQualifiedFirstKeyName(), $this->getKeys($models, $this->localKey) - ); - } - - /** - * Initialize the relation on a set of models. - * - * @param array $models - * @param string $relation - * @return array - */ - public function initRelation(array $models, $relation) - { - foreach ($models as $model) { - $model->setRelation($relation, $this->related->newCollection()); - } - - return $models; - } - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function match(array $models, Collection $results, $relation) - { - $dictionary = $this->buildDictionary($results); - - // Once we have the dictionary we can simply spin through the parent models to - // link them up with their children using the keyed dictionary to make the - // matching very convenient and easy work. Then we'll just return them. - foreach ($models as $model) { - if (isset($dictionary[$key = $model->getAttribute($this->localKey)])) { - $model->setRelation( - $relation, $this->related->newCollection($dictionary[$key]) - ); - } - } - - return $models; - } - - /** - * Build model dictionary keyed by the relation's foreign key. - * - * @param \Illuminate\Database\Eloquent\Collection $results - * @return array - */ - protected function buildDictionary(Collection $results) - { - $dictionary = []; - - // First we will create a dictionary of models keyed by the foreign key of the - // relationship as this will allow us to quickly access all of the related - // models without having to do nested looping which will be quite slow. - foreach ($results as $result) { - $dictionary[$result->{$this->firstKey}][] = $result; - } - - return $dictionary; - } - - /** - * Get the first related model record matching the attributes or instantiate it. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model - */ - public function firstOrNew(array $attributes) - { - if (is_null($instance = $this->where($attributes)->first())) { - $instance = $this->related->newInstance($attributes); - } - - return $instance; - } - - /** - * Create or update a related record matching the attributes, and fill it with values. - * - * @param array $attributes - * @param array $values - * @return \Illuminate\Database\Eloquent\Model - */ - public function updateOrCreate(array $attributes, array $values = []) - { - $instance = $this->firstOrNew($attributes); - - $instance->fill($values)->save(); - - return $instance; - } - - /** - * Execute the query and get the first related model. - * - * @param array $columns - * @return mixed - */ - public function first($columns = ['*']) - { - $results = $this->take(1)->get($columns); - - return count($results) > 0 ? $results->first() : null; - } - - /** - * Execute the query and get the first result or throw an exception. - * - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model|static - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException - */ - public function firstOrFail($columns = ['*']) - { - if (! is_null($model = $this->first($columns))) { - return $model; - } - - throw (new ModelNotFoundException)->setModel(get_class($this->related)); - } - - /** - * Find a related model by its primary key. - * - * @param mixed $id - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|null - */ - public function find($id, $columns = ['*']) - { - if (is_array($id)) { - return $this->findMany($id, $columns); - } - - return $this->where( - $this->getRelated()->getQualifiedKeyName(), '=', $id - )->first($columns); - } - - /** - * Find multiple related models by their primary keys. - * - * @param mixed $ids - * @param array $columns - * @return \Illuminate\Database\Eloquent\Collection - */ - public function findMany($ids, $columns = ['*']) - { - if (empty($ids)) { - return $this->getRelated()->newCollection(); - } - - return $this->whereIn( - $this->getRelated()->getQualifiedKeyName(), $ids - )->get($columns); - } - - /** - * Find a related model by its primary key or throw an exception. - * - * @param mixed $id - * @param array $columns - * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection - * - * @throws \Illuminate\Database\Eloquent\ModelNotFoundException - */ - public function findOrFail($id, $columns = ['*']) - { - $result = $this->find($id, $columns); - - if (is_array($id)) { - if (count($result) == count(array_unique($id))) { - return $result; - } - } elseif (! is_null($result)) { - return $result; - } - - throw (new ModelNotFoundException)->setModel(get_class($this->related)); - } - - /** - * Get the results of the relationship. - * - * @return mixed - */ - public function getResults() - { - return $this->get(); - } - - /** - * Execute the query as a "select" statement. - * - * @param array $columns - * @return \Illuminate\Database\Eloquent\Collection - */ - public function get($columns = ['*']) - { - // First we'll add the proper select columns onto the query so it is run with - // the proper columns. Then, we will get the results and hydrate out pivot - // models with the result of those columns as a separate model relation. - $columns = $this->query->getQuery()->columns ? [] : $columns; - - $builder = $this->query->applyScopes(); - - $models = $builder->addSelect( - $this->shouldSelect($columns) - )->getModels(); - - // If we actually found models we will also eager load any relationships that - // have been specified as needing to be eager loaded. This will solve the - // n + 1 query problem for the developer and also increase performance. - if (count($models) > 0) { - $models = $builder->eagerLoadRelations($models); - } - - return $this->related->newCollection($models); - } - - /** - * Get a paginator for the "select" statement. - * - * @param int $perPage - * @param array $columns - * @param string $pageName - * @param int $page - * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator - */ - public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) - { - $this->query->addSelect($this->shouldSelect($columns)); - - return $this->query->paginate($perPage, $columns, $pageName, $page); - } - - /** - * Paginate the given query into a simple paginator. - * - * @param int $perPage - * @param array $columns - * @param string $pageName - * @param int|null $page - * @return \Illuminate\Contracts\Pagination\Paginator - */ - public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) - { - $this->query->addSelect($this->shouldSelect($columns)); - - return $this->query->simplePaginate($perPage, $columns, $pageName, $page); - } - - /** - * Set the select clause for the relation query. - * - * @param array $columns - * @return array - */ - protected function shouldSelect(array $columns = ['*']) - { - if ($columns == ['*']) { - $columns = [$this->related->getTable().'.*']; - } - - return array_merge($columns, [$this->getQualifiedFirstKeyName()]); - } - - /** - * Add the constraints for a relationship query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) - { - if ($parentQuery->getQuery()->from == $query->getQuery()->from) { - return $this->getRelationExistenceQueryForSelfRelation($query, $parentQuery, $columns); - } - - $this->performJoin($query); - - return $query->select($columns)->whereColumn( - $this->getQualifiedLocalKeyName(), '=', $this->getQualifiedFirstKeyName() - ); - } - - /** - * Add the constraints for a relationship query on the same table. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQueryForSelfRelation(Builder $query, Builder $parentQuery, $columns = ['*']) - { - $query->from($query->getModel()->getTable().' as '.$hash = $this->getRelationCountHash()); - - $query->join($this->throughParent->getTable(), $this->getQualifiedParentKeyName(), '=', $hash.'.'.$this->secondLocalKey); - - if ($this->throughParentSoftDeletes()) { - $query->whereNull($this->throughParent->getQualifiedDeletedAtColumn()); - } - - $query->getModel()->setTable($hash); - - return $query->select($columns)->whereColumn( - $parentQuery->getQuery()->from.'.'.$query->getModel()->getKeyName(), '=', $this->getQualifiedFirstKeyName() - ); - } - - /** - * Get a relationship join table hash. - * - * @return string - */ - public function getRelationCountHash() - { - return 'laravel_reserved_'.static::$selfJoinCount++; - } - - /** - * Get the qualified foreign key on the related model. - * - * @return string - */ - public function getQualifiedFarKeyName() - { - return $this->getQualifiedForeignKeyName(); - } - - /** - * Get the qualified foreign key on the "through" model. - * - * @return string - */ - public function getQualifiedFirstKeyName() - { - return $this->throughParent->qualifyColumn($this->firstKey); - } - - /** - * Get the qualified foreign key on the related model. - * - * @return string - */ - public function getQualifiedForeignKeyName() - { - return $this->related->qualifyColumn($this->secondKey); - } - - /** - * Get the qualified local key on the far parent model. - * - * @return string - */ - public function getQualifiedLocalKeyName() - { - return $this->farParent->qualifyColumn($this->localKey); - } -} diff --git a/vendor/illuminate/database/Eloquent/Relations/HasOne.php b/vendor/illuminate/database/Eloquent/Relations/HasOne.php deleted file mode 100644 index 858e5d0..0000000 --- a/vendor/illuminate/database/Eloquent/Relations/HasOne.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Relations; - -use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Collection; -use Illuminate\Database\Eloquent\Relations\Concerns\SupportsDefaultModels; - -class HasOne extends HasOneOrMany -{ - use SupportsDefaultModels; - - /** - * Get the results of the relationship. - * - * @return mixed - */ - public function getResults() - { - return $this->query->first() ?: $this->getDefaultFor($this->parent); - } - - /** - * Initialize the relation on a set of models. - * - * @param array $models - * @param string $relation - * @return array - */ - public function initRelation(array $models, $relation) - { - foreach ($models as $model) { - $model->setRelation($relation, $this->getDefaultFor($model)); - } - - return $models; - } - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function match(array $models, Collection $results, $relation) - { - return $this->matchOne($models, $results, $relation); - } - - /** - * Make a new related instance for the given model. - * - * @param \Illuminate\Database\Eloquent\Model $parent - * @return \Illuminate\Database\Eloquent\Model - */ - public function newRelatedInstanceFor(Model $parent) - { - return $this->related->newInstance()->setAttribute( - $this->getForeignKeyName(), $parent->{$this->localKey} - ); - } -} diff --git a/vendor/illuminate/database/Eloquent/Relations/HasOneOrMany.php b/vendor/illuminate/database/Eloquent/Relations/HasOneOrMany.php deleted file mode 100644 index 54850fa..0000000 --- a/vendor/illuminate/database/Eloquent/Relations/HasOneOrMany.php +++ /dev/null @@ -1,423 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Relations; - -use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Builder; -use Illuminate\Database\Eloquent\Collection; - -abstract class HasOneOrMany extends Relation -{ - /** - * The foreign key of the parent model. - * - * @var string - */ - protected $foreignKey; - - /** - * The local key of the parent model. - * - * @var string - */ - protected $localKey; - - /** - * The count of self joins. - * - * @var int - */ - protected static $selfJoinCount = 0; - - /** - * Create a new has one or many relationship instance. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $foreignKey - * @param string $localKey - * @return void - */ - public function __construct(Builder $query, Model $parent, $foreignKey, $localKey) - { - $this->localKey = $localKey; - $this->foreignKey = $foreignKey; - - parent::__construct($query, $parent); - } - - /** - * Create and return an un-saved instance of the related model. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model - */ - public function make(array $attributes = []) - { - return tap($this->related->newInstance($attributes), function ($instance) { - $this->setForeignAttributesForCreate($instance); - }); - } - - /** - * Set the base constraints on the relation query. - * - * @return void - */ - public function addConstraints() - { - if (static::$constraints) { - $this->query->where($this->foreignKey, '=', $this->getParentKey()); - - $this->query->whereNotNull($this->foreignKey); - } - } - - /** - * Set the constraints for an eager load of the relation. - * - * @param array $models - * @return void - */ - public function addEagerConstraints(array $models) - { - $this->query->whereIn( - $this->foreignKey, $this->getKeys($models, $this->localKey) - ); - } - - /** - * Match the eagerly loaded results to their single parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function matchOne(array $models, Collection $results, $relation) - { - return $this->matchOneOrMany($models, $results, $relation, 'one'); - } - - /** - * Match the eagerly loaded results to their many parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function matchMany(array $models, Collection $results, $relation) - { - return $this->matchOneOrMany($models, $results, $relation, 'many'); - } - - /** - * Match the eagerly loaded results to their many parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @param string $type - * @return array - */ - protected function matchOneOrMany(array $models, Collection $results, $relation, $type) - { - $dictionary = $this->buildDictionary($results); - - // Once we have the dictionary we can simply spin through the parent models to - // link them up with their children using the keyed dictionary to make the - // matching very convenient and easy work. Then we'll just return them. - foreach ($models as $model) { - if (isset($dictionary[$key = $model->getAttribute($this->localKey)])) { - $model->setRelation( - $relation, $this->getRelationValue($dictionary, $key, $type) - ); - } - } - - return $models; - } - - /** - * Get the value of a relationship by one or many type. - * - * @param array $dictionary - * @param string $key - * @param string $type - * @return mixed - */ - protected function getRelationValue(array $dictionary, $key, $type) - { - $value = $dictionary[$key]; - - return $type == 'one' ? reset($value) : $this->related->newCollection($value); - } - - /** - * Build model dictionary keyed by the relation's foreign key. - * - * @param \Illuminate\Database\Eloquent\Collection $results - * @return array - */ - protected function buildDictionary(Collection $results) - { - $foreign = $this->getForeignKeyName(); - - return $results->mapToDictionary(function ($result) use ($foreign) { - return [$result->{$foreign} => $result]; - })->all(); - } - - /** - * Find a model by its primary key or return new instance of the related model. - * - * @param mixed $id - * @param array $columns - * @return \Illuminate\Support\Collection|\Illuminate\Database\Eloquent\Model - */ - public function findOrNew($id, $columns = ['*']) - { - if (is_null($instance = $this->find($id, $columns))) { - $instance = $this->related->newInstance(); - - $this->setForeignAttributesForCreate($instance); - } - - return $instance; - } - - /** - * Get the first related model record matching the attributes or instantiate it. - * - * @param array $attributes - * @param array $values - * @return \Illuminate\Database\Eloquent\Model - */ - public function firstOrNew(array $attributes, array $values = []) - { - if (is_null($instance = $this->where($attributes)->first())) { - $instance = $this->related->newInstance($attributes + $values); - - $this->setForeignAttributesForCreate($instance); - } - - return $instance; - } - - /** - * Get the first related record matching the attributes or create it. - * - * @param array $attributes - * @param array $values - * @return \Illuminate\Database\Eloquent\Model - */ - public function firstOrCreate(array $attributes, array $values = []) - { - if (is_null($instance = $this->where($attributes)->first())) { - $instance = $this->create($attributes + $values); - } - - return $instance; - } - - /** - * Create or update a related record matching the attributes, and fill it with values. - * - * @param array $attributes - * @param array $values - * @return \Illuminate\Database\Eloquent\Model - */ - public function updateOrCreate(array $attributes, array $values = []) - { - return tap($this->firstOrNew($attributes), function ($instance) use ($values) { - $instance->fill($values); - - $instance->save(); - }); - } - - /** - * Attach a model instance to the parent model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return \Illuminate\Database\Eloquent\Model|false - */ - public function save(Model $model) - { - $this->setForeignAttributesForCreate($model); - - return $model->save() ? $model : false; - } - - /** - * Attach a collection of models to the parent instance. - * - * @param \Traversable|array $models - * @return \Traversable|array - */ - public function saveMany($models) - { - foreach ($models as $model) { - $this->save($model); - } - - return $models; - } - - /** - * Create a new instance of the related model. - * - * @param array $attributes - * @return \Illuminate\Database\Eloquent\Model - */ - public function create(array $attributes = []) - { - return tap($this->related->newInstance($attributes), function ($instance) { - $this->setForeignAttributesForCreate($instance); - - $instance->save(); - }); - } - - /** - * Create a Collection of new instances of the related model. - * - * @param array $records - * @return \Illuminate\Database\Eloquent\Collection - */ - public function createMany(array $records) - { - $instances = $this->related->newCollection(); - - foreach ($records as $record) { - $instances->push($this->create($record)); - } - - return $instances; - } - - /** - * Set the foreign ID for creating a related model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return void - */ - protected function setForeignAttributesForCreate(Model $model) - { - $model->setAttribute($this->getForeignKeyName(), $this->getParentKey()); - } - - /** - * Perform an update on all the related models. - * - * @param array $attributes - * @return int - */ - public function update(array $attributes) - { - if ($this->related->usesTimestamps()) { - $attributes[$this->relatedUpdatedAt()] = $this->related->freshTimestampString(); - } - - return $this->query->update($attributes); - } - - /** - * Add the constraints for a relationship query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) - { - if ($query->getQuery()->from == $parentQuery->getQuery()->from) { - return $this->getRelationExistenceQueryForSelfRelation($query, $parentQuery, $columns); - } - - return parent::getRelationExistenceQuery($query, $parentQuery, $columns); - } - - /** - * Add the constraints for a relationship query on the same table. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQueryForSelfRelation(Builder $query, Builder $parentQuery, $columns = ['*']) - { - $query->from($query->getModel()->getTable().' as '.$hash = $this->getRelationCountHash()); - - $query->getModel()->setTable($hash); - - return $query->select($columns)->whereColumn( - $this->getQualifiedParentKeyName(), '=', $hash.'.'.$this->getForeignKeyName() - ); - } - - /** - * Get a relationship join table hash. - * - * @return string - */ - public function getRelationCountHash() - { - return 'laravel_reserved_'.static::$selfJoinCount++; - } - - /** - * Get the key for comparing against the parent key in "has" query. - * - * @return string - */ - public function getExistenceCompareKey() - { - return $this->getQualifiedForeignKeyName(); - } - - /** - * Get the key value of the parent's local key. - * - * @return mixed - */ - public function getParentKey() - { - return $this->parent->getAttribute($this->localKey); - } - - /** - * Get the fully qualified parent key name. - * - * @return string - */ - public function getQualifiedParentKeyName() - { - return $this->parent->qualifyColumn($this->localKey); - } - - /** - * Get the plain foreign key. - * - * @return string - */ - public function getForeignKeyName() - { - $segments = explode('.', $this->getQualifiedForeignKeyName()); - - return end($segments); - } - - /** - * Get the foreign key for the relationship. - * - * @return string - */ - public function getQualifiedForeignKeyName() - { - return $this->foreignKey; - } -} diff --git a/vendor/illuminate/database/Eloquent/Relations/MorphMany.php b/vendor/illuminate/database/Eloquent/Relations/MorphMany.php deleted file mode 100644 index e2a5c5a..0000000 --- a/vendor/illuminate/database/Eloquent/Relations/MorphMany.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Relations; - -use Illuminate\Database\Eloquent\Collection; - -class MorphMany extends MorphOneOrMany -{ - /** - * Get the results of the relationship. - * - * @return mixed - */ - public function getResults() - { - return $this->query->get(); - } - - /** - * Initialize the relation on a set of models. - * - * @param array $models - * @param string $relation - * @return array - */ - public function initRelation(array $models, $relation) - { - foreach ($models as $model) { - $model->setRelation($relation, $this->related->newCollection()); - } - - return $models; - } - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function match(array $models, Collection $results, $relation) - { - return $this->matchMany($models, $results, $relation); - } -} diff --git a/vendor/illuminate/database/Eloquent/Relations/MorphOne.php b/vendor/illuminate/database/Eloquent/Relations/MorphOne.php deleted file mode 100644 index 520a7ec..0000000 --- a/vendor/illuminate/database/Eloquent/Relations/MorphOne.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Relations; - -use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Collection; -use Illuminate\Database\Eloquent\Relations\Concerns\SupportsDefaultModels; - -class MorphOne extends MorphOneOrMany -{ - use SupportsDefaultModels; - - /** - * Get the results of the relationship. - * - * @return mixed - */ - public function getResults() - { - return $this->query->first() ?: $this->getDefaultFor($this->parent); - } - - /** - * Initialize the relation on a set of models. - * - * @param array $models - * @param string $relation - * @return array - */ - public function initRelation(array $models, $relation) - { - foreach ($models as $model) { - $model->setRelation($relation, $this->getDefaultFor($model)); - } - - return $models; - } - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function match(array $models, Collection $results, $relation) - { - return $this->matchOne($models, $results, $relation); - } - - /** - * Make a new related instance for the given model. - * - * @param \Illuminate\Database\Eloquent\Model $parent - * @return \Illuminate\Database\Eloquent\Model - */ - public function newRelatedInstanceFor(Model $parent) - { - return $this->related->newInstance() - ->setAttribute($this->getForeignKeyName(), $parent->{$this->localKey}) - ->setAttribute($this->getMorphType(), $this->morphClass); - } -} diff --git a/vendor/illuminate/database/Eloquent/Relations/MorphOneOrMany.php b/vendor/illuminate/database/Eloquent/Relations/MorphOneOrMany.php deleted file mode 100644 index 7e30054..0000000 --- a/vendor/illuminate/database/Eloquent/Relations/MorphOneOrMany.php +++ /dev/null @@ -1,140 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Relations; - -use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Builder; - -abstract class MorphOneOrMany extends HasOneOrMany -{ - /** - * The foreign key type for the relationship. - * - * @var string - */ - protected $morphType; - - /** - * The class name of the parent model. - * - * @var string - */ - protected $morphClass; - - /** - * Create a new morph one or many relationship instance. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $type - * @param string $id - * @param string $localKey - * @return void - */ - public function __construct(Builder $query, Model $parent, $type, $id, $localKey) - { - $this->morphType = $type; - - $this->morphClass = $parent->getMorphClass(); - - parent::__construct($query, $parent, $id, $localKey); - } - - /** - * Set the base constraints on the relation query. - * - * @return void - */ - public function addConstraints() - { - if (static::$constraints) { - parent::addConstraints(); - - $this->query->where($this->morphType, $this->morphClass); - } - } - - /** - * Set the constraints for an eager load of the relation. - * - * @param array $models - * @return void - */ - public function addEagerConstraints(array $models) - { - parent::addEagerConstraints($models); - - $this->query->where($this->morphType, $this->morphClass); - } - - /** - * Attach a model instance to the parent model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return \Illuminate\Database\Eloquent\Model - */ - public function save(Model $model) - { - $model->setAttribute($this->getMorphType(), $this->morphClass); - - return parent::save($model); - } - - /** - * Set the foreign ID and type for creating a related model. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return void - */ - protected function setForeignAttributesForCreate(Model $model) - { - $model->{$this->getForeignKeyName()} = $this->getParentKey(); - - $model->{$this->getMorphType()} = $this->morphClass; - } - - /** - * Get the relationship query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) - { - return parent::getRelationExistenceQuery($query, $parentQuery, $columns)->where( - $this->morphType, $this->morphClass - ); - } - - /** - * Get the foreign key "type" name. - * - * @return string - */ - public function getQualifiedMorphType() - { - return $this->morphType; - } - - /** - * Get the plain morph type name without the table. - * - * @return string - */ - public function getMorphType() - { - return last(explode('.', $this->morphType)); - } - - /** - * Get the class name of the parent model. - * - * @return string - */ - public function getMorphClass() - { - return $this->morphClass; - } -} diff --git a/vendor/illuminate/database/Eloquent/Relations/MorphPivot.php b/vendor/illuminate/database/Eloquent/Relations/MorphPivot.php deleted file mode 100644 index b7a2f34..0000000 --- a/vendor/illuminate/database/Eloquent/Relations/MorphPivot.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Relations; - -use Illuminate\Database\Eloquent\Builder; - -class MorphPivot extends Pivot -{ - /** - * The type of the polymorphic relation. - * - * Explicitly define this so it's not included in saved attributes. - * - * @var string - */ - protected $morphType; - - /** - * The value of the polymorphic relation. - * - * Explicitly define this so it's not included in saved attributes. - * - * @var string - */ - protected $morphClass; - - /** - * Set the keys for a save update query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function setKeysForSaveQuery(Builder $query) - { - $query->where($this->morphType, $this->morphClass); - - return parent::setKeysForSaveQuery($query); - } - - /** - * Delete the pivot model record from the database. - * - * @return int - */ - public function delete() - { - $query = $this->getDeleteQuery(); - - $query->where($this->morphType, $this->morphClass); - - return $query->delete(); - } - - /** - * Set the morph type for the pivot. - * - * @param string $morphType - * @return $this - */ - public function setMorphType($morphType) - { - $this->morphType = $morphType; - - return $this; - } - - /** - * Set the morph class for the pivot. - * - * @param string $morphClass - * @return \Illuminate\Database\Eloquent\Relations\MorphPivot - */ - public function setMorphClass($morphClass) - { - $this->morphClass = $morphClass; - - return $this; - } -} diff --git a/vendor/illuminate/database/Eloquent/Relations/MorphTo.php b/vendor/illuminate/database/Eloquent/Relations/MorphTo.php deleted file mode 100644 index 0b5375b..0000000 --- a/vendor/illuminate/database/Eloquent/Relations/MorphTo.php +++ /dev/null @@ -1,279 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Relations; - -use BadMethodCallException; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Builder; -use Illuminate\Database\Eloquent\Collection; - -/** - * @mixin \Illuminate\Database\Eloquent\Builder - */ -class MorphTo extends BelongsTo -{ - /** - * The type of the polymorphic relation. - * - * @var string - */ - protected $morphType; - - /** - * The models whose relations are being eager loaded. - * - * @var \Illuminate\Database\Eloquent\Collection - */ - protected $models; - - /** - * All of the models keyed by ID. - * - * @var array - */ - protected $dictionary = []; - - /** - * A buffer of dynamic calls to query macros. - * - * @var array - */ - protected $macroBuffer = []; - - /** - * Create a new morph to relationship instance. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $foreignKey - * @param string $ownerKey - * @param string $type - * @param string $relation - * @return void - */ - public function __construct(Builder $query, Model $parent, $foreignKey, $ownerKey, $type, $relation) - { - $this->morphType = $type; - - parent::__construct($query, $parent, $foreignKey, $ownerKey, $relation); - } - - /** - * Set the constraints for an eager load of the relation. - * - * @param array $models - * @return void - */ - public function addEagerConstraints(array $models) - { - $this->buildDictionary($this->models = Collection::make($models)); - } - - /** - * Build a dictionary with the models. - * - * @param \Illuminate\Database\Eloquent\Collection $models - * @return void - */ - protected function buildDictionary(Collection $models) - { - foreach ($models as $model) { - if ($model->{$this->morphType}) { - $this->dictionary[$model->{$this->morphType}][$model->{$this->foreignKey}][] = $model; - } - } - } - - /** - * Get the results of the relationship. - * - * @return mixed - */ - public function getResults() - { - return $this->ownerKey ? $this->query->first() : null; - } - - /** - * Get the results of the relationship. - * - * Called via eager load method of Eloquent query builder. - * - * @return mixed - */ - public function getEager() - { - foreach (array_keys($this->dictionary) as $type) { - $this->matchToMorphParents($type, $this->getResultsByType($type)); - } - - return $this->models; - } - - /** - * Get all of the relation results for a type. - * - * @param string $type - * @return \Illuminate\Database\Eloquent\Collection - */ - protected function getResultsByType($type) - { - $instance = $this->createModelByType($type); - - $query = $this->replayMacros($instance->newQuery()) - ->mergeConstraintsFrom($this->getQuery()) - ->with($this->getQuery()->getEagerLoads()); - - return $query->whereIn( - $instance->getTable().'.'.$instance->getKeyName(), $this->gatherKeysByType($type) - )->get(); - } - - /** - * Gather all of the foreign keys for a given type. - * - * @param string $type - * @return array - */ - protected function gatherKeysByType($type) - { - return collect($this->dictionary[$type])->map(function ($models) { - return head($models)->{$this->foreignKey}; - })->values()->unique()->all(); - } - - /** - * Create a new model instance by type. - * - * @param string $type - * @return \Illuminate\Database\Eloquent\Model - */ - public function createModelByType($type) - { - $class = Model::getActualClassNameForMorph($type); - - return new $class; - } - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - public function match(array $models, Collection $results, $relation) - { - return $models; - } - - /** - * Match the results for a given type to their parents. - * - * @param string $type - * @param \Illuminate\Database\Eloquent\Collection $results - * @return void - */ - protected function matchToMorphParents($type, Collection $results) - { - foreach ($results as $result) { - if (isset($this->dictionary[$type][$result->getKey()])) { - foreach ($this->dictionary[$type][$result->getKey()] as $model) { - $model->setRelation($this->relation, $result); - } - } - } - } - - /** - * Associate the model instance to the given parent. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @return \Illuminate\Database\Eloquent\Model - */ - public function associate($model) - { - $this->parent->setAttribute( - $this->foreignKey, $model instanceof Model ? $model->getKey() : null - ); - - $this->parent->setAttribute( - $this->morphType, $model instanceof Model ? $model->getMorphClass() : null - ); - - return $this->parent->setRelation($this->relation, $model); - } - - /** - * Dissociate previously associated model from the given parent. - * - * @return \Illuminate\Database\Eloquent\Model - */ - public function dissociate() - { - $this->parent->setAttribute($this->foreignKey, null); - - $this->parent->setAttribute($this->morphType, null); - - return $this->parent->setRelation($this->relation, null); - } - - /** - * Get the foreign key "type" name. - * - * @return string - */ - public function getMorphType() - { - return $this->morphType; - } - - /** - * Get the dictionary used by the relationship. - * - * @return array - */ - public function getDictionary() - { - return $this->dictionary; - } - - /** - * Replay stored macro calls on the actual related instance. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function replayMacros(Builder $query) - { - foreach ($this->macroBuffer as $macro) { - $query->{$macro['method']}(...$macro['parameters']); - } - - return $query; - } - - /** - * Handle dynamic method calls to the relationship. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - try { - return parent::__call($method, $parameters); - } - - // If we tried to call a method that does not exist on the parent Builder instance, - // we'll assume that we want to call a query macro (e.g. withTrashed) that only - // exists on related models. We will just store the call and replay it later. - catch (BadMethodCallException $e) { - $this->macroBuffer[] = compact('method', 'parameters'); - - return $this; - } - } -} diff --git a/vendor/illuminate/database/Eloquent/Relations/MorphToMany.php b/vendor/illuminate/database/Eloquent/Relations/MorphToMany.php deleted file mode 100644 index 15f5cfd..0000000 --- a/vendor/illuminate/database/Eloquent/Relations/MorphToMany.php +++ /dev/null @@ -1,168 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Relations; - -use Illuminate\Support\Arr; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Builder; - -class MorphToMany extends BelongsToMany -{ - /** - * The type of the polymorphic relation. - * - * @var string - */ - protected $morphType; - - /** - * The class name of the morph type constraint. - * - * @var string - */ - protected $morphClass; - - /** - * Indicates if we are connecting the inverse of the relation. - * - * This primarily affects the morphClass constraint. - * - * @var bool - */ - protected $inverse; - - /** - * Create a new morph to many relationship instance. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @param string $name - * @param string $table - * @param string $foreignPivotKey - * @param string $relatedPivotKey - * @param string $parentKey - * @param string $relatedKey - * @param string $relationName - * @param bool $inverse - * @return void - */ - public function __construct(Builder $query, Model $parent, $name, $table, $foreignPivotKey, - $relatedPivotKey, $parentKey, $relatedKey, $relationName = null, $inverse = false) - { - $this->inverse = $inverse; - $this->morphType = $name.'_type'; - $this->morphClass = $inverse ? $query->getModel()->getMorphClass() : $parent->getMorphClass(); - - parent::__construct( - $query, $parent, $table, $foreignPivotKey, - $relatedPivotKey, $parentKey, $relatedKey, $relationName - ); - } - - /** - * Set the where clause for the relation query. - * - * @return $this - */ - protected function addWhereConstraints() - { - parent::addWhereConstraints(); - - $this->query->where($this->table.'.'.$this->morphType, $this->morphClass); - - return $this; - } - - /** - * Set the constraints for an eager load of the relation. - * - * @param array $models - * @return void - */ - public function addEagerConstraints(array $models) - { - parent::addEagerConstraints($models); - - $this->query->where($this->table.'.'.$this->morphType, $this->morphClass); - } - - /** - * Create a new pivot attachment record. - * - * @param int $id - * @param bool $timed - * @return array - */ - protected function baseAttachRecord($id, $timed) - { - return Arr::add( - parent::baseAttachRecord($id, $timed), $this->morphType, $this->morphClass - ); - } - - /** - * Add the constraints for a relationship count query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) - { - return parent::getRelationExistenceQuery($query, $parentQuery, $columns)->where( - $this->table.'.'.$this->morphType, $this->morphClass - ); - } - - /** - * Create a new query builder for the pivot table. - * - * @return \Illuminate\Database\Query\Builder - */ - protected function newPivotQuery() - { - return parent::newPivotQuery()->where($this->morphType, $this->morphClass); - } - - /** - * Create a new pivot model instance. - * - * @param array $attributes - * @param bool $exists - * @return \Illuminate\Database\Eloquent\Relations\Pivot - */ - public function newPivot(array $attributes = [], $exists = false) - { - $using = $this->using; - - $pivot = $using ? $using::fromRawAttributes($this->parent, $attributes, $this->table, $exists) - : MorphPivot::fromAttributes($this->parent, $attributes, $this->table, $exists); - - $pivot->setPivotKeys($this->foreignPivotKey, $this->relatedPivotKey) - ->setMorphType($this->morphType) - ->setMorphClass($this->morphClass); - - return $pivot; - } - - /** - * Get the foreign key "type" name. - * - * @return string - */ - public function getMorphType() - { - return $this->morphType; - } - - /** - * Get the class name of the parent model. - * - * @return string - */ - public function getMorphClass() - { - return $this->morphClass; - } -} diff --git a/vendor/illuminate/database/Eloquent/Relations/Pivot.php b/vendor/illuminate/database/Eloquent/Relations/Pivot.php deleted file mode 100644 index 3223051..0000000 --- a/vendor/illuminate/database/Eloquent/Relations/Pivot.php +++ /dev/null @@ -1,235 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Relations; - -use Illuminate\Support\Str; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\Builder; - -class Pivot extends Model -{ - /** - * The parent model of the relationship. - * - * @var \Illuminate\Database\Eloquent\Model - */ - public $pivotParent; - - /** - * The name of the foreign key column. - * - * @var string - */ - protected $foreignKey; - - /** - * The name of the "other key" column. - * - * @var string - */ - protected $relatedKey; - - /** - * The attributes that aren't mass assignable. - * - * @var array - */ - protected $guarded = []; - - /** - * Create a new pivot model instance. - * - * @param \Illuminate\Database\Eloquent\Model $parent - * @param array $attributes - * @param string $table - * @param bool $exists - * @return static - */ - public static function fromAttributes(Model $parent, $attributes, $table, $exists = false) - { - $instance = new static; - - // The pivot model is a "dynamic" model since we will set the tables dynamically - // for the instance. This allows it work for any intermediate tables for the - // many to many relationship that are defined by this developer's classes. - $instance->setConnection($parent->getConnectionName()) - ->setTable($table) - ->forceFill($attributes) - ->syncOriginal(); - - // We store off the parent instance so we will access the timestamp column names - // for the model, since the pivot model timestamps aren't easily configurable - // from the developer's point of view. We can use the parents to get these. - $instance->pivotParent = $parent; - - $instance->exists = $exists; - - $instance->timestamps = $instance->hasTimestampAttributes(); - - return $instance; - } - - /** - * Create a new pivot model from raw values returned from a query. - * - * @param \Illuminate\Database\Eloquent\Model $parent - * @param array $attributes - * @param string $table - * @param bool $exists - * @return static - */ - public static function fromRawAttributes(Model $parent, $attributes, $table, $exists = false) - { - $instance = static::fromAttributes($parent, [], $table, $exists); - - $instance->setRawAttributes($attributes, true); - - $instance->timestamps = $instance->hasTimestampAttributes(); - - return $instance; - } - - /** - * Set the keys for a save update query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function setKeysForSaveQuery(Builder $query) - { - if (isset($this->attributes[$this->getKeyName()])) { - return parent::setKeysForSaveQuery($query); - } - - $query->where($this->foreignKey, $this->getOriginal( - $this->foreignKey, $this->getAttribute($this->foreignKey) - )); - - return $query->where($this->relatedKey, $this->getOriginal( - $this->relatedKey, $this->getAttribute($this->relatedKey) - )); - } - - /** - * Delete the pivot model record from the database. - * - * @return int - */ - public function delete() - { - if (isset($this->attributes[$this->getKeyName()])) { - return parent::delete(); - } - - return $this->getDeleteQuery()->delete(); - } - - /** - * Get the query builder for a delete operation on the pivot. - * - * @return \Illuminate\Database\Eloquent\Builder - */ - protected function getDeleteQuery() - { - return $this->newQuery()->where([ - $this->foreignKey => $this->getOriginal($this->foreignKey, $this->getAttribute($this->foreignKey)), - $this->relatedKey => $this->getOriginal($this->relatedKey, $this->getAttribute($this->relatedKey)), - ]); - } - - /** - * Get the table associated with the model. - * - * @return string - */ - public function getTable() - { - if (! isset($this->table)) { - $this->setTable(str_replace( - '\\', '', Str::snake(Str::singular(class_basename($this))) - )); - } - - return $this->table; - } - - /** - * Get the foreign key column name. - * - * @return string - */ - public function getForeignKey() - { - return $this->foreignKey; - } - - /** - * Get the "related key" column name. - * - * @return string - */ - public function getRelatedKey() - { - return $this->relatedKey; - } - - /** - * Get the "related key" column name. - * - * @return string - */ - public function getOtherKey() - { - return $this->getRelatedKey(); - } - - /** - * Set the key names for the pivot model instance. - * - * @param string $foreignKey - * @param string $relatedKey - * @return $this - */ - public function setPivotKeys($foreignKey, $relatedKey) - { - $this->foreignKey = $foreignKey; - - $this->relatedKey = $relatedKey; - - return $this; - } - - /** - * Determine if the pivot model has timestamp attributes. - * - * @return bool - */ - public function hasTimestampAttributes() - { - return array_key_exists($this->getCreatedAtColumn(), $this->attributes); - } - - /** - * Get the name of the "created at" column. - * - * @return string - */ - public function getCreatedAtColumn() - { - return ($this->pivotParent) - ? $this->pivotParent->getCreatedAtColumn() - : parent::getCreatedAtColumn(); - } - - /** - * Get the name of the "updated at" column. - * - * @return string - */ - public function getUpdatedAtColumn() - { - return ($this->pivotParent) - ? $this->pivotParent->getUpdatedAtColumn() - : parent::getUpdatedAtColumn(); - } -} diff --git a/vendor/illuminate/database/Eloquent/Relations/Relation.php b/vendor/illuminate/database/Eloquent/Relations/Relation.php deleted file mode 100644 index c46dc35..0000000 --- a/vendor/illuminate/database/Eloquent/Relations/Relation.php +++ /dev/null @@ -1,385 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent\Relations; - -use Closure; -use Illuminate\Support\Arr; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Support\Traits\Macroable; -use Illuminate\Database\Eloquent\Builder; -use Illuminate\Database\Query\Expression; -use Illuminate\Database\Eloquent\Collection; - -/** - * @mixin \Illuminate\Database\Eloquent\Builder - */ -abstract class Relation -{ - use Macroable { - __call as macroCall; - } - - /** - * The Eloquent query builder instance. - * - * @var \Illuminate\Database\Eloquent\Builder - */ - protected $query; - - /** - * The parent model instance. - * - * @var \Illuminate\Database\Eloquent\Model - */ - protected $parent; - - /** - * The related model instance. - * - * @var \Illuminate\Database\Eloquent\Model - */ - protected $related; - - /** - * Indicates if the relation is adding constraints. - * - * @var bool - */ - protected static $constraints = true; - - /** - * An array to map class names to their morph names in database. - * - * @var array - */ - public static $morphMap = []; - - /** - * Create a new relation instance. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Model $parent - * @return void - */ - public function __construct(Builder $query, Model $parent) - { - $this->query = $query; - $this->parent = $parent; - $this->related = $query->getModel(); - - $this->addConstraints(); - } - - /** - * Run a callback with constraints disabled on the relation. - * - * @param \Closure $callback - * @return mixed - */ - public static function noConstraints(Closure $callback) - { - $previous = static::$constraints; - - static::$constraints = false; - - // When resetting the relation where clause, we want to shift the first element - // off of the bindings, leaving only the constraints that the developers put - // as "extra" on the relationships, and not original relation constraints. - try { - return call_user_func($callback); - } finally { - static::$constraints = $previous; - } - } - - /** - * Set the base constraints on the relation query. - * - * @return void - */ - abstract public function addConstraints(); - - /** - * Set the constraints for an eager load of the relation. - * - * @param array $models - * @return void - */ - abstract public function addEagerConstraints(array $models); - - /** - * Initialize the relation on a set of models. - * - * @param array $models - * @param string $relation - * @return array - */ - abstract public function initRelation(array $models, $relation); - - /** - * Match the eagerly loaded results to their parents. - * - * @param array $models - * @param \Illuminate\Database\Eloquent\Collection $results - * @param string $relation - * @return array - */ - abstract public function match(array $models, Collection $results, $relation); - - /** - * Get the results of the relationship. - * - * @return mixed - */ - abstract public function getResults(); - - /** - * Get the relationship for eager loading. - * - * @return \Illuminate\Database\Eloquent\Collection - */ - public function getEager() - { - return $this->get(); - } - - /** - * Execute the query as a "select" statement. - * - * @param array $columns - * @return \Illuminate\Database\Eloquent\Collection - */ - public function get($columns = ['*']) - { - return $this->query->get($columns); - } - - /** - * Touch all of the related models for the relationship. - * - * @return void - */ - public function touch() - { - $column = $this->getRelated()->getUpdatedAtColumn(); - - $this->rawUpdate([$column => $this->getRelated()->freshTimestampString()]); - } - - /** - * Run a raw update against the base query. - * - * @param array $attributes - * @return int - */ - public function rawUpdate(array $attributes = []) - { - return $this->query->withoutGlobalScopes()->update($attributes); - } - - /** - * Add the constraints for a relationship count query. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceCountQuery(Builder $query, Builder $parentQuery) - { - return $this->getRelationExistenceQuery( - $query, $parentQuery, new Expression('count(*)') - )->setBindings([], 'select'); - } - - /** - * Add the constraints for an internal relationship existence query. - * - * Essentially, these queries compare on column names like whereColumn. - * - * @param \Illuminate\Database\Eloquent\Builder $query - * @param \Illuminate\Database\Eloquent\Builder $parentQuery - * @param array|mixed $columns - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getRelationExistenceQuery(Builder $query, Builder $parentQuery, $columns = ['*']) - { - return $query->select($columns)->whereColumn( - $this->getQualifiedParentKeyName(), '=', $this->getExistenceCompareKey() - ); - } - - /** - * Get all of the primary keys for an array of models. - * - * @param array $models - * @param string $key - * @return array - */ - protected function getKeys(array $models, $key = null) - { - return collect($models)->map(function ($value) use ($key) { - return $key ? $value->getAttribute($key) : $value->getKey(); - })->values()->unique()->sort()->all(); - } - - /** - * Get the underlying query for the relation. - * - * @return \Illuminate\Database\Eloquent\Builder - */ - public function getQuery() - { - return $this->query; - } - - /** - * Get the base query builder driving the Eloquent builder. - * - * @return \Illuminate\Database\Query\Builder - */ - public function getBaseQuery() - { - return $this->query->getQuery(); - } - - /** - * Get the parent model of the relation. - * - * @return \Illuminate\Database\Eloquent\Model - */ - public function getParent() - { - return $this->parent; - } - - /** - * Get the fully qualified parent key name. - * - * @return string - */ - public function getQualifiedParentKeyName() - { - return $this->parent->getQualifiedKeyName(); - } - - /** - * Get the related model of the relation. - * - * @return \Illuminate\Database\Eloquent\Model - */ - public function getRelated() - { - return $this->related; - } - - /** - * Get the name of the "created at" column. - * - * @return string - */ - public function createdAt() - { - return $this->parent->getCreatedAtColumn(); - } - - /** - * Get the name of the "updated at" column. - * - * @return string - */ - public function updatedAt() - { - return $this->parent->getUpdatedAtColumn(); - } - - /** - * Get the name of the related model's "updated at" column. - * - * @return string - */ - public function relatedUpdatedAt() - { - return $this->related->getUpdatedAtColumn(); - } - - /** - * Set or get the morph map for polymorphic relations. - * - * @param array|null $map - * @param bool $merge - * @return array - */ - public static function morphMap(array $map = null, $merge = true) - { - $map = static::buildMorphMapFromModels($map); - - if (is_array($map)) { - static::$morphMap = $merge && static::$morphMap - ? $map + static::$morphMap : $map; - } - - return static::$morphMap; - } - - /** - * Builds a table-keyed array from model class names. - * - * @param string[]|null $models - * @return array|null - */ - protected static function buildMorphMapFromModels(array $models = null) - { - if (is_null($models) || Arr::isAssoc($models)) { - return $models; - } - - return array_combine(array_map(function ($model) { - return (new $model)->getTable(); - }, $models), $models); - } - - /** - * Get the model associated with a custom polymorphic type. - * - * @param string $alias - * @return string|null - */ - public static function getMorphedModel($alias) - { - return array_key_exists($alias, self::$morphMap) - ? self::$morphMap[$alias] - : null; - } - - /** - * Handle dynamic method calls to the relationship. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $parameters); - } - - $result = $this->query->{$method}(...$parameters); - - if ($result === $this->query) { - return $this; - } - - return $result; - } - - /** - * Force a clone of the underlying query builder when cloning. - * - * @return void - */ - public function __clone() - { - $this->query = clone $this->query; - } -} diff --git a/vendor/illuminate/database/Eloquent/Scope.php b/vendor/illuminate/database/Eloquent/Scope.php deleted file mode 100644 index 63cba6a..0000000 --- a/vendor/illuminate/database/Eloquent/Scope.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent; - -interface Scope -{ - /** - * Apply the scope to a given Eloquent query builder. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @param \Illuminate\Database\Eloquent\Model $model - * @return void - */ - public function apply(Builder $builder, Model $model); -} diff --git a/vendor/illuminate/database/Eloquent/SoftDeletes.php b/vendor/illuminate/database/Eloquent/SoftDeletes.php deleted file mode 100644 index a2c38c8..0000000 --- a/vendor/illuminate/database/Eloquent/SoftDeletes.php +++ /dev/null @@ -1,169 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent; - -trait SoftDeletes -{ - /** - * Indicates if the model is currently force deleting. - * - * @var bool - */ - protected $forceDeleting = false; - - /** - * Boot the soft deleting trait for a model. - * - * @return void - */ - public static function bootSoftDeletes() - { - static::addGlobalScope(new SoftDeletingScope); - } - - /** - * Force a hard delete on a soft deleted model. - * - * @return bool|null - */ - public function forceDelete() - { - $this->forceDeleting = true; - - $deleted = $this->delete(); - - $this->forceDeleting = false; - - return $deleted; - } - - /** - * Perform the actual delete query on this model instance. - * - * @return mixed - */ - protected function performDeleteOnModel() - { - if ($this->forceDeleting) { - $this->exists = false; - - return $this->newModelQuery()->where($this->getKeyName(), $this->getKey())->forceDelete(); - } - - return $this->runSoftDelete(); - } - - /** - * Perform the actual delete query on this model instance. - * - * @return void - */ - protected function runSoftDelete() - { - $query = $this->newModelQuery()->where($this->getKeyName(), $this->getKey()); - - $time = $this->freshTimestamp(); - - $columns = [$this->getDeletedAtColumn() => $this->fromDateTime($time)]; - - $this->{$this->getDeletedAtColumn()} = $time; - - if ($this->timestamps && ! is_null($this->getUpdatedAtColumn())) { - $this->{$this->getUpdatedAtColumn()} = $time; - - $columns[$this->getUpdatedAtColumn()] = $this->fromDateTime($time); - } - - $query->update($columns); - } - - /** - * Restore a soft-deleted model instance. - * - * @return bool|null - */ - public function restore() - { - // If the restoring event does not return false, we will proceed with this - // restore operation. Otherwise, we bail out so the developer will stop - // the restore totally. We will clear the deleted timestamp and save. - if ($this->fireModelEvent('restoring') === false) { - return false; - } - - $this->{$this->getDeletedAtColumn()} = null; - - // Once we have saved the model, we will fire the "restored" event so this - // developer will do anything they need to after a restore operation is - // totally finished. Then we will return the result of the save call. - $this->exists = true; - - $result = $this->save(); - - $this->fireModelEvent('restored', false); - - return $result; - } - - /** - * Determine if the model instance has been soft-deleted. - * - * @return bool - */ - public function trashed() - { - return ! is_null($this->{$this->getDeletedAtColumn()}); - } - - /** - * Register a restoring model event with the dispatcher. - * - * @param \Closure|string $callback - * @return void - */ - public static function restoring($callback) - { - static::registerModelEvent('restoring', $callback); - } - - /** - * Register a restored model event with the dispatcher. - * - * @param \Closure|string $callback - * @return void - */ - public static function restored($callback) - { - static::registerModelEvent('restored', $callback); - } - - /** - * Determine if the model is currently force deleting. - * - * @return bool - */ - public function isForceDeleting() - { - return $this->forceDeleting; - } - - /** - * Get the name of the "deleted at" column. - * - * @return string - */ - public function getDeletedAtColumn() - { - return defined('static::DELETED_AT') ? static::DELETED_AT : 'deleted_at'; - } - - /** - * Get the fully qualified "deleted at" column. - * - * @return string - */ - public function getQualifiedDeletedAtColumn() - { - return $this->qualifyColumn($this->getDeletedAtColumn()); - } -} diff --git a/vendor/illuminate/database/Eloquent/SoftDeletingScope.php b/vendor/illuminate/database/Eloquent/SoftDeletingScope.php deleted file mode 100644 index 0d51696..0000000 --- a/vendor/illuminate/database/Eloquent/SoftDeletingScope.php +++ /dev/null @@ -1,131 +0,0 @@ -<?php - -namespace Illuminate\Database\Eloquent; - -class SoftDeletingScope implements Scope -{ - /** - * All of the extensions to be added to the builder. - * - * @var array - */ - protected $extensions = ['Restore', 'WithTrashed', 'WithoutTrashed', 'OnlyTrashed']; - - /** - * Apply the scope to a given Eloquent query builder. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @param \Illuminate\Database\Eloquent\Model $model - * @return void - */ - public function apply(Builder $builder, Model $model) - { - $builder->whereNull($model->getQualifiedDeletedAtColumn()); - } - - /** - * Extend the query builder with the needed functions. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @return void - */ - public function extend(Builder $builder) - { - foreach ($this->extensions as $extension) { - $this->{"add{$extension}"}($builder); - } - - $builder->onDelete(function (Builder $builder) { - $column = $this->getDeletedAtColumn($builder); - - return $builder->update([ - $column => $builder->getModel()->freshTimestampString(), - ]); - }); - } - - /** - * Get the "deleted at" column for the builder. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @return string - */ - protected function getDeletedAtColumn(Builder $builder) - { - if (count((array) $builder->getQuery()->joins) > 0) { - return $builder->getModel()->getQualifiedDeletedAtColumn(); - } - - return $builder->getModel()->getDeletedAtColumn(); - } - - /** - * Add the restore extension to the builder. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @return void - */ - protected function addRestore(Builder $builder) - { - $builder->macro('restore', function (Builder $builder) { - $builder->withTrashed(); - - return $builder->update([$builder->getModel()->getDeletedAtColumn() => null]); - }); - } - - /** - * Add the with-trashed extension to the builder. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @return void - */ - protected function addWithTrashed(Builder $builder) - { - $builder->macro('withTrashed', function (Builder $builder, $withTrashed = true) { - if (! $withTrashed) { - return $builder->withoutTrashed(); - } - - return $builder->withoutGlobalScope($this); - }); - } - - /** - * Add the without-trashed extension to the builder. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @return void - */ - protected function addWithoutTrashed(Builder $builder) - { - $builder->macro('withoutTrashed', function (Builder $builder) { - $model = $builder->getModel(); - - $builder->withoutGlobalScope($this)->whereNull( - $model->getQualifiedDeletedAtColumn() - ); - - return $builder; - }); - } - - /** - * Add the only-trashed extension to the builder. - * - * @param \Illuminate\Database\Eloquent\Builder $builder - * @return void - */ - protected function addOnlyTrashed(Builder $builder) - { - $builder->macro('onlyTrashed', function (Builder $builder) { - $model = $builder->getModel(); - - $builder->withoutGlobalScope($this)->whereNotNull( - $model->getQualifiedDeletedAtColumn() - ); - - return $builder; - }); - } -} diff --git a/vendor/illuminate/database/Events/ConnectionEvent.php b/vendor/illuminate/database/Events/ConnectionEvent.php deleted file mode 100644 index 818c785..0000000 --- a/vendor/illuminate/database/Events/ConnectionEvent.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace Illuminate\Database\Events; - -abstract class ConnectionEvent -{ - /** - * The name of the connection. - * - * @var string - */ - public $connectionName; - - /** - * The database connection instance. - * - * @var \Illuminate\Database\Connection - */ - public $connection; - - /** - * Create a new event instance. - * - * @param \Illuminate\Database\Connection $connection - * @return void - */ - public function __construct($connection) - { - $this->connection = $connection; - $this->connectionName = $connection->getName(); - } -} diff --git a/vendor/illuminate/database/Events/QueryExecuted.php b/vendor/illuminate/database/Events/QueryExecuted.php deleted file mode 100644 index 833a21e..0000000 --- a/vendor/illuminate/database/Events/QueryExecuted.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -namespace Illuminate\Database\Events; - -class QueryExecuted -{ - /** - * The SQL query that was executed. - * - * @var string - */ - public $sql; - - /** - * The array of query bindings. - * - * @var array - */ - public $bindings; - - /** - * The number of milliseconds it took to execute the query. - * - * @var float - */ - public $time; - - /** - * The database connection instance. - * - * @var \Illuminate\Database\Connection - */ - public $connection; - - /** - * The database connection name. - * - * @var string - */ - public $connectionName; - - /** - * Create a new event instance. - * - * @param string $sql - * @param array $bindings - * @param float|null $time - * @param \Illuminate\Database\Connection $connection - * @return void - */ - public function __construct($sql, $bindings, $time, $connection) - { - $this->sql = $sql; - $this->time = $time; - $this->bindings = $bindings; - $this->connection = $connection; - $this->connectionName = $connection->getName(); - } -} diff --git a/vendor/illuminate/database/Events/StatementPrepared.php b/vendor/illuminate/database/Events/StatementPrepared.php deleted file mode 100644 index 2f60323..0000000 --- a/vendor/illuminate/database/Events/StatementPrepared.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -namespace Illuminate\Database\Events; - -class StatementPrepared -{ - /** - * The database connection instance. - * - * @var \Illuminate\Database\Connection - */ - public $connection; - - /** - * The PDO statement. - * - * @var \PDOStatement - */ - public $statement; - - /** - * Create a new event instance. - * - * @param \Illuminate\Database\Connection $connection - * @param \PDOStatement $statement - * @return void - */ - public function __construct($connection, $statement) - { - $this->statement = $statement; - $this->connection = $connection; - } -} diff --git a/vendor/illuminate/database/Events/TransactionBeginning.php b/vendor/illuminate/database/Events/TransactionBeginning.php deleted file mode 100644 index 3287b5c..0000000 --- a/vendor/illuminate/database/Events/TransactionBeginning.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php - -namespace Illuminate\Database\Events; - -class TransactionBeginning extends ConnectionEvent -{ - // -} diff --git a/vendor/illuminate/database/Events/TransactionCommitted.php b/vendor/illuminate/database/Events/TransactionCommitted.php deleted file mode 100644 index a2f4cff..0000000 --- a/vendor/illuminate/database/Events/TransactionCommitted.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php - -namespace Illuminate\Database\Events; - -class TransactionCommitted extends ConnectionEvent -{ - // -} diff --git a/vendor/illuminate/database/Events/TransactionRolledBack.php b/vendor/illuminate/database/Events/TransactionRolledBack.php deleted file mode 100644 index 2457933..0000000 --- a/vendor/illuminate/database/Events/TransactionRolledBack.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php - -namespace Illuminate\Database\Events; - -class TransactionRolledBack extends ConnectionEvent -{ - // -} diff --git a/vendor/illuminate/database/Grammar.php b/vendor/illuminate/database/Grammar.php deleted file mode 100644 index 243f07c..0000000 --- a/vendor/illuminate/database/Grammar.php +++ /dev/null @@ -1,205 +0,0 @@ -<?php - -namespace Illuminate\Database; - -use Illuminate\Database\Query\Expression; - -abstract class Grammar -{ - /** - * The grammar table prefix. - * - * @var string - */ - protected $tablePrefix = ''; - - /** - * Wrap an array of values. - * - * @param array $values - * @return array - */ - public function wrapArray(array $values) - { - return array_map([$this, 'wrap'], $values); - } - - /** - * Wrap a table in keyword identifiers. - * - * @param \Illuminate\Database\Query\Expression|string $table - * @return string - */ - public function wrapTable($table) - { - if (! $this->isExpression($table)) { - return $this->wrap($this->tablePrefix.$table, true); - } - - return $this->getValue($table); - } - - /** - * Wrap a value in keyword identifiers. - * - * @param \Illuminate\Database\Query\Expression|string $value - * @param bool $prefixAlias - * @return string - */ - public function wrap($value, $prefixAlias = false) - { - if ($this->isExpression($value)) { - return $this->getValue($value); - } - - // If the value being wrapped has a column alias we will need to separate out - // the pieces so we can wrap each of the segments of the expression on it - // own, and then joins them both back together with the "as" connector. - if (strpos(strtolower($value), ' as ') !== false) { - return $this->wrapAliasedValue($value, $prefixAlias); - } - - return $this->wrapSegments(explode('.', $value)); - } - - /** - * Wrap a value that has an alias. - * - * @param string $value - * @param bool $prefixAlias - * @return string - */ - protected function wrapAliasedValue($value, $prefixAlias = false) - { - $segments = preg_split('/\s+as\s+/i', $value); - - // If we are wrapping a table we need to prefix the alias with the table prefix - // as well in order to generate proper syntax. If this is a column of course - // no prefix is necessary. The condition will be true when from wrapTable. - if ($prefixAlias) { - $segments[1] = $this->tablePrefix.$segments[1]; - } - - return $this->wrap( - $segments[0]).' as '.$this->wrapValue($segments[1] - ); - } - - /** - * Wrap the given value segments. - * - * @param array $segments - * @return string - */ - protected function wrapSegments($segments) - { - return collect($segments)->map(function ($segment, $key) use ($segments) { - return $key == 0 && count($segments) > 1 - ? $this->wrapTable($segment) - : $this->wrapValue($segment); - })->implode('.'); - } - - /** - * Wrap a single string in keyword identifiers. - * - * @param string $value - * @return string - */ - protected function wrapValue($value) - { - if ($value !== '*') { - return '"'.str_replace('"', '""', $value).'"'; - } - - return $value; - } - - /** - * Convert an array of column names into a delimited string. - * - * @param array $columns - * @return string - */ - public function columnize(array $columns) - { - return implode(', ', array_map([$this, 'wrap'], $columns)); - } - - /** - * Create query parameter place-holders for an array. - * - * @param array $values - * @return string - */ - public function parameterize(array $values) - { - return implode(', ', array_map([$this, 'parameter'], $values)); - } - - /** - * Get the appropriate query parameter place-holder for a value. - * - * @param mixed $value - * @return string - */ - public function parameter($value) - { - return $this->isExpression($value) ? $this->getValue($value) : '?'; - } - - /** - * Determine if the given value is a raw expression. - * - * @param mixed $value - * @return bool - */ - public function isExpression($value) - { - return $value instanceof Expression; - } - - /** - * Get the value of a raw expression. - * - * @param \Illuminate\Database\Query\Expression $expression - * @return string - */ - public function getValue($expression) - { - return $expression->getValue(); - } - - /** - * Get the format for database stored dates. - * - * @return string - */ - public function getDateFormat() - { - return 'Y-m-d H:i:s'; - } - - /** - * Get the grammar's table prefix. - * - * @return string - */ - public function getTablePrefix() - { - return $this->tablePrefix; - } - - /** - * Set the grammar's table prefix. - * - * @param string $prefix - * @return $this - */ - public function setTablePrefix($prefix) - { - $this->tablePrefix = $prefix; - - return $this; - } -} diff --git a/vendor/illuminate/database/MigrationServiceProvider.php b/vendor/illuminate/database/MigrationServiceProvider.php deleted file mode 100644 index a8b92ab..0000000 --- a/vendor/illuminate/database/MigrationServiceProvider.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php - -namespace Illuminate\Database; - -use Illuminate\Support\ServiceProvider; -use Illuminate\Database\Migrations\Migrator; -use Illuminate\Database\Migrations\MigrationCreator; -use Illuminate\Database\Migrations\DatabaseMigrationRepository; - -class MigrationServiceProvider extends ServiceProvider -{ - /** - * Indicates if loading of the provider is deferred. - * - * @var bool - */ - protected $defer = true; - - /** - * Register the service provider. - * - * @return void - */ - public function register() - { - $this->registerRepository(); - - $this->registerMigrator(); - - $this->registerCreator(); - } - - /** - * Register the migration repository service. - * - * @return void - */ - protected function registerRepository() - { - $this->app->singleton('migration.repository', function ($app) { - $table = $app['config']['database.migrations']; - - return new DatabaseMigrationRepository($app['db'], $table); - }); - } - - /** - * Register the migrator service. - * - * @return void - */ - protected function registerMigrator() - { - // The migrator is responsible for actually running and rollback the migration - // files in the application. We'll pass in our database connection resolver - // so the migrator can resolve any of these connections when it needs to. - $this->app->singleton('migrator', function ($app) { - $repository = $app['migration.repository']; - - return new Migrator($repository, $app['db'], $app['files']); - }); - } - - /** - * Register the migration creator. - * - * @return void - */ - protected function registerCreator() - { - $this->app->singleton('migration.creator', function ($app) { - return new MigrationCreator($app['files']); - }); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return [ - 'migrator', 'migration.repository', 'migration.creator', - ]; - } -} diff --git a/vendor/illuminate/database/Migrations/DatabaseMigrationRepository.php b/vendor/illuminate/database/Migrations/DatabaseMigrationRepository.php deleted file mode 100644 index b1685ff..0000000 --- a/vendor/illuminate/database/Migrations/DatabaseMigrationRepository.php +++ /dev/null @@ -1,199 +0,0 @@ -<?php - -namespace Illuminate\Database\Migrations; - -use Illuminate\Database\ConnectionResolverInterface as Resolver; - -class DatabaseMigrationRepository implements MigrationRepositoryInterface -{ - /** - * The database connection resolver instance. - * - * @var \Illuminate\Database\ConnectionResolverInterface - */ - protected $resolver; - - /** - * The name of the migration table. - * - * @var string - */ - protected $table; - - /** - * The name of the database connection to use. - * - * @var string - */ - protected $connection; - - /** - * Create a new database migration repository instance. - * - * @param \Illuminate\Database\ConnectionResolverInterface $resolver - * @param string $table - * @return void - */ - public function __construct(Resolver $resolver, $table) - { - $this->table = $table; - $this->resolver = $resolver; - } - - /** - * Get the ran migrations. - * - * @return array - */ - public function getRan() - { - return $this->table() - ->orderBy('batch', 'asc') - ->orderBy('migration', 'asc') - ->pluck('migration')->all(); - } - - /** - * Get list of migrations. - * - * @param int $steps - * @return array - */ - public function getMigrations($steps) - { - $query = $this->table()->where('batch', '>=', '1'); - - return $query->orderBy('batch', 'desc') - ->orderBy('migration', 'desc') - ->take($steps)->get()->all(); - } - - /** - * Get the last migration batch. - * - * @return array - */ - public function getLast() - { - $query = $this->table()->where('batch', $this->getLastBatchNumber()); - - return $query->orderBy('migration', 'desc')->get()->all(); - } - - /** - * Log that a migration was run. - * - * @param string $file - * @param int $batch - * @return void - */ - public function log($file, $batch) - { - $record = ['migration' => $file, 'batch' => $batch]; - - $this->table()->insert($record); - } - - /** - * Remove a migration from the log. - * - * @param object $migration - * @return void - */ - public function delete($migration) - { - $this->table()->where('migration', $migration->migration)->delete(); - } - - /** - * Get the next migration batch number. - * - * @return int - */ - public function getNextBatchNumber() - { - return $this->getLastBatchNumber() + 1; - } - - /** - * Get the last migration batch number. - * - * @return int - */ - public function getLastBatchNumber() - { - return $this->table()->max('batch'); - } - - /** - * Create the migration repository data store. - * - * @return void - */ - public function createRepository() - { - $schema = $this->getConnection()->getSchemaBuilder(); - - $schema->create($this->table, function ($table) { - // The migrations table is responsible for keeping track of which of the - // migrations have actually run for the application. We'll create the - // table to hold the migration file's path as well as the batch ID. - $table->increments('id'); - $table->string('migration'); - $table->integer('batch'); - }); - } - - /** - * Determine if the migration repository exists. - * - * @return bool - */ - public function repositoryExists() - { - $schema = $this->getConnection()->getSchemaBuilder(); - - return $schema->hasTable($this->table); - } - - /** - * Get a query builder for the migration table. - * - * @return \Illuminate\Database\Query\Builder - */ - protected function table() - { - return $this->getConnection()->table($this->table)->useWritePdo(); - } - - /** - * Get the connection resolver instance. - * - * @return \Illuminate\Database\ConnectionResolverInterface - */ - public function getConnectionResolver() - { - return $this->resolver; - } - - /** - * Resolve the database connection instance. - * - * @return \Illuminate\Database\Connection - */ - public function getConnection() - { - return $this->resolver->connection($this->connection); - } - - /** - * Set the information source to gather data. - * - * @param string $name - * @return void - */ - public function setSource($name) - { - $this->connection = $name; - } -} diff --git a/vendor/illuminate/database/Migrations/Migration.php b/vendor/illuminate/database/Migrations/Migration.php deleted file mode 100644 index ac1b9e7..0000000 --- a/vendor/illuminate/database/Migrations/Migration.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -namespace Illuminate\Database\Migrations; - -abstract class Migration -{ - /** - * The name of the database connection to use. - * - * @var string - */ - protected $connection; - - /** - * Enables, if supported, wrapping the migration within a transaction. - * - * @var bool - */ - public $withinTransaction = true; - - /** - * Get the migration connection name. - * - * @return string - */ - public function getConnection() - { - return $this->connection; - } -} diff --git a/vendor/illuminate/database/Migrations/MigrationCreator.php b/vendor/illuminate/database/Migrations/MigrationCreator.php deleted file mode 100644 index 719fbf1..0000000 --- a/vendor/illuminate/database/Migrations/MigrationCreator.php +++ /dev/null @@ -1,202 +0,0 @@ -<?php - -namespace Illuminate\Database\Migrations; - -use Closure; -use Illuminate\Support\Str; -use InvalidArgumentException; -use Illuminate\Filesystem\Filesystem; - -class MigrationCreator -{ - /** - * The filesystem instance. - * - * @var \Illuminate\Filesystem\Filesystem - */ - protected $files; - - /** - * The registered post create hooks. - * - * @var array - */ - protected $postCreate = []; - - /** - * Create a new migration creator instance. - * - * @param \Illuminate\Filesystem\Filesystem $files - * @return void - */ - public function __construct(Filesystem $files) - { - $this->files = $files; - } - - /** - * Create a new migration at the given path. - * - * @param string $name - * @param string $path - * @param string $table - * @param bool $create - * @return string - * @throws \Exception - */ - public function create($name, $path, $table = null, $create = false) - { - $this->ensureMigrationDoesntAlreadyExist($name); - - // First we will get the stub file for the migration, which serves as a type - // of template for the migration. Once we have those we will populate the - // various place-holders, save the file, and run the post create event. - $stub = $this->getStub($table, $create); - - $this->files->put( - $path = $this->getPath($name, $path), - $this->populateStub($name, $stub, $table) - ); - - // Next, we will fire any hooks that are supposed to fire after a migration is - // created. Once that is done we'll be ready to return the full path to the - // migration file so it can be used however it's needed by the developer. - $this->firePostCreateHooks(); - - return $path; - } - - /** - * Ensure that a migration with the given name doesn't already exist. - * - * @param string $name - * @return void - * - * @throws \InvalidArgumentException - */ - protected function ensureMigrationDoesntAlreadyExist($name) - { - if (class_exists($className = $this->getClassName($name))) { - throw new InvalidArgumentException("A {$className} class already exists."); - } - } - - /** - * Get the migration stub file. - * - * @param string $table - * @param bool $create - * @return string - */ - protected function getStub($table, $create) - { - if (is_null($table)) { - return $this->files->get($this->stubPath().'/blank.stub'); - } - - // We also have stubs for creating new tables and modifying existing tables - // to save the developer some typing when they are creating a new tables - // or modifying existing tables. We'll grab the appropriate stub here. - $stub = $create ? 'create.stub' : 'update.stub'; - - return $this->files->get($this->stubPath()."/{$stub}"); - } - - /** - * Populate the place-holders in the migration stub. - * - * @param string $name - * @param string $stub - * @param string $table - * @return string - */ - protected function populateStub($name, $stub, $table) - { - $stub = str_replace('DummyClass', $this->getClassName($name), $stub); - - // Here we will replace the table place-holders with the table specified by - // the developer, which is useful for quickly creating a tables creation - // or update migration from the console instead of typing it manually. - if (! is_null($table)) { - $stub = str_replace('DummyTable', $table, $stub); - } - - return $stub; - } - - /** - * Get the class name of a migration name. - * - * @param string $name - * @return string - */ - protected function getClassName($name) - { - return Str::studly($name); - } - - /** - * Get the full path to the migration. - * - * @param string $name - * @param string $path - * @return string - */ - protected function getPath($name, $path) - { - return $path.'/'.$this->getDatePrefix().'_'.$name.'.php'; - } - - /** - * Fire the registered post create hooks. - * - * @return void - */ - protected function firePostCreateHooks() - { - foreach ($this->postCreate as $callback) { - call_user_func($callback); - } - } - - /** - * Register a post migration create hook. - * - * @param \Closure $callback - * @return void - */ - public function afterCreate(Closure $callback) - { - $this->postCreate[] = $callback; - } - - /** - * Get the date prefix for the migration. - * - * @return string - */ - protected function getDatePrefix() - { - return date('Y_m_d_His'); - } - - /** - * Get the path to the stubs. - * - * @return string - */ - public function stubPath() - { - return __DIR__.'/stubs'; - } - - /** - * Get the filesystem instance. - * - * @return \Illuminate\Filesystem\Filesystem - */ - public function getFilesystem() - { - return $this->files; - } -} diff --git a/vendor/illuminate/database/Migrations/MigrationRepositoryInterface.php b/vendor/illuminate/database/Migrations/MigrationRepositoryInterface.php deleted file mode 100644 index 60bc921..0000000 --- a/vendor/illuminate/database/Migrations/MigrationRepositoryInterface.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php - -namespace Illuminate\Database\Migrations; - -interface MigrationRepositoryInterface -{ - /** - * Get the ran migrations for a given package. - * - * @return array - */ - public function getRan(); - - /** - * Get list of migrations. - * - * @param int $steps - * @return array - */ - public function getMigrations($steps); - - /** - * Get the last migration batch. - * - * @return array - */ - public function getLast(); - - /** - * Log that a migration was run. - * - * @param string $file - * @param int $batch - * @return void - */ - public function log($file, $batch); - - /** - * Remove a migration from the log. - * - * @param object $migration - * @return void - */ - public function delete($migration); - - /** - * Get the next migration batch number. - * - * @return int - */ - public function getNextBatchNumber(); - - /** - * Create the migration repository data store. - * - * @return void - */ - public function createRepository(); - - /** - * Determine if the migration repository exists. - * - * @return bool - */ - public function repositoryExists(); - - /** - * Set the information source to gather data. - * - * @param string $name - * @return void - */ - public function setSource($name); -} diff --git a/vendor/illuminate/database/Migrations/Migrator.php b/vendor/illuminate/database/Migrations/Migrator.php deleted file mode 100644 index d55046d..0000000 --- a/vendor/illuminate/database/Migrations/Migrator.php +++ /dev/null @@ -1,578 +0,0 @@ -<?php - -namespace Illuminate\Database\Migrations; - -use Illuminate\Support\Arr; -use Illuminate\Support\Str; -use Illuminate\Support\Collection; -use Illuminate\Filesystem\Filesystem; -use Illuminate\Database\ConnectionResolverInterface as Resolver; - -class Migrator -{ - /** - * The migration repository implementation. - * - * @var \Illuminate\Database\Migrations\MigrationRepositoryInterface - */ - protected $repository; - - /** - * The filesystem instance. - * - * @var \Illuminate\Filesystem\Filesystem - */ - protected $files; - - /** - * The connection resolver instance. - * - * @var \Illuminate\Database\ConnectionResolverInterface - */ - protected $resolver; - - /** - * The name of the default connection. - * - * @var string - */ - protected $connection; - - /** - * The notes for the current operation. - * - * @var array - */ - protected $notes = []; - - /** - * The paths to all of the migration files. - * - * @var array - */ - protected $paths = []; - - /** - * Create a new migrator instance. - * - * @param \Illuminate\Database\Migrations\MigrationRepositoryInterface $repository - * @param \Illuminate\Database\ConnectionResolverInterface $resolver - * @param \Illuminate\Filesystem\Filesystem $files - * @return void - */ - public function __construct(MigrationRepositoryInterface $repository, - Resolver $resolver, - Filesystem $files) - { - $this->files = $files; - $this->resolver = $resolver; - $this->repository = $repository; - } - - /** - * Run the pending migrations at a given path. - * - * @param array|string $paths - * @param array $options - * @return array - */ - public function run($paths = [], array $options = []) - { - $this->notes = []; - - // Once we grab all of the migration files for the path, we will compare them - // against the migrations that have already been run for this package then - // run each of the outstanding migrations against a database connection. - $files = $this->getMigrationFiles($paths); - - $this->requireFiles($migrations = $this->pendingMigrations( - $files, $this->repository->getRan() - )); - - // Once we have all these migrations that are outstanding we are ready to run - // we will go ahead and run them "up". This will execute each migration as - // an operation against a database. Then we'll return this list of them. - $this->runPending($migrations, $options); - - return $migrations; - } - - /** - * Get the migration files that have not yet run. - * - * @param array $files - * @param array $ran - * @return array - */ - protected function pendingMigrations($files, $ran) - { - return Collection::make($files) - ->reject(function ($file) use ($ran) { - return in_array($this->getMigrationName($file), $ran); - })->values()->all(); - } - - /** - * Run an array of migrations. - * - * @param array $migrations - * @param array $options - * @return void - */ - public function runPending(array $migrations, array $options = []) - { - // First we will just make sure that there are any migrations to run. If there - // aren't, we will just make a note of it to the developer so they're aware - // that all of the migrations have been run against this database system. - if (count($migrations) == 0) { - $this->note('<info>Nothing to migrate.</info>'); - - return; - } - - // Next, we will get the next batch number for the migrations so we can insert - // correct batch number in the database migrations repository when we store - // each migration's execution. We will also extract a few of the options. - $batch = $this->repository->getNextBatchNumber(); - - $pretend = $options['pretend'] ?? false; - - $step = $options['step'] ?? false; - - // Once we have the array of migrations, we will spin through them and run the - // migrations "up" so the changes are made to the databases. We'll then log - // that the migration was run so we don't repeat it next time we execute. - foreach ($migrations as $file) { - $this->runUp($file, $batch, $pretend); - - if ($step) { - $batch++; - } - } - } - - /** - * Run "up" a migration instance. - * - * @param string $file - * @param int $batch - * @param bool $pretend - * @return void - */ - protected function runUp($file, $batch, $pretend) - { - // First we will resolve a "real" instance of the migration class from this - // migration file name. Once we have the instances we can run the actual - // command such as "up" or "down", or we can just simulate the action. - $migration = $this->resolve( - $name = $this->getMigrationName($file) - ); - - if ($pretend) { - return $this->pretendToRun($migration, 'up'); - } - - $this->note("<comment>Migrating:</comment> {$name}"); - - $this->runMigration($migration, 'up'); - - // Once we have run a migrations class, we will log that it was run in this - // repository so that we don't try to run it next time we do a migration - // in the application. A migration repository keeps the migrate order. - $this->repository->log($name, $batch); - - $this->note("<info>Migrated:</info> {$name}"); - } - - /** - * Rollback the last migration operation. - * - * @param array|string $paths - * @param array $options - * @return array - */ - public function rollback($paths = [], array $options = []) - { - $this->notes = []; - - // We want to pull in the last batch of migrations that ran on the previous - // migration operation. We'll then reverse those migrations and run each - // of them "down" to reverse the last migration "operation" which ran. - $migrations = $this->getMigrationsForRollback($options); - - if (count($migrations) === 0) { - $this->note('<info>Nothing to rollback.</info>'); - - return []; - } - - return $this->rollbackMigrations($migrations, $paths, $options); - } - - /** - * Get the migrations for a rollback operation. - * - * @param array $options - * @return array - */ - protected function getMigrationsForRollback(array $options) - { - if (($steps = $options['step'] ?? 0) > 0) { - return $this->repository->getMigrations($steps); - } else { - return $this->repository->getLast(); - } - } - - /** - * Rollback the given migrations. - * - * @param array $migrations - * @param array|string $paths - * @param array $options - * @return array - */ - protected function rollbackMigrations(array $migrations, $paths, array $options) - { - $rolledBack = []; - - $this->requireFiles($files = $this->getMigrationFiles($paths)); - - // Next we will run through all of the migrations and call the "down" method - // which will reverse each migration in order. This getLast method on the - // repository already returns these migration's names in reverse order. - foreach ($migrations as $migration) { - $migration = (object) $migration; - - if (! $file = Arr::get($files, $migration->migration)) { - $this->note("<fg=red>Migration not found:</> {$migration->migration}"); - - continue; - } - - $rolledBack[] = $file; - - $this->runDown( - $file, $migration, - $options['pretend'] ?? false - ); - } - - return $rolledBack; - } - - /** - * Rolls all of the currently applied migrations back. - * - * @param array|string $paths - * @param bool $pretend - * @return array - */ - public function reset($paths = [], $pretend = false) - { - $this->notes = []; - - // Next, we will reverse the migration list so we can run them back in the - // correct order for resetting this database. This will allow us to get - // the database back into its "empty" state ready for the migrations. - $migrations = array_reverse($this->repository->getRan()); - - if (count($migrations) === 0) { - $this->note('<info>Nothing to rollback.</info>'); - - return []; - } - - return $this->resetMigrations($migrations, $paths, $pretend); - } - - /** - * Reset the given migrations. - * - * @param array $migrations - * @param array $paths - * @param bool $pretend - * @return array - */ - protected function resetMigrations(array $migrations, array $paths, $pretend = false) - { - // Since the getRan method that retrieves the migration name just gives us the - // migration name, we will format the names into objects with the name as a - // property on the objects so that we can pass it to the rollback method. - $migrations = collect($migrations)->map(function ($m) { - return (object) ['migration' => $m]; - })->all(); - - return $this->rollbackMigrations( - $migrations, $paths, compact('pretend') - ); - } - - /** - * Run "down" a migration instance. - * - * @param string $file - * @param object $migration - * @param bool $pretend - * @return void - */ - protected function runDown($file, $migration, $pretend) - { - // First we will get the file name of the migration so we can resolve out an - // instance of the migration. Once we get an instance we can either run a - // pretend execution of the migration or we can run the real migration. - $instance = $this->resolve( - $name = $this->getMigrationName($file) - ); - - $this->note("<comment>Rolling back:</comment> {$name}"); - - if ($pretend) { - return $this->pretendToRun($instance, 'down'); - } - - $this->runMigration($instance, 'down'); - - // Once we have successfully run the migration "down" we will remove it from - // the migration repository so it will be considered to have not been run - // by the application then will be able to fire by any later operation. - $this->repository->delete($migration); - - $this->note("<info>Rolled back:</info> {$name}"); - } - - /** - * Run a migration inside a transaction if the database supports it. - * - * @param object $migration - * @param string $method - * @return void - */ - protected function runMigration($migration, $method) - { - $connection = $this->resolveConnection( - $migration->getConnection() - ); - - $callback = function () use ($migration, $method) { - if (method_exists($migration, $method)) { - $migration->{$method}(); - } - }; - - $this->getSchemaGrammar($connection)->supportsSchemaTransactions() - && $migration->withinTransaction - ? $connection->transaction($callback) - : $callback(); - } - - /** - * Pretend to run the migrations. - * - * @param object $migration - * @param string $method - * @return void - */ - protected function pretendToRun($migration, $method) - { - foreach ($this->getQueries($migration, $method) as $query) { - $name = get_class($migration); - - $this->note("<info>{$name}:</info> {$query['query']}"); - } - } - - /** - * Get all of the queries that would be run for a migration. - * - * @param object $migration - * @param string $method - * @return array - */ - protected function getQueries($migration, $method) - { - // Now that we have the connections we can resolve it and pretend to run the - // queries against the database returning the array of raw SQL statements - // that would get fired against the database system for this migration. - $db = $this->resolveConnection( - $migration->getConnection() - ); - - return $db->pretend(function () use ($migration, $method) { - if (method_exists($migration, $method)) { - $migration->{$method}(); - } - }); - } - - /** - * Resolve a migration instance from a file. - * - * @param string $file - * @return object - */ - public function resolve($file) - { - $class = Str::studly(implode('_', array_slice(explode('_', $file), 4))); - - return new $class; - } - - /** - * Get all of the migration files in a given path. - * - * @param string|array $paths - * @return array - */ - public function getMigrationFiles($paths) - { - return Collection::make($paths)->flatMap(function ($path) { - return $this->files->glob($path.'/*_*.php'); - })->filter()->sortBy(function ($file) { - return $this->getMigrationName($file); - })->values()->keyBy(function ($file) { - return $this->getMigrationName($file); - })->all(); - } - - /** - * Require in all the migration files in a given path. - * - * @param array $files - * @return void - */ - public function requireFiles(array $files) - { - foreach ($files as $file) { - $this->files->requireOnce($file); - } - } - - /** - * Get the name of the migration. - * - * @param string $path - * @return string - */ - public function getMigrationName($path) - { - return str_replace('.php', '', basename($path)); - } - - /** - * Register a custom migration path. - * - * @param string $path - * @return void - */ - public function path($path) - { - $this->paths = array_unique(array_merge($this->paths, [$path])); - } - - /** - * Get all of the custom migration paths. - * - * @return array - */ - public function paths() - { - return $this->paths; - } - - /** - * Set the default connection name. - * - * @param string $name - * @return void - */ - public function setConnection($name) - { - if (! is_null($name)) { - $this->resolver->setDefaultConnection($name); - } - - $this->repository->setSource($name); - - $this->connection = $name; - } - - /** - * Resolve the database connection instance. - * - * @param string $connection - * @return \Illuminate\Database\Connection - */ - public function resolveConnection($connection) - { - return $this->resolver->connection($connection ?: $this->connection); - } - - /** - * Get the schema grammar out of a migration connection. - * - * @param \Illuminate\Database\Connection $connection - * @return \Illuminate\Database\Schema\Grammars\Grammar - */ - protected function getSchemaGrammar($connection) - { - if (is_null($grammar = $connection->getSchemaGrammar())) { - $connection->useDefaultSchemaGrammar(); - - $grammar = $connection->getSchemaGrammar(); - } - - return $grammar; - } - - /** - * Get the migration repository instance. - * - * @return \Illuminate\Database\Migrations\MigrationRepositoryInterface - */ - public function getRepository() - { - return $this->repository; - } - - /** - * Determine if the migration repository exists. - * - * @return bool - */ - public function repositoryExists() - { - return $this->repository->repositoryExists(); - } - - /** - * Get the file system instance. - * - * @return \Illuminate\Filesystem\Filesystem - */ - public function getFilesystem() - { - return $this->files; - } - - /** - * Raise a note event for the migrator. - * - * @param string $message - * @return void - */ - protected function note($message) - { - $this->notes[] = $message; - } - - /** - * Get the notes for the last operation. - * - * @return array - */ - public function getNotes() - { - return $this->notes; - } -} diff --git a/vendor/illuminate/database/Migrations/stubs/blank.stub b/vendor/illuminate/database/Migrations/stubs/blank.stub deleted file mode 100644 index da4ce82..0000000 --- a/vendor/illuminate/database/Migrations/stubs/blank.stub +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -use Illuminate\Support\Facades\Schema; -use Illuminate\Database\Schema\Blueprint; -use Illuminate\Database\Migrations\Migration; - -class DummyClass extends Migration -{ - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - // - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - // - } -} diff --git a/vendor/illuminate/database/Migrations/stubs/create.stub b/vendor/illuminate/database/Migrations/stubs/create.stub deleted file mode 100644 index a98c474..0000000 --- a/vendor/illuminate/database/Migrations/stubs/create.stub +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -use Illuminate\Support\Facades\Schema; -use Illuminate\Database\Schema\Blueprint; -use Illuminate\Database\Migrations\Migration; - -class DummyClass extends Migration -{ - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::create('DummyTable', function (Blueprint $table) { - $table->increments('id'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('DummyTable'); - } -} diff --git a/vendor/illuminate/database/Migrations/stubs/update.stub b/vendor/illuminate/database/Migrations/stubs/update.stub deleted file mode 100644 index 1fd4f6e..0000000 --- a/vendor/illuminate/database/Migrations/stubs/update.stub +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -use Illuminate\Support\Facades\Schema; -use Illuminate\Database\Schema\Blueprint; -use Illuminate\Database\Migrations\Migration; - -class DummyClass extends Migration -{ - /** - * Run the migrations. - * - * @return void - */ - public function up() - { - Schema::table('DummyTable', function (Blueprint $table) { - // - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('DummyTable', function (Blueprint $table) { - // - }); - } -} diff --git a/vendor/illuminate/database/MySqlConnection.php b/vendor/illuminate/database/MySqlConnection.php deleted file mode 100644 index 1e7fff2..0000000 --- a/vendor/illuminate/database/MySqlConnection.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php - -namespace Illuminate\Database; - -use PDO; -use Illuminate\Database\Schema\MySqlBuilder; -use Illuminate\Database\Query\Processors\MySqlProcessor; -use Doctrine\DBAL\Driver\PDOMySql\Driver as DoctrineDriver; -use Illuminate\Database\Query\Grammars\MySqlGrammar as QueryGrammar; -use Illuminate\Database\Schema\Grammars\MySqlGrammar as SchemaGrammar; - -class MySqlConnection extends Connection -{ - /** - * Get the default query grammar instance. - * - * @return \Illuminate\Database\Query\Grammars\MySqlGrammar - */ - protected function getDefaultQueryGrammar() - { - return $this->withTablePrefix(new QueryGrammar); - } - - /** - * Get a schema builder instance for the connection. - * - * @return \Illuminate\Database\Schema\MySqlBuilder - */ - public function getSchemaBuilder() - { - if (is_null($this->schemaGrammar)) { - $this->useDefaultSchemaGrammar(); - } - - return new MySqlBuilder($this); - } - - /** - * Get the default schema grammar instance. - * - * @return \Illuminate\Database\Schema\Grammars\MySqlGrammar - */ - protected function getDefaultSchemaGrammar() - { - return $this->withTablePrefix(new SchemaGrammar); - } - - /** - * Get the default post processor instance. - * - * @return \Illuminate\Database\Query\Processors\MySqlProcessor - */ - protected function getDefaultPostProcessor() - { - return new MySqlProcessor; - } - - /** - * Get the Doctrine DBAL driver. - * - * @return \Doctrine\DBAL\Driver\PDOMySql\Driver - */ - protected function getDoctrineDriver() - { - return new DoctrineDriver; - } - - /** - * Bind values to their parameters in the given statement. - * - * @param \PDOStatement $statement - * @param array $bindings - * @return void - */ - public function bindValues($statement, $bindings) - { - foreach ($bindings as $key => $value) { - $statement->bindValue( - is_string($key) ? $key : $key + 1, $value, - is_int($value) || is_float($value) ? PDO::PARAM_INT : PDO::PARAM_STR - ); - } - } -} diff --git a/vendor/illuminate/database/PostgresConnection.php b/vendor/illuminate/database/PostgresConnection.php deleted file mode 100644 index 01804a7..0000000 --- a/vendor/illuminate/database/PostgresConnection.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - -namespace Illuminate\Database; - -use Illuminate\Database\Schema\PostgresBuilder; -use Doctrine\DBAL\Driver\PDOPgSql\Driver as DoctrineDriver; -use Illuminate\Database\Query\Processors\PostgresProcessor; -use Illuminate\Database\Query\Grammars\PostgresGrammar as QueryGrammar; -use Illuminate\Database\Schema\Grammars\PostgresGrammar as SchemaGrammar; - -class PostgresConnection extends Connection -{ - /** - * Get the default query grammar instance. - * - * @return \Illuminate\Database\Query\Grammars\PostgresGrammar - */ - protected function getDefaultQueryGrammar() - { - return $this->withTablePrefix(new QueryGrammar); - } - - /** - * Get a schema builder instance for the connection. - * - * @return \Illuminate\Database\Schema\PostgresBuilder - */ - public function getSchemaBuilder() - { - if (is_null($this->schemaGrammar)) { - $this->useDefaultSchemaGrammar(); - } - - return new PostgresBuilder($this); - } - - /** - * Get the default schema grammar instance. - * - * @return \Illuminate\Database\Schema\Grammars\PostgresGrammar - */ - protected function getDefaultSchemaGrammar() - { - return $this->withTablePrefix(new SchemaGrammar); - } - - /** - * Get the default post processor instance. - * - * @return \Illuminate\Database\Query\Processors\PostgresProcessor - */ - protected function getDefaultPostProcessor() - { - return new PostgresProcessor; - } - - /** - * Get the Doctrine DBAL driver. - * - * @return \Doctrine\DBAL\Driver\PDOPgSql\Driver - */ - protected function getDoctrineDriver() - { - return new DoctrineDriver; - } -} diff --git a/vendor/illuminate/database/Query/Builder.php b/vendor/illuminate/database/Query/Builder.php deleted file mode 100644 index b0fedf2..0000000 --- a/vendor/illuminate/database/Query/Builder.php +++ /dev/null @@ -1,2485 +0,0 @@ -<?php - -namespace Illuminate\Database\Query; - -use Closure; -use RuntimeException; -use BadMethodCallException; -use Illuminate\Support\Arr; -use Illuminate\Support\Str; -use InvalidArgumentException; -use Illuminate\Support\Collection; -use Illuminate\Pagination\Paginator; -use Illuminate\Support\Traits\Macroable; -use Illuminate\Contracts\Support\Arrayable; -use Illuminate\Database\ConnectionInterface; -use Illuminate\Database\Concerns\BuildsQueries; -use Illuminate\Database\Query\Grammars\Grammar; -use Illuminate\Database\Query\Processors\Processor; -use Illuminate\Database\Eloquent\Builder as EloquentBuilder; - -class Builder -{ - use BuildsQueries, Macroable { - __call as macroCall; - } - - /** - * The database connection instance. - * - * @var \Illuminate\Database\ConnectionInterface - */ - public $connection; - - /** - * The database query grammar instance. - * - * @var \Illuminate\Database\Query\Grammars\Grammar - */ - public $grammar; - - /** - * The database query post processor instance. - * - * @var \Illuminate\Database\Query\Processors\Processor - */ - public $processor; - - /** - * The current query value bindings. - * - * @var array - */ - public $bindings = [ - 'select' => [], - 'join' => [], - 'where' => [], - 'having' => [], - 'order' => [], - 'union' => [], - ]; - - /** - * An aggregate function and column to be run. - * - * @var array - */ - public $aggregate; - - /** - * The columns that should be returned. - * - * @var array - */ - public $columns; - - /** - * Indicates if the query returns distinct results. - * - * @var bool - */ - public $distinct = false; - - /** - * The table which the query is targeting. - * - * @var string - */ - public $from; - - /** - * The table joins for the query. - * - * @var array - */ - public $joins; - - /** - * The where constraints for the query. - * - * @var array - */ - public $wheres = []; - - /** - * The groupings for the query. - * - * @var array - */ - public $groups; - - /** - * The having constraints for the query. - * - * @var array - */ - public $havings; - - /** - * The orderings for the query. - * - * @var array - */ - public $orders; - - /** - * The maximum number of records to return. - * - * @var int - */ - public $limit; - - /** - * The number of records to skip. - * - * @var int - */ - public $offset; - - /** - * The query union statements. - * - * @var array - */ - public $unions; - - /** - * The maximum number of union records to return. - * - * @var int - */ - public $unionLimit; - - /** - * The number of union records to skip. - * - * @var int - */ - public $unionOffset; - - /** - * The orderings for the union query. - * - * @var array - */ - public $unionOrders; - - /** - * Indicates whether row locking is being used. - * - * @var string|bool - */ - public $lock; - - /** - * All of the available clause operators. - * - * @var array - */ - public $operators = [ - '=', '<', '>', '<=', '>=', '<>', '!=', '<=>', - 'like', 'like binary', 'not like', 'ilike', - '&', '|', '^', '<<', '>>', - 'rlike', 'regexp', 'not regexp', - '~', '~*', '!~', '!~*', 'similar to', - 'not similar to', 'not ilike', '~~*', '!~~*', - ]; - - /** - * Whether use write pdo for select. - * - * @var bool - */ - public $useWritePdo = false; - - /** - * Create a new query builder instance. - * - * @param \Illuminate\Database\ConnectionInterface $connection - * @param \Illuminate\Database\Query\Grammars\Grammar $grammar - * @param \Illuminate\Database\Query\Processors\Processor $processor - * @return void - */ - public function __construct(ConnectionInterface $connection, - Grammar $grammar = null, - Processor $processor = null) - { - $this->connection = $connection; - $this->grammar = $grammar ?: $connection->getQueryGrammar(); - $this->processor = $processor ?: $connection->getPostProcessor(); - } - - /** - * Set the columns to be selected. - * - * @param array|mixed $columns - * @return $this - */ - public function select($columns = ['*']) - { - $this->columns = is_array($columns) ? $columns : func_get_args(); - - return $this; - } - - /** - * Add a new "raw" select expression to the query. - * - * @param string $expression - * @param array $bindings - * @return \Illuminate\Database\Query\Builder|static - */ - public function selectRaw($expression, array $bindings = []) - { - $this->addSelect(new Expression($expression)); - - if ($bindings) { - $this->addBinding($bindings, 'select'); - } - - return $this; - } - - /** - * Add a subselect expression to the query. - * - * @param \Closure|\Illuminate\Database\Query\Builder|string $query - * @param string $as - * @return \Illuminate\Database\Query\Builder|static - * - * @throws \InvalidArgumentException - */ - public function selectSub($query, $as) - { - // If the given query is a Closure, we will execute it while passing in a new - // query instance to the Closure. This will give the developer a chance to - // format and work with the query before we cast it to a raw SQL string. - if ($query instanceof Closure) { - $callback = $query; - - $callback($query = $this->forSubQuery()); - } - - // Here, we will parse this query into an SQL string and an array of bindings - // so we can add it to the query builder using the selectRaw method so the - // query is included in the real SQL generated by this builder instance. - list($query, $bindings) = $this->parseSubSelect($query); - - return $this->selectRaw( - '('.$query.') as '.$this->grammar->wrap($as), $bindings - ); - } - - /** - * Parse the sub-select query into SQL and bindings. - * - * @param mixed $query - * @return array - */ - protected function parseSubSelect($query) - { - if ($query instanceof self) { - $query->columns = [$query->columns[0]]; - - return [$query->toSql(), $query->getBindings()]; - } elseif (is_string($query)) { - return [$query, []]; - } else { - throw new InvalidArgumentException; - } - } - - /** - * Add a new select column to the query. - * - * @param array|mixed $column - * @return $this - */ - public function addSelect($column) - { - $column = is_array($column) ? $column : func_get_args(); - - $this->columns = array_merge((array) $this->columns, $column); - - return $this; - } - - /** - * Force the query to only return distinct results. - * - * @return $this - */ - public function distinct() - { - $this->distinct = true; - - return $this; - } - - /** - * Set the table which the query is targeting. - * - * @param string $table - * @return $this - */ - public function from($table) - { - $this->from = $table; - - return $this; - } - - /** - * Add a join clause to the query. - * - * @param string $table - * @param string $first - * @param string|null $operator - * @param string|null $second - * @param string $type - * @param bool $where - * @return $this - */ - public function join($table, $first, $operator = null, $second = null, $type = 'inner', $where = false) - { - $join = new JoinClause($this, $type, $table); - - // If the first "column" of the join is really a Closure instance the developer - // is trying to build a join with a complex "on" clause containing more than - // one condition, so we'll add the join and call a Closure with the query. - if ($first instanceof Closure) { - call_user_func($first, $join); - - $this->joins[] = $join; - - $this->addBinding($join->getBindings(), 'join'); - } - - // If the column is simply a string, we can assume the join simply has a basic - // "on" clause with a single condition. So we will just build the join with - // this simple join clauses attached to it. There is not a join callback. - else { - $method = $where ? 'where' : 'on'; - - $this->joins[] = $join->$method($first, $operator, $second); - - $this->addBinding($join->getBindings(), 'join'); - } - - return $this; - } - - /** - * Add a "join where" clause to the query. - * - * @param string $table - * @param string $first - * @param string $operator - * @param string $second - * @param string $type - * @return \Illuminate\Database\Query\Builder|static - */ - public function joinWhere($table, $first, $operator, $second, $type = 'inner') - { - return $this->join($table, $first, $operator, $second, $type, true); - } - - /** - * Add a left join to the query. - * - * @param string $table - * @param string $first - * @param string|null $operator - * @param string|null $second - * @return \Illuminate\Database\Query\Builder|static - */ - public function leftJoin($table, $first, $operator = null, $second = null) - { - return $this->join($table, $first, $operator, $second, 'left'); - } - - /** - * Add a "join where" clause to the query. - * - * @param string $table - * @param string $first - * @param string $operator - * @param string $second - * @return \Illuminate\Database\Query\Builder|static - */ - public function leftJoinWhere($table, $first, $operator, $second) - { - return $this->joinWhere($table, $first, $operator, $second, 'left'); - } - - /** - * Add a right join to the query. - * - * @param string $table - * @param string $first - * @param string|null $operator - * @param string|null $second - * @return \Illuminate\Database\Query\Builder|static - */ - public function rightJoin($table, $first, $operator = null, $second = null) - { - return $this->join($table, $first, $operator, $second, 'right'); - } - - /** - * Add a "right join where" clause to the query. - * - * @param string $table - * @param string $first - * @param string $operator - * @param string $second - * @return \Illuminate\Database\Query\Builder|static - */ - public function rightJoinWhere($table, $first, $operator, $second) - { - return $this->joinWhere($table, $first, $operator, $second, 'right'); - } - - /** - * Add a "cross join" clause to the query. - * - * @param string $table - * @param string|null $first - * @param string|null $operator - * @param string|null $second - * @return \Illuminate\Database\Query\Builder|static - */ - public function crossJoin($table, $first = null, $operator = null, $second = null) - { - if ($first) { - return $this->join($table, $first, $operator, $second, 'cross'); - } - - $this->joins[] = new JoinClause($this, 'cross', $table); - - return $this; - } - - /** - * Merge an array of where clauses and bindings. - * - * @param array $wheres - * @param array $bindings - * @return void - */ - public function mergeWheres($wheres, $bindings) - { - $this->wheres = array_merge($this->wheres, (array) $wheres); - - $this->bindings['where'] = array_values( - array_merge($this->bindings['where'], (array) $bindings) - ); - } - - /** - * Add a basic where clause to the query. - * - * @param string|array|\Closure $column - * @param mixed $operator - * @param mixed $value - * @param string $boolean - * @return $this - */ - public function where($column, $operator = null, $value = null, $boolean = 'and') - { - // If the column is an array, we will assume it is an array of key-value pairs - // and can add them each as a where clause. We will maintain the boolean we - // received when the method was called and pass it into the nested where. - if (is_array($column)) { - return $this->addArrayOfWheres($column, $boolean); - } - - // Here we will make some assumptions about the operator. If only 2 values are - // passed to the method, we will assume that the operator is an equals sign - // and keep going. Otherwise, we'll require the operator to be passed in. - list($value, $operator) = $this->prepareValueAndOperator( - $value, $operator, func_num_args() == 2 - ); - - // If the columns is actually a Closure instance, we will assume the developer - // wants to begin a nested where statement which is wrapped in parenthesis. - // We'll add that Closure to the query then return back out immediately. - if ($column instanceof Closure) { - return $this->whereNested($column, $boolean); - } - - // If the given operator is not found in the list of valid operators we will - // assume that the developer is just short-cutting the '=' operators and - // we will set the operators to '=' and set the values appropriately. - if ($this->invalidOperator($operator)) { - list($value, $operator) = [$operator, '=']; - } - - // If the value is a Closure, it means the developer is performing an entire - // sub-select within the query and we will need to compile the sub-select - // within the where clause to get the appropriate query record results. - if ($value instanceof Closure) { - return $this->whereSub($column, $operator, $value, $boolean); - } - - // If the value is "null", we will just assume the developer wants to add a - // where null clause to the query. So, we will allow a short-cut here to - // that method for convenience so the developer doesn't have to check. - if (is_null($value)) { - return $this->whereNull($column, $boolean, $operator !== '='); - } - - // If the column is making a JSON reference we'll check to see if the value - // is a boolean. If it is, we'll add the raw boolean string as an actual - // value to the query to ensure this is properly handled by the query. - if (Str::contains($column, '->') && is_bool($value)) { - $value = new Expression($value ? 'true' : 'false'); - } - - // Now that we are working with just a simple query we can put the elements - // in our array and add the query binding to our array of bindings that - // will be bound to each SQL statements when it is finally executed. - $type = 'Basic'; - - $this->wheres[] = compact( - 'type', 'column', 'operator', 'value', 'boolean' - ); - - if (! $value instanceof Expression) { - $this->addBinding($value, 'where'); - } - - return $this; - } - - /** - * Add an array of where clauses to the query. - * - * @param array $column - * @param string $boolean - * @param string $method - * @return $this - */ - protected function addArrayOfWheres($column, $boolean, $method = 'where') - { - return $this->whereNested(function ($query) use ($column, $method, $boolean) { - foreach ($column as $key => $value) { - if (is_numeric($key) && is_array($value)) { - $query->{$method}(...array_values($value)); - } else { - $query->$method($key, '=', $value, $boolean); - } - } - }, $boolean); - } - - /** - * Prepare the value and operator for a where clause. - * - * @param string $value - * @param string $operator - * @param bool $useDefault - * @return array - * - * @throws \InvalidArgumentException - */ - public function prepareValueAndOperator($value, $operator, $useDefault = false) - { - if ($useDefault) { - return [$operator, '=']; - } elseif ($this->invalidOperatorAndValue($operator, $value)) { - throw new InvalidArgumentException('Illegal operator and value combination.'); - } - - return [$value, $operator]; - } - - /** - * Determine if the given operator and value combination is legal. - * - * Prevents using Null values with invalid operators. - * - * @param string $operator - * @param mixed $value - * @return bool - */ - protected function invalidOperatorAndValue($operator, $value) - { - return is_null($value) && in_array($operator, $this->operators) && - ! in_array($operator, ['=', '<>', '!=']); - } - - /** - * Determine if the given operator is supported. - * - * @param string $operator - * @return bool - */ - protected function invalidOperator($operator) - { - return ! in_array(strtolower($operator), $this->operators, true) && - ! in_array(strtolower($operator), $this->grammar->getOperators(), true); - } - - /** - * Add an "or where" clause to the query. - * - * @param string|array|\Closure $column - * @param string|null $operator - * @param mixed $value - * @return \Illuminate\Database\Query\Builder|static - */ - public function orWhere($column, $operator = null, $value = null) - { - list($value, $operator) = $this->prepareValueAndOperator( - $value, $operator, func_num_args() == 2 - ); - - return $this->where($column, $operator, $value, 'or'); - } - - /** - * Add a "where" clause comparing two columns to the query. - * - * @param string|array $first - * @param string|null $operator - * @param string|null $second - * @param string|null $boolean - * @return \Illuminate\Database\Query\Builder|static - */ - public function whereColumn($first, $operator = null, $second = null, $boolean = 'and') - { - // If the column is an array, we will assume it is an array of key-value pairs - // and can add them each as a where clause. We will maintain the boolean we - // received when the method was called and pass it into the nested where. - if (is_array($first)) { - return $this->addArrayOfWheres($first, $boolean, 'whereColumn'); - } - - // If the given operator is not found in the list of valid operators we will - // assume that the developer is just short-cutting the '=' operators and - // we will set the operators to '=' and set the values appropriately. - if ($this->invalidOperator($operator)) { - list($second, $operator) = [$operator, '=']; - } - - // Finally, we will add this where clause into this array of clauses that we - // are building for the query. All of them will be compiled via a grammar - // once the query is about to be executed and run against the database. - $type = 'Column'; - - $this->wheres[] = compact( - 'type', 'first', 'operator', 'second', 'boolean' - ); - - return $this; - } - - /** - * Add an "or where" clause comparing two columns to the query. - * - * @param string|array $first - * @param string|null $operator - * @param string|null $second - * @return \Illuminate\Database\Query\Builder|static - */ - public function orWhereColumn($first, $operator = null, $second = null) - { - return $this->whereColumn($first, $operator, $second, 'or'); - } - - /** - * Add a raw where clause to the query. - * - * @param string $sql - * @param mixed $bindings - * @param string $boolean - * @return $this - */ - public function whereRaw($sql, $bindings = [], $boolean = 'and') - { - $this->wheres[] = ['type' => 'raw', 'sql' => $sql, 'boolean' => $boolean]; - - $this->addBinding((array) $bindings, 'where'); - - return $this; - } - - /** - * Add a raw or where clause to the query. - * - * @param string $sql - * @param mixed $bindings - * @return \Illuminate\Database\Query\Builder|static - */ - public function orWhereRaw($sql, $bindings = []) - { - return $this->whereRaw($sql, $bindings, 'or'); - } - - /** - * Add a "where in" clause to the query. - * - * @param string $column - * @param mixed $values - * @param string $boolean - * @param bool $not - * @return $this - */ - public function whereIn($column, $values, $boolean = 'and', $not = false) - { - $type = $not ? 'NotIn' : 'In'; - - if ($values instanceof EloquentBuilder) { - $values = $values->getQuery(); - } - - // If the value is a query builder instance we will assume the developer wants to - // look for any values that exists within this given query. So we will add the - // query accordingly so that this query is properly executed when it is run. - if ($values instanceof self) { - return $this->whereInExistingQuery( - $column, $values, $boolean, $not - ); - } - - // If the value of the where in clause is actually a Closure, we will assume that - // the developer is using a full sub-select for this "in" statement, and will - // execute those Closures, then we can re-construct the entire sub-selects. - if ($values instanceof Closure) { - return $this->whereInSub($column, $values, $boolean, $not); - } - - // Next, if the value is Arrayable we need to cast it to its raw array form so we - // have the underlying array value instead of an Arrayable object which is not - // able to be added as a binding, etc. We will then add to the wheres array. - if ($values instanceof Arrayable) { - $values = $values->toArray(); - } - - $this->wheres[] = compact('type', 'column', 'values', 'boolean'); - - // Finally we'll add a binding for each values unless that value is an expression - // in which case we will just skip over it since it will be the query as a raw - // string and not as a parameterized place-holder to be replaced by the PDO. - foreach ($values as $value) { - if (! $value instanceof Expression) { - $this->addBinding($value, 'where'); - } - } - - return $this; - } - - /** - * Add an "or where in" clause to the query. - * - * @param string $column - * @param mixed $values - * @return \Illuminate\Database\Query\Builder|static - */ - public function orWhereIn($column, $values) - { - return $this->whereIn($column, $values, 'or'); - } - - /** - * Add a "where not in" clause to the query. - * - * @param string $column - * @param mixed $values - * @param string $boolean - * @return \Illuminate\Database\Query\Builder|static - */ - public function whereNotIn($column, $values, $boolean = 'and') - { - return $this->whereIn($column, $values, $boolean, true); - } - - /** - * Add an "or where not in" clause to the query. - * - * @param string $column - * @param mixed $values - * @return \Illuminate\Database\Query\Builder|static - */ - public function orWhereNotIn($column, $values) - { - return $this->whereNotIn($column, $values, 'or'); - } - - /** - * Add a where in with a sub-select to the query. - * - * @param string $column - * @param \Closure $callback - * @param string $boolean - * @param bool $not - * @return $this - */ - protected function whereInSub($column, Closure $callback, $boolean, $not) - { - $type = $not ? 'NotInSub' : 'InSub'; - - // To create the exists sub-select, we will actually create a query and call the - // provided callback with the query so the developer may set any of the query - // conditions they want for the in clause, then we'll put it in this array. - call_user_func($callback, $query = $this->forSubQuery()); - - $this->wheres[] = compact('type', 'column', 'query', 'boolean'); - - $this->addBinding($query->getBindings(), 'where'); - - return $this; - } - - /** - * Add an external sub-select to the query. - * - * @param string $column - * @param \Illuminate\Database\Query\Builder|static $query - * @param string $boolean - * @param bool $not - * @return $this - */ - protected function whereInExistingQuery($column, $query, $boolean, $not) - { - $type = $not ? 'NotInSub' : 'InSub'; - - $this->wheres[] = compact('type', 'column', 'query', 'boolean'); - - $this->addBinding($query->getBindings(), 'where'); - - return $this; - } - - /** - * Add a "where null" clause to the query. - * - * @param string $column - * @param string $boolean - * @param bool $not - * @return $this - */ - public function whereNull($column, $boolean = 'and', $not = false) - { - $type = $not ? 'NotNull' : 'Null'; - - $this->wheres[] = compact('type', 'column', 'boolean'); - - return $this; - } - - /** - * Add an "or where null" clause to the query. - * - * @param string $column - * @return \Illuminate\Database\Query\Builder|static - */ - public function orWhereNull($column) - { - return $this->whereNull($column, 'or'); - } - - /** - * Add a "where not null" clause to the query. - * - * @param string $column - * @param string $boolean - * @return \Illuminate\Database\Query\Builder|static - */ - public function whereNotNull($column, $boolean = 'and') - { - return $this->whereNull($column, $boolean, true); - } - - /** - * Add a where between statement to the query. - * - * @param string $column - * @param array $values - * @param string $boolean - * @param bool $not - * @return $this - */ - public function whereBetween($column, array $values, $boolean = 'and', $not = false) - { - $type = 'between'; - - $this->wheres[] = compact('column', 'type', 'boolean', 'not'); - - $this->addBinding($values, 'where'); - - return $this; - } - - /** - * Add an or where between statement to the query. - * - * @param string $column - * @param array $values - * @return \Illuminate\Database\Query\Builder|static - */ - public function orWhereBetween($column, array $values) - { - return $this->whereBetween($column, $values, 'or'); - } - - /** - * Add a where not between statement to the query. - * - * @param string $column - * @param array $values - * @param string $boolean - * @return \Illuminate\Database\Query\Builder|static - */ - public function whereNotBetween($column, array $values, $boolean = 'and') - { - return $this->whereBetween($column, $values, $boolean, true); - } - - /** - * Add an or where not between statement to the query. - * - * @param string $column - * @param array $values - * @return \Illuminate\Database\Query\Builder|static - */ - public function orWhereNotBetween($column, array $values) - { - return $this->whereNotBetween($column, $values, 'or'); - } - - /** - * Add an "or where not null" clause to the query. - * - * @param string $column - * @return \Illuminate\Database\Query\Builder|static - */ - public function orWhereNotNull($column) - { - return $this->whereNotNull($column, 'or'); - } - - /** - * Add a "where date" statement to the query. - * - * @param string $column - * @param string $operator - * @param mixed $value - * @param string $boolean - * @return \Illuminate\Database\Query\Builder|static - */ - public function whereDate($column, $operator, $value = null, $boolean = 'and') - { - list($value, $operator) = $this->prepareValueAndOperator( - $value, $operator, func_num_args() == 2 - ); - - return $this->addDateBasedWhere('Date', $column, $operator, $value, $boolean); - } - - /** - * Add an "or where date" statement to the query. - * - * @param string $column - * @param string $operator - * @param string $value - * @return \Illuminate\Database\Query\Builder|static - */ - public function orWhereDate($column, $operator, $value) - { - list($value, $operator) = $this->prepareValueAndOperator( - $value, $operator, func_num_args() == 2 - ); - - return $this->whereDate($column, $operator, $value, 'or'); - } - - /** - * Add a "where time" statement to the query. - * - * @param string $column - * @param string $operator - * @param int $value - * @param string $boolean - * @return \Illuminate\Database\Query\Builder|static - */ - public function whereTime($column, $operator, $value, $boolean = 'and') - { - return $this->addDateBasedWhere('Time', $column, $operator, $value, $boolean); - } - - /** - * Add an "or where time" statement to the query. - * - * @param string $column - * @param string $operator - * @param int $value - * @return \Illuminate\Database\Query\Builder|static - */ - public function orWhereTime($column, $operator, $value) - { - list($value, $operator) = $this->prepareValueAndOperator( - $value, $operator, func_num_args() == 2 - ); - - return $this->whereTime($column, $operator, $value, 'or'); - } - - /** - * Add a "where day" statement to the query. - * - * @param string $column - * @param string $operator - * @param mixed $value - * @param string $boolean - * @return \Illuminate\Database\Query\Builder|static - */ - public function whereDay($column, $operator, $value = null, $boolean = 'and') - { - list($value, $operator) = $this->prepareValueAndOperator( - $value, $operator, func_num_args() == 2 - ); - - return $this->addDateBasedWhere('Day', $column, $operator, $value, $boolean); - } - - /** - * Add a "where month" statement to the query. - * - * @param string $column - * @param string $operator - * @param mixed $value - * @param string $boolean - * @return \Illuminate\Database\Query\Builder|static - */ - public function whereMonth($column, $operator, $value = null, $boolean = 'and') - { - list($value, $operator) = $this->prepareValueAndOperator( - $value, $operator, func_num_args() == 2 - ); - - return $this->addDateBasedWhere('Month', $column, $operator, $value, $boolean); - } - - /** - * Add a "where year" statement to the query. - * - * @param string $column - * @param string $operator - * @param mixed $value - * @param string $boolean - * @return \Illuminate\Database\Query\Builder|static - */ - public function whereYear($column, $operator, $value = null, $boolean = 'and') - { - list($value, $operator) = $this->prepareValueAndOperator( - $value, $operator, func_num_args() == 2 - ); - - return $this->addDateBasedWhere('Year', $column, $operator, $value, $boolean); - } - - /** - * Add a date based (year, month, day, time) statement to the query. - * - * @param string $type - * @param string $column - * @param string $operator - * @param int $value - * @param string $boolean - * @return $this - */ - protected function addDateBasedWhere($type, $column, $operator, $value, $boolean = 'and') - { - $this->wheres[] = compact('column', 'type', 'boolean', 'operator', 'value'); - - if (! $value instanceof Expression) { - $this->addBinding($value, 'where'); - } - - return $this; - } - - /** - * Add a nested where statement to the query. - * - * @param \Closure $callback - * @param string $boolean - * @return \Illuminate\Database\Query\Builder|static - */ - public function whereNested(Closure $callback, $boolean = 'and') - { - call_user_func($callback, $query = $this->forNestedWhere()); - - return $this->addNestedWhereQuery($query, $boolean); - } - - /** - * Create a new query instance for nested where condition. - * - * @return \Illuminate\Database\Query\Builder - */ - public function forNestedWhere() - { - return $this->newQuery()->from($this->from); - } - - /** - * Add another query builder as a nested where to the query builder. - * - * @param \Illuminate\Database\Query\Builder|static $query - * @param string $boolean - * @return $this - */ - public function addNestedWhereQuery($query, $boolean = 'and') - { - if (count($query->wheres)) { - $type = 'Nested'; - - $this->wheres[] = compact('type', 'query', 'boolean'); - - $this->addBinding($query->getBindings(), 'where'); - } - - return $this; - } - - /** - * Add a full sub-select to the query. - * - * @param string $column - * @param string $operator - * @param \Closure $callback - * @param string $boolean - * @return $this - */ - protected function whereSub($column, $operator, Closure $callback, $boolean) - { - $type = 'Sub'; - - // Once we have the query instance we can simply execute it so it can add all - // of the sub-select's conditions to itself, and then we can cache it off - // in the array of where clauses for the "main" parent query instance. - call_user_func($callback, $query = $this->forSubQuery()); - - $this->wheres[] = compact( - 'type', 'column', 'operator', 'query', 'boolean' - ); - - $this->addBinding($query->getBindings(), 'where'); - - return $this; - } - - /** - * Add an exists clause to the query. - * - * @param \Closure $callback - * @param string $boolean - * @param bool $not - * @return $this - */ - public function whereExists(Closure $callback, $boolean = 'and', $not = false) - { - $query = $this->forSubQuery(); - - // Similar to the sub-select clause, we will create a new query instance so - // the developer may cleanly specify the entire exists query and we will - // compile the whole thing in the grammar and insert it into the SQL. - call_user_func($callback, $query); - - return $this->addWhereExistsQuery($query, $boolean, $not); - } - - /** - * Add an or exists clause to the query. - * - * @param \Closure $callback - * @param bool $not - * @return \Illuminate\Database\Query\Builder|static - */ - public function orWhereExists(Closure $callback, $not = false) - { - return $this->whereExists($callback, 'or', $not); - } - - /** - * Add a where not exists clause to the query. - * - * @param \Closure $callback - * @param string $boolean - * @return \Illuminate\Database\Query\Builder|static - */ - public function whereNotExists(Closure $callback, $boolean = 'and') - { - return $this->whereExists($callback, $boolean, true); - } - - /** - * Add a where not exists clause to the query. - * - * @param \Closure $callback - * @return \Illuminate\Database\Query\Builder|static - */ - public function orWhereNotExists(Closure $callback) - { - return $this->orWhereExists($callback, true); - } - - /** - * Add an exists clause to the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $boolean - * @param bool $not - * @return $this - */ - public function addWhereExistsQuery(self $query, $boolean = 'and', $not = false) - { - $type = $not ? 'NotExists' : 'Exists'; - - $this->wheres[] = compact('type', 'query', 'boolean'); - - $this->addBinding($query->getBindings(), 'where'); - - return $this; - } - - /** - * Handles dynamic "where" clauses to the query. - * - * @param string $method - * @param string $parameters - * @return $this - */ - public function dynamicWhere($method, $parameters) - { - $finder = substr($method, 5); - - $segments = preg_split( - '/(And|Or)(?=[A-Z])/', $finder, -1, PREG_SPLIT_DELIM_CAPTURE - ); - - // The connector variable will determine which connector will be used for the - // query condition. We will change it as we come across new boolean values - // in the dynamic method strings, which could contain a number of these. - $connector = 'and'; - - $index = 0; - - foreach ($segments as $segment) { - // If the segment is not a boolean connector, we can assume it is a column's name - // and we will add it to the query as a new constraint as a where clause, then - // we can keep iterating through the dynamic method string's segments again. - if ($segment !== 'And' && $segment !== 'Or') { - $this->addDynamic($segment, $connector, $parameters, $index); - - $index++; - } - - // Otherwise, we will store the connector so we know how the next where clause we - // find in the query should be connected to the previous ones, meaning we will - // have the proper boolean connector to connect the next where clause found. - else { - $connector = $segment; - } - } - - return $this; - } - - /** - * Add a single dynamic where clause statement to the query. - * - * @param string $segment - * @param string $connector - * @param array $parameters - * @param int $index - * @return void - */ - protected function addDynamic($segment, $connector, $parameters, $index) - { - // Once we have parsed out the columns and formatted the boolean operators we - // are ready to add it to this query as a where clause just like any other - // clause on the query. Then we'll increment the parameter index values. - $bool = strtolower($connector); - - $this->where(Str::snake($segment), '=', $parameters[$index], $bool); - } - - /** - * Add a "group by" clause to the query. - * - * @param array ...$groups - * @return $this - */ - public function groupBy(...$groups) - { - foreach ($groups as $group) { - $this->groups = array_merge( - (array) $this->groups, - Arr::wrap($group) - ); - } - - return $this; - } - - /** - * Add a "having" clause to the query. - * - * @param string $column - * @param string|null $operator - * @param string|null $value - * @param string $boolean - * @return $this - */ - public function having($column, $operator = null, $value = null, $boolean = 'and') - { - $type = 'Basic'; - - // Here we will make some assumptions about the operator. If only 2 values are - // passed to the method, we will assume that the operator is an equals sign - // and keep going. Otherwise, we'll require the operator to be passed in. - list($value, $operator) = $this->prepareValueAndOperator( - $value, $operator, func_num_args() == 2 - ); - - // If the given operator is not found in the list of valid operators we will - // assume that the developer is just short-cutting the '=' operators and - // we will set the operators to '=' and set the values appropriately. - if ($this->invalidOperator($operator)) { - list($value, $operator) = [$operator, '=']; - } - - $this->havings[] = compact('type', 'column', 'operator', 'value', 'boolean'); - - if (! $value instanceof Expression) { - $this->addBinding($value, 'having'); - } - - return $this; - } - - /** - * Add a "or having" clause to the query. - * - * @param string $column - * @param string|null $operator - * @param string|null $value - * @return \Illuminate\Database\Query\Builder|static - */ - public function orHaving($column, $operator = null, $value = null) - { - return $this->having($column, $operator, $value, 'or'); - } - - /** - * Add a raw having clause to the query. - * - * @param string $sql - * @param array $bindings - * @param string $boolean - * @return $this - */ - public function havingRaw($sql, array $bindings = [], $boolean = 'and') - { - $type = 'Raw'; - - $this->havings[] = compact('type', 'sql', 'boolean'); - - $this->addBinding($bindings, 'having'); - - return $this; - } - - /** - * Add a raw or having clause to the query. - * - * @param string $sql - * @param array $bindings - * @return \Illuminate\Database\Query\Builder|static - */ - public function orHavingRaw($sql, array $bindings = []) - { - return $this->havingRaw($sql, $bindings, 'or'); - } - - /** - * Add an "order by" clause to the query. - * - * @param string $column - * @param string $direction - * @return $this - */ - public function orderBy($column, $direction = 'asc') - { - $this->{$this->unions ? 'unionOrders' : 'orders'}[] = [ - 'column' => $column, - 'direction' => strtolower($direction) == 'asc' ? 'asc' : 'desc', - ]; - - return $this; - } - - /** - * Add a descending "order by" clause to the query. - * - * @param string $column - * @return $this - */ - public function orderByDesc($column) - { - return $this->orderBy($column, 'desc'); - } - - /** - * Add an "order by" clause for a timestamp to the query. - * - * @param string $column - * @return \Illuminate\Database\Query\Builder|static - */ - public function latest($column = 'created_at') - { - return $this->orderBy($column, 'desc'); - } - - /** - * Add an "order by" clause for a timestamp to the query. - * - * @param string $column - * @return \Illuminate\Database\Query\Builder|static - */ - public function oldest($column = 'created_at') - { - return $this->orderBy($column, 'asc'); - } - - /** - * Put the query's results in random order. - * - * @param string $seed - * @return $this - */ - public function inRandomOrder($seed = '') - { - return $this->orderByRaw($this->grammar->compileRandom($seed)); - } - - /** - * Add a raw "order by" clause to the query. - * - * @param string $sql - * @param array $bindings - * @return $this - */ - public function orderByRaw($sql, $bindings = []) - { - $type = 'Raw'; - - $this->{$this->unions ? 'unionOrders' : 'orders'}[] = compact('type', 'sql'); - - $this->addBinding($bindings, 'order'); - - return $this; - } - - /** - * Alias to set the "offset" value of the query. - * - * @param int $value - * @return \Illuminate\Database\Query\Builder|static - */ - public function skip($value) - { - return $this->offset($value); - } - - /** - * Set the "offset" value of the query. - * - * @param int $value - * @return $this - */ - public function offset($value) - { - $property = $this->unions ? 'unionOffset' : 'offset'; - - $this->$property = max(0, $value); - - return $this; - } - - /** - * Alias to set the "limit" value of the query. - * - * @param int $value - * @return \Illuminate\Database\Query\Builder|static - */ - public function take($value) - { - return $this->limit($value); - } - - /** - * Set the "limit" value of the query. - * - * @param int $value - * @return $this - */ - public function limit($value) - { - $property = $this->unions ? 'unionLimit' : 'limit'; - - if ($value >= 0) { - $this->$property = $value; - } - - return $this; - } - - /** - * Set the limit and offset for a given page. - * - * @param int $page - * @param int $perPage - * @return \Illuminate\Database\Query\Builder|static - */ - public function forPage($page, $perPage = 15) - { - return $this->skip(($page - 1) * $perPage)->take($perPage); - } - - /** - * Constrain the query to the next "page" of results after a given ID. - * - * @param int $perPage - * @param int $lastId - * @param string $column - * @return \Illuminate\Database\Query\Builder|static - */ - public function forPageAfterId($perPage = 15, $lastId = 0, $column = 'id') - { - $this->orders = $this->removeExistingOrdersFor($column); - - return $this->where($column, '>', $lastId) - ->orderBy($column, 'asc') - ->take($perPage); - } - - /** - * Get an array with all orders with a given column removed. - * - * @param string $column - * @return array - */ - protected function removeExistingOrdersFor($column) - { - return Collection::make($this->orders) - ->reject(function ($order) use ($column) { - return isset($order['column']) - ? $order['column'] === $column : false; - })->values()->all(); - } - - /** - * Add a union statement to the query. - * - * @param \Illuminate\Database\Query\Builder|\Closure $query - * @param bool $all - * @return \Illuminate\Database\Query\Builder|static - */ - public function union($query, $all = false) - { - if ($query instanceof Closure) { - call_user_func($query, $query = $this->newQuery()); - } - - $this->unions[] = compact('query', 'all'); - - $this->addBinding($query->getBindings(), 'union'); - - return $this; - } - - /** - * Add a union all statement to the query. - * - * @param \Illuminate\Database\Query\Builder|\Closure $query - * @return \Illuminate\Database\Query\Builder|static - */ - public function unionAll($query) - { - return $this->union($query, true); - } - - /** - * Lock the selected rows in the table. - * - * @param string|bool $value - * @return $this - */ - public function lock($value = true) - { - $this->lock = $value; - - if (! is_null($this->lock)) { - $this->useWritePdo(); - } - - return $this; - } - - /** - * Lock the selected rows in the table for updating. - * - * @return \Illuminate\Database\Query\Builder - */ - public function lockForUpdate() - { - return $this->lock(true); - } - - /** - * Share lock the selected rows in the table. - * - * @return \Illuminate\Database\Query\Builder - */ - public function sharedLock() - { - return $this->lock(false); - } - - /** - * Get the SQL representation of the query. - * - * @return string - */ - public function toSql() - { - return $this->grammar->compileSelect($this); - } - - /** - * Execute a query for a single record by ID. - * - * @param int $id - * @param array $columns - * @return mixed|static - */ - public function find($id, $columns = ['*']) - { - return $this->where('id', '=', $id)->first($columns); - } - - /** - * Get a single column's value from the first result of a query. - * - * @param string $column - * @return mixed - */ - public function value($column) - { - $result = (array) $this->first([$column]); - - return count($result) > 0 ? reset($result) : null; - } - - /** - * Execute the query as a "select" statement. - * - * @param array $columns - * @return \Illuminate\Support\Collection - */ - public function get($columns = ['*']) - { - $original = $this->columns; - - if (is_null($original)) { - $this->columns = $columns; - } - - $results = $this->processor->processSelect($this, $this->runSelect()); - - $this->columns = $original; - - return collect($results); - } - - /** - * Run the query as a "select" statement against the connection. - * - * @return array - */ - protected function runSelect() - { - return $this->connection->select( - $this->toSql(), $this->getBindings(), ! $this->useWritePdo - ); - } - - /** - * Paginate the given query into a simple paginator. - * - * @param int $perPage - * @param array $columns - * @param string $pageName - * @param int|null $page - * @return \Illuminate\Contracts\Pagination\LengthAwarePaginator - */ - public function paginate($perPage = 15, $columns = ['*'], $pageName = 'page', $page = null) - { - $page = $page ?: Paginator::resolveCurrentPage($pageName); - - $total = $this->getCountForPagination($columns); - - $results = $total ? $this->forPage($page, $perPage)->get($columns) : collect(); - - return $this->paginator($results, $total, $perPage, $page, [ - 'path' => Paginator::resolveCurrentPath(), - 'pageName' => $pageName, - ]); - } - - /** - * Get a paginator only supporting simple next and previous links. - * - * This is more efficient on larger data-sets, etc. - * - * @param int $perPage - * @param array $columns - * @param string $pageName - * @param int|null $page - * @return \Illuminate\Contracts\Pagination\Paginator - */ - public function simplePaginate($perPage = 15, $columns = ['*'], $pageName = 'page', $page = null) - { - $page = $page ?: Paginator::resolveCurrentPage($pageName); - - $this->skip(($page - 1) * $perPage)->take($perPage + 1); - - return $this->simplePaginator($this->get($columns), $perPage, $page, [ - 'path' => Paginator::resolveCurrentPath(), - 'pageName' => $pageName, - ]); - } - - /** - * Get the count of the total records for the paginator. - * - * @param array $columns - * @return int - */ - public function getCountForPagination($columns = ['*']) - { - $results = $this->runPaginationCountQuery($columns); - - // Once we have run the pagination count query, we will get the resulting count and - // take into account what type of query it was. When there is a group by we will - // just return the count of the entire results set since that will be correct. - if (isset($this->groups)) { - return count($results); - } elseif (! isset($results[0])) { - return 0; - } elseif (is_object($results[0])) { - return (int) $results[0]->aggregate; - } - - return (int) array_change_key_case((array) $results[0])['aggregate']; - } - - /** - * Run a pagination count query. - * - * @param array $columns - * @return array - */ - protected function runPaginationCountQuery($columns = ['*']) - { - return $this->cloneWithout(['columns', 'orders', 'limit', 'offset']) - ->cloneWithoutBindings(['select', 'order']) - ->setAggregate('count', $this->withoutSelectAliases($columns)) - ->get()->all(); - } - - /** - * Remove the column aliases since they will break count queries. - * - * @param array $columns - * @return array - */ - protected function withoutSelectAliases(array $columns) - { - return array_map(function ($column) { - return is_string($column) && ($aliasPosition = strpos(strtolower($column), ' as ')) !== false - ? substr($column, 0, $aliasPosition) : $column; - }, $columns); - } - - /** - * Get a generator for the given query. - * - * @return \Generator - */ - public function cursor() - { - if (is_null($this->columns)) { - $this->columns = ['*']; - } - - return $this->connection->cursor( - $this->toSql(), $this->getBindings(), ! $this->useWritePdo - ); - } - - /** - * Chunk the results of a query by comparing numeric IDs. - * - * @param int $count - * @param callable $callback - * @param string $column - * @param string $alias - * @return bool - */ - public function chunkById($count, callable $callback, $column = 'id', $alias = null) - { - $alias = $alias ?: $column; - - $lastId = 0; - - do { - $clone = clone $this; - - // We'll execute the query for the given page and get the results. If there are - // no results we can just break and return from here. When there are results - // we will call the callback with the current chunk of these results here. - $results = $clone->forPageAfterId($count, $lastId, $column)->get(); - - $countResults = $results->count(); - - if ($countResults == 0) { - break; - } - - // On each chunk result set, we will pass them to the callback and then let the - // developer take care of everything within the callback, which allows us to - // keep the memory low for spinning through large result sets for working. - if ($callback($results) === false) { - return false; - } - - $lastId = $results->last()->{$alias}; - - unset($results); - } while ($countResults == $count); - - return true; - } - - /** - * Throw an exception if the query doesn't have an orderBy clause. - * - * @return void - * - * @throws \RuntimeException - */ - protected function enforceOrderBy() - { - if (empty($this->orders) && empty($this->unionOrders)) { - throw new RuntimeException('You must specify an orderBy clause when using this function.'); - } - } - - /** - * Get an array with the values of a given column. - * - * @param string $column - * @param string|null $key - * @return \Illuminate\Support\Collection - */ - public function pluck($column, $key = null) - { - $results = $this->get(is_null($key) ? [$column] : [$column, $key]); - - // If the columns are qualified with a table or have an alias, we cannot use - // those directly in the "pluck" operations since the results from the DB - // are only keyed by the column itself. We'll strip the table out here. - return $results->pluck( - $this->stripTableForPluck($column), - $this->stripTableForPluck($key) - ); - } - - /** - * Strip off the table name or alias from a column identifier. - * - * @param string $column - * @return string|null - */ - protected function stripTableForPluck($column) - { - return is_null($column) ? $column : last(preg_split('~\.| ~', $column)); - } - - /** - * Concatenate values of a given column as a string. - * - * @param string $column - * @param string $glue - * @return string - */ - public function implode($column, $glue = '') - { - return $this->pluck($column)->implode($glue); - } - - /** - * Determine if any rows exist for the current query. - * - * @return bool - */ - public function exists() - { - $results = $this->connection->select( - $this->grammar->compileExists($this), $this->getBindings(), ! $this->useWritePdo - ); - - // If the results has rows, we will get the row and see if the exists column is a - // boolean true. If there is no results for this query we will return false as - // there are no rows for this query at all and we can return that info here. - if (isset($results[0])) { - $results = (array) $results[0]; - - return (bool) $results['exists']; - } - - return false; - } - - /** - * Determine if no rows exist for the current query. - * - * @return bool - */ - public function doesntExist() - { - return ! $this->exists(); - } - - /** - * Retrieve the "count" result of the query. - * - * @param string $columns - * @return int - */ - public function count($columns = '*') - { - return (int) $this->aggregate(__FUNCTION__, Arr::wrap($columns)); - } - - /** - * Retrieve the minimum value of a given column. - * - * @param string $column - * @return mixed - */ - public function min($column) - { - return $this->aggregate(__FUNCTION__, [$column]); - } - - /** - * Retrieve the maximum value of a given column. - * - * @param string $column - * @return mixed - */ - public function max($column) - { - return $this->aggregate(__FUNCTION__, [$column]); - } - - /** - * Retrieve the sum of the values of a given column. - * - * @param string $column - * @return mixed - */ - public function sum($column) - { - $result = $this->aggregate(__FUNCTION__, [$column]); - - return $result ?: 0; - } - - /** - * Retrieve the average of the values of a given column. - * - * @param string $column - * @return mixed - */ - public function avg($column) - { - return $this->aggregate(__FUNCTION__, [$column]); - } - - /** - * Alias for the "avg" method. - * - * @param string $column - * @return mixed - */ - public function average($column) - { - return $this->avg($column); - } - - /** - * Execute an aggregate function on the database. - * - * @param string $function - * @param array $columns - * @return mixed - */ - public function aggregate($function, $columns = ['*']) - { - $results = $this->cloneWithout(['columns']) - ->cloneWithoutBindings(['select']) - ->setAggregate($function, $columns) - ->get($columns); - - if (! $results->isEmpty()) { - return array_change_key_case((array) $results[0])['aggregate']; - } - } - - /** - * Execute a numeric aggregate function on the database. - * - * @param string $function - * @param array $columns - * @return float|int - */ - public function numericAggregate($function, $columns = ['*']) - { - $result = $this->aggregate($function, $columns); - - // If there is no result, we can obviously just return 0 here. Next, we will check - // if the result is an integer or float. If it is already one of these two data - // types we can just return the result as-is, otherwise we will convert this. - if (! $result) { - return 0; - } - - if (is_int($result) || is_float($result)) { - return $result; - } - - // If the result doesn't contain a decimal place, we will assume it is an int then - // cast it to one. When it does we will cast it to a float since it needs to be - // cast to the expected data type for the developers out of pure convenience. - return strpos((string) $result, '.') === false - ? (int) $result : (float) $result; - } - - /** - * Set the aggregate property without running the query. - * - * @param string $function - * @param array $columns - * @return $this - */ - protected function setAggregate($function, $columns) - { - $this->aggregate = compact('function', 'columns'); - - if (empty($this->groups)) { - $this->orders = null; - - $this->bindings['order'] = []; - } - - return $this; - } - - /** - * Insert a new record into the database. - * - * @param array $values - * @return bool - */ - public function insert(array $values) - { - // Since every insert gets treated like a batch insert, we will make sure the - // bindings are structured in a way that is convenient when building these - // inserts statements by verifying these elements are actually an array. - if (empty($values)) { - return true; - } - - if (! is_array(reset($values))) { - $values = [$values]; - } - - // Here, we will sort the insert keys for every record so that each insert is - // in the same order for the record. We need to make sure this is the case - // so there are not any errors or problems when inserting these records. - else { - foreach ($values as $key => $value) { - ksort($value); - - $values[$key] = $value; - } - } - - // Finally, we will run this query against the database connection and return - // the results. We will need to also flatten these bindings before running - // the query so they are all in one huge, flattened array for execution. - return $this->connection->insert( - $this->grammar->compileInsert($this, $values), - $this->cleanBindings(Arr::flatten($values, 1)) - ); - } - - /** - * Insert a new record and get the value of the primary key. - * - * @param array $values - * @param string|null $sequence - * @return int - */ - public function insertGetId(array $values, $sequence = null) - { - $sql = $this->grammar->compileInsertGetId($this, $values, $sequence); - - $values = $this->cleanBindings($values); - - return $this->processor->processInsertGetId($this, $sql, $values, $sequence); - } - - /** - * Update a record in the database. - * - * @param array $values - * @return int - */ - public function update(array $values) - { - $sql = $this->grammar->compileUpdate($this, $values); - - return $this->connection->update($sql, $this->cleanBindings( - $this->grammar->prepareBindingsForUpdate($this->bindings, $values) - )); - } - - /** - * Insert or update a record matching the attributes, and fill it with values. - * - * @param array $attributes - * @param array $values - * @return bool - */ - public function updateOrInsert(array $attributes, array $values = []) - { - if (! $this->where($attributes)->exists()) { - return $this->insert(array_merge($attributes, $values)); - } - - return (bool) $this->take(1)->update($values); - } - - /** - * Increment a column's value by a given amount. - * - * @param string $column - * @param int $amount - * @param array $extra - * @return int - */ - public function increment($column, $amount = 1, array $extra = []) - { - if (! is_numeric($amount)) { - throw new InvalidArgumentException('Non-numeric value passed to increment method.'); - } - - $wrapped = $this->grammar->wrap($column); - - $columns = array_merge([$column => $this->raw("$wrapped + $amount")], $extra); - - return $this->update($columns); - } - - /** - * Decrement a column's value by a given amount. - * - * @param string $column - * @param int $amount - * @param array $extra - * @return int - */ - public function decrement($column, $amount = 1, array $extra = []) - { - if (! is_numeric($amount)) { - throw new InvalidArgumentException('Non-numeric value passed to decrement method.'); - } - - $wrapped = $this->grammar->wrap($column); - - $columns = array_merge([$column => $this->raw("$wrapped - $amount")], $extra); - - return $this->update($columns); - } - - /** - * Delete a record from the database. - * - * @param mixed $id - * @return int - */ - public function delete($id = null) - { - // If an ID is passed to the method, we will set the where clause to check the - // ID to let developers to simply and quickly remove a single row from this - // database without manually specifying the "where" clauses on the query. - if (! is_null($id)) { - $this->where($this->from.'.id', '=', $id); - } - - return $this->connection->delete( - $this->grammar->compileDelete($this), $this->cleanBindings( - $this->grammar->prepareBindingsForDelete($this->bindings) - ) - ); - } - - /** - * Run a truncate statement on the table. - * - * @return void - */ - public function truncate() - { - foreach ($this->grammar->compileTruncate($this) as $sql => $bindings) { - $this->connection->statement($sql, $bindings); - } - } - - /** - * Get a new instance of the query builder. - * - * @return \Illuminate\Database\Query\Builder - */ - public function newQuery() - { - return new static($this->connection, $this->grammar, $this->processor); - } - - /** - * Create a new query instance for a sub-query. - * - * @return \Illuminate\Database\Query\Builder - */ - protected function forSubQuery() - { - return $this->newQuery(); - } - - /** - * Create a raw database expression. - * - * @param mixed $value - * @return \Illuminate\Database\Query\Expression - */ - public function raw($value) - { - return $this->connection->raw($value); - } - - /** - * Get the current query value bindings in a flattened array. - * - * @return array - */ - public function getBindings() - { - return Arr::flatten($this->bindings); - } - - /** - * Get the raw array of bindings. - * - * @return array - */ - public function getRawBindings() - { - return $this->bindings; - } - - /** - * Set the bindings on the query builder. - * - * @param array $bindings - * @param string $type - * @return $this - * - * @throws \InvalidArgumentException - */ - public function setBindings(array $bindings, $type = 'where') - { - if (! array_key_exists($type, $this->bindings)) { - throw new InvalidArgumentException("Invalid binding type: {$type}."); - } - - $this->bindings[$type] = $bindings; - - return $this; - } - - /** - * Add a binding to the query. - * - * @param mixed $value - * @param string $type - * @return $this - * - * @throws \InvalidArgumentException - */ - public function addBinding($value, $type = 'where') - { - if (! array_key_exists($type, $this->bindings)) { - throw new InvalidArgumentException("Invalid binding type: {$type}."); - } - - if (is_array($value)) { - $this->bindings[$type] = array_values(array_merge($this->bindings[$type], $value)); - } else { - $this->bindings[$type][] = $value; - } - - return $this; - } - - /** - * Merge an array of bindings into our bindings. - * - * @param \Illuminate\Database\Query\Builder $query - * @return $this - */ - public function mergeBindings(self $query) - { - $this->bindings = array_merge_recursive($this->bindings, $query->bindings); - - return $this; - } - - /** - * Remove all of the expressions from a list of bindings. - * - * @param array $bindings - * @return array - */ - protected function cleanBindings(array $bindings) - { - return array_values(array_filter($bindings, function ($binding) { - return ! $binding instanceof Expression; - })); - } - - /** - * Get the database connection instance. - * - * @return \Illuminate\Database\ConnectionInterface - */ - public function getConnection() - { - return $this->connection; - } - - /** - * Get the database query processor instance. - * - * @return \Illuminate\Database\Query\Processors\Processor - */ - public function getProcessor() - { - return $this->processor; - } - - /** - * Get the query grammar instance. - * - * @return \Illuminate\Database\Query\Grammars\Grammar - */ - public function getGrammar() - { - return $this->grammar; - } - - /** - * Use the write pdo for query. - * - * @return $this - */ - public function useWritePdo() - { - $this->useWritePdo = true; - - return $this; - } - - /** - * Clone the query without the given properties. - * - * @param array $properties - * @return static - */ - public function cloneWithout(array $properties) - { - return tap(clone $this, function ($clone) use ($properties) { - foreach ($properties as $property) { - $clone->{$property} = null; - } - }); - } - - /** - * Clone the query without the given bindings. - * - * @param array $except - * @return static - */ - public function cloneWithoutBindings(array $except) - { - return tap(clone $this, function ($clone) use ($except) { - foreach ($except as $type) { - $clone->bindings[$type] = []; - } - }); - } - - /** - * Handle dynamic method calls into the method. - * - * @param string $method - * @param array $parameters - * @return mixed - * - * @throws \BadMethodCallException - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $parameters); - } - - if (Str::startsWith($method, 'where')) { - return $this->dynamicWhere($method, $parameters); - } - - $className = static::class; - - throw new BadMethodCallException("Call to undefined method {$className}::{$method}()"); - } -} diff --git a/vendor/illuminate/database/Query/Expression.php b/vendor/illuminate/database/Query/Expression.php deleted file mode 100644 index de69029..0000000 --- a/vendor/illuminate/database/Query/Expression.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -namespace Illuminate\Database\Query; - -class Expression -{ - /** - * The value of the expression. - * - * @var mixed - */ - protected $value; - - /** - * Create a new raw query expression. - * - * @param mixed $value - * @return void - */ - public function __construct($value) - { - $this->value = $value; - } - - /** - * Get the value of the expression. - * - * @return mixed - */ - public function getValue() - { - return $this->value; - } - - /** - * Get the value of the expression. - * - * @return string - */ - public function __toString() - { - return (string) $this->getValue(); - } -} diff --git a/vendor/illuminate/database/Query/Grammars/Grammar.php b/vendor/illuminate/database/Query/Grammars/Grammar.php deleted file mode 100644 index 63770ce..0000000 --- a/vendor/illuminate/database/Query/Grammars/Grammar.php +++ /dev/null @@ -1,863 +0,0 @@ -<?php - -namespace Illuminate\Database\Query\Grammars; - -use Illuminate\Support\Arr; -use Illuminate\Database\Query\Builder; -use Illuminate\Database\Query\JoinClause; -use Illuminate\Database\Grammar as BaseGrammar; - -class Grammar extends BaseGrammar -{ - /** - * The grammar specific operators. - * - * @var array - */ - protected $operators = []; - - /** - * The components that make up a select clause. - * - * @var array - */ - protected $selectComponents = [ - 'aggregate', - 'columns', - 'from', - 'joins', - 'wheres', - 'groups', - 'havings', - 'orders', - 'limit', - 'offset', - 'unions', - 'lock', - ]; - - /** - * Compile a select query into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - public function compileSelect(Builder $query) - { - // If the query does not have any columns set, we'll set the columns to the - // * character to just get all of the columns from the database. Then we - // can build the query and concatenate all the pieces together as one. - $original = $query->columns; - - if (is_null($query->columns)) { - $query->columns = ['*']; - } - - // To compile the query, we'll spin through each component of the query and - // see if that component exists. If it does we'll just call the compiler - // function for the component which is responsible for making the SQL. - $sql = trim($this->concatenate( - $this->compileComponents($query)) - ); - - $query->columns = $original; - - return $sql; - } - - /** - * Compile the components necessary for a select clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @return array - */ - protected function compileComponents(Builder $query) - { - $sql = []; - - foreach ($this->selectComponents as $component) { - // To compile the query, we'll spin through each component of the query and - // see if that component exists. If it does we'll just call the compiler - // function for the component which is responsible for making the SQL. - if (! is_null($query->$component)) { - $method = 'compile'.ucfirst($component); - - $sql[$component] = $this->$method($query, $query->$component); - } - } - - return $sql; - } - - /** - * Compile an aggregated select clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $aggregate - * @return string - */ - protected function compileAggregate(Builder $query, $aggregate) - { - $column = $this->columnize($aggregate['columns']); - - // If the query has a "distinct" constraint and we're not asking for all columns - // we need to prepend "distinct" onto the column name so that the query takes - // it into account when it performs the aggregating operations on the data. - if ($query->distinct && $column !== '*') { - $column = 'distinct '.$column; - } - - return 'select '.$aggregate['function'].'('.$column.') as aggregate'; - } - - /** - * Compile the "select *" portion of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $columns - * @return string|null - */ - protected function compileColumns(Builder $query, $columns) - { - // If the query is actually performing an aggregating select, we will let that - // compiler handle the building of the select clauses, as it will need some - // more syntax that is best handled by that function to keep things neat. - if (! is_null($query->aggregate)) { - return; - } - - $select = $query->distinct ? 'select distinct ' : 'select '; - - return $select.$this->columnize($columns); - } - - /** - * Compile the "from" portion of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $table - * @return string - */ - protected function compileFrom(Builder $query, $table) - { - return 'from '.$this->wrapTable($table); - } - - /** - * Compile the "join" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $joins - * @return string - */ - protected function compileJoins(Builder $query, $joins) - { - return collect($joins)->map(function ($join) { - $table = $this->wrapTable($join->table); - - return trim("{$join->type} join {$table} {$this->compileWheres($join)}"); - })->implode(' '); - } - - /** - * Compile the "where" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - protected function compileWheres(Builder $query) - { - // Each type of where clauses has its own compiler function which is responsible - // for actually creating the where clauses SQL. This helps keep the code nice - // and maintainable since each clause has a very small method that it uses. - if (is_null($query->wheres)) { - return ''; - } - - // If we actually have some where clauses, we will strip off the first boolean - // operator, which is added by the query builders for convenience so we can - // avoid checking for the first clauses in each of the compilers methods. - if (count($sql = $this->compileWheresToArray($query)) > 0) { - return $this->concatenateWhereClauses($query, $sql); - } - - return ''; - } - - /** - * Get an array of all the where clauses for the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @return array - */ - protected function compileWheresToArray($query) - { - return collect($query->wheres)->map(function ($where) use ($query) { - return $where['boolean'].' '.$this->{"where{$where['type']}"}($query, $where); - })->all(); - } - - /** - * Format the where clause statements into one string. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $sql - * @return string - */ - protected function concatenateWhereClauses($query, $sql) - { - $conjunction = $query instanceof JoinClause ? 'on' : 'where'; - - return $conjunction.' '.$this->removeLeadingBoolean(implode(' ', $sql)); - } - - /** - * Compile a raw where clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereRaw(Builder $query, $where) - { - return $where['sql']; - } - - /** - * Compile a basic where clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereBasic(Builder $query, $where) - { - $value = $this->parameter($where['value']); - - return $this->wrap($where['column']).' '.$where['operator'].' '.$value; - } - - /** - * Compile a "where in" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereIn(Builder $query, $where) - { - if (! empty($where['values'])) { - return $this->wrap($where['column']).' in ('.$this->parameterize($where['values']).')'; - } - - return '0 = 1'; - } - - /** - * Compile a "where not in" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereNotIn(Builder $query, $where) - { - if (! empty($where['values'])) { - return $this->wrap($where['column']).' not in ('.$this->parameterize($where['values']).')'; - } - - return '1 = 1'; - } - - /** - * Compile a where in sub-select clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereInSub(Builder $query, $where) - { - return $this->wrap($where['column']).' in ('.$this->compileSelect($where['query']).')'; - } - - /** - * Compile a where not in sub-select clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereNotInSub(Builder $query, $where) - { - return $this->wrap($where['column']).' not in ('.$this->compileSelect($where['query']).')'; - } - - /** - * Compile a "where null" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereNull(Builder $query, $where) - { - return $this->wrap($where['column']).' is null'; - } - - /** - * Compile a "where not null" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereNotNull(Builder $query, $where) - { - return $this->wrap($where['column']).' is not null'; - } - - /** - * Compile a "between" where clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereBetween(Builder $query, $where) - { - $between = $where['not'] ? 'not between' : 'between'; - - return $this->wrap($where['column']).' '.$between.' ? and ?'; - } - - /** - * Compile a "where date" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereDate(Builder $query, $where) - { - return $this->dateBasedWhere('date', $query, $where); - } - - /** - * Compile a "where time" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereTime(Builder $query, $where) - { - return $this->dateBasedWhere('time', $query, $where); - } - - /** - * Compile a "where day" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereDay(Builder $query, $where) - { - return $this->dateBasedWhere('day', $query, $where); - } - - /** - * Compile a "where month" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereMonth(Builder $query, $where) - { - return $this->dateBasedWhere('month', $query, $where); - } - - /** - * Compile a "where year" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereYear(Builder $query, $where) - { - return $this->dateBasedWhere('year', $query, $where); - } - - /** - * Compile a date based where clause. - * - * @param string $type - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function dateBasedWhere($type, Builder $query, $where) - { - $value = $this->parameter($where['value']); - - return $type.'('.$this->wrap($where['column']).') '.$where['operator'].' '.$value; - } - - /** - * Compile a where clause comparing two columns.. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereColumn(Builder $query, $where) - { - return $this->wrap($where['first']).' '.$where['operator'].' '.$this->wrap($where['second']); - } - - /** - * Compile a nested where clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereNested(Builder $query, $where) - { - // Here we will calculate what portion of the string we need to remove. If this - // is a join clause query, we need to remove the "on" portion of the SQL and - // if it is a normal query we need to take the leading "where" of queries. - $offset = $query instanceof JoinClause ? 3 : 6; - - return '('.substr($this->compileWheres($where['query']), $offset).')'; - } - - /** - * Compile a where condition with a sub-select. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereSub(Builder $query, $where) - { - $select = $this->compileSelect($where['query']); - - return $this->wrap($where['column']).' '.$where['operator']." ($select)"; - } - - /** - * Compile a where exists clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereExists(Builder $query, $where) - { - return 'exists ('.$this->compileSelect($where['query']).')'; - } - - /** - * Compile a where exists clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereNotExists(Builder $query, $where) - { - return 'not exists ('.$this->compileSelect($where['query']).')'; - } - - /** - * Compile the "group by" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $groups - * @return string - */ - protected function compileGroups(Builder $query, $groups) - { - return 'group by '.$this->columnize($groups); - } - - /** - * Compile the "having" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $havings - * @return string - */ - protected function compileHavings(Builder $query, $havings) - { - $sql = implode(' ', array_map([$this, 'compileHaving'], $havings)); - - return 'having '.$this->removeLeadingBoolean($sql); - } - - /** - * Compile a single having clause. - * - * @param array $having - * @return string - */ - protected function compileHaving(array $having) - { - // If the having clause is "raw", we can just return the clause straight away - // without doing any more processing on it. Otherwise, we will compile the - // clause into SQL based on the components that make it up from builder. - if ($having['type'] === 'Raw') { - return $having['boolean'].' '.$having['sql']; - } - - return $this->compileBasicHaving($having); - } - - /** - * Compile a basic having clause. - * - * @param array $having - * @return string - */ - protected function compileBasicHaving($having) - { - $column = $this->wrap($having['column']); - - $parameter = $this->parameter($having['value']); - - return $having['boolean'].' '.$column.' '.$having['operator'].' '.$parameter; - } - - /** - * Compile the "order by" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $orders - * @return string - */ - protected function compileOrders(Builder $query, $orders) - { - if (! empty($orders)) { - return 'order by '.implode(', ', $this->compileOrdersToArray($query, $orders)); - } - - return ''; - } - - /** - * Compile the query orders to an array. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $orders - * @return array - */ - protected function compileOrdersToArray(Builder $query, $orders) - { - return array_map(function ($order) { - return ! isset($order['sql']) - ? $this->wrap($order['column']).' '.$order['direction'] - : $order['sql']; - }, $orders); - } - - /** - * Compile the random statement into SQL. - * - * @param string $seed - * @return string - */ - public function compileRandom($seed) - { - return 'RANDOM()'; - } - - /** - * Compile the "limit" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param int $limit - * @return string - */ - protected function compileLimit(Builder $query, $limit) - { - return 'limit '.(int) $limit; - } - - /** - * Compile the "offset" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param int $offset - * @return string - */ - protected function compileOffset(Builder $query, $offset) - { - return 'offset '.(int) $offset; - } - - /** - * Compile the "union" queries attached to the main query. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - protected function compileUnions(Builder $query) - { - $sql = ''; - - foreach ($query->unions as $union) { - $sql .= $this->compileUnion($union); - } - - if (! empty($query->unionOrders)) { - $sql .= ' '.$this->compileOrders($query, $query->unionOrders); - } - - if (isset($query->unionLimit)) { - $sql .= ' '.$this->compileLimit($query, $query->unionLimit); - } - - if (isset($query->unionOffset)) { - $sql .= ' '.$this->compileOffset($query, $query->unionOffset); - } - - return ltrim($sql); - } - - /** - * Compile a single union statement. - * - * @param array $union - * @return string - */ - protected function compileUnion(array $union) - { - $conjuction = $union['all'] ? ' union all ' : ' union '; - - return $conjuction.$union['query']->toSql(); - } - - /** - * Compile an exists statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - public function compileExists(Builder $query) - { - $select = $this->compileSelect($query); - - return "select exists({$select}) as {$this->wrap('exists')}"; - } - - /** - * Compile an insert statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - public function compileInsert(Builder $query, array $values) - { - // Essentially we will force every insert to be treated as a batch insert which - // simply makes creating the SQL easier for us since we can utilize the same - // basic routine regardless of an amount of records given to us to insert. - $table = $this->wrapTable($query->from); - - if (! is_array(reset($values))) { - $values = [$values]; - } - - $columns = $this->columnize(array_keys(reset($values))); - - // We need to build a list of parameter place-holders of values that are bound - // to the query. Each insert should have the exact same amount of parameter - // bindings so we will loop through the record and parameterize them all. - $parameters = collect($values)->map(function ($record) { - return '('.$this->parameterize($record).')'; - })->implode(', '); - - return "insert into $table ($columns) values $parameters"; - } - - /** - * Compile an insert and get ID statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @param string $sequence - * @return string - */ - public function compileInsertGetId(Builder $query, $values, $sequence) - { - return $this->compileInsert($query, $values); - } - - /** - * Compile an update statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - public function compileUpdate(Builder $query, $values) - { - $table = $this->wrapTable($query->from); - - // Each one of the columns in the update statements needs to be wrapped in the - // keyword identifiers, also a place-holder needs to be created for each of - // the values in the list of bindings so we can make the sets statements. - $columns = collect($values)->map(function ($value, $key) { - return $this->wrap($key).' = '.$this->parameter($value); - })->implode(', '); - - // If the query has any "join" clauses, we will setup the joins on the builder - // and compile them so we can attach them to this update, as update queries - // can get join statements to attach to other tables when they're needed. - $joins = ''; - - if (isset($query->joins)) { - $joins = ' '.$this->compileJoins($query, $query->joins); - } - - // Of course, update queries may also be constrained by where clauses so we'll - // need to compile the where clauses and attach it to the query so only the - // intended records are updated by the SQL statements we generate to run. - $wheres = $this->compileWheres($query); - - return trim("update {$table}{$joins} set $columns $wheres"); - } - - /** - * Prepare the bindings for an update statement. - * - * @param array $bindings - * @param array $values - * @return array - */ - public function prepareBindingsForUpdate(array $bindings, array $values) - { - $cleanBindings = Arr::except($bindings, ['join', 'select']); - - return array_values( - array_merge($bindings['join'], $values, Arr::flatten($cleanBindings)) - ); - } - - /** - * Compile a delete statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - public function compileDelete(Builder $query) - { - $wheres = is_array($query->wheres) ? $this->compileWheres($query) : ''; - - return trim("delete from {$this->wrapTable($query->from)} $wheres"); - } - - /** - * Prepare the bindings for a delete statement. - * - * @param array $bindings - * @return array - */ - public function prepareBindingsForDelete(array $bindings) - { - return Arr::flatten($bindings); - } - - /** - * Compile a truncate table statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return array - */ - public function compileTruncate(Builder $query) - { - return ['truncate '.$this->wrapTable($query->from) => []]; - } - - /** - * Compile the lock into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param bool|string $value - * @return string - */ - protected function compileLock(Builder $query, $value) - { - return is_string($value) ? $value : ''; - } - - /** - * Determine if the grammar supports savepoints. - * - * @return bool - */ - public function supportsSavepoints() - { - return true; - } - - /** - * Compile the SQL statement to define a savepoint. - * - * @param string $name - * @return string - */ - public function compileSavepoint($name) - { - return 'SAVEPOINT '.$name; - } - - /** - * Compile the SQL statement to execute a savepoint rollback. - * - * @param string $name - * @return string - */ - public function compileSavepointRollBack($name) - { - return 'ROLLBACK TO SAVEPOINT '.$name; - } - - /** - * Concatenate an array of segments, removing empties. - * - * @param array $segments - * @return string - */ - protected function concatenate($segments) - { - return implode(' ', array_filter($segments, function ($value) { - return (string) $value !== ''; - })); - } - - /** - * Remove the leading boolean from a statement. - * - * @param string $value - * @return string - */ - protected function removeLeadingBoolean($value) - { - return preg_replace('/and |or /i', '', $value, 1); - } - - /** - * Get the grammar specific operators. - * - * @return array - */ - public function getOperators() - { - return $this->operators; - } -} diff --git a/vendor/illuminate/database/Query/Grammars/MySqlGrammar.php b/vendor/illuminate/database/Query/Grammars/MySqlGrammar.php deleted file mode 100644 index 8dff604..0000000 --- a/vendor/illuminate/database/Query/Grammars/MySqlGrammar.php +++ /dev/null @@ -1,316 +0,0 @@ -<?php - -namespace Illuminate\Database\Query\Grammars; - -use Illuminate\Support\Arr; -use Illuminate\Support\Str; -use Illuminate\Database\Query\Builder; -use Illuminate\Database\Query\JsonExpression; - -class MySqlGrammar extends Grammar -{ - /** - * The components that make up a select clause. - * - * @var array - */ - protected $selectComponents = [ - 'aggregate', - 'columns', - 'from', - 'joins', - 'wheres', - 'groups', - 'havings', - 'orders', - 'limit', - 'offset', - 'lock', - ]; - - /** - * Compile a select query into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - public function compileSelect(Builder $query) - { - $sql = parent::compileSelect($query); - - if ($query->unions) { - $sql = '('.$sql.') '.$this->compileUnions($query); - } - - return $sql; - } - - /** - * Compile a single union statement. - * - * @param array $union - * @return string - */ - protected function compileUnion(array $union) - { - $conjuction = $union['all'] ? ' union all ' : ' union '; - - return $conjuction.'('.$union['query']->toSql().')'; - } - - /** - * Compile the random statement into SQL. - * - * @param string $seed - * @return string - */ - public function compileRandom($seed) - { - return 'RAND('.$seed.')'; - } - - /** - * Compile the lock into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param bool|string $value - * @return string - */ - protected function compileLock(Builder $query, $value) - { - if (! is_string($value)) { - return $value ? 'for update' : 'lock in share mode'; - } - - return $value; - } - - /** - * Compile an update statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - public function compileUpdate(Builder $query, $values) - { - $table = $this->wrapTable($query->from); - - // Each one of the columns in the update statements needs to be wrapped in the - // keyword identifiers, also a place-holder needs to be created for each of - // the values in the list of bindings so we can make the sets statements. - $columns = $this->compileUpdateColumns($values); - - // If the query has any "join" clauses, we will setup the joins on the builder - // and compile them so we can attach them to this update, as update queries - // can get join statements to attach to other tables when they're needed. - $joins = ''; - - if (isset($query->joins)) { - $joins = ' '.$this->compileJoins($query, $query->joins); - } - - // Of course, update queries may also be constrained by where clauses so we'll - // need to compile the where clauses and attach it to the query so only the - // intended records are updated by the SQL statements we generate to run. - $where = $this->compileWheres($query); - - $sql = rtrim("update {$table}{$joins} set $columns $where"); - - // If the query has an order by clause we will compile it since MySQL supports - // order bys on update statements. We'll compile them using the typical way - // of compiling order bys. Then they will be appended to the SQL queries. - if (! empty($query->orders)) { - $sql .= ' '.$this->compileOrders($query, $query->orders); - } - - // Updates on MySQL also supports "limits", which allow you to easily update a - // single record very easily. This is not supported by all database engines - // so we have customized this update compiler here in order to add it in. - if (isset($query->limit)) { - $sql .= ' '.$this->compileLimit($query, $query->limit); - } - - return rtrim($sql); - } - - /** - * Compile all of the columns for an update statement. - * - * @param array $values - * @return string - */ - protected function compileUpdateColumns($values) - { - return collect($values)->map(function ($value, $key) { - if ($this->isJsonSelector($key)) { - return $this->compileJsonUpdateColumn($key, new JsonExpression($value)); - } - - return $this->wrap($key).' = '.$this->parameter($value); - })->implode(', '); - } - - /** - * Prepares a JSON column being updated using the JSON_SET function. - * - * @param string $key - * @param \Illuminate\Database\Query\JsonExpression $value - * @return string - */ - protected function compileJsonUpdateColumn($key, JsonExpression $value) - { - $path = explode('->', $key); - - $field = $this->wrapValue(array_shift($path)); - - $accessor = "'$.\"".implode('"."', $path)."\"'"; - - return "{$field} = json_set({$field}, {$accessor}, {$value->getValue()})"; - } - - /** - * Prepare the bindings for an update statement. - * - * Booleans, integers, and doubles are inserted into JSON updates as raw values. - * - * @param array $bindings - * @param array $values - * @return array - */ - public function prepareBindingsForUpdate(array $bindings, array $values) - { - $values = collect($values)->reject(function ($value, $column) { - return $this->isJsonSelector($column) && - in_array(gettype($value), ['boolean', 'integer', 'double']); - })->all(); - - return parent::prepareBindingsForUpdate($bindings, $values); - } - - /** - * Compile a delete statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - public function compileDelete(Builder $query) - { - $table = $this->wrapTable($query->from); - - $where = is_array($query->wheres) ? $this->compileWheres($query) : ''; - - return isset($query->joins) - ? $this->compileDeleteWithJoins($query, $table, $where) - : $this->compileDeleteWithoutJoins($query, $table, $where); - } - - /** - * Prepare the bindings for a delete statement. - * - * @param array $bindings - * @return array - */ - public function prepareBindingsForDelete(array $bindings) - { - $cleanBindings = Arr::except($bindings, ['join', 'select']); - - return array_values( - array_merge($bindings['join'], Arr::flatten($cleanBindings)) - ); - } - - /** - * Compile a delete query that does not use joins. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $table - * @param array $where - * @return string - */ - protected function compileDeleteWithoutJoins($query, $table, $where) - { - $sql = trim("delete from {$table} {$where}"); - - // When using MySQL, delete statements may contain order by statements and limits - // so we will compile both of those here. Once we have finished compiling this - // we will return the completed SQL statement so it will be executed for us. - if (! empty($query->orders)) { - $sql .= ' '.$this->compileOrders($query, $query->orders); - } - - if (isset($query->limit)) { - $sql .= ' '.$this->compileLimit($query, $query->limit); - } - - return $sql; - } - - /** - * Compile a delete query that uses joins. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $table - * @param array $where - * @return string - */ - protected function compileDeleteWithJoins($query, $table, $where) - { - $joins = ' '.$this->compileJoins($query, $query->joins); - - $alias = strpos(strtolower($table), ' as ') !== false - ? explode(' as ', $table)[1] : $table; - - return trim("delete {$alias} from {$table}{$joins} {$where}"); - } - - /** - * Wrap a single string in keyword identifiers. - * - * @param string $value - * @return string - */ - protected function wrapValue($value) - { - if ($value === '*') { - return $value; - } - - // If the given value is a JSON selector we will wrap it differently than a - // traditional value. We will need to split this path and wrap each part - // wrapped, etc. Otherwise, we will simply wrap the value as a string. - if ($this->isJsonSelector($value)) { - return $this->wrapJsonSelector($value); - } - - return '`'.str_replace('`', '``', $value).'`'; - } - - /** - * Wrap the given JSON selector. - * - * @param string $value - * @return string - */ - protected function wrapJsonSelector($value) - { - $path = explode('->', $value); - - $field = $this->wrapValue(array_shift($path)); - - return sprintf('%s->\'$.%s\'', $field, collect($path)->map(function ($part) { - return '"'.$part.'"'; - })->implode('.')); - } - - /** - * Determine if the given string is a JSON selector. - * - * @param string $value - * @return bool - */ - protected function isJsonSelector($value) - { - return Str::contains($value, '->'); - } -} diff --git a/vendor/illuminate/database/Query/Grammars/PostgresGrammar.php b/vendor/illuminate/database/Query/Grammars/PostgresGrammar.php deleted file mode 100644 index 564bbfb..0000000 --- a/vendor/illuminate/database/Query/Grammars/PostgresGrammar.php +++ /dev/null @@ -1,345 +0,0 @@ -<?php - -namespace Illuminate\Database\Query\Grammars; - -use Illuminate\Support\Arr; -use Illuminate\Support\Str; -use Illuminate\Database\Query\Builder; - -class PostgresGrammar extends Grammar -{ - /** - * All of the available clause operators. - * - * @var array - */ - protected $operators = [ - '=', '<', '>', '<=', '>=', '<>', '!=', - 'like', 'not like', 'between', 'ilike', - '~', '&', '|', '#', '<<', '>>', '<<=', '>>=', - '&&', '@>', '<@', '?', '?|', '?&', '||', '-', '+', '#-', - ]; - - /** - * Compile a "where date" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereDate(Builder $query, $where) - { - $value = $this->parameter($where['value']); - - return $this->wrap($where['column']).'::date '.$where['operator'].' '.$value; - } - - /** - * Compile a "where time" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereTime(Builder $query, $where) - { - $value = $this->parameter($where['value']); - - return $this->wrap($where['column']).'::time '.$where['operator'].' '.$value; - } - - /** - * Compile a date based where clause. - * - * @param string $type - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function dateBasedWhere($type, Builder $query, $where) - { - $value = $this->parameter($where['value']); - - return 'extract('.$type.' from '.$this->wrap($where['column']).') '.$where['operator'].' '.$value; - } - - /** - * Compile the lock into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param bool|string $value - * @return string - */ - protected function compileLock(Builder $query, $value) - { - if (! is_string($value)) { - return $value ? 'for update' : 'for share'; - } - - return $value; - } - - /** - * {@inheritdoc} - */ - public function compileInsert(Builder $query, array $values) - { - $table = $this->wrapTable($query->from); - - return empty($values) - ? "insert into {$table} DEFAULT VALUES" - : parent::compileInsert($query, $values); - } - - /** - * Compile an insert and get ID statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @param string $sequence - * @return string - */ - public function compileInsertGetId(Builder $query, $values, $sequence) - { - if (is_null($sequence)) { - $sequence = 'id'; - } - - return $this->compileInsert($query, $values).' returning '.$this->wrap($sequence); - } - - /** - * Compile an update statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - public function compileUpdate(Builder $query, $values) - { - $table = $this->wrapTable($query->from); - - // Each one of the columns in the update statements needs to be wrapped in the - // keyword identifiers, also a place-holder needs to be created for each of - // the values in the list of bindings so we can make the sets statements. - $columns = $this->compileUpdateColumns($values); - - $from = $this->compileUpdateFrom($query); - - $where = $this->compileUpdateWheres($query); - - return trim("update {$table} set {$columns}{$from} {$where}"); - } - - /** - * Compile the columns for the update statement. - * - * @param array $values - * @return string - */ - protected function compileUpdateColumns($values) - { - // When gathering the columns for an update statement, we'll wrap each of the - // columns and convert it to a parameter value. Then we will concatenate a - // list of the columns that can be added into this update query clauses. - return collect($values)->map(function ($value, $key) { - return $this->wrap($key).' = '.$this->parameter($value); - })->implode(', '); - } - - /** - * Compile the "from" clause for an update with a join. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string|null - */ - protected function compileUpdateFrom(Builder $query) - { - if (! isset($query->joins)) { - return ''; - } - - // When using Postgres, updates with joins list the joined tables in the from - // clause, which is different than other systems like MySQL. Here, we will - // compile out the tables that are joined and add them to a from clause. - $froms = collect($query->joins)->map(function ($join) { - return $this->wrapTable($join->table); - })->all(); - - if (count($froms) > 0) { - return ' from '.implode(', ', $froms); - } - } - - /** - * Compile the additional where clauses for updates with joins. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - protected function compileUpdateWheres(Builder $query) - { - $baseWheres = $this->compileWheres($query); - - if (! isset($query->joins)) { - return $baseWheres; - } - - // Once we compile the join constraints, we will either use them as the where - // clause or append them to the existing base where clauses. If we need to - // strip the leading boolean we will do so when using as the only where. - $joinWheres = $this->compileUpdateJoinWheres($query); - - if (trim($baseWheres) == '') { - return 'where '.$this->removeLeadingBoolean($joinWheres); - } - - return $baseWheres.' '.$joinWheres; - } - - /** - * Compile the "join" clause where clauses for an update. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - protected function compileUpdateJoinWheres(Builder $query) - { - $joinWheres = []; - - // Here we will just loop through all of the join constraints and compile them - // all out then implode them. This should give us "where" like syntax after - // everything has been built and then we will join it to the real wheres. - foreach ($query->joins as $join) { - foreach ($join->wheres as $where) { - $method = "where{$where['type']}"; - - $joinWheres[] = $where['boolean'].' '.$this->$method($query, $where); - } - } - - return implode(' ', $joinWheres); - } - - /** - * Prepare the bindings for an update statement. - * - * @param array $bindings - * @param array $values - * @return array - */ - public function prepareBindingsForUpdate(array $bindings, array $values) - { - // Update statements with "joins" in Postgres use an interesting syntax. We need to - // take all of the bindings and put them on the end of this array since they are - // added to the end of the "where" clause statements as typical where clauses. - $bindingsWithoutJoin = Arr::except($bindings, 'join'); - - return array_values( - array_merge($values, $bindings['join'], Arr::flatten($bindingsWithoutJoin)) - ); - } - - /** - * Compile a delete statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - public function compileDelete(Builder $query) - { - $table = $this->wrapTable($query->from); - - return isset($query->joins) - ? $this->compileDeleteWithJoins($query, $table) - : parent::compileDelete($query); - } - - /** - * Compile a delete query that uses joins. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $table - * @param array $where - * @return string - */ - protected function compileDeleteWithJoins($query, $table) - { - $using = ' USING '.collect($query->joins)->map(function ($join) { - return $this->wrapTable($join->table); - })->implode(', '); - - $where = count($query->wheres) > 0 ? ' '.$this->compileUpdateWheres($query) : ''; - - return trim("delete from {$table}{$using}{$where}"); - } - - /** - * Compile a truncate table statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return array - */ - public function compileTruncate(Builder $query) - { - return ['truncate '.$this->wrapTable($query->from).' restart identity' => []]; - } - - /** - * Wrap a single string in keyword identifiers. - * - * @param string $value - * @return string - */ - protected function wrapValue($value) - { - if ($value === '*') { - return $value; - } - - // If the given value is a JSON selector we will wrap it differently than a - // traditional value. We will need to split this path and wrap each part - // wrapped, etc. Otherwise, we will simply wrap the value as a string. - if (Str::contains($value, '->')) { - return $this->wrapJsonSelector($value); - } - - return '"'.str_replace('"', '""', $value).'"'; - } - - /** - * Wrap the given JSON selector. - * - * @param string $value - * @return string - */ - protected function wrapJsonSelector($value) - { - $path = explode('->', $value); - - $field = $this->wrapValue(array_shift($path)); - - $wrappedPath = $this->wrapJsonPathAttributes($path); - - $attribute = array_pop($wrappedPath); - - if (! empty($wrappedPath)) { - return $field.'->'.implode('->', $wrappedPath).'->>'.$attribute; - } - - return $field.'->>'.$attribute; - } - - /** - * Wrap the attributes of the give JSON path. - * - * @param array $path - * @return array - */ - protected function wrapJsonPathAttributes($path) - { - return array_map(function ($attribute) { - return "'$attribute'"; - }, $path); - } -} diff --git a/vendor/illuminate/database/Query/Grammars/SQLiteGrammar.php b/vendor/illuminate/database/Query/Grammars/SQLiteGrammar.php deleted file mode 100644 index cd57081..0000000 --- a/vendor/illuminate/database/Query/Grammars/SQLiteGrammar.php +++ /dev/null @@ -1,202 +0,0 @@ -<?php - -namespace Illuminate\Database\Query\Grammars; - -use Illuminate\Database\Query\Builder; - -class SQLiteGrammar extends Grammar -{ - /** - * The components that make up a select clause. - * - * @var array - */ - protected $selectComponents = [ - 'aggregate', - 'columns', - 'from', - 'joins', - 'wheres', - 'groups', - 'havings', - 'orders', - 'limit', - 'offset', - 'lock', - ]; - - /** - * All of the available clause operators. - * - * @var array - */ - protected $operators = [ - '=', '<', '>', '<=', '>=', '<>', '!=', - 'like', 'not like', 'ilike', - '&', '|', '<<', '>>', - ]; - - /** - * Compile a select query into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - public function compileSelect(Builder $query) - { - $sql = parent::compileSelect($query); - - if ($query->unions) { - $sql = 'select * from ('.$sql.') '.$this->compileUnions($query); - } - - return $sql; - } - - /** - * Compile a single union statement. - * - * @param array $union - * @return string - */ - protected function compileUnion(array $union) - { - $conjuction = $union['all'] ? ' union all ' : ' union '; - - return $conjuction.'select * from ('.$union['query']->toSql().')'; - } - - /** - * Compile a "where date" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereDate(Builder $query, $where) - { - return $this->dateBasedWhere('%Y-%m-%d', $query, $where); - } - - /** - * Compile a "where day" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereDay(Builder $query, $where) - { - return $this->dateBasedWhere('%d', $query, $where); - } - - /** - * Compile a "where month" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereMonth(Builder $query, $where) - { - return $this->dateBasedWhere('%m', $query, $where); - } - - /** - * Compile a "where year" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereYear(Builder $query, $where) - { - return $this->dateBasedWhere('%Y', $query, $where); - } - - /** - * Compile a "where time" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereTime(Builder $query, $where) - { - return $this->dateBasedWhere('%H:%M:%S', $query, $where); - } - - /** - * Compile a date based where clause. - * - * @param string $type - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function dateBasedWhere($type, Builder $query, $where) - { - $value = str_pad($where['value'], 2, '0', STR_PAD_LEFT); - - $value = $this->parameter($value); - - return "strftime('{$type}', {$this->wrap($where['column'])}) {$where['operator']} {$value}"; - } - - /** - * Compile an insert statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - public function compileInsert(Builder $query, array $values) - { - // Essentially we will force every insert to be treated as a batch insert which - // simply makes creating the SQL easier for us since we can utilize the same - // basic routine regardless of an amount of records given to us to insert. - $table = $this->wrapTable($query->from); - - if (! is_array(reset($values))) { - $values = [$values]; - } - - // If there is only one record being inserted, we will just use the usual query - // grammar insert builder because no special syntax is needed for the single - // row inserts in SQLite. However, if there are multiples, we'll continue. - if (count($values) == 1) { - return empty(reset($values)) - ? "insert into $table default values" - : parent::compileInsert($query, reset($values)); - } - - $names = $this->columnize(array_keys(reset($values))); - - $columns = []; - - // SQLite requires us to build the multi-row insert as a listing of select with - // unions joining them together. So we'll build out this list of columns and - // then join them all together with select unions to complete the queries. - foreach (array_keys(reset($values)) as $column) { - $columns[] = '? as '.$this->wrap($column); - } - - $columns = array_fill(0, count($values), implode(', ', $columns)); - - return "insert into $table ($names) select ".implode(' union all select ', $columns); - } - - /** - * Compile a truncate table statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return array - */ - public function compileTruncate(Builder $query) - { - return [ - 'delete from sqlite_sequence where name = ?' => [$query->from], - 'delete from '.$this->wrapTable($query->from) => [], - ]; - } -} diff --git a/vendor/illuminate/database/Query/Grammars/SqlServerGrammar.php b/vendor/illuminate/database/Query/Grammars/SqlServerGrammar.php deleted file mode 100644 index dfefda3..0000000 --- a/vendor/illuminate/database/Query/Grammars/SqlServerGrammar.php +++ /dev/null @@ -1,442 +0,0 @@ -<?php - -namespace Illuminate\Database\Query\Grammars; - -use Illuminate\Support\Arr; -use Illuminate\Database\Query\Builder; - -class SqlServerGrammar extends Grammar -{ - /** - * All of the available clause operators. - * - * @var array - */ - protected $operators = [ - '=', '<', '>', '<=', '>=', '!<', '!>', '<>', '!=', - 'like', 'not like', 'ilike', - '&', '&=', '|', '|=', '^', '^=', - ]; - - /** - * Compile a select query into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - public function compileSelect(Builder $query) - { - if (! $query->offset) { - return parent::compileSelect($query); - } - - // If an offset is present on the query, we will need to wrap the query in - // a big "ANSI" offset syntax block. This is very nasty compared to the - // other database systems but is necessary for implementing features. - if (is_null($query->columns)) { - $query->columns = ['*']; - } - - return $this->compileAnsiOffset( - $query, $this->compileComponents($query) - ); - } - - /** - * Compile the "select *" portion of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $columns - * @return string|null - */ - protected function compileColumns(Builder $query, $columns) - { - if (! is_null($query->aggregate)) { - return; - } - - $select = $query->distinct ? 'select distinct ' : 'select '; - - // If there is a limit on the query, but not an offset, we will add the top - // clause to the query, which serves as a "limit" type clause within the - // SQL Server system similar to the limit keywords available in MySQL. - if ($query->limit > 0 && $query->offset <= 0) { - $select .= 'top '.$query->limit.' '; - } - - return $select.$this->columnize($columns); - } - - /** - * Compile the "from" portion of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $table - * @return string - */ - protected function compileFrom(Builder $query, $table) - { - $from = parent::compileFrom($query, $table); - - if (is_string($query->lock)) { - return $from.' '.$query->lock; - } - - if (! is_null($query->lock)) { - return $from.' with(rowlock,'.($query->lock ? 'updlock,' : '').'holdlock)'; - } - - return $from; - } - - /** - * Compile a "where date" clause. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $where - * @return string - */ - protected function whereDate(Builder $query, $where) - { - $value = $this->parameter($where['value']); - - return 'cast('.$this->wrap($where['column']).' as date) '.$where['operator'].' '.$value; - } - - /** - * Create a full ANSI offset clause for the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $components - * @return string - */ - protected function compileAnsiOffset(Builder $query, $components) - { - // An ORDER BY clause is required to make this offset query work, so if one does - // not exist we'll just create a dummy clause to trick the database and so it - // does not complain about the queries for not having an "order by" clause. - if (empty($components['orders'])) { - $components['orders'] = 'order by (select 0)'; - } - - // We need to add the row number to the query so we can compare it to the offset - // and limit values given for the statements. So we will add an expression to - // the "select" that will give back the row numbers on each of the records. - $components['columns'] .= $this->compileOver($components['orders']); - - unset($components['orders']); - - // Next we need to calculate the constraints that should be placed on the query - // to get the right offset and limit from our query but if there is no limit - // set we will just handle the offset only since that is all that matters. - $sql = $this->concatenate($components); - - return $this->compileTableExpression($sql, $query); - } - - /** - * Compile the over statement for a table expression. - * - * @param string $orderings - * @return string - */ - protected function compileOver($orderings) - { - return ", row_number() over ({$orderings}) as row_num"; - } - - /** - * Compile a common table expression for a query. - * - * @param string $sql - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - protected function compileTableExpression($sql, $query) - { - $constraint = $this->compileRowConstraint($query); - - return "select * from ({$sql}) as temp_table where row_num {$constraint}"; - } - - /** - * Compile the limit / offset row constraint for a query. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - protected function compileRowConstraint($query) - { - $start = $query->offset + 1; - - if ($query->limit > 0) { - $finish = $query->offset + $query->limit; - - return "between {$start} and {$finish}"; - } - - return ">= {$start}"; - } - - /** - * Compile the random statement into SQL. - * - * @param string $seed - * @return string - */ - public function compileRandom($seed) - { - return 'NEWID()'; - } - - /** - * Compile the "limit" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param int $limit - * @return string - */ - protected function compileLimit(Builder $query, $limit) - { - return ''; - } - - /** - * Compile the "offset" portions of the query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param int $offset - * @return string - */ - protected function compileOffset(Builder $query, $offset) - { - return ''; - } - - /** - * Compile the lock into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param bool|string $value - * @return string - */ - protected function compileLock(Builder $query, $value) - { - return ''; - } - - /** - * Compile an exists statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - public function compileExists(Builder $query) - { - $existsQuery = clone $query; - - $existsQuery->columns = []; - - return $this->compileSelect($existsQuery->selectRaw('1 [exists]')->limit(1)); - } - - /** - * Compile a delete statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return string - */ - public function compileDelete(Builder $query) - { - $table = $this->wrapTable($query->from); - - $where = is_array($query->wheres) ? $this->compileWheres($query) : ''; - - return isset($query->joins) - ? $this->compileDeleteWithJoins($query, $table, $where) - : trim("delete from {$table} {$where}"); - } - - /** - * Compile a delete statement with joins into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $table - * @param string $where - * @return string - */ - protected function compileDeleteWithJoins(Builder $query, $table, $where) - { - $joins = ' '.$this->compileJoins($query, $query->joins); - - $alias = strpos(strtolower($table), ' as ') !== false - ? explode(' as ', $table)[1] : $table; - - return trim("delete {$alias} from {$table}{$joins} {$where}"); - } - - /** - * Compile a truncate table statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @return array - */ - public function compileTruncate(Builder $query) - { - return ['truncate table '.$this->wrapTable($query->from) => []]; - } - - /** - * Compile an update statement into SQL. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $values - * @return string - */ - public function compileUpdate(Builder $query, $values) - { - list($table, $alias) = $this->parseUpdateTable($query->from); - - // Each one of the columns in the update statements needs to be wrapped in the - // keyword identifiers, also a place-holder needs to be created for each of - // the values in the list of bindings so we can make the sets statements. - $columns = collect($values)->map(function ($value, $key) { - return $this->wrap($key).' = '.$this->parameter($value); - })->implode(', '); - - // If the query has any "join" clauses, we will setup the joins on the builder - // and compile them so we can attach them to this update, as update queries - // can get join statements to attach to other tables when they're needed. - $joins = ''; - - if (isset($query->joins)) { - $joins = ' '.$this->compileJoins($query, $query->joins); - } - - // Of course, update queries may also be constrained by where clauses so we'll - // need to compile the where clauses and attach it to the query so only the - // intended records are updated by the SQL statements we generate to run. - $where = $this->compileWheres($query); - - if (! empty($joins)) { - return trim("update {$alias} set {$columns} from {$table}{$joins} {$where}"); - } - - return trim("update {$table}{$joins} set $columns $where"); - } - - /** - * Get the table and alias for the given table. - * - * @param string $table - * @return array - */ - protected function parseUpdateTable($table) - { - $table = $alias = $this->wrapTable($table); - - if (strpos(strtolower($table), '] as [') !== false) { - $alias = '['.explode('] as [', $table)[1]; - } - - return [$table, $alias]; - } - - /** - * Prepare the bindings for an update statement. - * - * @param array $bindings - * @param array $values - * @return array - */ - public function prepareBindingsForUpdate(array $bindings, array $values) - { - // Update statements with joins in SQL Servers utilize an unique syntax. We need to - // take all of the bindings and put them on the end of this array since they are - // added to the end of the "where" clause statements as typical where clauses. - $bindingsWithoutJoin = Arr::except($bindings, 'join'); - - return array_values( - array_merge($values, $bindings['join'], Arr::flatten($bindingsWithoutJoin)) - ); - } - - /** - * Determine if the grammar supports savepoints. - * - * @return bool - */ - public function supportsSavepoints() - { - return true; - } - - /** - * Compile the SQL statement to define a savepoint. - * - * @param string $name - * @return string - */ - public function compileSavepoint($name) - { - return 'SAVE TRANSACTION '.$name; - } - - /** - * Compile the SQL statement to execute a savepoint rollback. - * - * @param string $name - * @return string - */ - public function compileSavepointRollBack($name) - { - return 'ROLLBACK TRANSACTION '.$name; - } - - /** - * Get the format for database stored dates. - * - * @return string - */ - public function getDateFormat() - { - return 'Y-m-d H:i:s.v'; - } - - /** - * Wrap a single string in keyword identifiers. - * - * @param string $value - * @return string - */ - protected function wrapValue($value) - { - return $value === '*' ? $value : '['.str_replace(']', ']]', $value).']'; - } - - /** - * Wrap a table in keyword identifiers. - * - * @param \Illuminate\Database\Query\Expression|string $table - * @return string - */ - public function wrapTable($table) - { - return $this->wrapTableValuedFunction(parent::wrapTable($table)); - } - - /** - * Wrap a table in keyword identifiers. - * - * @param string $table - * @return string - */ - protected function wrapTableValuedFunction($table) - { - if (preg_match('/^(.+?)(\(.*?\))]$/', $table, $matches) === 1) { - $table = $matches[1].']'.$matches[2]; - } - - return $table; - } -} diff --git a/vendor/illuminate/database/Query/JoinClause.php b/vendor/illuminate/database/Query/JoinClause.php deleted file mode 100644 index 4b32df2..0000000 --- a/vendor/illuminate/database/Query/JoinClause.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php - -namespace Illuminate\Database\Query; - -use Closure; - -class JoinClause extends Builder -{ - /** - * The type of join being performed. - * - * @var string - */ - public $type; - - /** - * The table the join clause is joining to. - * - * @var string - */ - public $table; - - /** - * The parent query builder instance. - * - * @var \Illuminate\Database\Query\Builder - */ - private $parentQuery; - - /** - * Create a new join clause instance. - * - * @param \Illuminate\Database\Query\Builder $parentQuery - * @param string $type - * @param string $table - * @return void - */ - public function __construct(Builder $parentQuery, $type, $table) - { - $this->type = $type; - $this->table = $table; - $this->parentQuery = $parentQuery; - - parent::__construct( - $parentQuery->getConnection(), $parentQuery->getGrammar(), $parentQuery->getProcessor() - ); - } - - /** - * Add an "on" clause to the join. - * - * On clauses can be chained, e.g. - * - * $join->on('contacts.user_id', '=', 'users.id') - * ->on('contacts.info_id', '=', 'info.id') - * - * will produce the following SQL: - * - * on `contacts`.`user_id` = `users`.`id` and `contacts`.`info_id` = `info`.`id` - * - * @param \Closure|string $first - * @param string|null $operator - * @param string|null $second - * @param string $boolean - * @return $this - * - * @throws \InvalidArgumentException - */ - public function on($first, $operator = null, $second = null, $boolean = 'and') - { - if ($first instanceof Closure) { - return $this->whereNested($first, $boolean); - } - - return $this->whereColumn($first, $operator, $second, $boolean); - } - - /** - * Add an "or on" clause to the join. - * - * @param \Closure|string $first - * @param string|null $operator - * @param string|null $second - * @return \Illuminate\Database\Query\JoinClause - */ - public function orOn($first, $operator = null, $second = null) - { - return $this->on($first, $operator, $second, 'or'); - } - - /** - * Get a new instance of the join clause builder. - * - * @return \Illuminate\Database\Query\JoinClause - */ - public function newQuery() - { - return new static($this->parentQuery, $this->type, $this->table); - } - - /** - * Create a new query instance for sub-query. - * - * @return \Illuminate\Database\Query\Builder - */ - protected function forSubQuery() - { - return $this->parentQuery->newQuery(); - } -} diff --git a/vendor/illuminate/database/Query/JsonExpression.php b/vendor/illuminate/database/Query/JsonExpression.php deleted file mode 100644 index 12635ff..0000000 --- a/vendor/illuminate/database/Query/JsonExpression.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -namespace Illuminate\Database\Query; - -use InvalidArgumentException; - -class JsonExpression extends Expression -{ - /** - * Create a new raw query expression. - * - * @param mixed $value - * @return void - */ - public function __construct($value) - { - parent::__construct( - $this->getJsonBindingParameter($value) - ); - } - - /** - * Translate the given value into the appropriate JSON binding parameter. - * - * @param mixed $value - * @return string - */ - protected function getJsonBindingParameter($value) - { - switch ($type = gettype($value)) { - case 'boolean': - return $value ? 'true' : 'false'; - case 'integer': - case 'double': - return $value; - case 'string': - return '?'; - case 'object': - case 'array': - return '?'; - } - - throw new InvalidArgumentException('JSON value is of illegal type: '.$type); - } -} diff --git a/vendor/illuminate/database/Query/Processors/MySqlProcessor.php b/vendor/illuminate/database/Query/Processors/MySqlProcessor.php deleted file mode 100644 index ce91838..0000000 --- a/vendor/illuminate/database/Query/Processors/MySqlProcessor.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Illuminate\Database\Query\Processors; - -class MySqlProcessor extends Processor -{ - /** - * Process the results of a column listing query. - * - * @param array $results - * @return array - */ - public function processColumnListing($results) - { - return array_map(function ($result) { - return ((object) $result)->column_name; - }, $results); - } -} diff --git a/vendor/illuminate/database/Query/Processors/PostgresProcessor.php b/vendor/illuminate/database/Query/Processors/PostgresProcessor.php deleted file mode 100644 index 90abf24..0000000 --- a/vendor/illuminate/database/Query/Processors/PostgresProcessor.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace Illuminate\Database\Query\Processors; - -use Illuminate\Database\Query\Builder; - -class PostgresProcessor extends Processor -{ - /** - * Process an "insert get ID" query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $sql - * @param array $values - * @param string $sequence - * @return int - */ - public function processInsertGetId(Builder $query, $sql, $values, $sequence = null) - { - $result = $query->getConnection()->selectFromWriteConnection($sql, $values)[0]; - - $sequence = $sequence ?: 'id'; - - $id = is_object($result) ? $result->{$sequence} : $result[$sequence]; - - return is_numeric($id) ? (int) $id : $id; - } - - /** - * Process the results of a column listing query. - * - * @param array $results - * @return array - */ - public function processColumnListing($results) - { - return array_map(function ($result) { - return ((object) $result)->column_name; - }, $results); - } -} diff --git a/vendor/illuminate/database/Query/Processors/Processor.php b/vendor/illuminate/database/Query/Processors/Processor.php deleted file mode 100644 index f78429f..0000000 --- a/vendor/illuminate/database/Query/Processors/Processor.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -namespace Illuminate\Database\Query\Processors; - -use Illuminate\Database\Query\Builder; - -class Processor -{ - /** - * Process the results of a "select" query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param array $results - * @return array - */ - public function processSelect(Builder $query, $results) - { - return $results; - } - - /** - * Process an "insert get ID" query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $sql - * @param array $values - * @param string $sequence - * @return int - */ - public function processInsertGetId(Builder $query, $sql, $values, $sequence = null) - { - $query->getConnection()->insert($sql, $values); - - $id = $query->getConnection()->getPdo()->lastInsertId($sequence); - - return is_numeric($id) ? (int) $id : $id; - } - - /** - * Process the results of a column listing query. - * - * @param array $results - * @return array - */ - public function processColumnListing($results) - { - return $results; - } -} diff --git a/vendor/illuminate/database/Query/Processors/SQLiteProcessor.php b/vendor/illuminate/database/Query/Processors/SQLiteProcessor.php deleted file mode 100644 index 65da1df..0000000 --- a/vendor/illuminate/database/Query/Processors/SQLiteProcessor.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Illuminate\Database\Query\Processors; - -class SQLiteProcessor extends Processor -{ - /** - * Process the results of a column listing query. - * - * @param array $results - * @return array - */ - public function processColumnListing($results) - { - return array_map(function ($result) { - return ((object) $result)->name; - }, $results); - } -} diff --git a/vendor/illuminate/database/Query/Processors/SqlServerProcessor.php b/vendor/illuminate/database/Query/Processors/SqlServerProcessor.php deleted file mode 100644 index 65140c4..0000000 --- a/vendor/illuminate/database/Query/Processors/SqlServerProcessor.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -namespace Illuminate\Database\Query\Processors; - -use Exception; -use Illuminate\Database\Connection; -use Illuminate\Database\Query\Builder; - -class SqlServerProcessor extends Processor -{ - /** - * Process an "insert get ID" query. - * - * @param \Illuminate\Database\Query\Builder $query - * @param string $sql - * @param array $values - * @param string $sequence - * @return int - */ - public function processInsertGetId(Builder $query, $sql, $values, $sequence = null) - { - $connection = $query->getConnection(); - - $connection->insert($sql, $values); - - if ($connection->getConfig('odbc') === true) { - $id = $this->processInsertGetIdForOdbc($connection); - } else { - $id = $connection->getPdo()->lastInsertId(); - } - - return is_numeric($id) ? (int) $id : $id; - } - - /** - * Process an "insert get ID" query for ODBC. - * - * @param \Illuminate\Database\Connection $connection - * @return int - * @throws \Exception - */ - protected function processInsertGetIdForOdbc(Connection $connection) - { - $result = $connection->selectFromWriteConnection( - 'SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS int) AS insertid' - ); - - if (! $result) { - throw new Exception('Unable to retrieve lastInsertID for ODBC.'); - } - - $row = $result[0]; - - return is_object($row) ? $row->insertid : $row['insertid']; - } - - /** - * Process the results of a column listing query. - * - * @param array $results - * @return array - */ - public function processColumnListing($results) - { - return array_map(function ($result) { - return ((object) $result)->name; - }, $results); - } -} diff --git a/vendor/illuminate/database/QueryException.php b/vendor/illuminate/database/QueryException.php deleted file mode 100644 index 9a3687d..0000000 --- a/vendor/illuminate/database/QueryException.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -namespace Illuminate\Database; - -use PDOException; -use Illuminate\Support\Str; - -class QueryException extends PDOException -{ - /** - * The SQL for the query. - * - * @var string - */ - protected $sql; - - /** - * The bindings for the query. - * - * @var array - */ - protected $bindings; - - /** - * Create a new query exception instance. - * - * @param string $sql - * @param array $bindings - * @param \Exception $previous - * @return void - */ - public function __construct($sql, array $bindings, $previous) - { - parent::__construct('', 0, $previous); - - $this->sql = $sql; - $this->bindings = $bindings; - $this->code = $previous->getCode(); - $this->message = $this->formatMessage($sql, $bindings, $previous); - - if ($previous instanceof PDOException) { - $this->errorInfo = $previous->errorInfo; - } - } - - /** - * Format the SQL error message. - * - * @param string $sql - * @param array $bindings - * @param \Exception $previous - * @return string - */ - protected function formatMessage($sql, $bindings, $previous) - { - return $previous->getMessage().' (SQL: '.Str::replaceArray('?', $bindings, $sql).')'; - } - - /** - * Get the SQL for the query. - * - * @return string - */ - public function getSql() - { - return $this->sql; - } - - /** - * Get the bindings for the query. - * - * @return array - */ - public function getBindings() - { - return $this->bindings; - } -} diff --git a/vendor/illuminate/database/README.md b/vendor/illuminate/database/README.md deleted file mode 100644 index b3014b0..0000000 --- a/vendor/illuminate/database/README.md +++ /dev/null @@ -1,69 +0,0 @@ -## Illuminate Database - -The Illuminate Database component is a full database toolkit for PHP, providing an expressive query builder, ActiveRecord style ORM, and schema builder. It currently supports MySQL, Postgres, SQL Server, and SQLite. It also serves as the database layer of the Laravel PHP framework. - -### Usage Instructions - -First, create a new "Capsule" manager instance. Capsule aims to make configuring the library for usage outside of the Laravel framework as easy as possible. - -```PHP -use Illuminate\Database\Capsule\Manager as Capsule; - -$capsule = new Capsule; - -$capsule->addConnection([ - 'driver' => 'mysql', - 'host' => 'localhost', - 'database' => 'database', - 'username' => 'root', - 'password' => 'password', - 'charset' => 'utf8', - 'collation' => 'utf8_unicode_ci', - 'prefix' => '', -]); - -// Set the event dispatcher used by Eloquent models... (optional) -use Illuminate\Events\Dispatcher; -use Illuminate\Container\Container; -$capsule->setEventDispatcher(new Dispatcher(new Container)); - -// Make this Capsule instance available globally via static methods... (optional) -$capsule->setAsGlobal(); - -// Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher()) -$capsule->bootEloquent(); -``` - -> `composer require "illuminate/events"` required when you need to use observers with Eloquent. - -Once the Capsule instance has been registered. You may use it like so: - -**Using The Query Builder** - -```PHP -$users = Capsule::table('users')->where('votes', '>', 100)->get(); -``` -Other core methods may be accessed directly from the Capsule in the same manner as from the DB facade: -```PHP -$results = Capsule::select('select * from users where id = ?', array(1)); -``` - -**Using The Schema Builder** - -```PHP -Capsule::schema()->create('users', function ($table) { - $table->increments('id'); - $table->string('email')->unique(); - $table->timestamps(); -}); -``` - -**Using The Eloquent ORM** - -```PHP -class User extends Illuminate\Database\Eloquent\Model {} - -$users = User::where('votes', '>', 1)->get(); -``` - -For further documentation on using the various database facilities this library provides, consult the [Laravel framework documentation](https://laravel.com/docs). diff --git a/vendor/illuminate/database/SQLiteConnection.php b/vendor/illuminate/database/SQLiteConnection.php deleted file mode 100644 index a5ec321..0000000 --- a/vendor/illuminate/database/SQLiteConnection.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php - -namespace Illuminate\Database; - -use Illuminate\Database\Schema\SQLiteBuilder; -use Illuminate\Database\Query\Processors\SQLiteProcessor; -use Doctrine\DBAL\Driver\PDOSqlite\Driver as DoctrineDriver; -use Illuminate\Database\Query\Grammars\SQLiteGrammar as QueryGrammar; -use Illuminate\Database\Schema\Grammars\SQLiteGrammar as SchemaGrammar; - -class SQLiteConnection extends Connection -{ - /** - * Get the default query grammar instance. - * - * @return \Illuminate\Database\Query\Grammars\SQLiteGrammar - */ - protected function getDefaultQueryGrammar() - { - return $this->withTablePrefix(new QueryGrammar); - } - - /** - * Get a schema builder instance for the connection. - * - * @return \Illuminate\Database\Schema\SQLiteBuilder - */ - public function getSchemaBuilder() - { - if (is_null($this->schemaGrammar)) { - $this->useDefaultSchemaGrammar(); - } - - return new SQLiteBuilder($this); - } - - /** - * Get the default schema grammar instance. - * - * @return \Illuminate\Database\Schema\Grammars\SQLiteGrammar - */ - protected function getDefaultSchemaGrammar() - { - return $this->withTablePrefix(new SchemaGrammar); - } - - /** - * Get the default post processor instance. - * - * @return \Illuminate\Database\Query\Processors\SQLiteProcessor - */ - protected function getDefaultPostProcessor() - { - return new SQLiteProcessor; - } - - /** - * Get the Doctrine DBAL driver. - * - * @return \Doctrine\DBAL\Driver\PDOSqlite\Driver - */ - protected function getDoctrineDriver() - { - return new DoctrineDriver; - } -} diff --git a/vendor/illuminate/database/Schema/Blueprint.php b/vendor/illuminate/database/Schema/Blueprint.php deleted file mode 100644 index 2342cec..0000000 --- a/vendor/illuminate/database/Schema/Blueprint.php +++ /dev/null @@ -1,1263 +0,0 @@ -<?php - -namespace Illuminate\Database\Schema; - -use Closure; -use Illuminate\Support\Fluent; -use Illuminate\Database\Connection; -use Illuminate\Support\Traits\Macroable; -use Illuminate\Database\Schema\Grammars\Grammar; - -class Blueprint -{ - use Macroable; - - /** - * The table the blueprint describes. - * - * @var string - */ - protected $table; - - /** - * The columns that should be added to the table. - * - * @var \Illuminate\Support\Fluent[] - */ - protected $columns = []; - - /** - * The commands that should be run for the table. - * - * @var \Illuminate\Support\Fluent[] - */ - protected $commands = []; - - /** - * The storage engine that should be used for the table. - * - * @var string - */ - public $engine; - - /** - * The default character set that should be used for the table. - */ - public $charset; - - /** - * The collation that should be used for the table. - */ - public $collation; - - /** - * Whether to make the table temporary. - * - * @var bool - */ - public $temporary = false; - - /** - * Create a new schema blueprint. - * - * @param string $table - * @param \Closure|null $callback - * @return void - */ - public function __construct($table, Closure $callback = null) - { - $this->table = $table; - - if (! is_null($callback)) { - $callback($this); - } - } - - /** - * Execute the blueprint against the database. - * - * @param \Illuminate\Database\Connection $connection - * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar - * @return void - */ - public function build(Connection $connection, Grammar $grammar) - { - foreach ($this->toSql($connection, $grammar) as $statement) { - $connection->statement($statement); - } - } - - /** - * Get the raw SQL statements for the blueprint. - * - * @param \Illuminate\Database\Connection $connection - * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar - * @return array - */ - public function toSql(Connection $connection, Grammar $grammar) - { - $this->addImpliedCommands(); - - $statements = []; - - // Each type of command has a corresponding compiler function on the schema - // grammar which is used to build the necessary SQL statements to build - // the blueprint element, so we'll just call that compilers function. - foreach ($this->commands as $command) { - $method = 'compile'.ucfirst($command->name); - - if (method_exists($grammar, $method)) { - if (! is_null($sql = $grammar->$method($this, $command, $connection))) { - $statements = array_merge($statements, (array) $sql); - } - } - } - - return $statements; - } - - /** - * Add the commands that are implied by the blueprint's state. - * - * @return void - */ - protected function addImpliedCommands() - { - if (count($this->getAddedColumns()) > 0 && ! $this->creating()) { - array_unshift($this->commands, $this->createCommand('add')); - } - - if (count($this->getChangedColumns()) > 0 && ! $this->creating()) { - array_unshift($this->commands, $this->createCommand('change')); - } - - $this->addFluentIndexes(); - } - - /** - * Add the index commands fluently specified on columns. - * - * @return void - */ - protected function addFluentIndexes() - { - foreach ($this->columns as $column) { - foreach (['primary', 'unique', 'index', 'spatialIndex'] as $index) { - // If the index has been specified on the given column, but is simply equal - // to "true" (boolean), no name has been specified for this index so the - // index method can be called without a name and it will generate one. - if ($column->{$index} === true) { - $this->{$index}($column->name); - - continue 2; - } - - // If the index has been specified on the given column, and it has a string - // value, we'll go ahead and call the index method and pass the name for - // the index since the developer specified the explicit name for this. - elseif (isset($column->{$index})) { - $this->{$index}($column->name, $column->{$index}); - - continue 2; - } - } - } - } - - /** - * Determine if the blueprint has a create command. - * - * @return bool - */ - protected function creating() - { - return collect($this->commands)->contains(function ($command) { - return $command->name == 'create'; - }); - } - - /** - * Indicate that the table needs to be created. - * - * @return \Illuminate\Support\Fluent - */ - public function create() - { - return $this->addCommand('create'); - } - - /** - * Indicate that the table needs to be temporary. - * - * @return void - */ - public function temporary() - { - $this->temporary = true; - } - - /** - * Indicate that the table should be dropped. - * - * @return \Illuminate\Support\Fluent - */ - public function drop() - { - return $this->addCommand('drop'); - } - - /** - * Indicate that the table should be dropped if it exists. - * - * @return \Illuminate\Support\Fluent - */ - public function dropIfExists() - { - return $this->addCommand('dropIfExists'); - } - - /** - * Indicate that the given columns should be dropped. - * - * @param array|mixed $columns - * @return \Illuminate\Support\Fluent - */ - public function dropColumn($columns) - { - $columns = is_array($columns) ? $columns : func_get_args(); - - return $this->addCommand('dropColumn', compact('columns')); - } - - /** - * Indicate that the given columns should be renamed. - * - * @param string $from - * @param string $to - * @return \Illuminate\Support\Fluent - */ - public function renameColumn($from, $to) - { - return $this->addCommand('renameColumn', compact('from', 'to')); - } - - /** - * Indicate that the given primary key should be dropped. - * - * @param string|array $index - * @return \Illuminate\Support\Fluent - */ - public function dropPrimary($index = null) - { - return $this->dropIndexCommand('dropPrimary', 'primary', $index); - } - - /** - * Indicate that the given unique key should be dropped. - * - * @param string|array $index - * @return \Illuminate\Support\Fluent - */ - public function dropUnique($index) - { - return $this->dropIndexCommand('dropUnique', 'unique', $index); - } - - /** - * Indicate that the given index should be dropped. - * - * @param string|array $index - * @return \Illuminate\Support\Fluent - */ - public function dropIndex($index) - { - return $this->dropIndexCommand('dropIndex', 'index', $index); - } - - /** - * Indicate that the given spatial index should be dropped. - * - * @param string|array $index - * @return \Illuminate\Support\Fluent - */ - public function dropSpatialIndex($index) - { - return $this->dropIndexCommand('dropSpatialIndex', 'spatialIndex', $index); - } - - /** - * Indicate that the given foreign key should be dropped. - * - * @param string|array $index - * @return \Illuminate\Support\Fluent - */ - public function dropForeign($index) - { - return $this->dropIndexCommand('dropForeign', 'foreign', $index); - } - - /** - * Indicate that the timestamp columns should be dropped. - * - * @return void - */ - public function dropTimestamps() - { - $this->dropColumn('created_at', 'updated_at'); - } - - /** - * Indicate that the timestamp columns should be dropped. - * - * @return void - */ - public function dropTimestampsTz() - { - $this->dropTimestamps(); - } - - /** - * Indicate that the soft delete column should be dropped. - * - * @return void - */ - public function dropSoftDeletes() - { - $this->dropColumn('deleted_at'); - } - - /** - * Indicate that the soft delete column should be dropped. - * - * @return void - */ - public function dropSoftDeletesTz() - { - $this->dropSoftDeletes(); - } - - /** - * Indicate that the remember token column should be dropped. - * - * @return void - */ - public function dropRememberToken() - { - $this->dropColumn('remember_token'); - } - - /** - * Rename the table to a given name. - * - * @param string $to - * @return \Illuminate\Support\Fluent - */ - public function rename($to) - { - return $this->addCommand('rename', compact('to')); - } - - /** - * Specify the primary key(s) for the table. - * - * @param string|array $columns - * @param string $name - * @param string|null $algorithm - * @return \Illuminate\Support\Fluent - */ - public function primary($columns, $name = null, $algorithm = null) - { - return $this->indexCommand('primary', $columns, $name, $algorithm); - } - - /** - * Specify a unique index for the table. - * - * @param string|array $columns - * @param string $name - * @param string|null $algorithm - * @return \Illuminate\Support\Fluent - */ - public function unique($columns, $name = null, $algorithm = null) - { - return $this->indexCommand('unique', $columns, $name, $algorithm); - } - - /** - * Specify an index for the table. - * - * @param string|array $columns - * @param string $name - * @param string|null $algorithm - * @return \Illuminate\Support\Fluent - */ - public function index($columns, $name = null, $algorithm = null) - { - return $this->indexCommand('index', $columns, $name, $algorithm); - } - - /** - * Specify a spatial index for the table. - * - * @param string|array $columns - * @param string $name - * @return \Illuminate\Support\Fluent - */ - public function spatialIndex($columns, $name = null) - { - return $this->indexCommand('spatialIndex', $columns, $name); - } - - /** - * Specify a foreign key for the table. - * - * @param string|array $columns - * @param string $name - * @return \Illuminate\Support\Fluent - */ - public function foreign($columns, $name = null) - { - return $this->indexCommand('foreign', $columns, $name); - } - - /** - * Create a new auto-incrementing integer (4-byte) column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function increments($column) - { - return $this->unsignedInteger($column, true); - } - - /** - * Create a new auto-incrementing tiny integer (1-byte) column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function tinyIncrements($column) - { - return $this->unsignedTinyInteger($column, true); - } - - /** - * Create a new auto-incrementing small integer (2-byte) column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function smallIncrements($column) - { - return $this->unsignedSmallInteger($column, true); - } - - /** - * Create a new auto-incrementing medium integer (3-byte) column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function mediumIncrements($column) - { - return $this->unsignedMediumInteger($column, true); - } - - /** - * Create a new auto-incrementing big integer (8-byte) column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function bigIncrements($column) - { - return $this->unsignedBigInteger($column, true); - } - - /** - * Create a new char column on the table. - * - * @param string $column - * @param int $length - * @return \Illuminate\Support\Fluent - */ - public function char($column, $length = null) - { - $length = $length ?: Builder::$defaultStringLength; - - return $this->addColumn('char', $column, compact('length')); - } - - /** - * Create a new string column on the table. - * - * @param string $column - * @param int $length - * @return \Illuminate\Support\Fluent - */ - public function string($column, $length = null) - { - $length = $length ?: Builder::$defaultStringLength; - - return $this->addColumn('string', $column, compact('length')); - } - - /** - * Create a new text column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function text($column) - { - return $this->addColumn('text', $column); - } - - /** - * Create a new medium text column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function mediumText($column) - { - return $this->addColumn('mediumText', $column); - } - - /** - * Create a new long text column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function longText($column) - { - return $this->addColumn('longText', $column); - } - - /** - * Create a new integer (4-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @param bool $unsigned - * @return \Illuminate\Support\Fluent - */ - public function integer($column, $autoIncrement = false, $unsigned = false) - { - return $this->addColumn('integer', $column, compact('autoIncrement', 'unsigned')); - } - - /** - * Create a new tiny integer (1-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @param bool $unsigned - * @return \Illuminate\Support\Fluent - */ - public function tinyInteger($column, $autoIncrement = false, $unsigned = false) - { - return $this->addColumn('tinyInteger', $column, compact('autoIncrement', 'unsigned')); - } - - /** - * Create a new small integer (2-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @param bool $unsigned - * @return \Illuminate\Support\Fluent - */ - public function smallInteger($column, $autoIncrement = false, $unsigned = false) - { - return $this->addColumn('smallInteger', $column, compact('autoIncrement', 'unsigned')); - } - - /** - * Create a new medium integer (3-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @param bool $unsigned - * @return \Illuminate\Support\Fluent - */ - public function mediumInteger($column, $autoIncrement = false, $unsigned = false) - { - return $this->addColumn('mediumInteger', $column, compact('autoIncrement', 'unsigned')); - } - - /** - * Create a new big integer (8-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @param bool $unsigned - * @return \Illuminate\Support\Fluent - */ - public function bigInteger($column, $autoIncrement = false, $unsigned = false) - { - return $this->addColumn('bigInteger', $column, compact('autoIncrement', 'unsigned')); - } - - /** - * Create a new unsigned integer (4-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @return \Illuminate\Support\Fluent - */ - public function unsignedInteger($column, $autoIncrement = false) - { - return $this->integer($column, $autoIncrement, true); - } - - /** - * Create a new unsigned tiny integer (1-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @return \Illuminate\Support\Fluent - */ - public function unsignedTinyInteger($column, $autoIncrement = false) - { - return $this->tinyInteger($column, $autoIncrement, true); - } - - /** - * Create a new unsigned small integer (2-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @return \Illuminate\Support\Fluent - */ - public function unsignedSmallInteger($column, $autoIncrement = false) - { - return $this->smallInteger($column, $autoIncrement, true); - } - - /** - * Create a new unsigned medium integer (3-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @return \Illuminate\Support\Fluent - */ - public function unsignedMediumInteger($column, $autoIncrement = false) - { - return $this->mediumInteger($column, $autoIncrement, true); - } - - /** - * Create a new unsigned big integer (8-byte) column on the table. - * - * @param string $column - * @param bool $autoIncrement - * @return \Illuminate\Support\Fluent - */ - public function unsignedBigInteger($column, $autoIncrement = false) - { - return $this->bigInteger($column, $autoIncrement, true); - } - - /** - * Create a new float column on the table. - * - * @param string $column - * @param int $total - * @param int $places - * @return \Illuminate\Support\Fluent - */ - public function float($column, $total = 8, $places = 2) - { - return $this->addColumn('float', $column, compact('total', 'places')); - } - - /** - * Create a new double column on the table. - * - * @param string $column - * @param int|null $total - * @param int|null $places - * @return \Illuminate\Support\Fluent - */ - public function double($column, $total = null, $places = null) - { - return $this->addColumn('double', $column, compact('total', 'places')); - } - - /** - * Create a new decimal column on the table. - * - * @param string $column - * @param int $total - * @param int $places - * @return \Illuminate\Support\Fluent - */ - public function decimal($column, $total = 8, $places = 2) - { - return $this->addColumn('decimal', $column, compact('total', 'places')); - } - - /** - * Create a new unsigned decimal column on the table. - * - * @param string $column - * @param int $total - * @param int $places - * @return \Illuminate\Support\Fluent - */ - public function unsignedDecimal($column, $total = 8, $places = 2) - { - return $this->addColumn('decimal', $column, [ - 'total' => $total, 'places' => $places, 'unsigned' => true, - ]); - } - - /** - * Create a new boolean column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function boolean($column) - { - return $this->addColumn('boolean', $column); - } - - /** - * Create a new enum column on the table. - * - * @param string $column - * @param array $allowed - * @return \Illuminate\Support\Fluent - */ - public function enum($column, array $allowed) - { - return $this->addColumn('enum', $column, compact('allowed')); - } - - /** - * Create a new json column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function json($column) - { - return $this->addColumn('json', $column); - } - - /** - * Create a new jsonb column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function jsonb($column) - { - return $this->addColumn('jsonb', $column); - } - - /** - * Create a new date column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function date($column) - { - return $this->addColumn('date', $column); - } - - /** - * Create a new date-time column on the table. - * - * @param string $column - * @param int $precision - * @return \Illuminate\Support\Fluent - */ - public function dateTime($column, $precision = 0) - { - return $this->addColumn('dateTime', $column, compact('precision')); - } - - /** - * Create a new date-time column (with time zone) on the table. - * - * @param string $column - * @param int $precision - * @return \Illuminate\Support\Fluent - */ - public function dateTimeTz($column, $precision = 0) - { - return $this->addColumn('dateTimeTz', $column, compact('precision')); - } - - /** - * Create a new time column on the table. - * - * @param string $column - * @param int $precision - * @return \Illuminate\Support\Fluent - */ - public function time($column, $precision = 0) - { - return $this->addColumn('time', $column, compact('precision')); - } - - /** - * Create a new time column (with time zone) on the table. - * - * @param string $column - * @param int $precision - * @return \Illuminate\Support\Fluent - */ - public function timeTz($column, $precision = 0) - { - return $this->addColumn('timeTz', $column, compact('precision')); - } - - /** - * Create a new timestamp column on the table. - * - * @param string $column - * @param int $precision - * @return \Illuminate\Support\Fluent - */ - public function timestamp($column, $precision = 0) - { - return $this->addColumn('timestamp', $column, compact('precision')); - } - - /** - * Create a new timestamp (with time zone) column on the table. - * - * @param string $column - * @param int $precision - * @return \Illuminate\Support\Fluent - */ - public function timestampTz($column, $precision = 0) - { - return $this->addColumn('timestampTz', $column, compact('precision')); - } - - /** - * Add nullable creation and update timestamps to the table. - * - * @param int $precision - * @return void - */ - public function timestamps($precision = 0) - { - $this->timestamp('created_at', $precision)->nullable(); - - $this->timestamp('updated_at', $precision)->nullable(); - } - - /** - * Add nullable creation and update timestamps to the table. - * - * Alias for self::timestamps(). - * - * @param int $precision - * @return void - */ - public function nullableTimestamps($precision = 0) - { - $this->timestamps($precision); - } - - /** - * Add creation and update timestampTz columns to the table. - * - * @param int $precision - * @return void - */ - public function timestampsTz($precision = 0) - { - $this->timestampTz('created_at', $precision)->nullable(); - - $this->timestampTz('updated_at', $precision)->nullable(); - } - - /** - * Add a "deleted at" timestamp for the table. - * - * @param string $column - * @param int $precision - * @return \Illuminate\Support\Fluent - */ - public function softDeletes($column = 'deleted_at', $precision = 0) - { - return $this->timestamp($column, $precision)->nullable(); - } - - /** - * Add a "deleted at" timestampTz for the table. - * - * @param int $precision - * @return \Illuminate\Support\Fluent - */ - public function softDeletesTz($precision = 0) - { - return $this->timestampTz('deleted_at', $precision)->nullable(); - } - - /** - * Create a new year column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function year($column) - { - return $this->addColumn('year', $column); - } - - /** - * Create a new binary column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function binary($column) - { - return $this->addColumn('binary', $column); - } - - /** - * Create a new uuid column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function uuid($column) - { - return $this->addColumn('uuid', $column); - } - - /** - * Create a new IP address column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function ipAddress($column) - { - return $this->addColumn('ipAddress', $column); - } - - /** - * Create a new MAC address column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function macAddress($column) - { - return $this->addColumn('macAddress', $column); - } - - /** - * Create a new geometry column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function geometry($column) - { - return $this->addColumn('geometry', $column); - } - - /** - * Create a new point column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function point($column) - { - return $this->addColumn('point', $column); - } - - /** - * Create a new linestring column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function lineString($column) - { - return $this->addColumn('linestring', $column); - } - - /** - * Create a new polygon column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function polygon($column) - { - return $this->addColumn('polygon', $column); - } - - /** - * Create a new geometrycollection column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function geometryCollection($column) - { - return $this->addColumn('geometrycollection', $column); - } - - /** - * Create a new multipoint column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function multiPoint($column) - { - return $this->addColumn('multipoint', $column); - } - - /** - * Create a new multilinestring column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function multiLineString($column) - { - return $this->addColumn('multilinestring', $column); - } - - /** - * Create a new multipolygon column on the table. - * - * @param string $column - * @return \Illuminate\Support\Fluent - */ - public function multiPolygon($column) - { - return $this->addColumn('multipolygon', $column); - } - - /** - * Add the proper columns for a polymorphic table. - * - * @param string $name - * @param string|null $indexName - * @return void - */ - public function morphs($name, $indexName = null) - { - $this->unsignedInteger("{$name}_id"); - - $this->string("{$name}_type"); - - $this->index(["{$name}_id", "{$name}_type"], $indexName); - } - - /** - * Add nullable columns for a polymorphic table. - * - * @param string $name - * @param string|null $indexName - * @return void - */ - public function nullableMorphs($name, $indexName = null) - { - $this->unsignedInteger("{$name}_id")->nullable(); - - $this->string("{$name}_type")->nullable(); - - $this->index(["{$name}_id", "{$name}_type"], $indexName); - } - - /** - * Adds the `remember_token` column to the table. - * - * @return \Illuminate\Support\Fluent - */ - public function rememberToken() - { - return $this->string('remember_token', 100)->nullable(); - } - - /** - * Add a new index command to the blueprint. - * - * @param string $type - * @param string|array $columns - * @param string $index - * @param string|null $algorithm - * @return \Illuminate\Support\Fluent - */ - protected function indexCommand($type, $columns, $index, $algorithm = null) - { - $columns = (array) $columns; - - // If no name was specified for this index, we will create one using a basic - // convention of the table name, followed by the columns, followed by an - // index type, such as primary or index, which makes the index unique. - $index = $index ?: $this->createIndexName($type, $columns); - - return $this->addCommand( - $type, compact('index', 'columns', 'algorithm') - ); - } - - /** - * Create a new drop index command on the blueprint. - * - * @param string $command - * @param string $type - * @param string|array $index - * @return \Illuminate\Support\Fluent - */ - protected function dropIndexCommand($command, $type, $index) - { - $columns = []; - - // If the given "index" is actually an array of columns, the developer means - // to drop an index merely by specifying the columns involved without the - // conventional name, so we will build the index name from the columns. - if (is_array($index)) { - $index = $this->createIndexName($type, $columns = $index); - } - - return $this->indexCommand($command, $columns, $index); - } - - /** - * Create a default index name for the table. - * - * @param string $type - * @param array $columns - * @return string - */ - protected function createIndexName($type, array $columns) - { - $index = strtolower($this->table.'_'.implode('_', $columns).'_'.$type); - - return str_replace(['-', '.'], '_', $index); - } - - /** - * Add a new column to the blueprint. - * - * @param string $type - * @param string $name - * @param array $parameters - * @return \Illuminate\Support\Fluent - */ - public function addColumn($type, $name, array $parameters = []) - { - $this->columns[] = $column = new Fluent( - array_merge(compact('type', 'name'), $parameters) - ); - - return $column; - } - - /** - * Remove a column from the schema blueprint. - * - * @param string $name - * @return $this - */ - public function removeColumn($name) - { - $this->columns = array_values(array_filter($this->columns, function ($c) use ($name) { - return $c['attributes']['name'] != $name; - })); - - return $this; - } - - /** - * Add a new command to the blueprint. - * - * @param string $name - * @param array $parameters - * @return \Illuminate\Support\Fluent - */ - protected function addCommand($name, array $parameters = []) - { - $this->commands[] = $command = $this->createCommand($name, $parameters); - - return $command; - } - - /** - * Create a new Fluent command. - * - * @param string $name - * @param array $parameters - * @return \Illuminate\Support\Fluent - */ - protected function createCommand($name, array $parameters = []) - { - return new Fluent(array_merge(compact('name'), $parameters)); - } - - /** - * Get the table the blueprint describes. - * - * @return string - */ - public function getTable() - { - return $this->table; - } - - /** - * Get the columns on the blueprint. - * - * @return \Illuminate\Support\Fluent[] - */ - public function getColumns() - { - return $this->columns; - } - - /** - * Get the commands on the blueprint. - * - * @return \Illuminate\Support\Fluent[] - */ - public function getCommands() - { - return $this->commands; - } - - /** - * Get the columns on the blueprint that should be added. - * - * @return \Illuminate\Support\Fluent[] - */ - public function getAddedColumns() - { - return array_filter($this->columns, function ($column) { - return ! $column->change; - }); - } - - /** - * Get the columns on the blueprint that should be changed. - * - * @return \Illuminate\Support\Fluent[] - */ - public function getChangedColumns() - { - return array_filter($this->columns, function ($column) { - return (bool) $column->change; - }); - } -} diff --git a/vendor/illuminate/database/Schema/Builder.php b/vendor/illuminate/database/Schema/Builder.php deleted file mode 100644 index 8220115..0000000 --- a/vendor/illuminate/database/Schema/Builder.php +++ /dev/null @@ -1,304 +0,0 @@ -<?php - -namespace Illuminate\Database\Schema; - -use Closure; -use LogicException; -use Illuminate\Database\Connection; - -class Builder -{ - /** - * The database connection instance. - * - * @var \Illuminate\Database\Connection - */ - protected $connection; - - /** - * The schema grammar instance. - * - * @var \Illuminate\Database\Schema\Grammars\Grammar - */ - protected $grammar; - - /** - * The Blueprint resolver callback. - * - * @var \Closure - */ - protected $resolver; - - /** - * The default string length for migrations. - * - * @var int - */ - public static $defaultStringLength = 255; - - /** - * Create a new database Schema manager. - * - * @param \Illuminate\Database\Connection $connection - * @return void - */ - public function __construct(Connection $connection) - { - $this->connection = $connection; - $this->grammar = $connection->getSchemaGrammar(); - } - - /** - * Set the default string length for migrations. - * - * @param int $length - * @return void - */ - public static function defaultStringLength($length) - { - static::$defaultStringLength = $length; - } - - /** - * Determine if the given table exists. - * - * @param string $table - * @return bool - */ - public function hasTable($table) - { - $table = $this->connection->getTablePrefix().$table; - - return count($this->connection->select( - $this->grammar->compileTableExists(), [$table] - )) > 0; - } - - /** - * Determine if the given table has a given column. - * - * @param string $table - * @param string $column - * @return bool - */ - public function hasColumn($table, $column) - { - return in_array( - strtolower($column), array_map('strtolower', $this->getColumnListing($table)) - ); - } - - /** - * Determine if the given table has given columns. - * - * @param string $table - * @param array $columns - * @return bool - */ - public function hasColumns($table, array $columns) - { - $tableColumns = array_map('strtolower', $this->getColumnListing($table)); - - foreach ($columns as $column) { - if (! in_array(strtolower($column), $tableColumns)) { - return false; - } - } - - return true; - } - - /** - * Get the data type for the given column name. - * - * @param string $table - * @param string $column - * @return string - */ - public function getColumnType($table, $column) - { - $table = $this->connection->getTablePrefix().$table; - - return $this->connection->getDoctrineColumn($table, $column)->getType()->getName(); - } - - /** - * Get the column listing for a given table. - * - * @param string $table - * @return array - */ - public function getColumnListing($table) - { - $results = $this->connection->select($this->grammar->compileColumnListing( - $this->connection->getTablePrefix().$table - )); - - return $this->connection->getPostProcessor()->processColumnListing($results); - } - - /** - * Modify a table on the schema. - * - * @param string $table - * @param \Closure $callback - * @return void - */ - public function table($table, Closure $callback) - { - $this->build($this->createBlueprint($table, $callback)); - } - - /** - * Create a new table on the schema. - * - * @param string $table - * @param \Closure $callback - * @return void - */ - public function create($table, Closure $callback) - { - $this->build(tap($this->createBlueprint($table), function ($blueprint) use ($callback) { - $blueprint->create(); - - $callback($blueprint); - })); - } - - /** - * Drop a table from the schema. - * - * @param string $table - * @return void - */ - public function drop($table) - { - $this->build(tap($this->createBlueprint($table), function ($blueprint) { - $blueprint->drop(); - })); - } - - /** - * Drop a table from the schema if it exists. - * - * @param string $table - * @return void - */ - public function dropIfExists($table) - { - $this->build(tap($this->createBlueprint($table), function ($blueprint) { - $blueprint->dropIfExists(); - })); - } - - /** - * Drop all tables from the database. - * - * @return void - * - * @throws \LogicException - */ - public function dropAllTables() - { - throw new LogicException('This database driver does not support dropping all tables.'); - } - - /** - * Rename a table on the schema. - * - * @param string $from - * @param string $to - * @return void - */ - public function rename($from, $to) - { - $this->build(tap($this->createBlueprint($from), function ($blueprint) use ($to) { - $blueprint->rename($to); - })); - } - - /** - * Enable foreign key constraints. - * - * @return bool - */ - public function enableForeignKeyConstraints() - { - return $this->connection->statement( - $this->grammar->compileEnableForeignKeyConstraints() - ); - } - - /** - * Disable foreign key constraints. - * - * @return bool - */ - public function disableForeignKeyConstraints() - { - return $this->connection->statement( - $this->grammar->compileDisableForeignKeyConstraints() - ); - } - - /** - * Execute the blueprint to build / modify the table. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @return void - */ - protected function build(Blueprint $blueprint) - { - $blueprint->build($this->connection, $this->grammar); - } - - /** - * Create a new command set with a Closure. - * - * @param string $table - * @param \Closure|null $callback - * @return \Illuminate\Database\Schema\Blueprint - */ - protected function createBlueprint($table, Closure $callback = null) - { - if (isset($this->resolver)) { - return call_user_func($this->resolver, $table, $callback); - } - - return new Blueprint($table, $callback); - } - - /** - * Get the database connection instance. - * - * @return \Illuminate\Database\Connection - */ - public function getConnection() - { - return $this->connection; - } - - /** - * Set the database connection instance. - * - * @param \Illuminate\Database\Connection $connection - * @return $this - */ - public function setConnection(Connection $connection) - { - $this->connection = $connection; - - return $this; - } - - /** - * Set the Schema Blueprint resolver callback. - * - * @param \Closure $resolver - * @return void - */ - public function blueprintResolver(Closure $resolver) - { - $this->resolver = $resolver; - } -} diff --git a/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php b/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php deleted file mode 100644 index 4751ecb..0000000 --- a/vendor/illuminate/database/Schema/Grammars/ChangeColumn.php +++ /dev/null @@ -1,205 +0,0 @@ -<?php - -namespace Illuminate\Database\Schema\Grammars; - -use RuntimeException; -use Doctrine\DBAL\Types\Type; -use Illuminate\Support\Fluent; -use Doctrine\DBAL\Schema\Table; -use Illuminate\Database\Connection; -use Doctrine\DBAL\Schema\Comparator; -use Illuminate\Database\Schema\Blueprint; -use Doctrine\DBAL\Schema\AbstractSchemaManager as SchemaManager; - -class ChangeColumn -{ - /** - * Compile a change column command into a series of SQL statements. - * - * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param \Illuminate\Database\Connection $connection - * @return array - * - * @throws \RuntimeException - */ - public static function compile($grammar, Blueprint $blueprint, Fluent $command, Connection $connection) - { - if (! $connection->isDoctrineAvailable()) { - throw new RuntimeException(sprintf( - 'Changing columns for table "%s" requires Doctrine DBAL; install "doctrine/dbal".', - $blueprint->getTable() - )); - } - - $tableDiff = static::getChangedDiff( - $grammar, $blueprint, $schema = $connection->getDoctrineSchemaManager() - ); - - if ($tableDiff !== false) { - return (array) $schema->getDatabasePlatform()->getAlterTableSQL($tableDiff); - } - - return []; - } - - /** - * Get the Doctrine table difference for the given changes. - * - * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Doctrine\DBAL\Schema\AbstractSchemaManager $schema - * @return \Doctrine\DBAL\Schema\TableDiff|bool - */ - protected static function getChangedDiff($grammar, Blueprint $blueprint, SchemaManager $schema) - { - $current = $schema->listTableDetails($grammar->getTablePrefix().$blueprint->getTable()); - - return (new Comparator)->diffTable( - $current, static::getTableWithColumnChanges($blueprint, $current) - ); - } - - /** - * Get a copy of the given Doctrine table after making the column changes. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Doctrine\DBAL\Schema\Table $table - * @return \Doctrine\DBAL\Schema\Table - */ - protected static function getTableWithColumnChanges(Blueprint $blueprint, Table $table) - { - $table = clone $table; - - foreach ($blueprint->getChangedColumns() as $fluent) { - $column = static::getDoctrineColumn($table, $fluent); - - // Here we will spin through each fluent column definition and map it to the proper - // Doctrine column definitions - which is necessary because Laravel and Doctrine - // use some different terminology for various column attributes on the tables. - foreach ($fluent->getAttributes() as $key => $value) { - if (! is_null($option = static::mapFluentOptionToDoctrine($key))) { - if (method_exists($column, $method = 'set'.ucfirst($option))) { - $column->{$method}(static::mapFluentValueToDoctrine($option, $value)); - } - } - } - } - - return $table; - } - - /** - * Get the Doctrine column instance for a column change. - * - * @param \Doctrine\DBAL\Schema\Table $table - * @param \Illuminate\Support\Fluent $fluent - * @return \Doctrine\DBAL\Schema\Column - */ - protected static function getDoctrineColumn(Table $table, Fluent $fluent) - { - return $table->changeColumn( - $fluent['name'], static::getDoctrineColumnChangeOptions($fluent) - )->getColumn($fluent['name']); - } - - /** - * Get the Doctrine column change options. - * - * @param \Illuminate\Support\Fluent $fluent - * @return array - */ - protected static function getDoctrineColumnChangeOptions(Fluent $fluent) - { - $options = ['type' => static::getDoctrineColumnType($fluent['type'])]; - - if (in_array($fluent['type'], ['text', 'mediumText', 'longText'])) { - $options['length'] = static::calculateDoctrineTextLength($fluent['type']); - } - - return $options; - } - - /** - * Get the doctrine column type. - * - * @param string $type - * @return \Doctrine\DBAL\Types\Type - */ - protected static function getDoctrineColumnType($type) - { - $type = strtolower($type); - - switch ($type) { - case 'biginteger': - $type = 'bigint'; - break; - case 'smallinteger': - $type = 'smallint'; - break; - case 'mediumtext': - case 'longtext': - $type = 'text'; - break; - case 'binary': - $type = 'blob'; - break; - } - - return Type::getType($type); - } - - /** - * Calculate the proper column length to force the Doctrine text type. - * - * @param string $type - * @return int - */ - protected static function calculateDoctrineTextLength($type) - { - switch ($type) { - case 'mediumText': - return 65535 + 1; - case 'longText': - return 16777215 + 1; - default: - return 255 + 1; - } - } - - /** - * Get the matching Doctrine option for a given Fluent attribute name. - * - * @param string $attribute - * @return string|null - */ - protected static function mapFluentOptionToDoctrine($attribute) - { - switch ($attribute) { - case 'type': - case 'name': - return; - case 'nullable': - return 'notnull'; - case 'total': - return 'precision'; - case 'places': - return 'scale'; - default: - return $attribute; - } - } - - /** - * Get the matching Doctrine value for a given Fluent attribute. - * - * @param string $option - * @param mixed $value - * @return mixed - */ - protected static function mapFluentValueToDoctrine($option, $value) - { - return $option == 'notnull' ? ! $value : $value; - } -} diff --git a/vendor/illuminate/database/Schema/Grammars/Grammar.php b/vendor/illuminate/database/Schema/Grammars/Grammar.php deleted file mode 100644 index ddd3838..0000000 --- a/vendor/illuminate/database/Schema/Grammars/Grammar.php +++ /dev/null @@ -1,255 +0,0 @@ -<?php - -namespace Illuminate\Database\Schema\Grammars; - -use Illuminate\Support\Fluent; -use Doctrine\DBAL\Schema\TableDiff; -use Illuminate\Database\Connection; -use Illuminate\Database\Query\Expression; -use Illuminate\Database\Schema\Blueprint; -use Illuminate\Database\Grammar as BaseGrammar; -use Doctrine\DBAL\Schema\AbstractSchemaManager as SchemaManager; - -abstract class Grammar extends BaseGrammar -{ - /** - * If this Grammar supports schema changes wrapped in a transaction. - * - * @var bool - */ - protected $transactions = false; - - /** - * Compile a rename column command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param \Illuminate\Database\Connection $connection - * @return array - */ - public function compileRenameColumn(Blueprint $blueprint, Fluent $command, Connection $connection) - { - return RenameColumn::compile($this, $blueprint, $command, $connection); - } - - /** - * Compile a change column command into a series of SQL statements. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param \Illuminate\Database\Connection $connection - * @return array - * - * @throws \RuntimeException - */ - public function compileChange(Blueprint $blueprint, Fluent $command, Connection $connection) - { - return ChangeColumn::compile($this, $blueprint, $command, $connection); - } - - /** - * Compile a foreign key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileForeign(Blueprint $blueprint, Fluent $command) - { - // We need to prepare several of the elements of the foreign key definition - // before we can create the SQL, such as wrapping the tables and convert - // an array of columns to comma-delimited strings for the SQL queries. - $sql = sprintf('alter table %s add constraint %s ', - $this->wrapTable($blueprint), - $this->wrap($command->index) - ); - - // Once we have the initial portion of the SQL statement we will add on the - // key name, table name, and referenced columns. These will complete the - // main portion of the SQL statement and this SQL will almost be done. - $sql .= sprintf('foreign key (%s) references %s (%s)', - $this->columnize($command->columns), - $this->wrapTable($command->on), - $this->columnize((array) $command->references) - ); - - // Once we have the basic foreign key creation statement constructed we can - // build out the syntax for what should happen on an update or delete of - // the affected columns, which will get something like "cascade", etc. - if (! is_null($command->onDelete)) { - $sql .= " on delete {$command->onDelete}"; - } - - if (! is_null($command->onUpdate)) { - $sql .= " on update {$command->onUpdate}"; - } - - return $sql; - } - - /** - * Compile the blueprint's column definitions. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @return array - */ - protected function getColumns(Blueprint $blueprint) - { - $columns = []; - - foreach ($blueprint->getAddedColumns() as $column) { - // Each of the column types have their own compiler functions which are tasked - // with turning the column definition into its SQL format for this platform - // used by the connection. The column's modifiers are compiled and added. - $sql = $this->wrap($column).' '.$this->getType($column); - - $columns[] = $this->addModifiers($sql, $blueprint, $column); - } - - return $columns; - } - - /** - * Get the SQL for the column data type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function getType(Fluent $column) - { - return $this->{'type'.ucfirst($column->type)}($column); - } - - /** - * Add the column modifiers to the definition. - * - * @param string $sql - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function addModifiers($sql, Blueprint $blueprint, Fluent $column) - { - foreach ($this->modifiers as $modifier) { - if (method_exists($this, $method = "modify{$modifier}")) { - $sql .= $this->{$method}($blueprint, $column); - } - } - - return $sql; - } - - /** - * Get the primary key command if it exists on the blueprint. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param string $name - * @return \Illuminate\Support\Fluent|null - */ - protected function getCommandByName(Blueprint $blueprint, $name) - { - $commands = $this->getCommandsByName($blueprint, $name); - - if (count($commands) > 0) { - return reset($commands); - } - } - - /** - * Get all of the commands with a given name. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param string $name - * @return array - */ - protected function getCommandsByName(Blueprint $blueprint, $name) - { - return array_filter($blueprint->getCommands(), function ($value) use ($name) { - return $value->name == $name; - }); - } - - /** - * Add a prefix to an array of values. - * - * @param string $prefix - * @param array $values - * @return array - */ - public function prefixArray($prefix, array $values) - { - return array_map(function ($value) use ($prefix) { - return $prefix.' '.$value; - }, $values); - } - - /** - * Wrap a table in keyword identifiers. - * - * @param mixed $table - * @return string - */ - public function wrapTable($table) - { - return parent::wrapTable( - $table instanceof Blueprint ? $table->getTable() : $table - ); - } - - /** - * Wrap a value in keyword identifiers. - * - * @param \Illuminate\Database\Query\Expression|string $value - * @param bool $prefixAlias - * @return string - */ - public function wrap($value, $prefixAlias = false) - { - return parent::wrap( - $value instanceof Fluent ? $value->name : $value, $prefixAlias - ); - } - - /** - * Format a value so that it can be used in "default" clauses. - * - * @param mixed $value - * @return string - */ - protected function getDefaultValue($value) - { - if ($value instanceof Expression) { - return $value; - } - - return is_bool($value) - ? "'".(int) $value."'" - : "'".(string) $value."'"; - } - - /** - * Create an empty Doctrine DBAL TableDiff from the Blueprint. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Doctrine\DBAL\Schema\AbstractSchemaManager $schema - * @return \Doctrine\DBAL\Schema\TableDiff - */ - public function getDoctrineTableDiff(Blueprint $blueprint, SchemaManager $schema) - { - $table = $this->getTablePrefix().$blueprint->getTable(); - - return tap(new TableDiff($table), function ($tableDiff) use ($schema, $table) { - $tableDiff->fromTable = $schema->listTableDetails($table); - }); - } - - /** - * Check if this Grammar supports schema changes wrapped in a transaction. - * - * @return bool - */ - public function supportsSchemaTransactions() - { - return $this->transactions; - } -} diff --git a/vendor/illuminate/database/Schema/Grammars/MySqlGrammar.php b/vendor/illuminate/database/Schema/Grammars/MySqlGrammar.php deleted file mode 100644 index 149f300..0000000 --- a/vendor/illuminate/database/Schema/Grammars/MySqlGrammar.php +++ /dev/null @@ -1,967 +0,0 @@ -<?php - -namespace Illuminate\Database\Schema\Grammars; - -use Illuminate\Support\Fluent; -use Illuminate\Database\Connection; -use Illuminate\Database\Schema\Blueprint; - -class MySqlGrammar extends Grammar -{ - /** - * The possible column modifiers. - * - * @var array - */ - protected $modifiers = [ - 'Unsigned', 'VirtualAs', 'StoredAs', 'Charset', 'Collate', 'Nullable', - 'Default', 'Increment', 'Comment', 'After', 'First', - ]; - - /** - * The possible column serials. - * - * @var array - */ - protected $serials = ['bigInteger', 'integer', 'mediumInteger', 'smallInteger', 'tinyInteger']; - - /** - * Compile the query to determine the list of tables. - * - * @return string - */ - public function compileTableExists() - { - return 'select * from information_schema.tables where table_schema = ? and table_name = ?'; - } - - /** - * Compile the query to determine the list of columns. - * - * @return string - */ - public function compileColumnListing() - { - return 'select column_name as `column_name` from information_schema.columns where table_schema = ? and table_name = ?'; - } - - /** - * Compile a create table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param \Illuminate\Database\Connection $connection - * @return string - */ - public function compileCreate(Blueprint $blueprint, Fluent $command, Connection $connection) - { - $sql = $this->compileCreateTable( - $blueprint, $command, $connection - ); - - // Once we have the primary SQL, we can add the encoding option to the SQL for - // the table. Then, we can check if a storage engine has been supplied for - // the table. If so, we will add the engine declaration to the SQL query. - $sql = $this->compileCreateEncoding( - $sql, $connection, $blueprint - ); - - // Finally, we will append the engine configuration onto this SQL statement as - // the final thing we do before returning this finished SQL. Once this gets - // added the query will be ready to execute against the real connections. - return $this->compileCreateEngine( - $sql, $connection, $blueprint - ); - } - - /** - * Create the main create table clause. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param \Illuminate\Database\Connection $connection - * @return string - */ - protected function compileCreateTable($blueprint, $command, $connection) - { - return sprintf('%s table %s (%s)', - $blueprint->temporary ? 'create temporary' : 'create', - $this->wrapTable($blueprint), - implode(', ', $this->getColumns($blueprint)) - ); - } - - /** - * Append the character set specifications to a command. - * - * @param string $sql - * @param \Illuminate\Database\Connection $connection - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @return string - */ - protected function compileCreateEncoding($sql, Connection $connection, Blueprint $blueprint) - { - // First we will set the character set if one has been set on either the create - // blueprint itself or on the root configuration for the connection that the - // table is being created on. We will add these to the create table query. - if (isset($blueprint->charset)) { - $sql .= ' default character set '.$blueprint->charset; - } elseif (! is_null($charset = $connection->getConfig('charset'))) { - $sql .= ' default character set '.$charset; - } - - // Next we will add the collation to the create table statement if one has been - // added to either this create table blueprint or the configuration for this - // connection that the query is targeting. We'll add it to this SQL query. - if (isset($blueprint->collation)) { - $sql .= ' collate '.$blueprint->collation; - } elseif (! is_null($collation = $connection->getConfig('collation'))) { - $sql .= ' collate '.$collation; - } - - return $sql; - } - - /** - * Append the engine specifications to a command. - * - * @param string $sql - * @param \Illuminate\Database\Connection $connection - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @return string - */ - protected function compileCreateEngine($sql, Connection $connection, Blueprint $blueprint) - { - if (isset($blueprint->engine)) { - return $sql.' engine = '.$blueprint->engine; - } elseif (! is_null($engine = $connection->getConfig('engine'))) { - return $sql.' engine = '.$engine; - } - - return $sql; - } - - /** - * Compile an add column command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileAdd(Blueprint $blueprint, Fluent $command) - { - $columns = $this->prefixArray('add', $this->getColumns($blueprint)); - - return 'alter table '.$this->wrapTable($blueprint).' '.implode(', ', $columns); - } - - /** - * Compile a primary key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compilePrimary(Blueprint $blueprint, Fluent $command) - { - $command->name(null); - - return $this->compileKey($blueprint, $command, 'primary key'); - } - - /** - * Compile a unique key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileUnique(Blueprint $blueprint, Fluent $command) - { - return $this->compileKey($blueprint, $command, 'unique'); - } - - /** - * Compile a plain index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileIndex(Blueprint $blueprint, Fluent $command) - { - return $this->compileKey($blueprint, $command, 'index'); - } - - /** - * Compile a spatial index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileSpatialIndex(Blueprint $blueprint, Fluent $command) - { - return $this->compileKey($blueprint, $command, 'spatial index'); - } - - /** - * Compile an index creation command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param string $type - * @return string - */ - protected function compileKey(Blueprint $blueprint, Fluent $command, $type) - { - return sprintf('alter table %s add %s %s%s(%s)', - $this->wrapTable($blueprint), - $type, - $this->wrap($command->index), - $command->algorithm ? ' using '.$command->algorithm : '', - $this->columnize($command->columns) - ); - } - - /** - * Compile a drop table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDrop(Blueprint $blueprint, Fluent $command) - { - return 'drop table '.$this->wrapTable($blueprint); - } - - /** - * Compile a drop table (if exists) command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropIfExists(Blueprint $blueprint, Fluent $command) - { - return 'drop table if exists '.$this->wrapTable($blueprint); - } - - /** - * Compile a drop column command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropColumn(Blueprint $blueprint, Fluent $command) - { - $columns = $this->prefixArray('drop', $this->wrapArray($command->columns)); - - return 'alter table '.$this->wrapTable($blueprint).' '.implode(', ', $columns); - } - - /** - * Compile a drop primary key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropPrimary(Blueprint $blueprint, Fluent $command) - { - return 'alter table '.$this->wrapTable($blueprint).' drop primary key'; - } - - /** - * Compile a drop unique key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropUnique(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "alter table {$this->wrapTable($blueprint)} drop index {$index}"; - } - - /** - * Compile a drop index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropIndex(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "alter table {$this->wrapTable($blueprint)} drop index {$index}"; - } - - /** - * Compile a drop spatial index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropSpatialIndex(Blueprint $blueprint, Fluent $command) - { - return $this->compileDropIndex($blueprint, $command); - } - - /** - * Compile a drop foreign key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropForeign(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "alter table {$this->wrapTable($blueprint)} drop foreign key {$index}"; - } - - /** - * Compile a rename table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileRename(Blueprint $blueprint, Fluent $command) - { - $from = $this->wrapTable($blueprint); - - return "rename table {$from} to ".$this->wrapTable($command->to); - } - - /** - * Compile the SQL needed to drop all tables. - * - * @param array $tables - * @return string - */ - public function compileDropAllTables($tables) - { - return 'drop table '.implode(',', $this->wrapArray($tables)); - } - - /** - * Compile the SQL needed to retrieve all table names. - * - * @return string - */ - public function compileGetAllTables() - { - return 'SHOW FULL TABLES WHERE table_type = \'BASE TABLE\''; - } - - /** - * Compile the command to enable foreign key constraints. - * - * @return string - */ - public function compileEnableForeignKeyConstraints() - { - return 'SET FOREIGN_KEY_CHECKS=1;'; - } - - /** - * Compile the command to disable foreign key constraints. - * - * @return string - */ - public function compileDisableForeignKeyConstraints() - { - return 'SET FOREIGN_KEY_CHECKS=0;'; - } - - /** - * Create the column definition for a char type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeChar(Fluent $column) - { - return "char({$column->length})"; - } - - /** - * Create the column definition for a string type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeString(Fluent $column) - { - return "varchar({$column->length})"; - } - - /** - * Create the column definition for a text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeText(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for a medium text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMediumText(Fluent $column) - { - return 'mediumtext'; - } - - /** - * Create the column definition for a long text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeLongText(Fluent $column) - { - return 'longtext'; - } - - /** - * Create the column definition for a big integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBigInteger(Fluent $column) - { - return 'bigint'; - } - - /** - * Create the column definition for an integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeInteger(Fluent $column) - { - return 'int'; - } - - /** - * Create the column definition for a medium integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMediumInteger(Fluent $column) - { - return 'mediumint'; - } - - /** - * Create the column definition for a tiny integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTinyInteger(Fluent $column) - { - return 'tinyint'; - } - - /** - * Create the column definition for a small integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeSmallInteger(Fluent $column) - { - return 'smallint'; - } - - /** - * Create the column definition for a float type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeFloat(Fluent $column) - { - return $this->typeDouble($column); - } - - /** - * Create the column definition for a double type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDouble(Fluent $column) - { - if ($column->total && $column->places) { - return "double({$column->total}, {$column->places})"; - } - - return 'double'; - } - - /** - * Create the column definition for a decimal type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDecimal(Fluent $column) - { - return "decimal({$column->total}, {$column->places})"; - } - - /** - * Create the column definition for a boolean type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBoolean(Fluent $column) - { - return 'tinyint(1)'; - } - - /** - * Create the column definition for an enum type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeEnum(Fluent $column) - { - return "enum('".implode("', '", $column->allowed)."')"; - } - - /** - * Create the column definition for a json type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeJson(Fluent $column) - { - return 'json'; - } - - /** - * Create the column definition for a jsonb type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeJsonb(Fluent $column) - { - return 'json'; - } - - /** - * Create the column definition for a date type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDate(Fluent $column) - { - return 'date'; - } - - /** - * Create the column definition for a date-time type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDateTime(Fluent $column) - { - return $column->precision ? "datetime($column->precision)" : 'datetime'; - } - - /** - * Create the column definition for a date-time (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDateTimeTz(Fluent $column) - { - return $this->typeDateTime($column); - } - - /** - * Create the column definition for a time type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTime(Fluent $column) - { - return $column->precision ? "time($column->precision)" : 'time'; - } - - /** - * Create the column definition for a time (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimeTz(Fluent $column) - { - return $this->typeTime($column); - } - - /** - * Create the column definition for a timestamp type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimestamp(Fluent $column) - { - $columnType = $column->precision ? "timestamp($column->precision)" : 'timestamp'; - - return $column->useCurrent ? "$columnType default CURRENT_TIMESTAMP" : $columnType; - } - - /** - * Create the column definition for a timestamp (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimestampTz(Fluent $column) - { - return $this->typeTimestamp($column); - } - - /** - * Create the column definition for a year type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeYear(Fluent $column) - { - return 'year'; - } - - /** - * Create the column definition for a binary type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBinary(Fluent $column) - { - return 'blob'; - } - - /** - * Create the column definition for a uuid type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeUuid(Fluent $column) - { - return 'char(36)'; - } - - /** - * Create the column definition for an IP address type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeIpAddress(Fluent $column) - { - return 'varchar(45)'; - } - - /** - * Create the column definition for a MAC address type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMacAddress(Fluent $column) - { - return 'varchar(17)'; - } - - /** - * Create the column definition for a spatial Geometry type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeGeometry(Fluent $column) - { - return 'geometry'; - } - - /** - * Create the column definition for a spatial Point type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typePoint(Fluent $column) - { - return 'point'; - } - - /** - * Create the column definition for a spatial LineString type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeLineString(Fluent $column) - { - return 'linestring'; - } - - /** - * Create the column definition for a spatial Polygon type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typePolygon(Fluent $column) - { - return 'polygon'; - } - - /** - * Create the column definition for a spatial GeometryCollection type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeGeometryCollection(Fluent $column) - { - return 'geometrycollection'; - } - - /** - * Create the column definition for a spatial MultiPoint type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiPoint(Fluent $column) - { - return 'multipoint'; - } - - /** - * Create the column definition for a spatial MultiLineString type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiLineString(Fluent $column) - { - return 'multilinestring'; - } - - /** - * Create the column definition for a spatial MultiPolygon type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiPolygon(Fluent $column) - { - return 'multipolygon'; - } - - /** - * Get the SQL for a generated virtual column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyVirtualAs(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->virtualAs)) { - return " as ({$column->virtualAs})"; - } - } - - /** - * Get the SQL for a generated stored column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyStoredAs(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->storedAs)) { - return " as ({$column->storedAs}) stored"; - } - } - - /** - * Get the SQL for an unsigned column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyUnsigned(Blueprint $blueprint, Fluent $column) - { - if ($column->unsigned) { - return ' unsigned'; - } - } - - /** - * Get the SQL for a character set column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyCharset(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->charset)) { - return ' character set '.$column->charset; - } - } - - /** - * Get the SQL for a collation column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyCollate(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->collation)) { - return ' collate '.$column->collation; - } - } - - /** - * Get the SQL for a nullable column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyNullable(Blueprint $blueprint, Fluent $column) - { - if (is_null($column->virtualAs) && is_null($column->storedAs)) { - return $column->nullable ? ' null' : ' not null'; - } - } - - /** - * Get the SQL for a default column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyDefault(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->default)) { - return ' default '.$this->getDefaultValue($column->default); - } - } - - /** - * Get the SQL for an auto-increment column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyIncrement(Blueprint $blueprint, Fluent $column) - { - if (in_array($column->type, $this->serials) && $column->autoIncrement) { - return ' auto_increment primary key'; - } - } - - /** - * Get the SQL for a "first" column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyFirst(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->first)) { - return ' first'; - } - } - - /** - * Get the SQL for an "after" column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyAfter(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->after)) { - return ' after '.$this->wrap($column->after); - } - } - - /** - * Get the SQL for a "comment" column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyComment(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->comment)) { - return " comment '".addslashes($column->comment)."'"; - } - } - - /** - * Wrap a single string in keyword identifiers. - * - * @param string $value - * @return string - */ - protected function wrapValue($value) - { - if ($value !== '*') { - return '`'.str_replace('`', '``', $value).'`'; - } - - return $value; - } -} diff --git a/vendor/illuminate/database/Schema/Grammars/PostgresGrammar.php b/vendor/illuminate/database/Schema/Grammars/PostgresGrammar.php deleted file mode 100644 index 5eed79c..0000000 --- a/vendor/illuminate/database/Schema/Grammars/PostgresGrammar.php +++ /dev/null @@ -1,802 +0,0 @@ -<?php - -namespace Illuminate\Database\Schema\Grammars; - -use RuntimeException; -use Illuminate\Support\Fluent; -use Illuminate\Database\Schema\Blueprint; - -class PostgresGrammar extends Grammar -{ - /** - * If this Grammar supports schema changes wrapped in a transaction. - * - * @var bool - */ - protected $transactions = true; - - /** - * The possible column modifiers. - * - * @var array - */ - protected $modifiers = ['Increment', 'Nullable', 'Default']; - - /** - * The columns available as serials. - * - * @var array - */ - protected $serials = ['bigInteger', 'integer', 'mediumInteger', 'smallInteger', 'tinyInteger']; - - /** - * Compile the query to determine if a table exists. - * - * @return string - */ - public function compileTableExists() - { - return 'select * from information_schema.tables where table_schema = ? and table_name = ?'; - } - - /** - * Compile the query to determine the list of columns. - * - * @return string - */ - public function compileColumnListing() - { - return 'select column_name from information_schema.columns where table_schema = ? and table_name = ?'; - } - - /** - * Compile a create table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileCreate(Blueprint $blueprint, Fluent $command) - { - return sprintf('%s table %s (%s)', - $blueprint->temporary ? 'create temporary' : 'create', - $this->wrapTable($blueprint), - implode(', ', $this->getColumns($blueprint)) - ); - } - - /** - * Compile a column addition command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileAdd(Blueprint $blueprint, Fluent $command) - { - return sprintf('alter table %s %s', - $this->wrapTable($blueprint), - implode(', ', $this->prefixArray('add column', $this->getColumns($blueprint))) - ); - } - - /** - * Compile a primary key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compilePrimary(Blueprint $blueprint, Fluent $command) - { - $columns = $this->columnize($command->columns); - - return 'alter table '.$this->wrapTable($blueprint)." add primary key ({$columns})"; - } - - /** - * Compile a unique key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileUnique(Blueprint $blueprint, Fluent $command) - { - return sprintf('alter table %s add constraint %s unique (%s)', - $this->wrapTable($blueprint), - $this->wrap($command->index), - $this->columnize($command->columns) - ); - } - - /** - * Compile a plain index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileIndex(Blueprint $blueprint, Fluent $command) - { - return sprintf('create index %s on %s%s (%s)', - $this->wrap($command->index), - $this->wrapTable($blueprint), - $command->algorithm ? ' using '.$command->algorithm : '', - $this->columnize($command->columns) - ); - } - - /** - * Compile a spatial index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileSpatialIndex(Blueprint $blueprint, Fluent $command) - { - $command->algorithm = 'gist'; - - return $this->compileIndex($blueprint, $command); - } - - /** - * Compile a foreign key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileForeign(Blueprint $blueprint, Fluent $command) - { - $sql = parent::compileForeign($blueprint, $command); - - if (! is_null($command->deferrable)) { - $sql .= $command->deferrable ? ' deferrable' : ' not deferrable'; - } - - if ($command->deferrable && ! is_null($command->initiallyImmediate)) { - $sql .= $command->initiallyImmediate ? ' initially immediate' : ' initially deferred'; - } - - return $sql; - } - - /** - * Compile a drop table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDrop(Blueprint $blueprint, Fluent $command) - { - return 'drop table '.$this->wrapTable($blueprint); - } - - /** - * Compile a drop table (if exists) command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropIfExists(Blueprint $blueprint, Fluent $command) - { - return 'drop table if exists '.$this->wrapTable($blueprint); - } - - /** - * Compile the SQL needed to drop all tables. - * - * @param string $tables - * @return string - */ - public function compileDropAllTables($tables) - { - return 'drop table "'.implode('","', $tables).'" cascade'; - } - - /** - * Compile the SQL needed to retrieve all table names. - * - * @param string $schema - * @return string - */ - public function compileGetAllTables($schema) - { - return "select tablename from pg_catalog.pg_tables where schemaname = '{$schema}'"; - } - - /** - * Compile a drop column command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropColumn(Blueprint $blueprint, Fluent $command) - { - $columns = $this->prefixArray('drop column', $this->wrapArray($command->columns)); - - return 'alter table '.$this->wrapTable($blueprint).' '.implode(', ', $columns); - } - - /** - * Compile a drop primary key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropPrimary(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap("{$blueprint->getTable()}_pkey"); - - return 'alter table '.$this->wrapTable($blueprint)." drop constraint {$index}"; - } - - /** - * Compile a drop unique key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropUnique(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "alter table {$this->wrapTable($blueprint)} drop constraint {$index}"; - } - - /** - * Compile a drop index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropIndex(Blueprint $blueprint, Fluent $command) - { - return "drop index {$this->wrap($command->index)}"; - } - - /** - * Compile a drop spatial index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropSpatialIndex(Blueprint $blueprint, Fluent $command) - { - return $this->compileDropIndex($blueprint, $command); - } - - /** - * Compile a drop foreign key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropForeign(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "alter table {$this->wrapTable($blueprint)} drop constraint {$index}"; - } - - /** - * Compile a rename table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileRename(Blueprint $blueprint, Fluent $command) - { - $from = $this->wrapTable($blueprint); - - return "alter table {$from} rename to ".$this->wrapTable($command->to); - } - - /** - * Compile the command to enable foreign key constraints. - * - * @return string - */ - public function compileEnableForeignKeyConstraints() - { - return 'SET CONSTRAINTS ALL IMMEDIATE;'; - } - - /** - * Compile the command to disable foreign key constraints. - * - * @return string - */ - public function compileDisableForeignKeyConstraints() - { - return 'SET CONSTRAINTS ALL DEFERRED;'; - } - - /** - * Create the column definition for a char type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeChar(Fluent $column) - { - return "char({$column->length})"; - } - - /** - * Create the column definition for a string type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeString(Fluent $column) - { - return "varchar({$column->length})"; - } - - /** - * Create the column definition for a text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeText(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for a medium text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMediumText(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for a long text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeLongText(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for an integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeInteger(Fluent $column) - { - return $column->autoIncrement ? 'serial' : 'integer'; - } - - /** - * Create the column definition for a big integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBigInteger(Fluent $column) - { - return $column->autoIncrement ? 'bigserial' : 'bigint'; - } - - /** - * Create the column definition for a medium integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMediumInteger(Fluent $column) - { - return $column->autoIncrement ? 'serial' : 'integer'; - } - - /** - * Create the column definition for a tiny integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTinyInteger(Fluent $column) - { - return $column->autoIncrement ? 'smallserial' : 'smallint'; - } - - /** - * Create the column definition for a small integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeSmallInteger(Fluent $column) - { - return $column->autoIncrement ? 'smallserial' : 'smallint'; - } - - /** - * Create the column definition for a float type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeFloat(Fluent $column) - { - return $this->typeDouble($column); - } - - /** - * Create the column definition for a double type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDouble(Fluent $column) - { - return 'double precision'; - } - - /** - * Create the column definition for a real type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeReal(Fluent $column) - { - return 'real'; - } - - /** - * Create the column definition for a decimal type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDecimal(Fluent $column) - { - return "decimal({$column->total}, {$column->places})"; - } - - /** - * Create the column definition for a boolean type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBoolean(Fluent $column) - { - return 'boolean'; - } - - /** - * Create the column definition for an enum type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeEnum(Fluent $column) - { - $allowed = array_map(function ($a) { - return "'{$a}'"; - }, $column->allowed); - - return "varchar(255) check (\"{$column->name}\" in (".implode(', ', $allowed).'))'; - } - - /** - * Create the column definition for a json type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeJson(Fluent $column) - { - return 'json'; - } - - /** - * Create the column definition for a jsonb type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeJsonb(Fluent $column) - { - return 'jsonb'; - } - - /** - * Create the column definition for a date type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDate(Fluent $column) - { - return 'date'; - } - - /** - * Create the column definition for a date-time type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDateTime(Fluent $column) - { - return "timestamp($column->precision) without time zone"; - } - - /** - * Create the column definition for a date-time (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDateTimeTz(Fluent $column) - { - return "timestamp($column->precision) with time zone"; - } - - /** - * Create the column definition for a time type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTime(Fluent $column) - { - return "time($column->precision) without time zone"; - } - - /** - * Create the column definition for a time (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimeTz(Fluent $column) - { - return "time($column->precision) with time zone"; - } - - /** - * Create the column definition for a timestamp type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimestamp(Fluent $column) - { - $columnType = "timestamp($column->precision) without time zone"; - - return $column->useCurrent ? "$columnType default CURRENT_TIMESTAMP" : $columnType; - } - - /** - * Create the column definition for a timestamp (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimestampTz(Fluent $column) - { - $columnType = "timestamp($column->precision) with time zone"; - - return $column->useCurrent ? "$columnType default CURRENT_TIMESTAMP" : $columnType; - } - - /** - * Create the column definition for a year type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeYear(Fluent $column) - { - return $this->typeInteger($column); - } - - /** - * Create the column definition for a binary type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBinary(Fluent $column) - { - return 'bytea'; - } - - /** - * Create the column definition for a uuid type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeUuid(Fluent $column) - { - return 'uuid'; - } - - /** - * Create the column definition for an IP address type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeIpAddress(Fluent $column) - { - return 'inet'; - } - - /** - * Create the column definition for a MAC address type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMacAddress(Fluent $column) - { - return 'macaddr'; - } - - /** - * Create the column definition for a spatial Geometry type. - * - * @param \Illuminate\Support\Fluent $column - * @throws \RuntimeException - */ - protected function typeGeometry(Fluent $column) - { - throw new RuntimeException('The database driver in use does not support the Geometry spatial column type.'); - } - - /** - * Create the column definition for a spatial Point type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typePoint(Fluent $column) - { - return $this->formatPostGisType('point'); - } - - /** - * Create the column definition for a spatial LineString type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeLineString(Fluent $column) - { - return $this->formatPostGisType('linestring'); - } - - /** - * Create the column definition for a spatial Polygon type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typePolygon(Fluent $column) - { - return $this->formatPostGisType('polygon'); - } - - /** - * Create the column definition for a spatial GeometryCollection type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeGeometryCollection(Fluent $column) - { - return $this->formatPostGisType('geometrycollection'); - } - - /** - * Create the column definition for a spatial MultiPoint type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMultiPoint(Fluent $column) - { - return $this->formatPostGisType('multipoint'); - } - - /** - * Create the column definition for a spatial MultiLineString type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiLineString(Fluent $column) - { - return $this->formatPostGisType('multilinestring'); - } - - /** - * Create the column definition for a spatial MultiPolygon type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMultiPolygon(Fluent $column) - { - return $this->formatPostGisType('multipolygon'); - } - - /** - * Format the column definition for a PostGIS spatial type. - * - * @param string $type - * @return string - */ - private function formatPostGisType(string $type) - { - return "geography($type, 4326)"; - } - - /** - * Get the SQL for a nullable column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyNullable(Blueprint $blueprint, Fluent $column) - { - return $column->nullable ? ' null' : ' not null'; - } - - /** - * Get the SQL for a default column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyDefault(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->default)) { - return ' default '.$this->getDefaultValue($column->default); - } - } - - /** - * Get the SQL for an auto-increment column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyIncrement(Blueprint $blueprint, Fluent $column) - { - if (in_array($column->type, $this->serials) && $column->autoIncrement) { - return ' primary key'; - } - } -} diff --git a/vendor/illuminate/database/Schema/Grammars/RenameColumn.php b/vendor/illuminate/database/Schema/Grammars/RenameColumn.php deleted file mode 100644 index a07c4fe..0000000 --- a/vendor/illuminate/database/Schema/Grammars/RenameColumn.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -namespace Illuminate\Database\Schema\Grammars; - -use Illuminate\Support\Fluent; -use Doctrine\DBAL\Schema\Column; -use Doctrine\DBAL\Schema\TableDiff; -use Illuminate\Database\Connection; -use Illuminate\Database\Schema\Blueprint; -use Doctrine\DBAL\Schema\AbstractSchemaManager as SchemaManager; - -class RenameColumn -{ - /** - * Compile a rename column command. - * - * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param \Illuminate\Database\Connection $connection - * @return array - */ - public static function compile(Grammar $grammar, Blueprint $blueprint, Fluent $command, Connection $connection) - { - $column = $connection->getDoctrineColumn( - $grammar->getTablePrefix().$blueprint->getTable(), $command->from - ); - - $schema = $connection->getDoctrineSchemaManager(); - - return (array) $schema->getDatabasePlatform()->getAlterTableSQL(static::getRenamedDiff( - $grammar, $blueprint, $command, $column, $schema - )); - } - - /** - * Get a new column instance with the new column name. - * - * @param \Illuminate\Database\Schema\Grammars\Grammar $grammar - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param \Doctrine\DBAL\Schema\Column $column - * @param \Doctrine\DBAL\Schema\AbstractSchemaManager $schema - * @return \Doctrine\DBAL\Schema\TableDiff - */ - protected static function getRenamedDiff(Grammar $grammar, Blueprint $blueprint, Fluent $command, Column $column, SchemaManager $schema) - { - return static::setRenamedColumns( - $grammar->getDoctrineTableDiff($blueprint, $schema), $command, $column - ); - } - - /** - * Set the renamed columns on the table diff. - * - * @param \Doctrine\DBAL\Schema\TableDiff $tableDiff - * @param \Illuminate\Support\Fluent $command - * @param \Doctrine\DBAL\Schema\Column $column - * @return \Doctrine\DBAL\Schema\TableDiff - */ - protected static function setRenamedColumns(TableDiff $tableDiff, Fluent $command, Column $column) - { - $tableDiff->renamedColumns = [ - $command->from => new Column($command->to, $column->getType(), $column->toArray()), - ]; - - return $tableDiff; - } -} diff --git a/vendor/illuminate/database/Schema/Grammars/SQLiteGrammar.php b/vendor/illuminate/database/Schema/Grammars/SQLiteGrammar.php deleted file mode 100644 index 27e372d..0000000 --- a/vendor/illuminate/database/Schema/Grammars/SQLiteGrammar.php +++ /dev/null @@ -1,799 +0,0 @@ -<?php - -namespace Illuminate\Database\Schema\Grammars; - -use RuntimeException; -use Illuminate\Support\Fluent; -use Illuminate\Database\Connection; -use Illuminate\Database\Schema\Blueprint; - -class SQLiteGrammar extends Grammar -{ - /** - * The possible column modifiers. - * - * @var array - */ - protected $modifiers = ['Nullable', 'Default', 'Increment']; - - /** - * The columns available as serials. - * - * @var array - */ - protected $serials = ['bigInteger', 'integer', 'mediumInteger', 'smallInteger', 'tinyInteger']; - - /** - * Compile the query to determine if a table exists. - * - * @return string - */ - public function compileTableExists() - { - return "select * from sqlite_master where type = 'table' and name = ?"; - } - - /** - * Compile the query to determine the list of columns. - * - * @param string $table - * @return string - */ - public function compileColumnListing($table) - { - return 'pragma table_info('.$this->wrap(str_replace('.', '__', $table)).')'; - } - - /** - * Compile a create table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileCreate(Blueprint $blueprint, Fluent $command) - { - return sprintf('%s table %s (%s%s%s)', - $blueprint->temporary ? 'create temporary' : 'create', - $this->wrapTable($blueprint), - implode(', ', $this->getColumns($blueprint)), - (string) $this->addForeignKeys($blueprint), - (string) $this->addPrimaryKeys($blueprint) - ); - } - - /** - * Get the foreign key syntax for a table creation statement. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @return string|null - */ - protected function addForeignKeys(Blueprint $blueprint) - { - $foreigns = $this->getCommandsByName($blueprint, 'foreign'); - - return collect($foreigns)->reduce(function ($sql, $foreign) { - // Once we have all the foreign key commands for the table creation statement - // we'll loop through each of them and add them to the create table SQL we - // are building, since SQLite needs foreign keys on the tables creation. - $sql .= $this->getForeignKey($foreign); - - if (! is_null($foreign->onDelete)) { - $sql .= " on delete {$foreign->onDelete}"; - } - - // If this foreign key specifies the action to be taken on update we will add - // that to the statement here. We'll append it to this SQL and then return - // the SQL so we can keep adding any other foreign consraints onto this. - if (! is_null($foreign->onUpdate)) { - $sql .= " on update {$foreign->onUpdate}"; - } - - return $sql; - }, ''); - } - - /** - * Get the SQL for the foreign key. - * - * @param \Illuminate\Support\Fluent $foreign - * @return string - */ - protected function getForeignKey($foreign) - { - // We need to columnize the columns that the foreign key is being defined for - // so that it is a properly formatted list. Once we have done this, we can - // return the foreign key SQL declaration to the calling method for use. - return sprintf(', foreign key(%s) references %s(%s)', - $this->columnize($foreign->columns), - $this->wrapTable($foreign->on), - $this->columnize((array) $foreign->references) - ); - } - - /** - * Get the primary key syntax for a table creation statement. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @return string|null - */ - protected function addPrimaryKeys(Blueprint $blueprint) - { - if (! is_null($primary = $this->getCommandByName($blueprint, 'primary'))) { - return ", primary key ({$this->columnize($primary->columns)})"; - } - } - - /** - * Compile alter table commands for adding columns. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return array - */ - public function compileAdd(Blueprint $blueprint, Fluent $command) - { - $columns = $this->prefixArray('add column', $this->getColumns($blueprint)); - - return collect($columns)->map(function ($column) use ($blueprint) { - return 'alter table '.$this->wrapTable($blueprint).' '.$column; - })->all(); - } - - /** - * Compile a unique key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileUnique(Blueprint $blueprint, Fluent $command) - { - return sprintf('create unique index %s on %s (%s)', - $this->wrap($command->index), - $this->wrapTable($blueprint), - $this->columnize($command->columns) - ); - } - - /** - * Compile a plain index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileIndex(Blueprint $blueprint, Fluent $command) - { - return sprintf('create index %s on %s (%s)', - $this->wrap($command->index), - $this->wrapTable($blueprint), - $this->columnize($command->columns) - ); - } - - /** - * Compile a spatial index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @throws \RuntimeException - */ - public function compileSpatialIndex(Blueprint $blueprint, Fluent $command) - { - throw new RuntimeException('The database driver in use does not support spatial indexes.'); - } - - /** - * Compile a foreign key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileForeign(Blueprint $blueprint, Fluent $command) - { - // Handled on table creation... - } - - /** - * Compile a drop table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDrop(Blueprint $blueprint, Fluent $command) - { - return 'drop table '.$this->wrapTable($blueprint); - } - - /** - * Compile a drop table (if exists) command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropIfExists(Blueprint $blueprint, Fluent $command) - { - return 'drop table if exists '.$this->wrapTable($blueprint); - } - - /** - * Compile the SQL needed to drop all tables. - * - * @return string - */ - public function compileDropAllTables() - { - return "delete from sqlite_master where type in ('table', 'index', 'trigger')"; - } - - /** - * Compile a drop column command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @param \Illuminate\Database\Connection $connection - * @return array - */ - public function compileDropColumn(Blueprint $blueprint, Fluent $command, Connection $connection) - { - $tableDiff = $this->getDoctrineTableDiff( - $blueprint, $schema = $connection->getDoctrineSchemaManager() - ); - - foreach ($command->columns as $name) { - $tableDiff->removedColumns[$name] = $connection->getDoctrineColumn( - $this->getTablePrefix().$blueprint->getTable(), $name - ); - } - - return (array) $schema->getDatabasePlatform()->getAlterTableSQL($tableDiff); - } - - /** - * Compile a drop unique key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropUnique(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "drop index {$index}"; - } - - /** - * Compile a drop index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropIndex(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "drop index {$index}"; - } - - /** - * Compile a drop spatial index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @throws \RuntimeException - */ - public function compileDropSpatialIndex(Blueprint $blueprint, Fluent $command) - { - throw new RuntimeException('The database driver in use does not support spatial indexes.'); - } - - /** - * Compile a rename table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileRename(Blueprint $blueprint, Fluent $command) - { - $from = $this->wrapTable($blueprint); - - return "alter table {$from} rename to ".$this->wrapTable($command->to); - } - - /** - * Compile the command to enable foreign key constraints. - * - * @return string - */ - public function compileEnableForeignKeyConstraints() - { - return 'PRAGMA foreign_keys = ON;'; - } - - /** - * Compile the command to disable foreign key constraints. - * - * @return string - */ - public function compileDisableForeignKeyConstraints() - { - return 'PRAGMA foreign_keys = OFF;'; - } - - /** - * Compile the SQL needed to enable a writable schema. - * - * @return string - */ - public function compileEnableWriteableSchema() - { - return 'PRAGMA writable_schema = 1;'; - } - - /** - * Compile the SQL needed to disable a writable schema. - * - * @return string - */ - public function compileDisableWriteableSchema() - { - return 'PRAGMA writable_schema = 0;'; - } - - /** - * Create the column definition for a char type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeChar(Fluent $column) - { - return 'varchar'; - } - - /** - * Create the column definition for a string type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeString(Fluent $column) - { - return 'varchar'; - } - - /** - * Create the column definition for a text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeText(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for a medium text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMediumText(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for a long text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeLongText(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for a integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeInteger(Fluent $column) - { - return 'integer'; - } - - /** - * Create the column definition for a big integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBigInteger(Fluent $column) - { - return 'integer'; - } - - /** - * Create the column definition for a medium integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMediumInteger(Fluent $column) - { - return 'integer'; - } - - /** - * Create the column definition for a tiny integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTinyInteger(Fluent $column) - { - return 'integer'; - } - - /** - * Create the column definition for a small integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeSmallInteger(Fluent $column) - { - return 'integer'; - } - - /** - * Create the column definition for a float type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeFloat(Fluent $column) - { - return 'float'; - } - - /** - * Create the column definition for a double type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDouble(Fluent $column) - { - return 'float'; - } - - /** - * Create the column definition for a decimal type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDecimal(Fluent $column) - { - return 'numeric'; - } - - /** - * Create the column definition for a boolean type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBoolean(Fluent $column) - { - return 'tinyint(1)'; - } - - /** - * Create the column definition for an enum type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeEnum(Fluent $column) - { - return 'varchar'; - } - - /** - * Create the column definition for a json type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeJson(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for a jsonb type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeJsonb(Fluent $column) - { - return 'text'; - } - - /** - * Create the column definition for a date type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDate(Fluent $column) - { - return 'date'; - } - - /** - * Create the column definition for a date-time type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDateTime(Fluent $column) - { - return 'datetime'; - } - - /** - * Create the column definition for a date-time (with time zone) type. - * - * Note: "SQLite does not have a storage class set aside for storing dates and/or times." - * @link https://www.sqlite.org/datatype3.html - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDateTimeTz(Fluent $column) - { - return $this->typeDateTime($column); - } - - /** - * Create the column definition for a time type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTime(Fluent $column) - { - return 'time'; - } - - /** - * Create the column definition for a time (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimeTz(Fluent $column) - { - return $this->typeTime($column); - } - - /** - * Create the column definition for a timestamp type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimestamp(Fluent $column) - { - return $column->useCurrent ? 'datetime default CURRENT_TIMESTAMP' : 'datetime'; - } - - /** - * Create the column definition for a timestamp (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimestampTz(Fluent $column) - { - return $this->typeTimestamp($column); - } - - /** - * Create the column definition for a year type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeYear(Fluent $column) - { - return $this->typeInteger($column); - } - - /** - * Create the column definition for a binary type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBinary(Fluent $column) - { - return 'blob'; - } - - /** - * Create the column definition for a uuid type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeUuid(Fluent $column) - { - return 'varchar'; - } - - /** - * Create the column definition for an IP address type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeIpAddress(Fluent $column) - { - return 'varchar'; - } - - /** - * Create the column definition for a MAC address type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMacAddress(Fluent $column) - { - return 'varchar'; - } - - /** - * Create the column definition for a spatial Geometry type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeGeometry(Fluent $column) - { - return 'geometry'; - } - - /** - * Create the column definition for a spatial Point type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typePoint(Fluent $column) - { - return 'point'; - } - - /** - * Create the column definition for a spatial LineString type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeLineString(Fluent $column) - { - return 'linestring'; - } - - /** - * Create the column definition for a spatial Polygon type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typePolygon(Fluent $column) - { - return 'polygon'; - } - - /** - * Create the column definition for a spatial GeometryCollection type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeGeometryCollection(Fluent $column) - { - return 'geometrycollection'; - } - - /** - * Create the column definition for a spatial MultiPoint type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiPoint(Fluent $column) - { - return 'multipoint'; - } - - /** - * Create the column definition for a spatial MultiLineString type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiLineString(Fluent $column) - { - return 'multilinestring'; - } - - /** - * Create the column definition for a spatial MultiPolygon type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiPolygon(Fluent $column) - { - return 'multipolygon'; - } - - /** - * Get the SQL for a nullable column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyNullable(Blueprint $blueprint, Fluent $column) - { - return $column->nullable ? ' null' : ' not null'; - } - - /** - * Get the SQL for a default column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyDefault(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->default)) { - return ' default '.$this->getDefaultValue($column->default); - } - } - - /** - * Get the SQL for an auto-increment column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyIncrement(Blueprint $blueprint, Fluent $column) - { - if (in_array($column->type, $this->serials) && $column->autoIncrement) { - return ' primary key autoincrement'; - } - } -} diff --git a/vendor/illuminate/database/Schema/Grammars/SqlServerGrammar.php b/vendor/illuminate/database/Schema/Grammars/SqlServerGrammar.php deleted file mode 100644 index 40a21c1..0000000 --- a/vendor/illuminate/database/Schema/Grammars/SqlServerGrammar.php +++ /dev/null @@ -1,785 +0,0 @@ -<?php - -namespace Illuminate\Database\Schema\Grammars; - -use Illuminate\Support\Fluent; -use Illuminate\Database\Schema\Blueprint; - -class SqlServerGrammar extends Grammar -{ - /** - * If this Grammar supports schema changes wrapped in a transaction. - * - * @var bool - */ - protected $transactions = true; - - /** - * The possible column modifiers. - * - * @var array - */ - protected $modifiers = ['Increment', 'Collate', 'Nullable', 'Default']; - - /** - * The columns available as serials. - * - * @var array - */ - protected $serials = ['tinyInteger', 'smallInteger', 'mediumInteger', 'integer', 'bigInteger']; - - /** - * Compile the query to determine if a table exists. - * - * @return string - */ - public function compileTableExists() - { - return "select * from sysobjects where type = 'U' and name = ?"; - } - - /** - * Compile the query to determine the list of columns. - * - * @param string $table - * @return string - */ - public function compileColumnListing($table) - { - return "select col.name from sys.columns as col - join sys.objects as obj on col.object_id = obj.object_id - where obj.type = 'U' and obj.name = '$table'"; - } - - /** - * Compile a create table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileCreate(Blueprint $blueprint, Fluent $command) - { - $columns = implode(', ', $this->getColumns($blueprint)); - - return 'create table '.$this->wrapTable($blueprint)." ($columns)"; - } - - /** - * Compile a column addition table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileAdd(Blueprint $blueprint, Fluent $command) - { - return sprintf('alter table %s add %s', - $this->wrapTable($blueprint), - implode(', ', $this->getColumns($blueprint)) - ); - } - - /** - * Compile a primary key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compilePrimary(Blueprint $blueprint, Fluent $command) - { - return sprintf('alter table %s add constraint %s primary key (%s)', - $this->wrapTable($blueprint), - $this->wrap($command->index), - $this->columnize($command->columns) - ); - } - - /** - * Compile a unique key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileUnique(Blueprint $blueprint, Fluent $command) - { - return sprintf('create unique index %s on %s (%s)', - $this->wrap($command->index), - $this->wrapTable($blueprint), - $this->columnize($command->columns) - ); - } - - /** - * Compile a plain index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileIndex(Blueprint $blueprint, Fluent $command) - { - return sprintf('create index %s on %s (%s)', - $this->wrap($command->index), - $this->wrapTable($blueprint), - $this->columnize($command->columns) - ); - } - - /** - * Compile a spatial index key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileSpatialIndex(Blueprint $blueprint, Fluent $command) - { - return sprintf('create spatial index %s on %s (%s)', - $this->wrap($command->index), - $this->wrapTable($blueprint), - $this->columnize($command->columns) - ); - } - - /** - * Compile a drop table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDrop(Blueprint $blueprint, Fluent $command) - { - return 'drop table '.$this->wrapTable($blueprint); - } - - /** - * Compile a drop table (if exists) command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropIfExists(Blueprint $blueprint, Fluent $command) - { - return sprintf('if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = %s) drop table %s', - "'".str_replace("'", "''", $this->getTablePrefix().$blueprint->getTable())."'", - $this->wrapTable($blueprint) - ); - } - - /** - * Compile the SQL needed to drop all tables. - * - * @return string - */ - public function compileDropAllTables() - { - return "EXEC sp_msforeachtable 'DROP TABLE ?'"; - } - - /** - * Compile a drop column command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropColumn(Blueprint $blueprint, Fluent $command) - { - $columns = $this->wrapArray($command->columns); - - return 'alter table '.$this->wrapTable($blueprint).' drop column '.implode(', ', $columns); - } - - /** - * Compile a drop primary key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropPrimary(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "alter table {$this->wrapTable($blueprint)} drop constraint {$index}"; - } - - /** - * Compile a drop unique key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropUnique(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "drop index {$index} on {$this->wrapTable($blueprint)}"; - } - - /** - * Compile a drop index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropIndex(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "drop index {$index} on {$this->wrapTable($blueprint)}"; - } - - /** - * Compile a drop spatial index command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropSpatialIndex(Blueprint $blueprint, Fluent $command) - { - return $this->compileDropIndex($blueprint, $command); - } - - /** - * Compile a drop foreign key command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileDropForeign(Blueprint $blueprint, Fluent $command) - { - $index = $this->wrap($command->index); - - return "alter table {$this->wrapTable($blueprint)} drop constraint {$index}"; - } - - /** - * Compile a rename table command. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $command - * @return string - */ - public function compileRename(Blueprint $blueprint, Fluent $command) - { - $from = $this->wrapTable($blueprint); - - return "sp_rename {$from}, ".$this->wrapTable($command->to); - } - - /** - * Compile the command to enable foreign key constraints. - * - * @return string - */ - public function compileEnableForeignKeyConstraints() - { - return 'EXEC sp_msforeachtable @command1="print \'?\'", @command2="ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all";'; - } - - /** - * Compile the command to disable foreign key constraints. - * - * @return string - */ - public function compileDisableForeignKeyConstraints() - { - return 'EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all";'; - } - - /** - * Create the column definition for a char type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeChar(Fluent $column) - { - return "nchar({$column->length})"; - } - - /** - * Create the column definition for a string type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeString(Fluent $column) - { - return "nvarchar({$column->length})"; - } - - /** - * Create the column definition for a text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeText(Fluent $column) - { - return 'nvarchar(max)'; - } - - /** - * Create the column definition for a medium text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMediumText(Fluent $column) - { - return 'nvarchar(max)'; - } - - /** - * Create the column definition for a long text type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeLongText(Fluent $column) - { - return 'nvarchar(max)'; - } - - /** - * Create the column definition for an integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeInteger(Fluent $column) - { - return 'int'; - } - - /** - * Create the column definition for a big integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBigInteger(Fluent $column) - { - return 'bigint'; - } - - /** - * Create the column definition for a medium integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMediumInteger(Fluent $column) - { - return 'int'; - } - - /** - * Create the column definition for a tiny integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTinyInteger(Fluent $column) - { - return 'tinyint'; - } - - /** - * Create the column definition for a small integer type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeSmallInteger(Fluent $column) - { - return 'smallint'; - } - - /** - * Create the column definition for a float type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeFloat(Fluent $column) - { - return 'float'; - } - - /** - * Create the column definition for a double type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDouble(Fluent $column) - { - return 'float'; - } - - /** - * Create the column definition for a decimal type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDecimal(Fluent $column) - { - return "decimal({$column->total}, {$column->places})"; - } - - /** - * Create the column definition for a boolean type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBoolean(Fluent $column) - { - return 'bit'; - } - - /** - * Create the column definition for an enum type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeEnum(Fluent $column) - { - return 'nvarchar(255)'; - } - - /** - * Create the column definition for a json type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeJson(Fluent $column) - { - return 'nvarchar(max)'; - } - - /** - * Create the column definition for a jsonb type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeJsonb(Fluent $column) - { - return 'nvarchar(max)'; - } - - /** - * Create the column definition for a date type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDate(Fluent $column) - { - return 'date'; - } - - /** - * Create the column definition for a date-time type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDateTime(Fluent $column) - { - return $column->precision ? "datetime2($column->precision)" : 'datetime'; - } - - /** - * Create the column definition for a date-time (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeDateTimeTz(Fluent $column) - { - return $column->precision ? "datetimeoffset($column->precision)" : 'datetimeoffset'; - } - - /** - * Create the column definition for a time type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTime(Fluent $column) - { - return $column->precision ? "time($column->precision)" : 'time'; - } - - /** - * Create the column definition for a time (with time zone) type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimeTz(Fluent $column) - { - return $this->typeTime($column); - } - - /** - * Create the column definition for a timestamp type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimestamp(Fluent $column) - { - $columnType = $column->precision ? "datetime2($column->precision)" : 'datetime'; - - return $column->useCurrent ? "$columnType default CURRENT_TIMESTAMP" : $columnType; - } - - /** - * Create the column definition for a timestamp (with time zone) type. - * - * @link https://msdn.microsoft.com/en-us/library/bb630289(v=sql.120).aspx - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeTimestampTz(Fluent $column) - { - if ($column->useCurrent) { - $columnType = $column->precision ? "datetimeoffset($column->precision)" : 'datetimeoffset'; - - return "$columnType default CURRENT_TIMESTAMP"; - } - - return "datetimeoffset($column->precision)"; - } - - /** - * Create the column definition for a year type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeYear(Fluent $column) - { - return $this->typeInteger($column); - } - - /** - * Create the column definition for a binary type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeBinary(Fluent $column) - { - return 'varbinary(max)'; - } - - /** - * Create the column definition for a uuid type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeUuid(Fluent $column) - { - return 'uniqueidentifier'; - } - - /** - * Create the column definition for an IP address type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeIpAddress(Fluent $column) - { - return 'nvarchar(45)'; - } - - /** - * Create the column definition for a MAC address type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - protected function typeMacAddress(Fluent $column) - { - return 'nvarchar(17)'; - } - - /** - * Create the column definition for a spatial Geometry type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeGeometry(Fluent $column) - { - return 'geography'; - } - - /** - * Create the column definition for a spatial Point type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typePoint(Fluent $column) - { - return 'geography'; - } - - /** - * Create the column definition for a spatial LineString type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeLineString(Fluent $column) - { - return 'geography'; - } - - /** - * Create the column definition for a spatial Polygon type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typePolygon(Fluent $column) - { - return 'geography'; - } - - /** - * Create the column definition for a spatial GeometryCollection type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeGeometryCollection(Fluent $column) - { - return 'geography'; - } - - /** - * Create the column definition for a spatial MultiPoint type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiPoint(Fluent $column) - { - return 'geography'; - } - - /** - * Create the column definition for a spatial MultiLineString type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiLineString(Fluent $column) - { - return 'geography'; - } - - /** - * Create the column definition for a spatial MultiPolygon type. - * - * @param \Illuminate\Support\Fluent $column - * @return string - */ - public function typeMultiPolygon(Fluent $column) - { - return 'geography'; - } - - /** - * Get the SQL for a collation column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyCollate(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->collation)) { - return ' collate '.$column->collation; - } - } - - /** - * Get the SQL for a nullable column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyNullable(Blueprint $blueprint, Fluent $column) - { - return $column->nullable ? ' null' : ' not null'; - } - - /** - * Get the SQL for a default column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyDefault(Blueprint $blueprint, Fluent $column) - { - if (! is_null($column->default)) { - return ' default '.$this->getDefaultValue($column->default); - } - } - - /** - * Get the SQL for an auto-increment column modifier. - * - * @param \Illuminate\Database\Schema\Blueprint $blueprint - * @param \Illuminate\Support\Fluent $column - * @return string|null - */ - protected function modifyIncrement(Blueprint $blueprint, Fluent $column) - { - if (in_array($column->type, $this->serials) && $column->autoIncrement) { - return ' identity primary key'; - } - } - - /** - * Wrap a table in keyword identifiers. - * - * @param \Illuminate\Database\Query\Expression|string $table - * @return string - */ - public function wrapTable($table) - { - if ($table instanceof Blueprint && $table->temporary) { - $this->setTablePrefix('#'); - } - - return parent::wrapTable($table); - } -} diff --git a/vendor/illuminate/database/Schema/MySqlBuilder.php b/vendor/illuminate/database/Schema/MySqlBuilder.php deleted file mode 100644 index 7e4c6d2..0000000 --- a/vendor/illuminate/database/Schema/MySqlBuilder.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -namespace Illuminate\Database\Schema; - -class MySqlBuilder extends Builder -{ - /** - * Determine if the given table exists. - * - * @param string $table - * @return bool - */ - public function hasTable($table) - { - $table = $this->connection->getTablePrefix().$table; - - return count($this->connection->select( - $this->grammar->compileTableExists(), [$this->connection->getDatabaseName(), $table] - )) > 0; - } - - /** - * Get the column listing for a given table. - * - * @param string $table - * @return array - */ - public function getColumnListing($table) - { - $table = $this->connection->getTablePrefix().$table; - - $results = $this->connection->select( - $this->grammar->compileColumnListing(), [$this->connection->getDatabaseName(), $table] - ); - - return $this->connection->getPostProcessor()->processColumnListing($results); - } - - /** - * Drop all tables from the database. - * - * @return void - */ - public function dropAllTables() - { - $tables = []; - - foreach ($this->getAllTables() as $row) { - $row = (array) $row; - - $tables[] = reset($row); - } - - if (empty($tables)) { - return; - } - - $this->disableForeignKeyConstraints(); - - $this->connection->statement( - $this->grammar->compileDropAllTables($tables) - ); - - $this->enableForeignKeyConstraints(); - } - - /** - * Get all of the table names for the database. - * - * @return array - */ - protected function getAllTables() - { - return $this->connection->select( - $this->grammar->compileGetAllTables() - ); - } -} diff --git a/vendor/illuminate/database/Schema/PostgresBuilder.php b/vendor/illuminate/database/Schema/PostgresBuilder.php deleted file mode 100644 index 8fa0a2c..0000000 --- a/vendor/illuminate/database/Schema/PostgresBuilder.php +++ /dev/null @@ -1,105 +0,0 @@ -<?php - -namespace Illuminate\Database\Schema; - -class PostgresBuilder extends Builder -{ - /** - * Determine if the given table exists. - * - * @param string $table - * @return bool - */ - public function hasTable($table) - { - list($schema, $table) = $this->parseSchemaAndTable($table); - - $table = $this->connection->getTablePrefix().$table; - - return count($this->connection->select( - $this->grammar->compileTableExists(), [$schema, $table] - )) > 0; - } - - /** - * Drop all tables from the database. - * - * @return void - */ - public function dropAllTables() - { - $tables = []; - - $excludedTables = ['spatial_ref_sys']; - - foreach ($this->getAllTables() as $row) { - $row = (array) $row; - - $table = reset($row); - - if (! in_array($table, $excludedTables)) { - $tables[] = $table; - } - } - - if (empty($tables)) { - return; - } - - $this->connection->statement( - $this->grammar->compileDropAllTables($tables) - ); - } - - /** - * Get all of the table names for the database. - * - * @return array - */ - protected function getAllTables() - { - return $this->connection->select( - $this->grammar->compileGetAllTables($this->connection->getConfig('schema')) - ); - } - - /** - * Get the column listing for a given table. - * - * @param string $table - * @return array - */ - public function getColumnListing($table) - { - list($schema, $table) = $this->parseSchemaAndTable($table); - - $table = $this->connection->getTablePrefix().$table; - - $results = $this->connection->select( - $this->grammar->compileColumnListing(), [$schema, $table] - ); - - return $this->connection->getPostProcessor()->processColumnListing($results); - } - - /** - * Parse the table name and extract the schema and table. - * - * @param string $table - * @return array - */ - protected function parseSchemaAndTable($table) - { - $table = explode('.', $table); - - if (is_array($schema = $this->connection->getConfig('schema'))) { - if (in_array($table[0], $schema)) { - return [array_shift($table), implode('.', $table)]; - } - - $schema = head($schema); - } - - return [$schema ?: 'public', implode('.', $table)]; - } -} diff --git a/vendor/illuminate/database/Schema/SQLiteBuilder.php b/vendor/illuminate/database/Schema/SQLiteBuilder.php deleted file mode 100644 index 8cfacc1..0000000 --- a/vendor/illuminate/database/Schema/SQLiteBuilder.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -namespace Illuminate\Database\Schema; - -class SQLiteBuilder extends Builder -{ - /** - * Drop all tables from the database. - * - * @return void - */ - public function dropAllTables() - { - if ($this->connection->getDatabaseName() !== ':memory:') { - return $this->refreshDatabaseFile(); - } - - $this->connection->select($this->grammar->compileEnableWriteableSchema()); - - $this->connection->select($this->grammar->compileDropAllTables()); - - $this->connection->select($this->grammar->compileDisableWriteableSchema()); - } - - /** - * Empty the database file. - * - * @return void - */ - public function refreshDatabaseFile() - { - file_put_contents($this->connection->getDatabaseName(), ''); - } -} diff --git a/vendor/illuminate/database/Schema/SqlServerBuilder.php b/vendor/illuminate/database/Schema/SqlServerBuilder.php deleted file mode 100644 index 2c54282..0000000 --- a/vendor/illuminate/database/Schema/SqlServerBuilder.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Illuminate\Database\Schema; - -class SqlServerBuilder extends Builder -{ - /** - * Drop all tables from the database. - * - * @return void - */ - public function dropAllTables() - { - $this->disableForeignKeyConstraints(); - - $this->connection->statement($this->grammar->compileDropAllTables()); - - $this->enableForeignKeyConstraints(); - } -} diff --git a/vendor/illuminate/database/Seeder.php b/vendor/illuminate/database/Seeder.php deleted file mode 100644 index e4d3009..0000000 --- a/vendor/illuminate/database/Seeder.php +++ /dev/null @@ -1,125 +0,0 @@ -<?php - -namespace Illuminate\Database; - -use Illuminate\Support\Arr; -use InvalidArgumentException; -use Illuminate\Console\Command; -use Illuminate\Container\Container; - -abstract class Seeder -{ - /** - * The container instance. - * - * @var \Illuminate\Container\Container - */ - protected $container; - - /** - * The console command instance. - * - * @var \Illuminate\Console\Command - */ - protected $command; - - /** - * Seed the given connection from the given path. - * - * @param array|string $class - * @param bool $silent - * @return $this - */ - public function call($class, $silent = false) - { - $classes = Arr::wrap($class); - - foreach ($classes as $class) { - if ($silent === false && isset($this->command)) { - $this->command->getOutput()->writeln("<info>Seeding:</info> $class"); - } - - $this->resolve($class)->__invoke(); - } - - return $this; - } - - /** - * Silently seed the given connection from the given path. - * - * @param array|string $class - * @return void - */ - public function callSilent($class) - { - $this->call($class, true); - } - - /** - * Resolve an instance of the given seeder class. - * - * @param string $class - * @return \Illuminate\Database\Seeder - */ - protected function resolve($class) - { - if (isset($this->container)) { - $instance = $this->container->make($class); - - $instance->setContainer($this->container); - } else { - $instance = new $class; - } - - if (isset($this->command)) { - $instance->setCommand($this->command); - } - - return $instance; - } - - /** - * Set the IoC container instance. - * - * @param \Illuminate\Container\Container $container - * @return $this - */ - public function setContainer(Container $container) - { - $this->container = $container; - - return $this; - } - - /** - * Set the console command instance. - * - * @param \Illuminate\Console\Command $command - * @return $this - */ - public function setCommand(Command $command) - { - $this->command = $command; - - return $this; - } - - /** - * Run the database seeds. - * - * @return void - * - * @throws \InvalidArgumentException - */ - public function __invoke() - { - if (! method_exists($this, 'run')) { - throw new InvalidArgumentException('Method [run] missing from '.get_class($this)); - } - - return isset($this->container) - ? $this->container->call([$this, 'run']) - : $this->run(); - } -} diff --git a/vendor/illuminate/database/SqlServerConnection.php b/vendor/illuminate/database/SqlServerConnection.php deleted file mode 100644 index 9539563..0000000 --- a/vendor/illuminate/database/SqlServerConnection.php +++ /dev/null @@ -1,113 +0,0 @@ -<?php - -namespace Illuminate\Database; - -use Closure; -use Exception; -use Throwable; -use Illuminate\Database\Schema\SqlServerBuilder; -use Doctrine\DBAL\Driver\PDOSqlsrv\Driver as DoctrineDriver; -use Illuminate\Database\Query\Processors\SqlServerProcessor; -use Illuminate\Database\Query\Grammars\SqlServerGrammar as QueryGrammar; -use Illuminate\Database\Schema\Grammars\SqlServerGrammar as SchemaGrammar; - -class SqlServerConnection extends Connection -{ - /** - * Execute a Closure within a transaction. - * - * @param \Closure $callback - * @param int $attempts - * @return mixed - * - * @throws \Exception|\Throwable - */ - public function transaction(Closure $callback, $attempts = 1) - { - for ($a = 1; $a <= $attempts; $a++) { - if ($this->getDriverName() == 'sqlsrv') { - return parent::transaction($callback); - } - - $this->getPdo()->exec('BEGIN TRAN'); - - // We'll simply execute the given callback within a try / catch block - // and if we catch any exception we can rollback the transaction - // so that none of the changes are persisted to the database. - try { - $result = $callback($this); - - $this->getPdo()->exec('COMMIT TRAN'); - } - - // If we catch an exception, we will roll back so nothing gets messed - // up in the database. Then we'll re-throw the exception so it can - // be handled how the developer sees fit for their applications. - catch (Exception $e) { - $this->getPdo()->exec('ROLLBACK TRAN'); - - throw $e; - } catch (Throwable $e) { - $this->getPdo()->exec('ROLLBACK TRAN'); - - throw $e; - } - - return $result; - } - } - - /** - * Get the default query grammar instance. - * - * @return \Illuminate\Database\Query\Grammars\SqlServerGrammar - */ - protected function getDefaultQueryGrammar() - { - return $this->withTablePrefix(new QueryGrammar); - } - - /** - * Get a schema builder instance for the connection. - * - * @return \Illuminate\Database\Schema\SqlServerBuilder - */ - public function getSchemaBuilder() - { - if (is_null($this->schemaGrammar)) { - $this->useDefaultSchemaGrammar(); - } - - return new SqlServerBuilder($this); - } - - /** - * Get the default schema grammar instance. - * - * @return \Illuminate\Database\Schema\Grammars\SqlServerGrammar - */ - protected function getDefaultSchemaGrammar() - { - return $this->withTablePrefix(new SchemaGrammar); - } - - /** - * Get the default post processor instance. - * - * @return \Illuminate\Database\Query\Processors\SqlServerProcessor - */ - protected function getDefaultPostProcessor() - { - return new SqlServerProcessor; - } - - /** - * Get the Doctrine DBAL driver. - * - * @return \Doctrine\DBAL\Driver\PDOSqlsrv\Driver - */ - protected function getDoctrineDriver() - { - return new DoctrineDriver; - } -} diff --git a/vendor/illuminate/database/composer.json b/vendor/illuminate/database/composer.json deleted file mode 100644 index 153abad..0000000 --- a/vendor/illuminate/database/composer.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "illuminate/database", - "description": "The Illuminate Database package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "keywords": ["laravel", "database", "sql", "orm"], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": ">=7.0", - "illuminate/container": "5.5.*", - "illuminate/contracts": "5.5.*", - "illuminate/support": "5.5.*" - }, - "autoload": { - "psr-4": { - "Illuminate\\Database\\": "" - } - }, - "extra": { - "branch-alias": { - "dev-master": "5.5-dev" - } - }, - "suggest": { - "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.5).", - "fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).", - "illuminate/console": "Required to use the database commands (5.5.*).", - "illuminate/events": "Required to use the observers with Eloquent (5.5.*).", - "illuminate/filesystem": "Required to use the migrations (5.5.*).", - "illuminate/pagination": "Required to paginate the result set (5.5.*)." - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/illuminate/support/AggregateServiceProvider.php b/vendor/illuminate/support/AggregateServiceProvider.php deleted file mode 100644 index d7425c5..0000000 --- a/vendor/illuminate/support/AggregateServiceProvider.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -namespace Illuminate\Support; - -class AggregateServiceProvider extends ServiceProvider -{ - /** - * The provider class names. - * - * @var array - */ - protected $providers = []; - - /** - * An array of the service provider instances. - * - * @var array - */ - protected $instances = []; - - /** - * Register the service provider. - * - * @return void - */ - public function register() - { - $this->instances = []; - - foreach ($this->providers as $provider) { - $this->instances[] = $this->app->register($provider); - } - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - $provides = []; - - foreach ($this->providers as $provider) { - $instance = $this->app->resolveProvider($provider); - - $provides = array_merge($provides, $instance->provides()); - } - - return $provides; - } -} diff --git a/vendor/illuminate/support/Arr.php b/vendor/illuminate/support/Arr.php deleted file mode 100644 index 5cf83eb..0000000 --- a/vendor/illuminate/support/Arr.php +++ /dev/null @@ -1,610 +0,0 @@ -<?php - -namespace Illuminate\Support; - -use ArrayAccess; -use InvalidArgumentException; -use Illuminate\Support\Traits\Macroable; - -class Arr -{ - use Macroable; - - /** - * Determine whether the given value is array accessible. - * - * @param mixed $value - * @return bool - */ - public static function accessible($value) - { - return is_array($value) || $value instanceof ArrayAccess; - } - - /** - * Add an element to an array using "dot" notation if it doesn't exist. - * - * @param array $array - * @param string $key - * @param mixed $value - * @return array - */ - public static function add($array, $key, $value) - { - if (is_null(static::get($array, $key))) { - static::set($array, $key, $value); - } - - return $array; - } - - /** - * Collapse an array of arrays into a single array. - * - * @param array $array - * @return array - */ - public static function collapse($array) - { - $results = []; - - foreach ($array as $values) { - if ($values instanceof Collection) { - $values = $values->all(); - } elseif (! is_array($values)) { - continue; - } - - $results = array_merge($results, $values); - } - - return $results; - } - - /** - * Cross join the given arrays, returning all possible permutations. - * - * @param array ...$arrays - * @return array - */ - public static function crossJoin(...$arrays) - { - $results = [[]]; - - foreach ($arrays as $index => $array) { - $append = []; - - foreach ($results as $product) { - foreach ($array as $item) { - $product[$index] = $item; - - $append[] = $product; - } - } - - $results = $append; - } - - return $results; - } - - /** - * Divide an array into two arrays. One with keys and the other with values. - * - * @param array $array - * @return array - */ - public static function divide($array) - { - return [array_keys($array), array_values($array)]; - } - - /** - * Flatten a multi-dimensional associative array with dots. - * - * @param array $array - * @param string $prepend - * @return array - */ - public static function dot($array, $prepend = '') - { - $results = []; - - foreach ($array as $key => $value) { - if (is_array($value) && ! empty($value)) { - $results = array_merge($results, static::dot($value, $prepend.$key.'.')); - } else { - $results[$prepend.$key] = $value; - } - } - - return $results; - } - - /** - * Get all of the given array except for a specified array of keys. - * - * @param array $array - * @param array|string $keys - * @return array - */ - public static function except($array, $keys) - { - static::forget($array, $keys); - - return $array; - } - - /** - * Determine if the given key exists in the provided array. - * - * @param \ArrayAccess|array $array - * @param string|int $key - * @return bool - */ - public static function exists($array, $key) - { - if ($array instanceof ArrayAccess) { - return $array->offsetExists($key); - } - - return array_key_exists($key, $array); - } - - /** - * Return the first element in an array passing a given truth test. - * - * @param array $array - * @param callable|null $callback - * @param mixed $default - * @return mixed - */ - public static function first($array, callable $callback = null, $default = null) - { - if (is_null($callback)) { - if (empty($array)) { - return value($default); - } - - foreach ($array as $item) { - return $item; - } - } - - foreach ($array as $key => $value) { - if (call_user_func($callback, $value, $key)) { - return $value; - } - } - - return value($default); - } - - /** - * Return the last element in an array passing a given truth test. - * - * @param array $array - * @param callable|null $callback - * @param mixed $default - * @return mixed - */ - public static function last($array, callable $callback = null, $default = null) - { - if (is_null($callback)) { - return empty($array) ? value($default) : end($array); - } - - return static::first(array_reverse($array, true), $callback, $default); - } - - /** - * Flatten a multi-dimensional array into a single level. - * - * @param array $array - * @param int $depth - * @return array - */ - public static function flatten($array, $depth = INF) - { - $result = []; - - foreach ($array as $item) { - $item = $item instanceof Collection ? $item->all() : $item; - - if (! is_array($item)) { - $result[] = $item; - } elseif ($depth === 1) { - $result = array_merge($result, array_values($item)); - } else { - $result = array_merge($result, static::flatten($item, $depth - 1)); - } - } - - return $result; - } - - /** - * Remove one or many array items from a given array using "dot" notation. - * - * @param array $array - * @param array|string $keys - * @return void - */ - public static function forget(&$array, $keys) - { - $original = &$array; - - $keys = (array) $keys; - - if (count($keys) === 0) { - return; - } - - foreach ($keys as $key) { - // if the exact key exists in the top-level, remove it - if (static::exists($array, $key)) { - unset($array[$key]); - - continue; - } - - $parts = explode('.', $key); - - // clean up before each pass - $array = &$original; - - while (count($parts) > 1) { - $part = array_shift($parts); - - if (isset($array[$part]) && is_array($array[$part])) { - $array = &$array[$part]; - } else { - continue 2; - } - } - - unset($array[array_shift($parts)]); - } - } - - /** - * Get an item from an array using "dot" notation. - * - * @param \ArrayAccess|array $array - * @param string $key - * @param mixed $default - * @return mixed - */ - public static function get($array, $key, $default = null) - { - if (! static::accessible($array)) { - return value($default); - } - - if (is_null($key)) { - return $array; - } - - if (static::exists($array, $key)) { - return $array[$key]; - } - - if (strpos($key, '.') === false) { - return $array[$key] ?? value($default); - } - - foreach (explode('.', $key) as $segment) { - if (static::accessible($array) && static::exists($array, $segment)) { - $array = $array[$segment]; - } else { - return value($default); - } - } - - return $array; - } - - /** - * Check if an item or items exist in an array using "dot" notation. - * - * @param \ArrayAccess|array $array - * @param string|array $keys - * @return bool - */ - public static function has($array, $keys) - { - if (is_null($keys)) { - return false; - } - - $keys = (array) $keys; - - if (! $array) { - return false; - } - - if ($keys === []) { - return false; - } - - foreach ($keys as $key) { - $subKeyArray = $array; - - if (static::exists($array, $key)) { - continue; - } - - foreach (explode('.', $key) as $segment) { - if (static::accessible($subKeyArray) && static::exists($subKeyArray, $segment)) { - $subKeyArray = $subKeyArray[$segment]; - } else { - return false; - } - } - } - - return true; - } - - /** - * Determines if an array is associative. - * - * An array is "associative" if it doesn't have sequential numerical keys beginning with zero. - * - * @param array $array - * @return bool - */ - public static function isAssoc(array $array) - { - $keys = array_keys($array); - - return array_keys($keys) !== $keys; - } - - /** - * Get a subset of the items from the given array. - * - * @param array $array - * @param array|string $keys - * @return array - */ - public static function only($array, $keys) - { - return array_intersect_key($array, array_flip((array) $keys)); - } - - /** - * Pluck an array of values from an array. - * - * @param array $array - * @param string|array $value - * @param string|array|null $key - * @return array - */ - public static function pluck($array, $value, $key = null) - { - $results = []; - - list($value, $key) = static::explodePluckParameters($value, $key); - - foreach ($array as $item) { - $itemValue = data_get($item, $value); - - // If the key is "null", we will just append the value to the array and keep - // looping. Otherwise we will key the array using the value of the key we - // received from the developer. Then we'll return the final array form. - if (is_null($key)) { - $results[] = $itemValue; - } else { - $itemKey = data_get($item, $key); - - if (is_object($itemKey) && method_exists($itemKey, '__toString')) { - $itemKey = (string) $itemKey; - } - - $results[$itemKey] = $itemValue; - } - } - - return $results; - } - - /** - * Explode the "value" and "key" arguments passed to "pluck". - * - * @param string|array $value - * @param string|array|null $key - * @return array - */ - protected static function explodePluckParameters($value, $key) - { - $value = is_string($value) ? explode('.', $value) : $value; - - $key = is_null($key) || is_array($key) ? $key : explode('.', $key); - - return [$value, $key]; - } - - /** - * Push an item onto the beginning of an array. - * - * @param array $array - * @param mixed $value - * @param mixed $key - * @return array - */ - public static function prepend($array, $value, $key = null) - { - if (is_null($key)) { - array_unshift($array, $value); - } else { - $array = [$key => $value] + $array; - } - - return $array; - } - - /** - * Get a value from the array, and remove it. - * - * @param array $array - * @param string $key - * @param mixed $default - * @return mixed - */ - public static function pull(&$array, $key, $default = null) - { - $value = static::get($array, $key, $default); - - static::forget($array, $key); - - return $value; - } - - /** - * Get one or a specified number of random values from an array. - * - * @param array $array - * @param int|null $number - * @return mixed - * - * @throws \InvalidArgumentException - */ - public static function random($array, $number = null) - { - $requested = is_null($number) ? 1 : $number; - - $count = count($array); - - if ($requested > $count) { - throw new InvalidArgumentException( - "You requested {$requested} items, but there are only {$count} items available." - ); - } - - if (is_null($number)) { - return $array[array_rand($array)]; - } - - if ((int) $number === 0) { - return []; - } - - $keys = array_rand($array, $number); - - $results = []; - - foreach ((array) $keys as $key) { - $results[] = $array[$key]; - } - - return $results; - } - - /** - * Set an array item to a given value using "dot" notation. - * - * If no key is given to the method, the entire array will be replaced. - * - * @param array $array - * @param string $key - * @param mixed $value - * @return array - */ - public static function set(&$array, $key, $value) - { - if (is_null($key)) { - return $array = $value; - } - - $keys = explode('.', $key); - - while (count($keys) > 1) { - $key = array_shift($keys); - - // If the key doesn't exist at this depth, we will just create an empty array - // to hold the next value, allowing us to create the arrays to hold final - // values at the correct depth. Then we'll keep digging into the array. - if (! isset($array[$key]) || ! is_array($array[$key])) { - $array[$key] = []; - } - - $array = &$array[$key]; - } - - $array[array_shift($keys)] = $value; - - return $array; - } - - /** - * Shuffle the given array and return the result. - * - * @param array $array - * @return array - */ - public static function shuffle($array) - { - shuffle($array); - - return $array; - } - - /** - * Sort the array using the given callback or "dot" notation. - * - * @param array $array - * @param callable|string|null $callback - * @return array - */ - public static function sort($array, $callback = null) - { - return Collection::make($array)->sortBy($callback)->all(); - } - - /** - * Recursively sort an array by keys and values. - * - * @param array $array - * @return array - */ - public static function sortRecursive($array) - { - foreach ($array as &$value) { - if (is_array($value)) { - $value = static::sortRecursive($value); - } - } - - if (static::isAssoc($array)) { - ksort($array); - } else { - sort($array); - } - - return $array; - } - - /** - * Filter the array using the given callback. - * - * @param array $array - * @param callable $callback - * @return array - */ - public static function where($array, callable $callback) - { - return array_filter($array, $callback, ARRAY_FILTER_USE_BOTH); - } - - /** - * If the given value is not an array, wrap it in one. - * - * @param mixed $value - * @return array - */ - public static function wrap($value) - { - return ! is_array($value) ? [$value] : $value; - } -} diff --git a/vendor/illuminate/support/Carbon.php b/vendor/illuminate/support/Carbon.php deleted file mode 100644 index db1bdbe..0000000 --- a/vendor/illuminate/support/Carbon.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - -namespace Illuminate\Support; - -use JsonSerializable; -use Carbon\Carbon as BaseCarbon; -use Illuminate\Support\Traits\Macroable; - -class Carbon extends BaseCarbon implements JsonSerializable -{ - use Macroable; - - /** - * The custom Carbon JSON serializer. - * - * @var callable|null - */ - protected static $serializer; - - /** - * Prepare the object for JSON serialization. - * - * @return array|string - */ - public function jsonSerialize() - { - if (static::$serializer) { - return call_user_func(static::$serializer, $this); - } - - $carbon = $this; - - return call_user_func(function () use ($carbon) { - return get_object_vars($carbon); - }); - } - - /** - * JSON serialize all Carbon instances using the given callback. - * - * @param callable $callback - * @return void - */ - public static function serializeUsing($callback) - { - static::$serializer = $callback; - } -} diff --git a/vendor/illuminate/support/Collection.php b/vendor/illuminate/support/Collection.php deleted file mode 100644 index 38dd526..0000000 --- a/vendor/illuminate/support/Collection.php +++ /dev/null @@ -1,1798 +0,0 @@ -<?php - -namespace Illuminate\Support; - -use stdClass; -use Countable; -use Exception; -use ArrayAccess; -use Traversable; -use ArrayIterator; -use CachingIterator; -use JsonSerializable; -use IteratorAggregate; -use Illuminate\Support\Debug\Dumper; -use Illuminate\Support\Traits\Macroable; -use Illuminate\Contracts\Support\Jsonable; -use Illuminate\Contracts\Support\Arrayable; - -class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate, Jsonable, JsonSerializable -{ - use Macroable; - - /** - * The items contained in the collection. - * - * @var array - */ - protected $items = []; - - /** - * The methods that can be proxied. - * - * @var array - */ - protected static $proxies = [ - 'average', 'avg', 'contains', 'each', 'every', 'filter', 'first', 'flatMap', - 'keyBy', 'map', 'partition', 'reject', 'sortBy', 'sortByDesc', 'sum', 'unique', - ]; - - /** - * Create a new collection. - * - * @param mixed $items - * @return void - */ - public function __construct($items = []) - { - $this->items = $this->getArrayableItems($items); - } - - /** - * Create a new collection instance if the value isn't one already. - * - * @param mixed $items - * @return static - */ - public static function make($items = []) - { - return new static($items); - } - - /** - * Wrap the given value in a collection if applicable. - * - * @param mixed $value - * @return static - */ - public static function wrap($value) - { - return $value instanceof self - ? new static($value) - : new static(Arr::wrap($value)); - } - - /** - * Get the underlying items from the given collection if applicable. - * - * @param array|static $value - * @return array - */ - public static function unwrap($value) - { - return $value instanceof self ? $value->all() : $value; - } - - /** - * Create a new collection by invoking the callback a given amount of times. - * - * @param int $number - * @param callable $callback - * @return static - */ - public static function times($number, callable $callback = null) - { - if ($number < 1) { - return new static; - } - - if (is_null($callback)) { - return new static(range(1, $number)); - } - - return (new static(range(1, $number)))->map($callback); - } - - /** - * Get all of the items in the collection. - * - * @return array - */ - public function all() - { - return $this->items; - } - - /** - * Get the average value of a given key. - * - * @param callable|string|null $callback - * @return mixed - */ - public function avg($callback = null) - { - if ($count = $this->count()) { - return $this->sum($callback) / $count; - } - } - - /** - * Alias for the "avg" method. - * - * @param callable|string|null $callback - * @return mixed - */ - public function average($callback = null) - { - return $this->avg($callback); - } - - /** - * Get the median of a given key. - * - * @param null $key - * @return mixed - */ - public function median($key = null) - { - $count = $this->count(); - - if ($count == 0) { - return; - } - - $values = (isset($key) ? $this->pluck($key) : $this) - ->sort()->values(); - - $middle = (int) ($count / 2); - - if ($count % 2) { - return $values->get($middle); - } - - return (new static([ - $values->get($middle - 1), $values->get($middle), - ]))->average(); - } - - /** - * Get the mode of a given key. - * - * @param mixed $key - * @return array|null - */ - public function mode($key = null) - { - $count = $this->count(); - - if ($count == 0) { - return; - } - - $collection = isset($key) ? $this->pluck($key) : $this; - - $counts = new self; - - $collection->each(function ($value) use ($counts) { - $counts[$value] = isset($counts[$value]) ? $counts[$value] + 1 : 1; - }); - - $sorted = $counts->sort(); - - $highestValue = $sorted->last(); - - return $sorted->filter(function ($value) use ($highestValue) { - return $value == $highestValue; - })->sort()->keys()->all(); - } - - /** - * Collapse the collection of items into a single array. - * - * @return static - */ - public function collapse() - { - return new static(Arr::collapse($this->items)); - } - - /** - * Determine if an item exists in the collection. - * - * @param mixed $key - * @param mixed $operator - * @param mixed $value - * @return bool - */ - public function contains($key, $operator = null, $value = null) - { - if (func_num_args() == 1) { - if ($this->useAsCallable($key)) { - $placeholder = new stdClass; - - return $this->first($key, $placeholder) !== $placeholder; - } - - return in_array($key, $this->items); - } - - return $this->contains($this->operatorForWhere(...func_get_args())); - } - - /** - * Determine if an item exists in the collection using strict comparison. - * - * @param mixed $key - * @param mixed $value - * @return bool - */ - public function containsStrict($key, $value = null) - { - if (func_num_args() == 2) { - return $this->contains(function ($item) use ($key, $value) { - return data_get($item, $key) === $value; - }); - } - - if ($this->useAsCallable($key)) { - return ! is_null($this->first($key)); - } - - return in_array($key, $this->items, true); - } - - /** - * Cross join with the given lists, returning all possible permutations. - * - * @param mixed ...$lists - * @return static - */ - public function crossJoin(...$lists) - { - return new static(Arr::crossJoin( - $this->items, ...array_map([$this, 'getArrayableItems'], $lists) - )); - } - - /** - * Dump the collection and end the script. - * - * @return void - */ - public function dd(...$args) - { - http_response_code(500); - - call_user_func_array([$this, 'dump'], $args); - - die(1); - } - - /** - * Dump the collection. - * - * @return $this - */ - public function dump() - { - (new static(func_get_args())) - ->push($this) - ->each(function ($item) { - (new Dumper)->dump($item); - }); - - return $this; - } - - /** - * Get the items in the collection that are not present in the given items. - * - * @param mixed $items - * @return static - */ - public function diff($items) - { - return new static(array_diff($this->items, $this->getArrayableItems($items))); - } - - /** - * Get the items in the collection whose keys and values are not present in the given items. - * - * @param mixed $items - * @return static - */ - public function diffAssoc($items) - { - return new static(array_diff_assoc($this->items, $this->getArrayableItems($items))); - } - - /** - * Get the items in the collection whose keys are not present in the given items. - * - * @param mixed $items - * @return static - */ - public function diffKeys($items) - { - return new static(array_diff_key($this->items, $this->getArrayableItems($items))); - } - - /** - * Execute a callback over each item. - * - * @param callable $callback - * @return $this - */ - public function each(callable $callback) - { - foreach ($this->items as $key => $item) { - if ($callback($item, $key) === false) { - break; - } - } - - return $this; - } - - /** - * Execute a callback over each nested chunk of items. - * - * @param callable $callback - * @return static - */ - public function eachSpread(callable $callback) - { - return $this->each(function ($chunk, $key) use ($callback) { - $chunk[] = $key; - - return $callback(...$chunk); - }); - } - - /** - * Determine if all items in the collection pass the given test. - * - * @param string|callable $key - * @param mixed $operator - * @param mixed $value - * @return bool - */ - public function every($key, $operator = null, $value = null) - { - if (func_num_args() == 1) { - $callback = $this->valueRetriever($key); - - foreach ($this->items as $k => $v) { - if (! $callback($v, $k)) { - return false; - } - } - - return true; - } - - return $this->every($this->operatorForWhere(...func_get_args())); - } - - /** - * Get all items except for those with the specified keys. - * - * @param \Illuminate\Support\Collection|mixed $keys - * @return static - */ - public function except($keys) - { - if ($keys instanceof self) { - $keys = $keys->all(); - } elseif (! is_array($keys)) { - $keys = func_get_args(); - } - - return new static(Arr::except($this->items, $keys)); - } - - /** - * Run a filter over each of the items. - * - * @param callable|null $callback - * @return static - */ - public function filter(callable $callback = null) - { - if ($callback) { - return new static(Arr::where($this->items, $callback)); - } - - return new static(array_filter($this->items)); - } - - /** - * Apply the callback if the value is truthy. - * - * @param bool $value - * @param callable $callback - * @param callable $default - * @return mixed - */ - public function when($value, callable $callback, callable $default = null) - { - if ($value) { - return $callback($this, $value); - } elseif ($default) { - return $default($this, $value); - } - - return $this; - } - - /** - * Apply the callback if the value is falsy. - * - * @param bool $value - * @param callable $callback - * @param callable $default - * @return mixed - */ - public function unless($value, callable $callback, callable $default = null) - { - return $this->when(! $value, $callback, $default); - } - - /** - * Filter items by the given key value pair. - * - * @param string $key - * @param mixed $operator - * @param mixed $value - * @return static - */ - public function where($key, $operator, $value = null) - { - return $this->filter($this->operatorForWhere(...func_get_args())); - } - - /** - * Get an operator checker callback. - * - * @param string $key - * @param string $operator - * @param mixed $value - * @return \Closure - */ - protected function operatorForWhere($key, $operator, $value = null) - { - if (func_num_args() == 2) { - $value = $operator; - - $operator = '='; - } - - return function ($item) use ($key, $operator, $value) { - $retrieved = data_get($item, $key); - - $strings = array_filter([$retrieved, $value], function ($value) { - return is_string($value) || (is_object($value) && method_exists($value, '__toString')); - }); - - if (count($strings) < 2 && count(array_filter([$retrieved, $value], 'is_object')) == 1) { - return in_array($operator, ['!=', '<>', '!==']); - } - - switch ($operator) { - default: - case '=': - case '==': return $retrieved == $value; - case '!=': - case '<>': return $retrieved != $value; - case '<': return $retrieved < $value; - case '>': return $retrieved > $value; - case '<=': return $retrieved <= $value; - case '>=': return $retrieved >= $value; - case '===': return $retrieved === $value; - case '!==': return $retrieved !== $value; - } - }; - } - - /** - * Filter items by the given key value pair using strict comparison. - * - * @param string $key - * @param mixed $value - * @return static - */ - public function whereStrict($key, $value) - { - return $this->where($key, '===', $value); - } - - /** - * Filter items by the given key value pair. - * - * @param string $key - * @param mixed $values - * @param bool $strict - * @return static - */ - public function whereIn($key, $values, $strict = false) - { - $values = $this->getArrayableItems($values); - - return $this->filter(function ($item) use ($key, $values, $strict) { - return in_array(data_get($item, $key), $values, $strict); - }); - } - - /** - * Filter items by the given key value pair using strict comparison. - * - * @param string $key - * @param mixed $values - * @return static - */ - public function whereInStrict($key, $values) - { - return $this->whereIn($key, $values, true); - } - - /** - * Filter items by the given key value pair. - * - * @param string $key - * @param mixed $values - * @param bool $strict - * @return static - */ - public function whereNotIn($key, $values, $strict = false) - { - $values = $this->getArrayableItems($values); - - return $this->reject(function ($item) use ($key, $values, $strict) { - return in_array(data_get($item, $key), $values, $strict); - }); - } - - /** - * Filter items by the given key value pair using strict comparison. - * - * @param string $key - * @param mixed $values - * @return static - */ - public function whereNotInStrict($key, $values) - { - return $this->whereNotIn($key, $values, true); - } - - /** - * Get the first item from the collection. - * - * @param callable|null $callback - * @param mixed $default - * @return mixed - */ - public function first(callable $callback = null, $default = null) - { - return Arr::first($this->items, $callback, $default); - } - - /** - * Get the first item by the given key value pair. - * - * @param string $key - * @param mixed $operator - * @param mixed $value - * @return static - */ - public function firstWhere($key, $operator, $value = null) - { - return $this->first($this->operatorForWhere(...func_get_args())); - } - - /** - * Get a flattened array of the items in the collection. - * - * @param int $depth - * @return static - */ - public function flatten($depth = INF) - { - return new static(Arr::flatten($this->items, $depth)); - } - - /** - * Flip the items in the collection. - * - * @return static - */ - public function flip() - { - return new static(array_flip($this->items)); - } - - /** - * Remove an item from the collection by key. - * - * @param string|array $keys - * @return $this - */ - public function forget($keys) - { - foreach ((array) $keys as $key) { - $this->offsetUnset($key); - } - - return $this; - } - - /** - * Get an item from the collection by key. - * - * @param mixed $key - * @param mixed $default - * @return mixed - */ - public function get($key, $default = null) - { - if ($this->offsetExists($key)) { - return $this->items[$key]; - } - - return value($default); - } - - /** - * Group an associative array by a field or using a callback. - * - * @param callable|string $groupBy - * @param bool $preserveKeys - * @return static - */ - public function groupBy($groupBy, $preserveKeys = false) - { - if (is_array($groupBy)) { - $nextGroups = $groupBy; - - $groupBy = array_shift($nextGroups); - } - - $groupBy = $this->valueRetriever($groupBy); - - $results = []; - - foreach ($this->items as $key => $value) { - $groupKeys = $groupBy($value, $key); - - if (! is_array($groupKeys)) { - $groupKeys = [$groupKeys]; - } - - foreach ($groupKeys as $groupKey) { - $groupKey = is_bool($groupKey) ? (int) $groupKey : $groupKey; - - if (! array_key_exists($groupKey, $results)) { - $results[$groupKey] = new static; - } - - $results[$groupKey]->offsetSet($preserveKeys ? $key : null, $value); - } - } - - $result = new static($results); - - if (! empty($nextGroups)) { - return $result->map->groupBy($nextGroups, $preserveKeys); - } - - return $result; - } - - /** - * Key an associative array by a field or using a callback. - * - * @param callable|string $keyBy - * @return static - */ - public function keyBy($keyBy) - { - $keyBy = $this->valueRetriever($keyBy); - - $results = []; - - foreach ($this->items as $key => $item) { - $resolvedKey = $keyBy($item, $key); - - if (is_object($resolvedKey)) { - $resolvedKey = (string) $resolvedKey; - } - - $results[$resolvedKey] = $item; - } - - return new static($results); - } - - /** - * Determine if an item exists in the collection by key. - * - * @param mixed $key - * @return bool - */ - public function has($key) - { - $keys = is_array($key) ? $key : func_get_args(); - - foreach ($keys as $value) { - if (! $this->offsetExists($value)) { - return false; - } - } - - return true; - } - - /** - * Concatenate values of a given key as a string. - * - * @param string $value - * @param string $glue - * @return string - */ - public function implode($value, $glue = null) - { - $first = $this->first(); - - if (is_array($first) || is_object($first)) { - return implode($glue, $this->pluck($value)->all()); - } - - return implode($value, $this->items); - } - - /** - * Intersect the collection with the given items. - * - * @param mixed $items - * @return static - */ - public function intersect($items) - { - return new static(array_intersect($this->items, $this->getArrayableItems($items))); - } - - /** - * Intersect the collection with the given items by key. - * - * @param mixed $items - * @return static - */ - public function intersectByKeys($items) - { - return new static(array_intersect_key( - $this->items, $this->getArrayableItems($items) - )); - } - - /** - * Determine if the collection is empty or not. - * - * @return bool - */ - public function isEmpty() - { - return empty($this->items); - } - - /** - * Determine if the collection is not empty. - * - * @return bool - */ - public function isNotEmpty() - { - return ! $this->isEmpty(); - } - - /** - * Determine if the given value is callable, but not a string. - * - * @param mixed $value - * @return bool - */ - protected function useAsCallable($value) - { - return ! is_string($value) && is_callable($value); - } - - /** - * Get the keys of the collection items. - * - * @return static - */ - public function keys() - { - return new static(array_keys($this->items)); - } - - /** - * Get the last item from the collection. - * - * @param callable|null $callback - * @param mixed $default - * @return mixed - */ - public function last(callable $callback = null, $default = null) - { - return Arr::last($this->items, $callback, $default); - } - - /** - * Get the values of a given key. - * - * @param string|array $value - * @param string|null $key - * @return static - */ - public function pluck($value, $key = null) - { - return new static(Arr::pluck($this->items, $value, $key)); - } - - /** - * Run a map over each of the items. - * - * @param callable $callback - * @return static - */ - public function map(callable $callback) - { - $keys = array_keys($this->items); - - $items = array_map($callback, $this->items, $keys); - - return new static(array_combine($keys, $items)); - } - - /** - * Run a map over each nested chunk of items. - * - * @param callable $callback - * @return static - */ - public function mapSpread(callable $callback) - { - return $this->map(function ($chunk, $key) use ($callback) { - $chunk[] = $key; - - return $callback(...$chunk); - }); - } - - /** - * Run a dictionary map over the items. - * - * The callback should return an associative array with a single key/value pair. - * - * @param callable $callback - * @return static - */ - public function mapToDictionary(callable $callback) - { - $dictionary = $this->map($callback)->reduce(function ($groups, $pair) { - $groups[key($pair)][] = reset($pair); - - return $groups; - }, []); - - return new static($dictionary); - } - - /** - * Run a grouping map over the items. - * - * The callback should return an associative array with a single key/value pair. - * - * @param callable $callback - * @return static - */ - public function mapToGroups(callable $callback) - { - $groups = $this->mapToDictionary($callback); - - return $groups->map([$this, 'make']); - } - - /** - * Run an associative map over each of the items. - * - * The callback should return an associative array with a single key/value pair. - * - * @param callable $callback - * @return static - */ - public function mapWithKeys(callable $callback) - { - $result = []; - - foreach ($this->items as $key => $value) { - $assoc = $callback($value, $key); - - foreach ($assoc as $mapKey => $mapValue) { - $result[$mapKey] = $mapValue; - } - } - - return new static($result); - } - - /** - * Map a collection and flatten the result by a single level. - * - * @param callable $callback - * @return static - */ - public function flatMap(callable $callback) - { - return $this->map($callback)->collapse(); - } - - /** - * Map the values into a new class. - * - * @param string $class - * @return static - */ - public function mapInto($class) - { - return $this->map(function ($value, $key) use ($class) { - return new $class($value, $key); - }); - } - - /** - * Get the max value of a given key. - * - * @param callable|string|null $callback - * @return mixed - */ - public function max($callback = null) - { - $callback = $this->valueRetriever($callback); - - return $this->filter(function ($value) { - return ! is_null($value); - })->reduce(function ($result, $item) use ($callback) { - $value = $callback($item); - - return is_null($result) || $value > $result ? $value : $result; - }); - } - - /** - * Merge the collection with the given items. - * - * @param mixed $items - * @return static - */ - public function merge($items) - { - return new static(array_merge($this->items, $this->getArrayableItems($items))); - } - - /** - * Create a collection by using this collection for keys and another for its values. - * - * @param mixed $values - * @return static - */ - public function combine($values) - { - return new static(array_combine($this->all(), $this->getArrayableItems($values))); - } - - /** - * Union the collection with the given items. - * - * @param mixed $items - * @return static - */ - public function union($items) - { - return new static($this->items + $this->getArrayableItems($items)); - } - - /** - * Get the min value of a given key. - * - * @param callable|string|null $callback - * @return mixed - */ - public function min($callback = null) - { - $callback = $this->valueRetriever($callback); - - return $this->filter(function ($value) { - return ! is_null($value); - })->reduce(function ($result, $item) use ($callback) { - $value = $callback($item); - - return is_null($result) || $value < $result ? $value : $result; - }); - } - - /** - * Create a new collection consisting of every n-th element. - * - * @param int $step - * @param int $offset - * @return static - */ - public function nth($step, $offset = 0) - { - $new = []; - - $position = 0; - - foreach ($this->items as $item) { - if ($position % $step === $offset) { - $new[] = $item; - } - - $position++; - } - - return new static($new); - } - - /** - * Get the items with the specified keys. - * - * @param mixed $keys - * @return static - */ - public function only($keys) - { - if (is_null($keys)) { - return new static($this->items); - } - - if ($keys instanceof self) { - $keys = $keys->all(); - } - - $keys = is_array($keys) ? $keys : func_get_args(); - - return new static(Arr::only($this->items, $keys)); - } - - /** - * "Paginate" the collection by slicing it into a smaller collection. - * - * @param int $page - * @param int $perPage - * @return static - */ - public function forPage($page, $perPage) - { - $offset = max(0, ($page - 1) * $perPage); - - return $this->slice($offset, $perPage); - } - - /** - * Partition the collection into two arrays using the given callback or key. - * - * @param callable|string $callback - * @return static - */ - public function partition($callback) - { - $partitions = [new static, new static]; - - $callback = $this->valueRetriever($callback); - - foreach ($this->items as $key => $item) { - $partitions[(int) ! $callback($item, $key)][$key] = $item; - } - - return new static($partitions); - } - - /** - * Pass the collection to the given callback and return the result. - * - * @param callable $callback - * @return mixed - */ - public function pipe(callable $callback) - { - return $callback($this); - } - - /** - * Get and remove the last item from the collection. - * - * @return mixed - */ - public function pop() - { - return array_pop($this->items); - } - - /** - * Push an item onto the beginning of the collection. - * - * @param mixed $value - * @param mixed $key - * @return $this - */ - public function prepend($value, $key = null) - { - $this->items = Arr::prepend($this->items, $value, $key); - - return $this; - } - - /** - * Push an item onto the end of the collection. - * - * @param mixed $value - * @return $this - */ - public function push($value) - { - $this->offsetSet(null, $value); - - return $this; - } - - /** - * Push all of the given items onto the collection. - * - * @param \Traversable $source - * @return $this - */ - public function concat($source) - { - $result = new static($this); - - foreach ($source as $item) { - $result->push($item); - } - - return $result; - } - - /** - * Get and remove an item from the collection. - * - * @param mixed $key - * @param mixed $default - * @return mixed - */ - public function pull($key, $default = null) - { - return Arr::pull($this->items, $key, $default); - } - - /** - * Put an item in the collection by key. - * - * @param mixed $key - * @param mixed $value - * @return $this - */ - public function put($key, $value) - { - $this->offsetSet($key, $value); - - return $this; - } - - /** - * Get one or a specified number of items randomly from the collection. - * - * @param int|null $number - * @return mixed - * - * @throws \InvalidArgumentException - */ - public function random($number = null) - { - if (is_null($number)) { - return Arr::random($this->items); - } - - return new static(Arr::random($this->items, $number)); - } - - /** - * Reduce the collection to a single value. - * - * @param callable $callback - * @param mixed $initial - * @return mixed - */ - public function reduce(callable $callback, $initial = null) - { - return array_reduce($this->items, $callback, $initial); - } - - /** - * Create a collection of all elements that do not pass a given truth test. - * - * @param callable|mixed $callback - * @return static - */ - public function reject($callback) - { - if ($this->useAsCallable($callback)) { - return $this->filter(function ($value, $key) use ($callback) { - return ! $callback($value, $key); - }); - } - - return $this->filter(function ($item) use ($callback) { - return $item != $callback; - }); - } - - /** - * Reverse items order. - * - * @return static - */ - public function reverse() - { - return new static(array_reverse($this->items, true)); - } - - /** - * Search the collection for a given value and return the corresponding key if successful. - * - * @param mixed $value - * @param bool $strict - * @return mixed - */ - public function search($value, $strict = false) - { - if (! $this->useAsCallable($value)) { - return array_search($value, $this->items, $strict); - } - - foreach ($this->items as $key => $item) { - if (call_user_func($value, $item, $key)) { - return $key; - } - } - - return false; - } - - /** - * Get and remove the first item from the collection. - * - * @return mixed - */ - public function shift() - { - return array_shift($this->items); - } - - /** - * Shuffle the items in the collection. - * - * @param int $seed - * @return static - */ - public function shuffle($seed = null) - { - $items = $this->items; - - if (is_null($seed)) { - shuffle($items); - } else { - srand($seed); - - usort($items, function () { - return rand(-1, 1); - }); - } - - return new static($items); - } - - /** - * Slice the underlying collection array. - * - * @param int $offset - * @param int $length - * @return static - */ - public function slice($offset, $length = null) - { - return new static(array_slice($this->items, $offset, $length, true)); - } - - /** - * Split a collection into a certain number of groups. - * - * @param int $numberOfGroups - * @return static - */ - public function split($numberOfGroups) - { - if ($this->isEmpty()) { - return new static; - } - - $groupSize = ceil($this->count() / $numberOfGroups); - - return $this->chunk($groupSize); - } - - /** - * Chunk the underlying collection array. - * - * @param int $size - * @return static - */ - public function chunk($size) - { - if ($size <= 0) { - return new static; - } - - $chunks = []; - - foreach (array_chunk($this->items, $size, true) as $chunk) { - $chunks[] = new static($chunk); - } - - return new static($chunks); - } - - /** - * Sort through each item with a callback. - * - * @param callable|null $callback - * @return static - */ - public function sort(callable $callback = null) - { - $items = $this->items; - - $callback - ? uasort($items, $callback) - : asort($items); - - return new static($items); - } - - /** - * Sort the collection using the given callback. - * - * @param callable|string $callback - * @param int $options - * @param bool $descending - * @return static - */ - public function sortBy($callback, $options = SORT_REGULAR, $descending = false) - { - $results = []; - - $callback = $this->valueRetriever($callback); - - // First we will loop through the items and get the comparator from a callback - // function which we were given. Then, we will sort the returned values and - // and grab the corresponding values for the sorted keys from this array. - foreach ($this->items as $key => $value) { - $results[$key] = $callback($value, $key); - } - - $descending ? arsort($results, $options) - : asort($results, $options); - - // Once we have sorted all of the keys in the array, we will loop through them - // and grab the corresponding model so we can set the underlying items list - // to the sorted version. Then we'll just return the collection instance. - foreach (array_keys($results) as $key) { - $results[$key] = $this->items[$key]; - } - - return new static($results); - } - - /** - * Sort the collection in descending order using the given callback. - * - * @param callable|string $callback - * @param int $options - * @return static - */ - public function sortByDesc($callback, $options = SORT_REGULAR) - { - return $this->sortBy($callback, $options, true); - } - - /** - * Splice a portion of the underlying collection array. - * - * @param int $offset - * @param int|null $length - * @param mixed $replacement - * @return static - */ - public function splice($offset, $length = null, $replacement = []) - { - if (func_num_args() == 1) { - return new static(array_splice($this->items, $offset)); - } - - return new static(array_splice($this->items, $offset, $length, $replacement)); - } - - /** - * Get the sum of the given values. - * - * @param callable|string|null $callback - * @return mixed - */ - public function sum($callback = null) - { - if (is_null($callback)) { - return array_sum($this->items); - } - - $callback = $this->valueRetriever($callback); - - return $this->reduce(function ($result, $item) use ($callback) { - return $result + $callback($item); - }, 0); - } - - /** - * Take the first or last {$limit} items. - * - * @param int $limit - * @return static - */ - public function take($limit) - { - if ($limit < 0) { - return $this->slice($limit, abs($limit)); - } - - return $this->slice(0, $limit); - } - - /** - * Pass the collection to the given callback and then return it. - * - * @param callable $callback - * @return $this - */ - public function tap(callable $callback) - { - $callback(new static($this->items)); - - return $this; - } - - /** - * Transform each item in the collection using a callback. - * - * @param callable $callback - * @return $this - */ - public function transform(callable $callback) - { - $this->items = $this->map($callback)->all(); - - return $this; - } - - /** - * Return only unique items from the collection array. - * - * @param string|callable|null $key - * @param bool $strict - * @return static - */ - public function unique($key = null, $strict = false) - { - if (is_null($key)) { - return new static(array_unique($this->items, SORT_REGULAR)); - } - - $callback = $this->valueRetriever($key); - - $exists = []; - - return $this->reject(function ($item, $key) use ($callback, $strict, &$exists) { - if (in_array($id = $callback($item, $key), $exists, $strict)) { - return true; - } - - $exists[] = $id; - }); - } - - /** - * Return only unique items from the collection array using strict comparison. - * - * @param string|callable|null $key - * @return static - */ - public function uniqueStrict($key = null) - { - return $this->unique($key, true); - } - - /** - * Reset the keys on the underlying array. - * - * @return static - */ - public function values() - { - return new static(array_values($this->items)); - } - - /** - * Get a value retrieving callback. - * - * @param string $value - * @return callable - */ - protected function valueRetriever($value) - { - if ($this->useAsCallable($value)) { - return $value; - } - - return function ($item) use ($value) { - return data_get($item, $value); - }; - } - - /** - * Zip the collection together with one or more arrays. - * - * e.g. new Collection([1, 2, 3])->zip([4, 5, 6]); - * => [[1, 4], [2, 5], [3, 6]] - * - * @param mixed ...$items - * @return static - */ - public function zip($items) - { - $arrayableItems = array_map(function ($items) { - return $this->getArrayableItems($items); - }, func_get_args()); - - $params = array_merge([function () { - return new static(func_get_args()); - }, $this->items], $arrayableItems); - - return new static(call_user_func_array('array_map', $params)); - } - - /** - * Pad collection to the specified length with a value. - * - * @param int $size - * @param mixed $value - * @return static - */ - public function pad($size, $value) - { - return new static(array_pad($this->items, $size, $value)); - } - - /** - * Get the collection of items as a plain array. - * - * @return array - */ - public function toArray() - { - return array_map(function ($value) { - return $value instanceof Arrayable ? $value->toArray() : $value; - }, $this->items); - } - - /** - * Convert the object into something JSON serializable. - * - * @return array - */ - public function jsonSerialize() - { - return array_map(function ($value) { - if ($value instanceof JsonSerializable) { - return $value->jsonSerialize(); - } elseif ($value instanceof Jsonable) { - return json_decode($value->toJson(), true); - } elseif ($value instanceof Arrayable) { - return $value->toArray(); - } - - return $value; - }, $this->items); - } - - /** - * Get the collection of items as JSON. - * - * @param int $options - * @return string - */ - public function toJson($options = 0) - { - return json_encode($this->jsonSerialize(), $options); - } - - /** - * Get an iterator for the items. - * - * @return \ArrayIterator - */ - public function getIterator() - { - return new ArrayIterator($this->items); - } - - /** - * Get a CachingIterator instance. - * - * @param int $flags - * @return \CachingIterator - */ - public function getCachingIterator($flags = CachingIterator::CALL_TOSTRING) - { - return new CachingIterator($this->getIterator(), $flags); - } - - /** - * Count the number of items in the collection. - * - * @return int - */ - public function count() - { - return count($this->items); - } - - /** - * Get a base Support collection instance from this collection. - * - * @return \Illuminate\Support\Collection - */ - public function toBase() - { - return new self($this); - } - - /** - * Determine if an item exists at an offset. - * - * @param mixed $key - * @return bool - */ - public function offsetExists($key) - { - return array_key_exists($key, $this->items); - } - - /** - * Get an item at a given offset. - * - * @param mixed $key - * @return mixed - */ - public function offsetGet($key) - { - return $this->items[$key]; - } - - /** - * Set the item at a given offset. - * - * @param mixed $key - * @param mixed $value - * @return void - */ - public function offsetSet($key, $value) - { - if (is_null($key)) { - $this->items[] = $value; - } else { - $this->items[$key] = $value; - } - } - - /** - * Unset the item at a given offset. - * - * @param string $key - * @return void - */ - public function offsetUnset($key) - { - unset($this->items[$key]); - } - - /** - * Convert the collection to its string representation. - * - * @return string - */ - public function __toString() - { - return $this->toJson(); - } - - /** - * Results array of items from Collection or Arrayable. - * - * @param mixed $items - * @return array - */ - protected function getArrayableItems($items) - { - if (is_array($items)) { - return $items; - } elseif ($items instanceof self) { - return $items->all(); - } elseif ($items instanceof Arrayable) { - return $items->toArray(); - } elseif ($items instanceof Jsonable) { - return json_decode($items->toJson(), true); - } elseif ($items instanceof JsonSerializable) { - return $items->jsonSerialize(); - } elseif ($items instanceof Traversable) { - return iterator_to_array($items); - } - - return (array) $items; - } - - /** - * Add a method to the list of proxied methods. - * - * @param string $method - * @return void - */ - public static function proxy($method) - { - static::$proxies[] = $method; - } - - /** - * Dynamically access collection proxies. - * - * @param string $key - * @return mixed - * - * @throws \Exception - */ - public function __get($key) - { - if (! in_array($key, static::$proxies)) { - throw new Exception("Property [{$key}] does not exist on this collection instance."); - } - - return new HigherOrderCollectionProxy($this, $key); - } -} diff --git a/vendor/illuminate/support/Composer.php b/vendor/illuminate/support/Composer.php deleted file mode 100644 index bc76aeb..0000000 --- a/vendor/illuminate/support/Composer.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php - -namespace Illuminate\Support; - -use Illuminate\Filesystem\Filesystem; -use Symfony\Component\Process\Process; -use Symfony\Component\Process\PhpExecutableFinder; - -class Composer -{ - /** - * The filesystem instance. - * - * @var \Illuminate\Filesystem\Filesystem - */ - protected $files; - - /** - * The working path to regenerate from. - * - * @var string - */ - protected $workingPath; - - /** - * Create a new Composer manager instance. - * - * @param \Illuminate\Filesystem\Filesystem $files - * @param string|null $workingPath - * @return void - */ - public function __construct(Filesystem $files, $workingPath = null) - { - $this->files = $files; - $this->workingPath = $workingPath; - } - - /** - * Regenerate the Composer autoloader files. - * - * @param string $extra - * @return void - */ - public function dumpAutoloads($extra = '') - { - $process = $this->getProcess(); - - $process->setCommandLine(trim($this->findComposer().' dump-autoload '.$extra)); - - $process->run(); - } - - /** - * Regenerate the optimized Composer autoloader files. - * - * @return void - */ - public function dumpOptimized() - { - $this->dumpAutoloads('--optimize'); - } - - /** - * Get the composer command for the environment. - * - * @return string - */ - protected function findComposer() - { - if ($this->files->exists($this->workingPath.'/composer.phar')) { - return ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false)).' composer.phar'; - } - - return 'composer'; - } - - /** - * Get a new Symfony process instance. - * - * @return \Symfony\Component\Process\Process - */ - protected function getProcess() - { - return (new Process('', $this->workingPath))->setTimeout(null); - } - - /** - * Set the working path used by the class. - * - * @param string $path - * @return $this - */ - public function setWorkingPath($path) - { - $this->workingPath = realpath($path); - - return $this; - } -} diff --git a/vendor/illuminate/support/Debug/Dumper.php b/vendor/illuminate/support/Debug/Dumper.php deleted file mode 100644 index 7442343..0000000 --- a/vendor/illuminate/support/Debug/Dumper.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -namespace Illuminate\Support\Debug; - -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\CliDumper; - -class Dumper -{ - /** - * Dump a value with elegance. - * - * @param mixed $value - * @return void - */ - public function dump($value) - { - if (class_exists(CliDumper::class)) { - $dumper = in_array(PHP_SAPI, ['cli', 'phpdbg']) ? new CliDumper : new HtmlDumper; - - $dumper->dump((new VarCloner)->cloneVar($value)); - } else { - var_dump($value); - } - } -} diff --git a/vendor/illuminate/support/Debug/HtmlDumper.php b/vendor/illuminate/support/Debug/HtmlDumper.php deleted file mode 100644 index 5825ac8..0000000 --- a/vendor/illuminate/support/Debug/HtmlDumper.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -namespace Illuminate\Support\Debug; - -use Symfony\Component\VarDumper\Dumper\HtmlDumper as SymfonyHtmlDumper; - -class HtmlDumper extends SymfonyHtmlDumper -{ - /** - * Colour definitions for output. - * - * @var array - */ - protected $styles = [ - 'default' => 'background-color:#fff; color:#222; line-height:1.2em; font-weight:normal; font:12px Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap; position:relative; z-index:100000', - 'num' => 'color:#a71d5d', - 'const' => 'color:#795da3', - 'str' => 'color:#df5000', - 'cchr' => 'color:#222', - 'note' => 'color:#a71d5d', - 'ref' => 'color:#a0a0a0', - 'public' => 'color:#795da3', - 'protected' => 'color:#795da3', - 'private' => 'color:#795da3', - 'meta' => 'color:#b729d9', - 'key' => 'color:#df5000', - 'index' => 'color:#a71d5d', - ]; -} diff --git a/vendor/illuminate/support/Facades/App.php b/vendor/illuminate/support/Facades/App.php deleted file mode 100644 index 0e9e637..0000000 --- a/vendor/illuminate/support/Facades/App.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @method static string version() - * @method static string basePath() - * @method static string environment() - * @method static bool isDownForMaintenance() - * @method static void registerConfiguredProviders() - * @method static \Illuminate\Support\ServiceProvider register(\Illuminate\Support\ServiceProvider|string $provider, array $options = [], bool $force = false) - * @method static void registerDeferredProvider(string $provider, string $service = null) - * @method static void boot() - * @method static void booting(mixed $callback) - * @method static void booted(mixed $callback) - * @method static string getCachedServicesPath() - * - * @see \Illuminate\Foundation\Application - */ -class App extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'app'; - } -} diff --git a/vendor/illuminate/support/Facades/Artisan.php b/vendor/illuminate/support/Facades/Artisan.php deleted file mode 100644 index 8be0b5c..0000000 --- a/vendor/illuminate/support/Facades/Artisan.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract; - -/** - * @method static int handle(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output = null) - * @method static int call(string $command, array $parameters = [], $outputBuffer = null) - * @method static int queue(string $command, array $parameters = []) - * @method static array all() - * @method static string output() - * - * @see \Illuminate\Contracts\Console\Kernel - */ -class Artisan extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return ConsoleKernelContract::class; - } -} diff --git a/vendor/illuminate/support/Facades/Auth.php b/vendor/illuminate/support/Facades/Auth.php deleted file mode 100644 index 3f9d0d2..0000000 --- a/vendor/illuminate/support/Facades/Auth.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @method static mixed guard(string|null $name = null) - * @method static void shouldUse(string $name); - * @method static bool check() - * @method static bool guest() - * @method static \Illuminate\Contracts\Auth\Authenticatable|null user() - * @method static int|null id() - * @method static bool validate(array $credentials = []) - * @method static void setUser(\Illuminate\Contracts\Auth\Authenticatable $user) - * @method static bool attempt(array $credentials = [], bool $remember = false) - * @method static bool once(array $credentials = []) - * @method static void login(\Illuminate\Contracts\Auth\Authenticatable $user, bool $remember = false) - * @method static \Illuminate\Contracts\Auth\Authenticatable loginUsingId(mixed $id, bool $remember = false) - * @method static bool onceUsingId(mixed $id) - * @method static bool viaRemember() - * @method static void logout() - * - * @see \Illuminate\Auth\AuthManager - * @see \Illuminate\Contracts\Auth\Factory - * @see \Illuminate\Contracts\Auth\Guard - * @see \Illuminate\Contracts\Auth\StatefulGuard - */ -class Auth extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'auth'; - } - - /** - * Register the typical authentication routes for an application. - * - * @return void - */ - public static function routes() - { - static::$app->make('router')->auth(); - } -} diff --git a/vendor/illuminate/support/Facades/Blade.php b/vendor/illuminate/support/Facades/Blade.php deleted file mode 100644 index b016a46..0000000 --- a/vendor/illuminate/support/Facades/Blade.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\View\Compilers\BladeCompiler - */ -class Blade extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return static::$app['view']->getEngineResolver()->resolve('blade')->getCompiler(); - } -} diff --git a/vendor/illuminate/support/Facades/Broadcast.php b/vendor/illuminate/support/Facades/Broadcast.php deleted file mode 100644 index 81af932..0000000 --- a/vendor/illuminate/support/Facades/Broadcast.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -use Illuminate\Contracts\Broadcasting\Factory as BroadcastingFactoryContract; - -/** - * @see \Illuminate\Contracts\Broadcasting\Factory - */ -class Broadcast extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return BroadcastingFactoryContract::class; - } -} diff --git a/vendor/illuminate/support/Facades/Bus.php b/vendor/illuminate/support/Facades/Bus.php deleted file mode 100644 index eeebac4..0000000 --- a/vendor/illuminate/support/Facades/Bus.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -use Illuminate\Support\Testing\Fakes\BusFake; -use Illuminate\Contracts\Bus\Dispatcher as BusDispatcherContract; - -/** - * @see \Illuminate\Contracts\Bus\Dispatcher - */ -class Bus extends Facade -{ - /** - * Replace the bound instance with a fake. - * - * @return void - */ - public static function fake() - { - static::swap(new BusFake); - } - - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return BusDispatcherContract::class; - } -} diff --git a/vendor/illuminate/support/Facades/Cache.php b/vendor/illuminate/support/Facades/Cache.php deleted file mode 100644 index 2e32301..0000000 --- a/vendor/illuminate/support/Facades/Cache.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\Cache\CacheManager - * @see \Illuminate\Cache\Repository - */ -class Cache extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'cache'; - } -} diff --git a/vendor/illuminate/support/Facades/Config.php b/vendor/illuminate/support/Facades/Config.php deleted file mode 100644 index 3eb4fdf..0000000 --- a/vendor/illuminate/support/Facades/Config.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\Config\Repository - */ -class Config extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'config'; - } -} diff --git a/vendor/illuminate/support/Facades/Cookie.php b/vendor/illuminate/support/Facades/Cookie.php deleted file mode 100644 index bbcd5a3..0000000 --- a/vendor/illuminate/support/Facades/Cookie.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\Cookie\CookieJar - */ -class Cookie extends Facade -{ - /** - * Determine if a cookie exists on the request. - * - * @param string $key - * @return bool - */ - public static function has($key) - { - return ! is_null(static::$app['request']->cookie($key, null)); - } - - /** - * Retrieve a cookie from the request. - * - * @param string $key - * @param mixed $default - * @return string - */ - public static function get($key = null, $default = null) - { - return static::$app['request']->cookie($key, $default); - } - - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'cookie'; - } -} diff --git a/vendor/illuminate/support/Facades/Crypt.php b/vendor/illuminate/support/Facades/Crypt.php deleted file mode 100644 index 0eef08d..0000000 --- a/vendor/illuminate/support/Facades/Crypt.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\Encryption\Encrypter - */ -class Crypt extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'encrypter'; - } -} diff --git a/vendor/illuminate/support/Facades/DB.php b/vendor/illuminate/support/Facades/DB.php deleted file mode 100644 index 0369128..0000000 --- a/vendor/illuminate/support/Facades/DB.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\Database\DatabaseManager - * @see \Illuminate\Database\Connection - */ -class DB extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'db'; - } -} diff --git a/vendor/illuminate/support/Facades/Event.php b/vendor/illuminate/support/Facades/Event.php deleted file mode 100644 index 11757f0..0000000 --- a/vendor/illuminate/support/Facades/Event.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -use Illuminate\Database\Eloquent\Model; -use Illuminate\Support\Testing\Fakes\EventFake; - -/** - * @see \Illuminate\Events\Dispatcher - */ -class Event extends Facade -{ - /** - * Replace the bound instance with a fake. - * - * @param array|string $eventsToFake - * @return void - */ - public static function fake($eventsToFake = []) - { - static::swap($fake = new EventFake(static::getFacadeRoot(), $eventsToFake)); - - Model::setEventDispatcher($fake); - } - - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'events'; - } -} diff --git a/vendor/illuminate/support/Facades/Facade.php b/vendor/illuminate/support/Facades/Facade.php deleted file mode 100644 index c53180c..0000000 --- a/vendor/illuminate/support/Facades/Facade.php +++ /dev/null @@ -1,223 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -use Mockery; -use RuntimeException; -use Mockery\MockInterface; - -abstract class Facade -{ - /** - * The application instance being facaded. - * - * @var \Illuminate\Contracts\Foundation\Application - */ - protected static $app; - - /** - * The resolved object instances. - * - * @var array - */ - protected static $resolvedInstance; - - /** - * Convert the facade into a Mockery spy. - * - * @return void - */ - public static function spy() - { - if (! static::isMock()) { - $class = static::getMockableClass(); - - static::swap($class ? Mockery::spy($class) : Mockery::spy()); - } - } - - /** - * Initiate a mock expectation on the facade. - * - * @return \Mockery\Expectation - */ - public static function shouldReceive() - { - $name = static::getFacadeAccessor(); - - $mock = static::isMock() - ? static::$resolvedInstance[$name] - : static::createFreshMockInstance(); - - return $mock->shouldReceive(...func_get_args()); - } - - /** - * Create a fresh mock instance for the given class. - * - * @return \Mockery\Expectation - */ - protected static function createFreshMockInstance() - { - return tap(static::createMock(), function ($mock) { - static::swap($mock); - - $mock->shouldAllowMockingProtectedMethods(); - }); - } - - /** - * Create a fresh mock instance for the given class. - * - * @return \Mockery\MockInterface - */ - protected static function createMock() - { - $class = static::getMockableClass(); - - return $class ? Mockery::mock($class) : Mockery::mock(); - } - - /** - * Determines whether a mock is set as the instance of the facade. - * - * @return bool - */ - protected static function isMock() - { - $name = static::getFacadeAccessor(); - - return isset(static::$resolvedInstance[$name]) && - static::$resolvedInstance[$name] instanceof MockInterface; - } - - /** - * Get the mockable class for the bound instance. - * - * @return string|null - */ - protected static function getMockableClass() - { - if ($root = static::getFacadeRoot()) { - return get_class($root); - } - } - - /** - * Hotswap the underlying instance behind the facade. - * - * @param mixed $instance - * @return void - */ - public static function swap($instance) - { - static::$resolvedInstance[static::getFacadeAccessor()] = $instance; - - if (isset(static::$app)) { - static::$app->instance(static::getFacadeAccessor(), $instance); - } - } - - /** - * Get the root object behind the facade. - * - * @return mixed - */ - public static function getFacadeRoot() - { - return static::resolveFacadeInstance(static::getFacadeAccessor()); - } - - /** - * Get the registered name of the component. - * - * @return string - * - * @throws \RuntimeException - */ - protected static function getFacadeAccessor() - { - throw new RuntimeException('Facade does not implement getFacadeAccessor method.'); - } - - /** - * Resolve the facade root instance from the container. - * - * @param string|object $name - * @return mixed - */ - protected static function resolveFacadeInstance($name) - { - if (is_object($name)) { - return $name; - } - - if (isset(static::$resolvedInstance[$name])) { - return static::$resolvedInstance[$name]; - } - - return static::$resolvedInstance[$name] = static::$app[$name]; - } - - /** - * Clear a resolved facade instance. - * - * @param string $name - * @return void - */ - public static function clearResolvedInstance($name) - { - unset(static::$resolvedInstance[$name]); - } - - /** - * Clear all of the resolved instances. - * - * @return void - */ - public static function clearResolvedInstances() - { - static::$resolvedInstance = []; - } - - /** - * Get the application instance behind the facade. - * - * @return \Illuminate\Contracts\Foundation\Application - */ - public static function getFacadeApplication() - { - return static::$app; - } - - /** - * Set the application instance. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @return void - */ - public static function setFacadeApplication($app) - { - static::$app = $app; - } - - /** - * Handle dynamic, static calls to the object. - * - * @param string $method - * @param array $args - * @return mixed - * - * @throws \RuntimeException - */ - public static function __callStatic($method, $args) - { - $instance = static::getFacadeRoot(); - - if (! $instance) { - throw new RuntimeException('A facade root has not been set.'); - } - - return $instance->$method(...$args); - } -} diff --git a/vendor/illuminate/support/Facades/File.php b/vendor/illuminate/support/Facades/File.php deleted file mode 100644 index 0f81bf6..0000000 --- a/vendor/illuminate/support/Facades/File.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\Filesystem\Filesystem - */ -class File extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'files'; - } -} diff --git a/vendor/illuminate/support/Facades/Gate.php b/vendor/illuminate/support/Facades/Gate.php deleted file mode 100644 index 62977c6..0000000 --- a/vendor/illuminate/support/Facades/Gate.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -use Illuminate\Contracts\Auth\Access\Gate as GateContract; - -/** - * @see \Illuminate\Contracts\Auth\Access\Gate - */ -class Gate extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return GateContract::class; - } -} diff --git a/vendor/illuminate/support/Facades/Hash.php b/vendor/illuminate/support/Facades/Hash.php deleted file mode 100644 index 8486425..0000000 --- a/vendor/illuminate/support/Facades/Hash.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\Hashing\BcryptHasher - */ -class Hash extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'hash'; - } -} diff --git a/vendor/illuminate/support/Facades/Input.php b/vendor/illuminate/support/Facades/Input.php deleted file mode 100644 index 35f52d5..0000000 --- a/vendor/illuminate/support/Facades/Input.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\Http\Request - */ -class Input extends Facade -{ - /** - * Get an item from the input data. - * - * This method is used for all request verbs (GET, POST, PUT, and DELETE) - * - * @param string $key - * @param mixed $default - * @return mixed - */ - public static function get($key = null, $default = null) - { - return static::$app['request']->input($key, $default); - } - - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'request'; - } -} diff --git a/vendor/illuminate/support/Facades/Lang.php b/vendor/illuminate/support/Facades/Lang.php deleted file mode 100644 index e5862b9..0000000 --- a/vendor/illuminate/support/Facades/Lang.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\Translation\Translator - */ -class Lang extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'translator'; - } -} diff --git a/vendor/illuminate/support/Facades/Log.php b/vendor/illuminate/support/Facades/Log.php deleted file mode 100644 index b10e064..0000000 --- a/vendor/illuminate/support/Facades/Log.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -use Psr\Log\LoggerInterface; - -/** - * @see \Illuminate\Log\Writer - */ -class Log extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return LoggerInterface::class; - } -} diff --git a/vendor/illuminate/support/Facades/Mail.php b/vendor/illuminate/support/Facades/Mail.php deleted file mode 100644 index f5140c4..0000000 --- a/vendor/illuminate/support/Facades/Mail.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -use Illuminate\Support\Testing\Fakes\MailFake; - -/** - * @see \Illuminate\Mail\Mailer - */ -class Mail extends Facade -{ - /** - * Replace the bound instance with a fake. - * - * @return void - */ - public static function fake() - { - static::swap(new MailFake); - } - - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'mailer'; - } -} diff --git a/vendor/illuminate/support/Facades/Notification.php b/vendor/illuminate/support/Facades/Notification.php deleted file mode 100644 index 37fb6c9..0000000 --- a/vendor/illuminate/support/Facades/Notification.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -use Illuminate\Notifications\ChannelManager; -use Illuminate\Notifications\AnonymousNotifiable; -use Illuminate\Support\Testing\Fakes\NotificationFake; - -/** - * @see \Illuminate\Notifications\ChannelManager - */ -class Notification extends Facade -{ - /** - * Replace the bound instance with a fake. - * - * @return \Illuminate\Support\Testing\Fakes\NotificationFake - */ - public static function fake() - { - static::swap($fake = new NotificationFake); - - return $fake; - } - - /** - * Begin sending a notification to an anonymous notifiable. - * - * @param string $channel - * @param mixed $route - * @return \Illuminate\Notifications\AnonymousNotifiable - */ - public static function route($channel, $route) - { - return (new AnonymousNotifiable)->route($channel, $route); - } - - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return ChannelManager::class; - } -} diff --git a/vendor/illuminate/support/Facades/Password.php b/vendor/illuminate/support/Facades/Password.php deleted file mode 100644 index 6ebea84..0000000 --- a/vendor/illuminate/support/Facades/Password.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\Auth\Passwords\PasswordBroker - */ -class Password extends Facade -{ - /** - * Constant representing a successfully sent reminder. - * - * @var string - */ - const RESET_LINK_SENT = 'passwords.sent'; - - /** - * Constant representing a successfully reset password. - * - * @var string - */ - const PASSWORD_RESET = 'passwords.reset'; - - /** - * Constant representing the user not found response. - * - * @var string - */ - const INVALID_USER = 'passwords.user'; - - /** - * Constant representing an invalid password. - * - * @var string - */ - const INVALID_PASSWORD = 'passwords.password'; - - /** - * Constant representing an invalid token. - * - * @var string - */ - const INVALID_TOKEN = 'passwords.token'; - - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'auth.password'; - } -} diff --git a/vendor/illuminate/support/Facades/Queue.php b/vendor/illuminate/support/Facades/Queue.php deleted file mode 100644 index 647312f..0000000 --- a/vendor/illuminate/support/Facades/Queue.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -use Illuminate\Support\Testing\Fakes\QueueFake; - -/** - * @see \Illuminate\Queue\QueueManager - * @see \Illuminate\Queue\Queue - */ -class Queue extends Facade -{ - /** - * Replace the bound instance with a fake. - * - * @return void - */ - public static function fake() - { - static::swap(new QueueFake(static::getFacadeApplication())); - } - - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'queue'; - } -} diff --git a/vendor/illuminate/support/Facades/Redirect.php b/vendor/illuminate/support/Facades/Redirect.php deleted file mode 100644 index 647a7c3..0000000 --- a/vendor/illuminate/support/Facades/Redirect.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\Routing\Redirector - */ -class Redirect extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'redirect'; - } -} diff --git a/vendor/illuminate/support/Facades/Redis.php b/vendor/illuminate/support/Facades/Redis.php deleted file mode 100644 index a7491ba..0000000 --- a/vendor/illuminate/support/Facades/Redis.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\Redis\RedisManager - * @see \Illuminate\Contracts\Redis\Factory - */ -class Redis extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'redis'; - } -} diff --git a/vendor/illuminate/support/Facades/Request.php b/vendor/illuminate/support/Facades/Request.php deleted file mode 100644 index 5cb12f4..0000000 --- a/vendor/illuminate/support/Facades/Request.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\Http\Request - */ -class Request extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'request'; - } -} diff --git a/vendor/illuminate/support/Facades/Response.php b/vendor/illuminate/support/Facades/Response.php deleted file mode 100644 index 2bbf02b..0000000 --- a/vendor/illuminate/support/Facades/Response.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -use Illuminate\Contracts\Routing\ResponseFactory as ResponseFactoryContract; - -/** - * @see \Illuminate\Contracts\Routing\ResponseFactory - */ -class Response extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return ResponseFactoryContract::class; - } -} diff --git a/vendor/illuminate/support/Facades/Route.php b/vendor/illuminate/support/Facades/Route.php deleted file mode 100644 index ab2086c..0000000 --- a/vendor/illuminate/support/Facades/Route.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @method static \Illuminate\Support\Facades\Route get(string $uri, \Closure|array|string|null $action = null) - * @method static \Illuminate\Support\Facades\Route post(string $uri, \Closure|array|string|null $action = null) - * @method static \Illuminate\Support\Facades\Route put(string $uri, \Closure|array|string|null $action = null) - * @method static \Illuminate\Support\Facades\Route delete(string $uri, \Closure|array|string|null $action = null) - * @method static \Illuminate\Support\Facades\Route patch(string $uri, \Closure|array|string|null $action = null) - * @method static \Illuminate\Support\Facades\Route options(string $uri, \Closure|array|string|null $action = null) - * @method static \Illuminate\Support\Facades\Route any(string $uri, \Closure|array|string|null $action = null) - * @method static \Illuminate\Support\Facades\Route match(array|string $methods, string $uri, \Closure|array|string|null $action = null) - * @method static \Illuminate\Support\Facades\Route prefix(string $prefix) - * @method static \Illuminate\Routing\PendingResourceRegistration resource(string $name, string $controller, array $options = []) - * @method static \Illuminate\Routing\PendingResourceRegistration apiResource(string $name, string $controller, array $options = []) - * @method static \Illuminate\Support\Facades\Route middleware(array|string|null $middleware) - * @method static \Illuminate\Support\Facades\Route substituteBindings(\Illuminate\Support\Facades\Route $route) - * @method static void substituteImplicitBindings(\Illuminate\Support\Facades\Route $route) - * @method static \Illuminate\Support\Facades\Route as(string $value) - * @method static \Illuminate\Support\Facades\Route domain(string $value) - * @method static \Illuminate\Support\Facades\Route name(string $value) - * @method static \Illuminate\Support\Facades\Route namespace(string $value) - * @method static \Illuminate\Support\Facades\Route where(array|string $name, string $expression = null) - * @method static \Illuminate\Routing\Router group(\Closure|string|array $value, \Closure|string $routes) - * @method static \Illuminate\Support\Facades\Route redirect(string $uri, string $destination, int $status = 301) - * @method static \Illuminate\Support\Facades\Route view(string $uri, string $view, array $data = []) - * - * @see \Illuminate\Routing\Router - */ -class Route extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'router'; - } -} diff --git a/vendor/illuminate/support/Facades/Schema.php b/vendor/illuminate/support/Facades/Schema.php deleted file mode 100644 index 0cf1ee9..0000000 --- a/vendor/illuminate/support/Facades/Schema.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @method static \Illuminate\Database\Schema\Builder create(string $table, \Closure $callback) - * @method static \Illuminate\Database\Schema\Builder drop(string $table) - * @method static \Illuminate\Database\Schema\Builder dropIfExists(string $table) - * @method static \Illuminate\Database\Schema\Builder table(string $table, \Closure $callback) - * - * @see \Illuminate\Database\Schema\Builder - */ -class Schema extends Facade -{ - /** - * Get a schema builder instance for a connection. - * - * @param string $name - * @return \Illuminate\Database\Schema\Builder - */ - public static function connection($name) - { - return static::$app['db']->connection($name)->getSchemaBuilder(); - } - - /** - * Get a schema builder instance for the default connection. - * - * @return \Illuminate\Database\Schema\Builder - */ - protected static function getFacadeAccessor() - { - return static::$app['db']->connection()->getSchemaBuilder(); - } -} diff --git a/vendor/illuminate/support/Facades/Session.php b/vendor/illuminate/support/Facades/Session.php deleted file mode 100644 index bc9b5fd..0000000 --- a/vendor/illuminate/support/Facades/Session.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\Session\SessionManager - * @see \Illuminate\Session\Store - */ -class Session extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'session'; - } -} diff --git a/vendor/illuminate/support/Facades/Storage.php b/vendor/illuminate/support/Facades/Storage.php deleted file mode 100644 index 1ab840d..0000000 --- a/vendor/illuminate/support/Facades/Storage.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -use Illuminate\Filesystem\Filesystem; - -/** - * @see \Illuminate\Filesystem\FilesystemManager - */ -class Storage extends Facade -{ - /** - * Replace the given disk with a local testing disk. - * - * @param string|null $disk - * - * @return void - */ - public static function fake($disk = null) - { - $disk = $disk ?: self::$app['config']->get('filesystems.default'); - - (new Filesystem)->cleanDirectory( - $root = storage_path('framework/testing/disks/'.$disk) - ); - - static::set($disk, self::createLocalDriver(['root' => $root])); - } - - /** - * Replace the given disk with a persistent local testing disk. - * - * @param string|null $disk - * @return void - */ - public static function persistentFake($disk = null) - { - $disk = $disk ?: self::$app['config']->get('filesystems.default'); - - static::set($disk, self::createLocalDriver([ - 'root' => storage_path('framework/testing/disks/'.$disk), - ])); - } - - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'filesystem'; - } -} diff --git a/vendor/illuminate/support/Facades/URL.php b/vendor/illuminate/support/Facades/URL.php deleted file mode 100644 index e17414b..0000000 --- a/vendor/illuminate/support/Facades/URL.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\Routing\UrlGenerator - */ -class URL extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'url'; - } -} diff --git a/vendor/illuminate/support/Facades/Validator.php b/vendor/illuminate/support/Facades/Validator.php deleted file mode 100644 index e3e1ba4..0000000 --- a/vendor/illuminate/support/Facades/Validator.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\Validation\Factory - */ -class Validator extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'validator'; - } -} diff --git a/vendor/illuminate/support/Facades/View.php b/vendor/illuminate/support/Facades/View.php deleted file mode 100644 index 9de57c3..0000000 --- a/vendor/illuminate/support/Facades/View.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace Illuminate\Support\Facades; - -/** - * @see \Illuminate\View\Factory - */ -class View extends Facade -{ - /** - * Get the registered name of the component. - * - * @return string - */ - protected static function getFacadeAccessor() - { - return 'view'; - } -} diff --git a/vendor/illuminate/support/Fluent.php b/vendor/illuminate/support/Fluent.php deleted file mode 100644 index c34a5d7..0000000 --- a/vendor/illuminate/support/Fluent.php +++ /dev/null @@ -1,192 +0,0 @@ -<?php - -namespace Illuminate\Support; - -use ArrayAccess; -use JsonSerializable; -use Illuminate\Contracts\Support\Jsonable; -use Illuminate\Contracts\Support\Arrayable; - -class Fluent implements ArrayAccess, Arrayable, Jsonable, JsonSerializable -{ - /** - * All of the attributes set on the container. - * - * @var array - */ - protected $attributes = []; - - /** - * Create a new fluent container instance. - * - * @param array|object $attributes - * @return void - */ - public function __construct($attributes = []) - { - foreach ($attributes as $key => $value) { - $this->attributes[$key] = $value; - } - } - - /** - * Get an attribute from the container. - * - * @param string $key - * @param mixed $default - * @return mixed - */ - public function get($key, $default = null) - { - if (array_key_exists($key, $this->attributes)) { - return $this->attributes[$key]; - } - - return value($default); - } - - /** - * Get the attributes from the container. - * - * @return array - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * Convert the Fluent instance to an array. - * - * @return array - */ - public function toArray() - { - return $this->attributes; - } - - /** - * Convert the object into something JSON serializable. - * - * @return array - */ - public function jsonSerialize() - { - return $this->toArray(); - } - - /** - * Convert the Fluent instance to JSON. - * - * @param int $options - * @return string - */ - public function toJson($options = 0) - { - return json_encode($this->jsonSerialize(), $options); - } - - /** - * Determine if the given offset exists. - * - * @param string $offset - * @return bool - */ - public function offsetExists($offset) - { - return isset($this->attributes[$offset]); - } - - /** - * Get the value for a given offset. - * - * @param string $offset - * @return mixed - */ - public function offsetGet($offset) - { - return $this->get($offset); - } - - /** - * Set the value at the given offset. - * - * @param string $offset - * @param mixed $value - * @return void - */ - public function offsetSet($offset, $value) - { - $this->attributes[$offset] = $value; - } - - /** - * Unset the value at the given offset. - * - * @param string $offset - * @return void - */ - public function offsetUnset($offset) - { - unset($this->attributes[$offset]); - } - - /** - * Handle dynamic calls to the container to set attributes. - * - * @param string $method - * @param array $parameters - * @return $this - */ - public function __call($method, $parameters) - { - $this->attributes[$method] = count($parameters) > 0 ? $parameters[0] : true; - - return $this; - } - - /** - * Dynamically retrieve the value of an attribute. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - return $this->get($key); - } - - /** - * Dynamically set the value of an attribute. - * - * @param string $key - * @param mixed $value - * @return void - */ - public function __set($key, $value) - { - $this->offsetSet($key, $value); - } - - /** - * Dynamically check if an attribute is set. - * - * @param string $key - * @return bool - */ - public function __isset($key) - { - return $this->offsetExists($key); - } - - /** - * Dynamically unset an attribute. - * - * @param string $key - * @return void - */ - public function __unset($key) - { - $this->offsetUnset($key); - } -} diff --git a/vendor/illuminate/support/HigherOrderCollectionProxy.php b/vendor/illuminate/support/HigherOrderCollectionProxy.php deleted file mode 100644 index 7a781a0..0000000 --- a/vendor/illuminate/support/HigherOrderCollectionProxy.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php - -namespace Illuminate\Support; - -/** - * @mixin \Illuminate\Support\Collection - */ -class HigherOrderCollectionProxy -{ - /** - * The collection being operated on. - * - * @var \Illuminate\Support\Collection - */ - protected $collection; - - /** - * The method being proxied. - * - * @var string - */ - protected $method; - - /** - * Create a new proxy instance. - * - * @param \Illuminate\Support\Collection $collection - * @param string $method - * @return void - */ - public function __construct(Collection $collection, $method) - { - $this->method = $method; - $this->collection = $collection; - } - - /** - * Proxy accessing an attribute onto the collection items. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - return $this->collection->{$this->method}(function ($value) use ($key) { - return is_array($value) ? $value[$key] : $value->{$key}; - }); - } - - /** - * Proxy a method call onto the collection items. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->collection->{$this->method}(function ($value) use ($method, $parameters) { - return $value->{$method}(...$parameters); - }); - } -} diff --git a/vendor/illuminate/support/HigherOrderTapProxy.php b/vendor/illuminate/support/HigherOrderTapProxy.php deleted file mode 100644 index bbf9b2e..0000000 --- a/vendor/illuminate/support/HigherOrderTapProxy.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -namespace Illuminate\Support; - -class HigherOrderTapProxy -{ - /** - * The target being tapped. - * - * @var mixed - */ - public $target; - - /** - * Create a new tap proxy instance. - * - * @param mixed $target - * @return void - */ - public function __construct($target) - { - $this->target = $target; - } - - /** - * Dynamically pass method calls to the target. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - $this->target->{$method}(...$parameters); - - return $this->target; - } -} diff --git a/vendor/illuminate/support/HtmlString.php b/vendor/illuminate/support/HtmlString.php deleted file mode 100644 index c13adfd..0000000 --- a/vendor/illuminate/support/HtmlString.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -namespace Illuminate\Support; - -use Illuminate\Contracts\Support\Htmlable; - -class HtmlString implements Htmlable -{ - /** - * The HTML string. - * - * @var string - */ - protected $html; - - /** - * Create a new HTML string instance. - * - * @param string $html - * @return void - */ - public function __construct($html) - { - $this->html = $html; - } - - /** - * Get the HTML string. - * - * @return string - */ - public function toHtml() - { - return $this->html; - } - - /** - * Get the HTML string. - * - * @return string - */ - public function __toString() - { - return $this->toHtml(); - } -} diff --git a/vendor/illuminate/support/InteractsWithTime.php b/vendor/illuminate/support/InteractsWithTime.php deleted file mode 100644 index 19ed3f2..0000000 --- a/vendor/illuminate/support/InteractsWithTime.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -namespace Illuminate\Support; - -use DateInterval; -use DateTimeInterface; - -trait InteractsWithTime -{ - /** - * Get the number of seconds until the given DateTime. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @return int - */ - protected function secondsUntil($delay) - { - $delay = $this->parseDateInterval($delay); - - return $delay instanceof DateTimeInterface - ? max(0, $delay->getTimestamp() - $this->currentTime()) - : (int) $delay; - } - - /** - * Get the "available at" UNIX timestamp. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @return int - */ - protected function availableAt($delay = 0) - { - $delay = $this->parseDateInterval($delay); - - return $delay instanceof DateTimeInterface - ? $delay->getTimestamp() - : Carbon::now()->addSeconds($delay)->getTimestamp(); - } - - /** - * If the given value is an interval, convert it to a DateTime instance. - * - * @param \DateTimeInterface|\DateInterval|int $delay - * @return \DateTimeInterface|int - */ - protected function parseDateInterval($delay) - { - if ($delay instanceof DateInterval) { - $delay = Carbon::now()->add($delay); - } - - return $delay; - } - - /** - * Get the current system time as a UNIX timestamp. - * - * @return int - */ - protected function currentTime() - { - return Carbon::now()->getTimestamp(); - } -} diff --git a/vendor/illuminate/support/Manager.php b/vendor/illuminate/support/Manager.php deleted file mode 100644 index 592776c..0000000 --- a/vendor/illuminate/support/Manager.php +++ /dev/null @@ -1,140 +0,0 @@ -<?php - -namespace Illuminate\Support; - -use Closure; -use InvalidArgumentException; - -abstract class Manager -{ - /** - * The application instance. - * - * @var \Illuminate\Foundation\Application - */ - protected $app; - - /** - * The registered custom driver creators. - * - * @var array - */ - protected $customCreators = []; - - /** - * The array of created "drivers". - * - * @var array - */ - protected $drivers = []; - - /** - * Create a new manager instance. - * - * @param \Illuminate\Foundation\Application $app - * @return void - */ - public function __construct($app) - { - $this->app = $app; - } - - /** - * Get the default driver name. - * - * @return string - */ - abstract public function getDefaultDriver(); - - /** - * Get a driver instance. - * - * @param string $driver - * @return mixed - */ - public function driver($driver = null) - { - $driver = $driver ?: $this->getDefaultDriver(); - - // If the given driver has not been created before, we will create the instances - // here and cache it so we can return it next time very quickly. If there is - // already a driver created by this name, we'll just return that instance. - if (! isset($this->drivers[$driver])) { - $this->drivers[$driver] = $this->createDriver($driver); - } - - return $this->drivers[$driver]; - } - - /** - * Create a new driver instance. - * - * @param string $driver - * @return mixed - * - * @throws \InvalidArgumentException - */ - protected function createDriver($driver) - { - // We'll check to see if a creator method exists for the given driver. If not we - // will check for a custom driver creator, which allows developers to create - // drivers using their own customized driver creator Closure to create it. - if (isset($this->customCreators[$driver])) { - return $this->callCustomCreator($driver); - } else { - $method = 'create'.Str::studly($driver).'Driver'; - - if (method_exists($this, $method)) { - return $this->$method(); - } - } - throw new InvalidArgumentException("Driver [$driver] not supported."); - } - - /** - * Call a custom driver creator. - * - * @param string $driver - * @return mixed - */ - protected function callCustomCreator($driver) - { - return $this->customCreators[$driver]($this->app); - } - - /** - * Register a custom driver creator Closure. - * - * @param string $driver - * @param \Closure $callback - * @return $this - */ - public function extend($driver, Closure $callback) - { - $this->customCreators[$driver] = $callback; - - return $this; - } - - /** - * Get all of the created "drivers". - * - * @return array - */ - public function getDrivers() - { - return $this->drivers; - } - - /** - * Dynamically call the default driver instance. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->driver()->$method(...$parameters); - } -} diff --git a/vendor/illuminate/support/MessageBag.php b/vendor/illuminate/support/MessageBag.php deleted file mode 100644 index da2c31e..0000000 --- a/vendor/illuminate/support/MessageBag.php +++ /dev/null @@ -1,395 +0,0 @@ -<?php - -namespace Illuminate\Support; - -use Countable; -use JsonSerializable; -use Illuminate\Contracts\Support\Jsonable; -use Illuminate\Contracts\Support\Arrayable; -use Illuminate\Contracts\Support\MessageProvider; -use Illuminate\Contracts\Support\MessageBag as MessageBagContract; - -class MessageBag implements Arrayable, Countable, Jsonable, JsonSerializable, MessageBagContract, MessageProvider -{ - /** - * All of the registered messages. - * - * @var array - */ - protected $messages = []; - - /** - * Default format for message output. - * - * @var string - */ - protected $format = ':message'; - - /** - * Create a new message bag instance. - * - * @param array $messages - * @return void - */ - public function __construct(array $messages = []) - { - foreach ($messages as $key => $value) { - $this->messages[$key] = $value instanceof Arrayable - ? $value->toArray() : (array) $value; - } - } - - /** - * Get the keys present in the message bag. - * - * @return array - */ - public function keys() - { - return array_keys($this->messages); - } - - /** - * Add a message to the bag. - * - * @param string $key - * @param string $message - * @return $this - */ - public function add($key, $message) - { - if ($this->isUnique($key, $message)) { - $this->messages[$key][] = $message; - } - - return $this; - } - - /** - * Determine if a key and message combination already exists. - * - * @param string $key - * @param string $message - * @return bool - */ - protected function isUnique($key, $message) - { - $messages = (array) $this->messages; - - return ! isset($messages[$key]) || ! in_array($message, $messages[$key]); - } - - /** - * Merge a new array of messages into the bag. - * - * @param \Illuminate\Contracts\Support\MessageProvider|array $messages - * @return $this - */ - public function merge($messages) - { - if ($messages instanceof MessageProvider) { - $messages = $messages->getMessageBag()->getMessages(); - } - - $this->messages = array_merge_recursive($this->messages, $messages); - - return $this; - } - - /** - * Determine if messages exist for all of the given keys. - * - * @param array|string $key - * @return bool - */ - public function has($key) - { - if (is_null($key)) { - return $this->any(); - } - - $keys = is_array($key) ? $key : func_get_args(); - - foreach ($keys as $key) { - if ($this->first($key) === '') { - return false; - } - } - - return true; - } - - /** - * Determine if messages exist for any of the given keys. - * - * @param array|string $keys - * @return bool - */ - public function hasAny($keys = []) - { - $keys = is_array($keys) ? $keys : func_get_args(); - - foreach ($keys as $key) { - if ($this->has($key)) { - return true; - } - } - - return false; - } - - /** - * Get the first message from the bag for a given key. - * - * @param string $key - * @param string $format - * @return string - */ - public function first($key = null, $format = null) - { - $messages = is_null($key) ? $this->all($format) : $this->get($key, $format); - - $firstMessage = Arr::first($messages, null, ''); - - return is_array($firstMessage) ? Arr::first($firstMessage) : $firstMessage; - } - - /** - * Get all of the messages from the bag for a given key. - * - * @param string $key - * @param string $format - * @return array - */ - public function get($key, $format = null) - { - // If the message exists in the container, we will transform it and return - // the message. Otherwise, we'll check if the key is implicit & collect - // all the messages that match a given key and output it as an array. - if (array_key_exists($key, $this->messages)) { - return $this->transform( - $this->messages[$key], $this->checkFormat($format), $key - ); - } - - if (Str::contains($key, '*')) { - return $this->getMessagesForWildcardKey($key, $format); - } - - return []; - } - - /** - * Get the messages for a wildcard key. - * - * @param string $key - * @param string|null $format - * @return array - */ - protected function getMessagesForWildcardKey($key, $format) - { - return collect($this->messages) - ->filter(function ($messages, $messageKey) use ($key) { - return Str::is($key, $messageKey); - }) - ->map(function ($messages, $messageKey) use ($format) { - return $this->transform( - $messages, $this->checkFormat($format), $messageKey - ); - })->all(); - } - - /** - * Get all of the messages for every key in the bag. - * - * @param string $format - * @return array - */ - public function all($format = null) - { - $format = $this->checkFormat($format); - - $all = []; - - foreach ($this->messages as $key => $messages) { - $all = array_merge($all, $this->transform($messages, $format, $key)); - } - - return $all; - } - - /** - * Get all of the unique messages for every key in the bag. - * - * @param string $format - * @return array - */ - public function unique($format = null) - { - return array_unique($this->all($format)); - } - - /** - * Format an array of messages. - * - * @param array $messages - * @param string $format - * @param string $messageKey - * @return array - */ - protected function transform($messages, $format, $messageKey) - { - return collect((array) $messages) - ->map(function ($message) use ($format, $messageKey) { - // We will simply spin through the given messages and transform each one - // replacing the :message place holder with the real message allowing - // the messages to be easily formatted to each developer's desires. - return str_replace([':message', ':key'], [$message, $messageKey], $format); - })->all(); - } - - /** - * Get the appropriate format based on the given format. - * - * @param string $format - * @return string - */ - protected function checkFormat($format) - { - return $format ?: $this->format; - } - - /** - * Get the raw messages in the container. - * - * @return array - */ - public function messages() - { - return $this->messages; - } - - /** - * Get the raw messages in the container. - * - * @return array - */ - public function getMessages() - { - return $this->messages(); - } - - /** - * Get the messages for the instance. - * - * @return \Illuminate\Support\MessageBag - */ - public function getMessageBag() - { - return $this; - } - - /** - * Get the default message format. - * - * @return string - */ - public function getFormat() - { - return $this->format; - } - - /** - * Set the default message format. - * - * @param string $format - * @return \Illuminate\Support\MessageBag - */ - public function setFormat($format = ':message') - { - $this->format = $format; - - return $this; - } - - /** - * Determine if the message bag has any messages. - * - * @return bool - */ - public function isEmpty() - { - return ! $this->any(); - } - - /** - * Determine if the message bag has any messages. - * - * @return bool - */ - public function isNotEmpty() - { - return $this->any(); - } - - /** - * Determine if the message bag has any messages. - * - * @return bool - */ - public function any() - { - return $this->count() > 0; - } - - /** - * Get the number of messages in the container. - * - * @return int - */ - public function count() - { - return count($this->messages, COUNT_RECURSIVE) - count($this->messages); - } - - /** - * Get the instance as an array. - * - * @return array - */ - public function toArray() - { - return $this->getMessages(); - } - - /** - * Convert the object into something JSON serializable. - * - * @return array - */ - public function jsonSerialize() - { - return $this->toArray(); - } - - /** - * Convert the object to its JSON representation. - * - * @param int $options - * @return string - */ - public function toJson($options = 0) - { - return json_encode($this->jsonSerialize(), $options); - } - - /** - * Convert the message bag to its string representation. - * - * @return string - */ - public function __toString() - { - return $this->toJson(); - } -} diff --git a/vendor/illuminate/support/NamespacedItemResolver.php b/vendor/illuminate/support/NamespacedItemResolver.php deleted file mode 100644 index fea3275..0000000 --- a/vendor/illuminate/support/NamespacedItemResolver.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php - -namespace Illuminate\Support; - -class NamespacedItemResolver -{ - /** - * A cache of the parsed items. - * - * @var array - */ - protected $parsed = []; - - /** - * Parse a key into namespace, group, and item. - * - * @param string $key - * @return array - */ - public function parseKey($key) - { - // If we've already parsed the given key, we'll return the cached version we - // already have, as this will save us some processing. We cache off every - // key we parse so we can quickly return it on all subsequent requests. - if (isset($this->parsed[$key])) { - return $this->parsed[$key]; - } - - // If the key does not contain a double colon, it means the key is not in a - // namespace, and is just a regular configuration item. Namespaces are a - // tool for organizing configuration items for things such as modules. - if (strpos($key, '::') === false) { - $segments = explode('.', $key); - - $parsed = $this->parseBasicSegments($segments); - } else { - $parsed = $this->parseNamespacedSegments($key); - } - - // Once we have the parsed array of this key's elements, such as its groups - // and namespace, we will cache each array inside a simple list that has - // the key and the parsed array for quick look-ups for later requests. - return $this->parsed[$key] = $parsed; - } - - /** - * Parse an array of basic segments. - * - * @param array $segments - * @return array - */ - protected function parseBasicSegments(array $segments) - { - // The first segment in a basic array will always be the group, so we can go - // ahead and grab that segment. If there is only one total segment we are - // just pulling an entire group out of the array and not a single item. - $group = $segments[0]; - - // If there is more than one segment in this group, it means we are pulling - // a specific item out of a group and will need to return this item name - // as well as the group so we know which item to pull from the arrays. - $item = count($segments) === 1 - ? null - : implode('.', array_slice($segments, 1)); - - return [null, $group, $item]; - } - - /** - * Parse an array of namespaced segments. - * - * @param string $key - * @return array - */ - protected function parseNamespacedSegments($key) - { - list($namespace, $item) = explode('::', $key); - - // First we'll just explode the first segment to get the namespace and group - // since the item should be in the remaining segments. Once we have these - // two pieces of data we can proceed with parsing out the item's value. - $itemSegments = explode('.', $item); - - $groupAndItem = array_slice( - $this->parseBasicSegments($itemSegments), 1 - ); - - return array_merge([$namespace], $groupAndItem); - } - - /** - * Set the parsed value of a key. - * - * @param string $key - * @param array $parsed - * @return void - */ - public function setParsedKey($key, $parsed) - { - $this->parsed[$key] = $parsed; - } -} diff --git a/vendor/illuminate/support/Optional.php b/vendor/illuminate/support/Optional.php deleted file mode 100644 index 8f35221..0000000 --- a/vendor/illuminate/support/Optional.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php - -namespace Illuminate\Support; - -use ArrayAccess; - -class Optional implements ArrayAccess -{ - use Traits\Macroable { - __call as macroCall; - } - - /** - * The underlying object. - * - * @var mixed - */ - protected $value; - - /** - * Create a new optional instance. - * - * @param mixed $value - * @return void - */ - public function __construct($value) - { - $this->value = $value; - } - - /** - * Dynamically access a property on the underlying object. - * - * @param string $key - * @return mixed - */ - public function __get($key) - { - if (is_object($this->value)) { - return $this->value->{$key}; - } - } - - /** - * Dynamically pass a method to the underlying object. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return $this->macroCall($method, $parameters); - } - - if (is_object($this->value)) { - return $this->value->{$method}(...$parameters); - } - } - - /** - * Determine if an item exists at an offset. - * - * @param mixed $key - * @return bool - */ - public function offsetExists($key) - { - return Arr::accessible($this->value) && Arr::exists($this->value, $key); - } - - /** - * Get an item at a given offset. - * - * @param mixed $key - * @return mixed - */ - public function offsetGet($key) - { - return Arr::get($this->value, $key); - } - - /** - * Set the item at a given offset. - * - * @param mixed $key - * @param mixed $value - * @return void - */ - public function offsetSet($key, $value) - { - if (Arr::accessible($this->value)) { - $this->value[$key] = $value; - } - } - - /** - * Unset the item at a given offset. - * - * @param string $key - * @return void - */ - public function offsetUnset($key) - { - if (Arr::accessible($this->value)) { - unset($this->value[$key]); - } - } -} diff --git a/vendor/illuminate/support/Pluralizer.php b/vendor/illuminate/support/Pluralizer.php deleted file mode 100644 index 6cc55ad..0000000 --- a/vendor/illuminate/support/Pluralizer.php +++ /dev/null @@ -1,119 +0,0 @@ -<?php - -namespace Illuminate\Support; - -use Doctrine\Common\Inflector\Inflector; - -class Pluralizer -{ - /** - * Uncountable word forms. - * - * @var array - */ - public static $uncountable = [ - 'audio', - 'bison', - 'cattle', - 'chassis', - 'compensation', - 'coreopsis', - 'data', - 'deer', - 'education', - 'emoji', - 'equipment', - 'evidence', - 'feedback', - 'firmware', - 'fish', - 'furniture', - 'gold', - 'hardware', - 'information', - 'jedi', - 'kin', - 'knowledge', - 'love', - 'metadata', - 'money', - 'moose', - 'news', - 'nutrition', - 'offspring', - 'plankton', - 'pokemon', - 'police', - 'rain', - 'rice', - 'series', - 'sheep', - 'software', - 'species', - 'swine', - 'traffic', - 'wheat', - ]; - - /** - * Get the plural form of an English word. - * - * @param string $value - * @param int $count - * @return string - */ - public static function plural($value, $count = 2) - { - if ((int) $count === 1 || static::uncountable($value)) { - return $value; - } - - $plural = Inflector::pluralize($value); - - return static::matchCase($plural, $value); - } - - /** - * Get the singular form of an English word. - * - * @param string $value - * @return string - */ - public static function singular($value) - { - $singular = Inflector::singularize($value); - - return static::matchCase($singular, $value); - } - - /** - * Determine if the given value is uncountable. - * - * @param string $value - * @return bool - */ - protected static function uncountable($value) - { - return in_array(strtolower($value), static::$uncountable); - } - - /** - * Attempt to match the case on two strings. - * - * @param string $value - * @param string $comparison - * @return string - */ - protected static function matchCase($value, $comparison) - { - $functions = ['mb_strtolower', 'mb_strtoupper', 'ucfirst', 'ucwords']; - - foreach ($functions as $function) { - if (call_user_func($function, $comparison) === $comparison) { - return call_user_func($function, $value); - } - } - - return $value; - } -} diff --git a/vendor/illuminate/support/ProcessUtils.php b/vendor/illuminate/support/ProcessUtils.php deleted file mode 100644 index 1caa9e1..0000000 --- a/vendor/illuminate/support/ProcessUtils.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -namespace Illuminate\Support; - -/** - * ProcessUtils is a bunch of utility methods. - * - * This class was originally copied from Symfony 3. - */ -class ProcessUtils -{ - /** - * Escapes a string to be used as a shell argument. - * - * @param string $argument - * @return string - */ - public static function escapeArgument($argument) - { - // Fix for PHP bug #43784 escapeshellarg removes % from given string - // Fix for PHP bug #49446 escapeshellarg doesn't work on Windows - // @see https://bugs.php.net/bug.php?id=43784 - // @see https://bugs.php.net/bug.php?id=49446 - if ('\\' === DIRECTORY_SEPARATOR) { - if ('' === $argument) { - return '""'; - } - - $escapedArgument = ''; - $quote = false; - - foreach (preg_split('/(")/', $argument, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE) as $part) { - if ('"' === $part) { - $escapedArgument .= '\\"'; - } elseif (self::isSurroundedBy($part, '%')) { - // Avoid environment variable expansion - $escapedArgument .= '^%"'.substr($part, 1, -1).'"^%'; - } else { - // escape trailing backslash - if ('\\' === substr($part, -1)) { - $part .= '\\'; - } - $quote = true; - $escapedArgument .= $part; - } - } - - if ($quote) { - $escapedArgument = '"'.$escapedArgument.'"'; - } - - return $escapedArgument; - } - - return "'".str_replace("'", "'\\''", $argument)."'"; - } - - /** - * Is the given string surrounded by the given character? - * - * @param string $arg - * @param string $char - * @return bool - */ - protected static function isSurroundedBy($arg, $char) - { - return 2 < strlen($arg) && $char === $arg[0] && $char === $arg[strlen($arg) - 1]; - } -} diff --git a/vendor/illuminate/support/ServiceProvider.php b/vendor/illuminate/support/ServiceProvider.php deleted file mode 100644 index ba0f64a..0000000 --- a/vendor/illuminate/support/ServiceProvider.php +++ /dev/null @@ -1,300 +0,0 @@ -<?php - -namespace Illuminate\Support; - -use Illuminate\Console\Application as Artisan; - -abstract class ServiceProvider -{ - /** - * The application instance. - * - * @var \Illuminate\Contracts\Foundation\Application - */ - protected $app; - - /** - * Indicates if loading of the provider is deferred. - * - * @var bool - */ - protected $defer = false; - - /** - * The paths that should be published. - * - * @var array - */ - public static $publishes = []; - - /** - * The paths that should be published by group. - * - * @var array - */ - public static $publishGroups = []; - - /** - * Create a new service provider instance. - * - * @param \Illuminate\Contracts\Foundation\Application $app - * @return void - */ - public function __construct($app) - { - $this->app = $app; - } - - /** - * Merge the given configuration with the existing configuration. - * - * @param string $path - * @param string $key - * @return void - */ - protected function mergeConfigFrom($path, $key) - { - $config = $this->app['config']->get($key, []); - - $this->app['config']->set($key, array_merge(require $path, $config)); - } - - /** - * Load the given routes file if routes are not already cached. - * - * @param string $path - * @return void - */ - protected function loadRoutesFrom($path) - { - if (! $this->app->routesAreCached()) { - require $path; - } - } - - /** - * Register a view file namespace. - * - * @param string|array $path - * @param string $namespace - * @return void - */ - protected function loadViewsFrom($path, $namespace) - { - if (is_array($this->app->config['view']['paths'])) { - foreach ($this->app->config['view']['paths'] as $viewPath) { - if (is_dir($appPath = $viewPath.'/vendor/'.$namespace)) { - $this->app['view']->addNamespace($namespace, $appPath); - } - } - } - - $this->app['view']->addNamespace($namespace, $path); - } - - /** - * Register a translation file namespace. - * - * @param string $path - * @param string $namespace - * @return void - */ - protected function loadTranslationsFrom($path, $namespace) - { - $this->app['translator']->addNamespace($namespace, $path); - } - - /** - * Register a JSON translation file path. - * - * @param string $path - * @return void - */ - protected function loadJsonTranslationsFrom($path) - { - $this->app['translator']->addJsonPath($path); - } - - /** - * Register a database migration path. - * - * @param array|string $paths - * @return void - */ - protected function loadMigrationsFrom($paths) - { - $this->app->afterResolving('migrator', function ($migrator) use ($paths) { - foreach ((array) $paths as $path) { - $migrator->path($path); - } - }); - } - - /** - * Register paths to be published by the publish command. - * - * @param array $paths - * @param string $group - * @return void - */ - protected function publishes(array $paths, $group = null) - { - $this->ensurePublishArrayInitialized($class = static::class); - - static::$publishes[$class] = array_merge(static::$publishes[$class], $paths); - - if ($group) { - $this->addPublishGroup($group, $paths); - } - } - - /** - * Ensure the publish array for the service provider is initialized. - * - * @param string $class - * @return void - */ - protected function ensurePublishArrayInitialized($class) - { - if (! array_key_exists($class, static::$publishes)) { - static::$publishes[$class] = []; - } - } - - /** - * Add a publish group / tag to the service provider. - * - * @param string $group - * @param array $paths - * @return void - */ - protected function addPublishGroup($group, $paths) - { - if (! array_key_exists($group, static::$publishGroups)) { - static::$publishGroups[$group] = []; - } - - static::$publishGroups[$group] = array_merge( - static::$publishGroups[$group], $paths - ); - } - - /** - * Get the paths to publish. - * - * @param string $provider - * @param string $group - * @return array - */ - public static function pathsToPublish($provider = null, $group = null) - { - if (! is_null($paths = static::pathsForProviderOrGroup($provider, $group))) { - return $paths; - } - - return collect(static::$publishes)->reduce(function ($paths, $p) { - return array_merge($paths, $p); - }, []); - } - - /** - * Get the paths for the provider or group (or both). - * - * @param string|null $provider - * @param string|null $group - * @return array - */ - protected static function pathsForProviderOrGroup($provider, $group) - { - if ($provider && $group) { - return static::pathsForProviderAndGroup($provider, $group); - } elseif ($group && array_key_exists($group, static::$publishGroups)) { - return static::$publishGroups[$group]; - } elseif ($provider && array_key_exists($provider, static::$publishes)) { - return static::$publishes[$provider]; - } elseif ($group || $provider) { - return []; - } - } - - /** - * Get the paths for the provider and group. - * - * @param string $provider - * @param string $group - * @return array - */ - protected static function pathsForProviderAndGroup($provider, $group) - { - if (! empty(static::$publishes[$provider]) && ! empty(static::$publishGroups[$group])) { - return array_intersect_key(static::$publishes[$provider], static::$publishGroups[$group]); - } - - return []; - } - - /** - * Get the service providers available for publishing. - * - * @return array - */ - public static function publishableProviders() - { - return array_keys(static::$publishes); - } - - /** - * Get the groups available for publishing. - * - * @return array - */ - public static function publishableGroups() - { - return array_keys(static::$publishGroups); - } - - /** - * Register the package's custom Artisan commands. - * - * @param array|mixed $commands - * @return void - */ - public function commands($commands) - { - $commands = is_array($commands) ? $commands : func_get_args(); - - Artisan::starting(function ($artisan) use ($commands) { - $artisan->resolveCommands($commands); - }); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides() - { - return []; - } - - /** - * Get the events that trigger this service provider to register. - * - * @return array - */ - public function when() - { - return []; - } - - /** - * Determine if the provider is deferred. - * - * @return bool - */ - public function isDeferred() - { - return $this->defer; - } -} diff --git a/vendor/illuminate/support/Str.php b/vendor/illuminate/support/Str.php deleted file mode 100644 index 6775f92..0000000 --- a/vendor/illuminate/support/Str.php +++ /dev/null @@ -1,683 +0,0 @@ -<?php - -namespace Illuminate\Support; - -use Illuminate\Support\Traits\Macroable; - -class Str -{ - use Macroable; - - /** - * The cache of snake-cased words. - * - * @var array - */ - protected static $snakeCache = []; - - /** - * The cache of camel-cased words. - * - * @var array - */ - protected static $camelCache = []; - - /** - * The cache of studly-cased words. - * - * @var array - */ - protected static $studlyCache = []; - - /** - * Return the remainder of a string after a given value. - * - * @param string $subject - * @param string $search - * @return string - */ - public static function after($subject, $search) - { - return $search === '' ? $subject : array_reverse(explode($search, $subject, 2))[0]; - } - - /** - * Transliterate a UTF-8 value to ASCII. - * - * @param string $value - * @param string $language - * @return string - */ - public static function ascii($value, $language = 'en') - { - $languageSpecific = static::languageSpecificCharsArray($language); - - if (! is_null($languageSpecific)) { - $value = str_replace($languageSpecific[0], $languageSpecific[1], $value); - } - - foreach (static::charsArray() as $key => $val) { - $value = str_replace($val, $key, $value); - } - - return preg_replace('/[^\x20-\x7E]/u', '', $value); - } - - /** - * Get the portion of a string before a given value. - * - * @param string $subject - * @param string $search - * @return string - */ - public static function before($subject, $search) - { - return $search === '' ? $subject : explode($search, $subject)[0]; - } - - /** - * Convert a value to camel case. - * - * @param string $value - * @return string - */ - public static function camel($value) - { - if (isset(static::$camelCache[$value])) { - return static::$camelCache[$value]; - } - - return static::$camelCache[$value] = lcfirst(static::studly($value)); - } - - /** - * Determine if a given string contains a given substring. - * - * @param string $haystack - * @param string|array $needles - * @return bool - */ - public static function contains($haystack, $needles) - { - foreach ((array) $needles as $needle) { - if ($needle !== '' && mb_strpos($haystack, $needle) !== false) { - return true; - } - } - - return false; - } - - /** - * Determine if a given string ends with a given substring. - * - * @param string $haystack - * @param string|array $needles - * @return bool - */ - public static function endsWith($haystack, $needles) - { - foreach ((array) $needles as $needle) { - if (substr($haystack, -strlen($needle)) === (string) $needle) { - return true; - } - } - - return false; - } - - /** - * Cap a string with a single instance of a given value. - * - * @param string $value - * @param string $cap - * @return string - */ - public static function finish($value, $cap) - { - $quoted = preg_quote($cap, '/'); - - return preg_replace('/(?:'.$quoted.')+$/u', '', $value).$cap; - } - - /** - * Determine if a given string matches a given pattern. - * - * @param string|array $pattern - * @param string $value - * @return bool - */ - public static function is($pattern, $value) - { - $patterns = is_array($pattern) ? $pattern : (array) $pattern; - - if (empty($patterns)) { - return false; - } - - foreach ($patterns as $pattern) { - // If the given value is an exact match we can of course return true right - // from the beginning. Otherwise, we will translate asterisks and do an - // actual pattern match against the two strings to see if they match. - if ($pattern == $value) { - return true; - } - - $pattern = preg_quote($pattern, '#'); - - // Asterisks are translated into zero-or-more regular expression wildcards - // to make it convenient to check if the strings starts with the given - // pattern such as "library/*", making any string check convenient. - $pattern = str_replace('\*', '.*', $pattern); - - if (preg_match('#^'.$pattern.'\z#u', $value) === 1) { - return true; - } - } - - return false; - } - - /** - * Convert a string to kebab case. - * - * @param string $value - * @return string - */ - public static function kebab($value) - { - return static::snake($value, '-'); - } - - /** - * Return the length of the given string. - * - * @param string $value - * @param string $encoding - * @return int - */ - public static function length($value, $encoding = null) - { - if ($encoding) { - return mb_strlen($value, $encoding); - } - - return mb_strlen($value); - } - - /** - * Limit the number of characters in a string. - * - * @param string $value - * @param int $limit - * @param string $end - * @return string - */ - public static function limit($value, $limit = 100, $end = '...') - { - if (mb_strwidth($value, 'UTF-8') <= $limit) { - return $value; - } - - return rtrim(mb_strimwidth($value, 0, $limit, '', 'UTF-8')).$end; - } - - /** - * Convert the given string to lower-case. - * - * @param string $value - * @return string - */ - public static function lower($value) - { - return mb_strtolower($value, 'UTF-8'); - } - - /** - * Limit the number of words in a string. - * - * @param string $value - * @param int $words - * @param string $end - * @return string - */ - public static function words($value, $words = 100, $end = '...') - { - preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $value, $matches); - - if (! isset($matches[0]) || static::length($value) === static::length($matches[0])) { - return $value; - } - - return rtrim($matches[0]).$end; - } - - /** - * Parse a Class@method style callback into class and method. - * - * @param string $callback - * @param string|null $default - * @return array - */ - public static function parseCallback($callback, $default = null) - { - return static::contains($callback, '@') ? explode('@', $callback, 2) : [$callback, $default]; - } - - /** - * Get the plural form of an English word. - * - * @param string $value - * @param int $count - * @return string - */ - public static function plural($value, $count = 2) - { - return Pluralizer::plural($value, $count); - } - - /** - * Generate a more truly "random" alpha-numeric string. - * - * @param int $length - * @return string - */ - public static function random($length = 16) - { - $string = ''; - - while (($len = strlen($string)) < $length) { - $size = $length - $len; - - $bytes = random_bytes($size); - - $string .= substr(str_replace(['/', '+', '='], '', base64_encode($bytes)), 0, $size); - } - - return $string; - } - - /** - * Replace a given value in the string sequentially with an array. - * - * @param string $search - * @param array $replace - * @param string $subject - * @return string - */ - public static function replaceArray($search, array $replace, $subject) - { - foreach ($replace as $value) { - $subject = static::replaceFirst($search, $value, $subject); - } - - return $subject; - } - - /** - * Replace the first occurrence of a given value in the string. - * - * @param string $search - * @param string $replace - * @param string $subject - * @return string - */ - public static function replaceFirst($search, $replace, $subject) - { - if ($search == '') { - return $subject; - } - - $position = strpos($subject, $search); - - if ($position !== false) { - return substr_replace($subject, $replace, $position, strlen($search)); - } - - return $subject; - } - - /** - * Replace the last occurrence of a given value in the string. - * - * @param string $search - * @param string $replace - * @param string $subject - * @return string - */ - public static function replaceLast($search, $replace, $subject) - { - $position = strrpos($subject, $search); - - if ($position !== false) { - return substr_replace($subject, $replace, $position, strlen($search)); - } - - return $subject; - } - - /** - * Begin a string with a single instance of a given value. - * - * @param string $value - * @param string $prefix - * @return string - */ - public static function start($value, $prefix) - { - $quoted = preg_quote($prefix, '/'); - - return $prefix.preg_replace('/^(?:'.$quoted.')+/u', '', $value); - } - - /** - * Convert the given string to upper-case. - * - * @param string $value - * @return string - */ - public static function upper($value) - { - return mb_strtoupper($value, 'UTF-8'); - } - - /** - * Convert the given string to title case. - * - * @param string $value - * @return string - */ - public static function title($value) - { - return mb_convert_case($value, MB_CASE_TITLE, 'UTF-8'); - } - - /** - * Get the singular form of an English word. - * - * @param string $value - * @return string - */ - public static function singular($value) - { - return Pluralizer::singular($value); - } - - /** - * Generate a URL friendly "slug" from a given string. - * - * @param string $title - * @param string $separator - * @param string $language - * @return string - */ - public static function slug($title, $separator = '-', $language = 'en') - { - $title = static::ascii($title, $language); - - // Convert all dashes/underscores into separator - $flip = $separator == '-' ? '_' : '-'; - - $title = preg_replace('!['.preg_quote($flip).']+!u', $separator, $title); - - // Replace @ with the word 'at' - $title = str_replace('@', $separator.'at'.$separator, $title); - - // Remove all characters that are not the separator, letters, numbers, or whitespace. - $title = preg_replace('![^'.preg_quote($separator).'\pL\pN\s]+!u', '', mb_strtolower($title)); - - // Replace all separator characters and whitespace by a single separator - $title = preg_replace('!['.preg_quote($separator).'\s]+!u', $separator, $title); - - return trim($title, $separator); - } - - /** - * Convert a string to snake case. - * - * @param string $value - * @param string $delimiter - * @return string - */ - public static function snake($value, $delimiter = '_') - { - $key = $value; - - if (isset(static::$snakeCache[$key][$delimiter])) { - return static::$snakeCache[$key][$delimiter]; - } - - if (! ctype_lower($value)) { - $value = preg_replace('/\s+/u', '', ucwords($value)); - - $value = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $value)); - } - - return static::$snakeCache[$key][$delimiter] = $value; - } - - /** - * Determine if a given string starts with a given substring. - * - * @param string $haystack - * @param string|array $needles - * @return bool - */ - public static function startsWith($haystack, $needles) - { - foreach ((array) $needles as $needle) { - if ($needle !== '' && substr($haystack, 0, strlen($needle)) === (string) $needle) { - return true; - } - } - - return false; - } - - /** - * Convert a value to studly caps case. - * - * @param string $value - * @return string - */ - public static function studly($value) - { - $key = $value; - - if (isset(static::$studlyCache[$key])) { - return static::$studlyCache[$key]; - } - - $value = ucwords(str_replace(['-', '_'], ' ', $value)); - - return static::$studlyCache[$key] = str_replace(' ', '', $value); - } - - /** - * Returns the portion of string specified by the start and length parameters. - * - * @param string $string - * @param int $start - * @param int|null $length - * @return string - */ - public static function substr($string, $start, $length = null) - { - return mb_substr($string, $start, $length, 'UTF-8'); - } - - /** - * Make a string's first character uppercase. - * - * @param string $string - * @return string - */ - public static function ucfirst($string) - { - return static::upper(static::substr($string, 0, 1)).static::substr($string, 1); - } - - /** - * Returns the replacements for the ascii method. - * - * Note: Adapted from Stringy\Stringy. - * - * @see https://github.com/danielstjules/Stringy/blob/3.1.0/LICENSE.txt - * - * @return array - */ - protected static function charsArray() - { - static $charsArray; - - if (isset($charsArray)) { - return $charsArray; - } - - return $charsArray = [ - '0' => ['°', '₀', '۰', '0'], - '1' => ['¹', '₁', '۱', '1'], - '2' => ['²', '₂', '۲', '2'], - '3' => ['³', '₃', '۳', '3'], - '4' => ['⁴', '₄', '۴', '٤', '4'], - '5' => ['⁵', '₅', '۵', '٥', '5'], - '6' => ['⁶', '₆', '۶', '٦', '6'], - '7' => ['⁷', '₇', '۷', '7'], - '8' => ['⁸', '₈', '۸', '8'], - '9' => ['⁹', '₉', '۹', '9'], - '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', 'ŋ', 'ν', 'н', 'ن', 'န', 'ნ', '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'], - 'aa' => ['ع', 'आ', 'آ'], - 'ae' => ['æ', 'ǽ'], - 'ai' => ['ऐ'], - 'ch' => ['ч', 'ჩ', 'ჭ', 'چ'], - 'dj' => ['ђ', 'đ'], - 'dz' => ['џ', 'ძ'], - 'ei' => ['ऍ'], - 'gh' => ['غ', 'ღ'], - 'ii' => ['ई'], - 'ij' => ['ij'], - 'kh' => ['х', 'خ', 'ხ'], - 'lj' => ['љ'], - 'nj' => ['њ'], - 'oe' => ['ö', 'œ', 'ؤ'], - 'oi' => ['ऑ'], - 'oii' => ['ऒ'], - 'ps' => ['ψ'], - 'sh' => ['ш', 'შ', 'ش'], - 'shch' => ['щ'], - 'ss' => ['ß'], - 'sx' => ['ŝ'], - 'th' => ['þ', 'ϑ', 'ث', 'ذ', 'ظ'], - 'ts' => ['ц', 'ც', 'წ'], - 'ue' => ['ü'], - 'uu' => ['ऊ'], - 'ya' => ['я'], - 'yu' => ['ю'], - 'zh' => ['ж', 'ჟ', 'ژ'], - '(c)' => ['©'], - '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'], - 'AE' => ['Æ', 'Ǽ'], - 'Ch' => ['Ч'], - 'Dj' => ['Ђ'], - 'Dz' => ['Џ'], - 'Gx' => ['Ĝ'], - 'Hx' => ['Ĥ'], - 'Ij' => ['IJ'], - 'Jx' => ['Ĵ'], - 'Kh' => ['Х'], - 'Lj' => ['Љ'], - 'Nj' => ['Њ'], - 'Oe' => ['Œ'], - 'Ps' => ['Ψ'], - 'Sh' => ['Ш'], - 'Shch' => ['Щ'], - 'Ss' => ['ẞ'], - 'Th' => ['Þ'], - 'Ts' => ['Ц'], - 'Ya' => ['Я'], - 'Yu' => ['Ю'], - 'Zh' => ['Ж'], - ' ' => ["\xC2\xA0", "\xE2\x80\x80", "\xE2\x80\x81", "\xE2\x80\x82", "\xE2\x80\x83", "\xE2\x80\x84", "\xE2\x80\x85", "\xE2\x80\x86", "\xE2\x80\x87", "\xE2\x80\x88", "\xE2\x80\x89", "\xE2\x80\x8A", "\xE2\x80\xAF", "\xE2\x81\x9F", "\xE3\x80\x80", "\xEF\xBE\xA0"], - ]; - } - - /** - * Returns the language specific replacements for the ascii method. - * - * Note: Adapted from Stringy\Stringy. - * - * @see https://github.com/danielstjules/Stringy/blob/3.1.0/LICENSE.txt - * - * @param string $language - * @return array|null - */ - protected static function languageSpecificCharsArray($language) - { - static $languageSpecific; - - if (! isset($languageSpecific)) { - $languageSpecific = [ - 'bg' => [ - ['х', 'Х', 'щ', 'Щ', 'ъ', 'Ъ', 'ь', 'Ь'], - ['h', 'H', 'sht', 'SHT', 'a', 'А', 'y', 'Y'], - ], - 'de' => [ - ['ä', 'ö', 'ü', 'Ä', 'Ö', 'Ü'], - ['ae', 'oe', 'ue', 'AE', 'OE', 'UE'], - ], - ]; - } - - return $languageSpecific[$language] ?? null; - } -} diff --git a/vendor/illuminate/support/Testing/Fakes/BusFake.php b/vendor/illuminate/support/Testing/Fakes/BusFake.php deleted file mode 100644 index ae1209a..0000000 --- a/vendor/illuminate/support/Testing/Fakes/BusFake.php +++ /dev/null @@ -1,132 +0,0 @@ -<?php - -namespace Illuminate\Support\Testing\Fakes; - -use Illuminate\Contracts\Bus\Dispatcher; -use PHPUnit\Framework\Assert as PHPUnit; - -class BusFake implements Dispatcher -{ - /** - * The commands that have been dispatched. - * - * @var array - */ - protected $commands = []; - - /** - * Assert if a job was dispatched based on a truth-test callback. - * - * @param string $command - * @param callable|int|null $callback - * @return void - */ - public function assertDispatched($command, $callback = null) - { - if (is_numeric($callback)) { - return $this->assertDispatchedTimes($command, $callback); - } - - PHPUnit::assertTrue( - $this->dispatched($command, $callback)->count() > 0, - "The expected [{$command}] job was not dispatched." - ); - } - - /** - * Assert if a job was pushed a number of times. - * - * @param string $command - * @param int $times - * @return void - */ - protected function assertDispatchedTimes($command, $times = 1) - { - PHPUnit::assertTrue( - ($count = $this->dispatched($command)->count()) === $times, - "The expected [{$command}] job was pushed {$count} times instead of {$times} times." - ); - } - - /** - * Determine if a job was dispatched based on a truth-test callback. - * - * @param string $command - * @param callable|null $callback - * @return void - */ - public function assertNotDispatched($command, $callback = null) - { - PHPUnit::assertTrue( - $this->dispatched($command, $callback)->count() === 0, - "The unexpected [{$command}] job was dispatched." - ); - } - - /** - * Get all of the jobs matching a truth-test callback. - * - * @param string $command - * @param callable|null $callback - * @return \Illuminate\Support\Collection - */ - public function dispatched($command, $callback = null) - { - if (! $this->hasDispatched($command)) { - return collect(); - } - - $callback = $callback ?: function () { - return true; - }; - - return collect($this->commands[$command])->filter(function ($command) use ($callback) { - return $callback($command); - }); - } - - /** - * Determine if there are any stored commands for a given class. - * - * @param string $command - * @return bool - */ - public function hasDispatched($command) - { - return isset($this->commands[$command]) && ! empty($this->commands[$command]); - } - - /** - * Dispatch a command to its appropriate handler. - * - * @param mixed $command - * @return mixed - */ - public function dispatch($command) - { - return $this->dispatchNow($command); - } - - /** - * Dispatch a command to its appropriate handler in the current process. - * - * @param mixed $command - * @param mixed $handler - * @return mixed - */ - public function dispatchNow($command, $handler = null) - { - $this->commands[get_class($command)][] = $command; - } - - /** - * Set the pipes commands should be piped through before dispatching. - * - * @param array $pipes - * @return $this - */ - public function pipeThrough(array $pipes) - { - // - } -} diff --git a/vendor/illuminate/support/Testing/Fakes/EventFake.php b/vendor/illuminate/support/Testing/Fakes/EventFake.php deleted file mode 100644 index edbb90e..0000000 --- a/vendor/illuminate/support/Testing/Fakes/EventFake.php +++ /dev/null @@ -1,260 +0,0 @@ -<?php - -namespace Illuminate\Support\Testing\Fakes; - -use Illuminate\Support\Arr; -use PHPUnit\Framework\Assert as PHPUnit; -use Illuminate\Contracts\Events\Dispatcher; - -class EventFake implements Dispatcher -{ - /** - * The original event dispatcher. - * - * @var \Illuminate\Contracts\Events\Dispatcher - */ - protected $dispatcher; - - /** - * The event types that should be intercepted instead of dispatched. - * - * @var array - */ - protected $eventsToFake; - - /** - * All of the events that have been intercepted keyed by type. - * - * @var array - */ - protected $events = []; - - /** - * Create a new event fake instance. - * - * @param \Illuminate\Contracts\Events\Dispatcher $dispatcher - * @param array|string $eventsToFake - * @return void - */ - public function __construct(Dispatcher $dispatcher, $eventsToFake = []) - { - $this->dispatcher = $dispatcher; - - $this->eventsToFake = Arr::wrap($eventsToFake); - } - - /** - * Assert if an event was dispatched based on a truth-test callback. - * - * @param string $event - * @param callable|int|null $callback - * @return void - */ - public function assertDispatched($event, $callback = null) - { - if (is_int($callback)) { - return $this->assertDispatchedTimes($event, $callback); - } - - PHPUnit::assertTrue( - $this->dispatched($event, $callback)->count() > 0, - "The expected [{$event}] event was not dispatched." - ); - } - - /** - * Assert if a event was dispatched a number of times. - * - * @param string $event - * @param int $times - * @return void - */ - public function assertDispatchedTimes($event, $times = 1) - { - PHPUnit::assertTrue( - ($count = $this->dispatched($event)->count()) === $times, - "The expected [{$event}] event was dispatched {$count} times instead of {$times} times." - ); - } - - /** - * Determine if an event was dispatched based on a truth-test callback. - * - * @param string $event - * @param callable|null $callback - * @return void - */ - public function assertNotDispatched($event, $callback = null) - { - PHPUnit::assertTrue( - $this->dispatched($event, $callback)->count() === 0, - "The unexpected [{$event}] event was dispatched." - ); - } - - /** - * Get all of the events matching a truth-test callback. - * - * @param string $event - * @param callable|null $callback - * @return \Illuminate\Support\Collection - */ - public function dispatched($event, $callback = null) - { - if (! $this->hasDispatched($event)) { - return collect(); - } - - $callback = $callback ?: function () { - return true; - }; - - return collect($this->events[$event])->filter(function ($arguments) use ($callback) { - return $callback(...$arguments); - }); - } - - /** - * Determine if the given event has been dispatched. - * - * @param string $event - * @return bool - */ - public function hasDispatched($event) - { - return isset($this->events[$event]) && ! empty($this->events[$event]); - } - - /** - * Register an event listener with the dispatcher. - * - * @param string|array $events - * @param mixed $listener - * @return void - */ - public function listen($events, $listener) - { - // - } - - /** - * Determine if a given event has listeners. - * - * @param string $eventName - * @return bool - */ - public function hasListeners($eventName) - { - // - } - - /** - * Register an event and payload to be dispatched later. - * - * @param string $event - * @param array $payload - * @return void - */ - public function push($event, $payload = []) - { - // - } - - /** - * Register an event subscriber with the dispatcher. - * - * @param object|string $subscriber - * @return void - */ - public function subscribe($subscriber) - { - // - } - - /** - * Flush a set of pushed events. - * - * @param string $event - * @return void - */ - public function flush($event) - { - // - } - - /** - * Fire an event and call the listeners. - * - * @param string|object $event - * @param mixed $payload - * @param bool $halt - * @return array|null - */ - public function fire($event, $payload = [], $halt = false) - { - return $this->dispatch($event, $payload, $halt); - } - - /** - * Fire an event and call the listeners. - * - * @param string|object $event - * @param mixed $payload - * @param bool $halt - * @return array|null - */ - public function dispatch($event, $payload = [], $halt = false) - { - $name = is_object($event) ? get_class($event) : (string) $event; - - if ($this->shouldFakeEvent($name)) { - $this->events[$name][] = func_get_args(); - } else { - $this->dispatcher->dispatch($event, $payload, $halt); - } - } - - /** - * Determine if an event should be faked or actually dispatched. - * - * @param string $eventName - * @return bool - */ - protected function shouldFakeEvent($eventName) - { - return empty($this->eventsToFake) || in_array($eventName, $this->eventsToFake); - } - - /** - * Remove a set of listeners from the dispatcher. - * - * @param string $event - * @return void - */ - public function forget($event) - { - // - } - - /** - * Forget all of the queued listeners. - * - * @return void - */ - public function forgetPushed() - { - // - } - - /** - * Dispatch an event and call the listeners. - * - * @param string|object $event - * @param mixed $payload - * @return void - */ - public function until($event, $payload = []) - { - return $this->dispatch($event, $payload, true); - } -} diff --git a/vendor/illuminate/support/Testing/Fakes/MailFake.php b/vendor/illuminate/support/Testing/Fakes/MailFake.php deleted file mode 100644 index 0d11c08..0000000 --- a/vendor/illuminate/support/Testing/Fakes/MailFake.php +++ /dev/null @@ -1,316 +0,0 @@ -<?php - -namespace Illuminate\Support\Testing\Fakes; - -use Illuminate\Contracts\Mail\Mailer; -use Illuminate\Contracts\Mail\Mailable; -use PHPUnit\Framework\Assert as PHPUnit; -use Illuminate\Contracts\Queue\ShouldQueue; - -class MailFake implements Mailer -{ - /** - * All of the mailables that have been sent. - * - * @var array - */ - protected $mailables = []; - - /** - * All of the mailables that have been queued. - * - * @var array - */ - protected $queuedMailables = []; - - /** - * Assert if a mailable was sent based on a truth-test callback. - * - * @param string $mailable - * @param callable|int|null $callback - * @return void - */ - public function assertSent($mailable, $callback = null) - { - if (is_numeric($callback)) { - return $this->assertSentTimes($mailable, $callback); - } - - PHPUnit::assertTrue( - $this->sent($mailable, $callback)->count() > 0, - "The expected [{$mailable}] mailable was not sent." - ); - } - - /** - * Assert if a mailable was sent a number of times. - * - * @param string $mailable - * @param int $times - * @return void - */ - protected function assertSentTimes($mailable, $times = 1) - { - PHPUnit::assertTrue( - ($count = $this->sent($mailable)->count()) === $times, - "The expected [{$mailable}] mailable was sent {$count} times instead of {$times} times." - ); - } - - /** - * Determine if a mailable was not sent based on a truth-test callback. - * - * @param string $mailable - * @param callable|null $callback - * @return void - */ - public function assertNotSent($mailable, $callback = null) - { - PHPUnit::assertTrue( - $this->sent($mailable, $callback)->count() === 0, - "The unexpected [{$mailable}] mailable was sent." - ); - } - - /** - * Assert that no mailables were sent. - * - * @return void - */ - public function assertNothingSent() - { - PHPUnit::assertEmpty($this->mailables, 'Mailables were sent unexpectedly.'); - } - - /** - * Assert if a mailable was queued based on a truth-test callback. - * - * @param string $mailable - * @param callable|int|null $callback - * @return void - */ - public function assertQueued($mailable, $callback = null) - { - if (is_numeric($callback)) { - return $this->assertQueuedTimes($mailable, $callback); - } - - PHPUnit::assertTrue( - $this->queued($mailable, $callback)->count() > 0, - "The expected [{$mailable}] mailable was not queued." - ); - } - - /** - * Assert if a mailable was queued a number of times. - * - * @param string $mailable - * @param int $times - * @return void - */ - protected function assertQueuedTimes($mailable, $times = 1) - { - PHPUnit::assertTrue( - ($count = $this->queued($mailable)->count()) === $times, - "The expected [{$mailable}] mailable was queued {$count} times instead of {$times} times." - ); - } - - /** - * Determine if a mailable was not queued based on a truth-test callback. - * - * @param string $mailable - * @param callable|null $callback - * @return void - */ - public function assertNotQueued($mailable, $callback = null) - { - PHPUnit::assertTrue( - $this->queued($mailable, $callback)->count() === 0, - "The unexpected [{$mailable}] mailable was queued." - ); - } - - /** - * Assert that no mailables were queued. - * - * @return void - */ - public function assertNothingQueued() - { - PHPUnit::assertEmpty($this->queuedMailables, 'Mailables were queued unexpectedly.'); - } - - /** - * Get all of the mailables matching a truth-test callback. - * - * @param string $mailable - * @param callable|null $callback - * @return \Illuminate\Support\Collection - */ - public function sent($mailable, $callback = null) - { - if (! $this->hasSent($mailable)) { - return collect(); - } - - $callback = $callback ?: function () { - return true; - }; - - return $this->mailablesOf($mailable)->filter(function ($mailable) use ($callback) { - return $callback($mailable); - }); - } - - /** - * Determine if the given mailable has been sent. - * - * @param string $mailable - * @return bool - */ - public function hasSent($mailable) - { - return $this->mailablesOf($mailable)->count() > 0; - } - - /** - * Get all of the queued mailables matching a truth-test callback. - * - * @param string $mailable - * @param callable|null $callback - * @return \Illuminate\Support\Collection - */ - public function queued($mailable, $callback = null) - { - if (! $this->hasQueued($mailable)) { - return collect(); - } - - $callback = $callback ?: function () { - return true; - }; - - return $this->queuedMailablesOf($mailable)->filter(function ($mailable) use ($callback) { - return $callback($mailable); - }); - } - - /** - * Determine if the given mailable has been queued. - * - * @param string $mailable - * @return bool - */ - public function hasQueued($mailable) - { - return $this->queuedMailablesOf($mailable)->count() > 0; - } - - /** - * Get all of the mailed mailables for a given type. - * - * @param string $type - * @return \Illuminate\Support\Collection - */ - protected function mailablesOf($type) - { - return collect($this->mailables)->filter(function ($mailable) use ($type) { - return $mailable instanceof $type; - }); - } - - /** - * Get all of the mailed mailables for a given type. - * - * @param string $type - * @return \Illuminate\Support\Collection - */ - protected function queuedMailablesOf($type) - { - return collect($this->queuedMailables)->filter(function ($mailable) use ($type) { - return $mailable instanceof $type; - }); - } - - /** - * Begin the process of mailing a mailable class instance. - * - * @param mixed $users - * @return \Illuminate\Mail\PendingMail - */ - public function to($users) - { - return (new PendingMailFake($this))->to($users); - } - - /** - * Begin the process of mailing a mailable class instance. - * - * @param mixed $users - * @return \Illuminate\Mail\PendingMail - */ - public function bcc($users) - { - return (new PendingMailFake($this))->bcc($users); - } - - /** - * Send a new message when only a raw text part. - * - * @param string $text - * @param \Closure|string $callback - * @return int - */ - public function raw($text, $callback) - { - // - } - - /** - * Send a new message using a view. - * - * @param string|array $view - * @param array $data - * @param \Closure|string $callback - * @return void - */ - public function send($view, array $data = [], $callback = null) - { - if (! $view instanceof Mailable) { - return; - } - - if ($view instanceof ShouldQueue) { - return $this->queue($view, $data, $callback); - } - - $this->mailables[] = $view; - } - - /** - * Queue a new e-mail message for sending. - * - * @param string|array $view - * @param string|null $queue - * @return mixed - */ - public function queue($view, $queue = null) - { - if (! $view instanceof Mailable) { - return; - } - - $this->queuedMailables[] = $view; - } - - /** - * Get the array of failed recipients. - * - * @return array - */ - public function failures() - { - // - } -} diff --git a/vendor/illuminate/support/Testing/Fakes/NotificationFake.php b/vendor/illuminate/support/Testing/Fakes/NotificationFake.php deleted file mode 100644 index b610932..0000000 --- a/vendor/illuminate/support/Testing/Fakes/NotificationFake.php +++ /dev/null @@ -1,199 +0,0 @@ -<?php - -namespace Illuminate\Support\Testing\Fakes; - -use Ramsey\Uuid\Uuid; -use Illuminate\Support\Collection; -use PHPUnit\Framework\Assert as PHPUnit; -use Illuminate\Contracts\Notifications\Factory as NotificationFactory; -use Illuminate\Contracts\Notifications\Dispatcher as NotificationDispatcher; - -class NotificationFake implements NotificationFactory, NotificationDispatcher -{ - /** - * All of the notifications that have been sent. - * - * @var array - */ - protected $notifications = []; - - /** - * Assert if a notification was sent based on a truth-test callback. - * - * @param mixed $notifiable - * @param string $notification - * @param callable|null $callback - * @return void - */ - public function assertSentTo($notifiable, $notification, $callback = null) - { - if (is_array($notifiable) || $notifiable instanceof Collection) { - foreach ($notifiable as $singleNotifiable) { - $this->assertSentTo($singleNotifiable, $notification, $callback); - } - - return; - } - - if (is_numeric($callback)) { - return $this->assertSentToTimes($notifiable, $notification, $callback); - } - - PHPUnit::assertTrue( - $this->sent($notifiable, $notification, $callback)->count() > 0, - "The expected [{$notification}] notification was not sent." - ); - } - - /** - * Assert if a notification was sent a number of times. - * - * @param mixed $notifiable - * @param string $notification - * @param int $times - * @return void - */ - public function assertSentToTimes($notifiable, $notification, $times = 1) - { - PHPUnit::assertTrue( - ($count = $this->sent($notifiable, $notification)->count()) === $times, - "The expected [{$notification}] notification was sent {$count} times instead of {$times} times." - ); - } - - /** - * Determine if a notification was sent based on a truth-test callback. - * - * @param mixed $notifiable - * @param string $notification - * @param callable|null $callback - * @return void - */ - public function assertNotSentTo($notifiable, $notification, $callback = null) - { - if (is_array($notifiable) || $notifiable instanceof Collection) { - foreach ($notifiable as $singleNotifiable) { - $this->assertNotSentTo($singleNotifiable, $notification, $callback); - } - - return; - } - - PHPUnit::assertTrue( - $this->sent($notifiable, $notification, $callback)->count() === 0, - "The unexpected [{$notification}] notification was sent." - ); - } - - /** - * Assert that no notifications were sent. - * - * @return void - */ - public function assertNothingSent() - { - PHPUnit::assertEmpty($this->notifications, 'Notifications were sent unexpectedly.'); - } - - /** - * Get all of the notifications matching a truth-test callback. - * - * @param mixed $notifiable - * @param string $notification - * @param callable|null $callback - * @return \Illuminate\Support\Collection - */ - public function sent($notifiable, $notification, $callback = null) - { - if (! $this->hasSent($notifiable, $notification)) { - return collect(); - } - - $callback = $callback ?: function () { - return true; - }; - - $notifications = collect($this->notificationsFor($notifiable, $notification)); - - return $notifications->filter(function ($arguments) use ($callback) { - return $callback(...array_values($arguments)); - })->pluck('notification'); - } - - /** - * Determine if there are more notifications left to inspect. - * - * @param mixed $notifiable - * @param string $notification - * @return bool - */ - public function hasSent($notifiable, $notification) - { - return ! empty($this->notificationsFor($notifiable, $notification)); - } - - /** - * Get all of the notifications for a notifiable entity by type. - * - * @param mixed $notifiable - * @param string $notification - * @return array - */ - protected function notificationsFor($notifiable, $notification) - { - if (isset($this->notifications[get_class($notifiable)][$notifiable->getKey()][$notification])) { - return $this->notifications[get_class($notifiable)][$notifiable->getKey()][$notification]; - } - - return []; - } - - /** - * Send the given notification to the given notifiable entities. - * - * @param \Illuminate\Support\Collection|array|mixed $notifiables - * @param mixed $notification - * @return void - */ - public function send($notifiables, $notification) - { - return $this->sendNow($notifiables, $notification); - } - - /** - * Send the given notification immediately. - * - * @param \Illuminate\Support\Collection|array|mixed $notifiables - * @param mixed $notification - * @return void - */ - public function sendNow($notifiables, $notification) - { - if (! $notifiables instanceof Collection && ! is_array($notifiables)) { - $notifiables = [$notifiables]; - } - - foreach ($notifiables as $notifiable) { - if (! $notification->id) { - $notification->id = Uuid::uuid4()->toString(); - } - - $this->notifications[get_class($notifiable)][$notifiable->getKey()][get_class($notification)][] = [ - 'notification' => $notification, - 'channels' => $notification->via($notifiable), - 'notifiable' => $notifiable, - ]; - } - } - - /** - * Get a channel instance by name. - * - * @param string|null $name - * @return mixed - */ - public function channel($name = null) - { - // - } -} diff --git a/vendor/illuminate/support/Testing/Fakes/PendingMailFake.php b/vendor/illuminate/support/Testing/Fakes/PendingMailFake.php deleted file mode 100644 index e344fcf..0000000 --- a/vendor/illuminate/support/Testing/Fakes/PendingMailFake.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -namespace Illuminate\Support\Testing\Fakes; - -use Illuminate\Mail\Mailable; -use Illuminate\Mail\PendingMail; - -class PendingMailFake extends PendingMail -{ - /** - * Create a new instance. - * - * @param \Illuminate\Support\Testing\Fakes\MailFake $mailer - * @return void - */ - public function __construct($mailer) - { - $this->mailer = $mailer; - } - - /** - * Send a new mailable message instance. - * - * @param \Illuminate\Mail\Mailable $mailable - * @return mixed - */ - public function send(Mailable $mailable) - { - return $this->sendNow($mailable); - } - - /** - * Send a mailable message immediately. - * - * @param \Illuminate\Mail\Mailable $mailable - * @return mixed - */ - public function sendNow(Mailable $mailable) - { - $this->mailer->send($this->fill($mailable)); - } - - /** - * Push the given mailable onto the queue. - * - * @param \Illuminate\Mail\Mailable $mailable - * @return mixed - */ - public function queue(Mailable $mailable) - { - return $this->mailer->queue($this->fill($mailable)); - } -} diff --git a/vendor/illuminate/support/Testing/Fakes/QueueFake.php b/vendor/illuminate/support/Testing/Fakes/QueueFake.php deleted file mode 100644 index 66d191e..0000000 --- a/vendor/illuminate/support/Testing/Fakes/QueueFake.php +++ /dev/null @@ -1,267 +0,0 @@ -<?php - -namespace Illuminate\Support\Testing\Fakes; - -use Illuminate\Queue\QueueManager; -use Illuminate\Contracts\Queue\Queue; -use PHPUnit\Framework\Assert as PHPUnit; - -class QueueFake extends QueueManager implements Queue -{ - /** - * All of the jobs that have been pushed. - * - * @var array - */ - protected $jobs = []; - - /** - * Assert if a job was pushed based on a truth-test callback. - * - * @param string $job - * @param callable|int|null $callback - * @return void - */ - public function assertPushed($job, $callback = null) - { - if (is_numeric($callback)) { - return $this->assertPushedTimes($job, $callback); - } - - PHPUnit::assertTrue( - $this->pushed($job, $callback)->count() > 0, - "The expected [{$job}] job was not pushed." - ); - } - - /** - * Assert if a job was pushed a number of times. - * - * @param string $job - * @param int $times - * @return void - */ - protected function assertPushedTimes($job, $times = 1) - { - PHPUnit::assertTrue( - ($count = $this->pushed($job)->count()) === $times, - "The expected [{$job}] job was pushed {$count} times instead of {$times} times." - ); - } - - /** - * Assert if a job was pushed based on a truth-test callback. - * - * @param string $queue - * @param string $job - * @param callable|null $callback - * @return void - */ - public function assertPushedOn($queue, $job, $callback = null) - { - return $this->assertPushed($job, function ($job, $pushedQueue) use ($callback, $queue) { - if ($pushedQueue !== $queue) { - return false; - } - - return $callback ? $callback(...func_get_args()) : true; - }); - } - - /** - * Determine if a job was pushed based on a truth-test callback. - * - * @param string $job - * @param callable|null $callback - * @return void - */ - public function assertNotPushed($job, $callback = null) - { - PHPUnit::assertTrue( - $this->pushed($job, $callback)->count() === 0, - "The unexpected [{$job}] job was pushed." - ); - } - - /** - * Assert that no jobs were pushed. - * - * @return void - */ - public function assertNothingPushed() - { - PHPUnit::assertEmpty($this->jobs, 'Jobs were pushed unexpectedly.'); - } - - /** - * Get all of the jobs matching a truth-test callback. - * - * @param string $job - * @param callable|null $callback - * @return \Illuminate\Support\Collection - */ - public function pushed($job, $callback = null) - { - if (! $this->hasPushed($job)) { - return collect(); - } - - $callback = $callback ?: function () { - return true; - }; - - return collect($this->jobs[$job])->filter(function ($data) use ($callback) { - return $callback($data['job'], $data['queue']); - })->pluck('job'); - } - - /** - * Determine if there are any stored jobs for a given class. - * - * @param string $job - * @return bool - */ - public function hasPushed($job) - { - return isset($this->jobs[$job]) && ! empty($this->jobs[$job]); - } - - /** - * Resolve a queue connection instance. - * - * @param mixed $value - * @return \Illuminate\Contracts\Queue\Queue - */ - public function connection($value = null) - { - return $this; - } - - /** - * Get the size of the queue. - * - * @param string $queue - * @return int - */ - public function size($queue = null) - { - return 0; - } - - /** - * Push a new job onto the queue. - * - * @param string $job - * @param mixed $data - * @param string $queue - * @return mixed - */ - public function push($job, $data = '', $queue = null) - { - $this->jobs[is_object($job) ? get_class($job) : $job][] = [ - 'job' => $job, - 'queue' => $queue, - ]; - } - - /** - * Push a raw payload onto the queue. - * - * @param string $payload - * @param string $queue - * @param array $options - * @return mixed - */ - public function pushRaw($payload, $queue = null, array $options = []) - { - // - } - - /** - * Push a new job onto the queue after a delay. - * - * @param \DateTime|int $delay - * @param string $job - * @param mixed $data - * @param string $queue - * @return mixed - */ - public function later($delay, $job, $data = '', $queue = null) - { - return $this->push($job, $data, $queue); - } - - /** - * Push a new job onto the queue. - * - * @param string $queue - * @param string $job - * @param mixed $data - * @return mixed - */ - public function pushOn($queue, $job, $data = '') - { - return $this->push($job, $data, $queue); - } - - /** - * Push a new job onto the queue after a delay. - * - * @param string $queue - * @param \DateTime|int $delay - * @param string $job - * @param mixed $data - * @return mixed - */ - public function laterOn($queue, $delay, $job, $data = '') - { - return $this->push($job, $data, $queue); - } - - /** - * Pop the next job off of the queue. - * - * @param string $queue - * @return \Illuminate\Contracts\Queue\Job|null - */ - public function pop($queue = null) - { - // - } - - /** - * Push an array of jobs onto the queue. - * - * @param array $jobs - * @param mixed $data - * @param string $queue - * @return mixed - */ - public function bulk($jobs, $data = '', $queue = null) - { - foreach ($jobs as $job) { - $this->push($job, $data, $queue); - } - } - - /** - * Get the connection name for the queue. - * - * @return string - */ - public function getConnectionName() - { - // - } - - /** - * Set the connection name for the queue. - * - * @param string $name - * @return $this - */ - public function setConnectionName($name) - { - return $this; - } -} diff --git a/vendor/illuminate/support/Traits/CapsuleManagerTrait.php b/vendor/illuminate/support/Traits/CapsuleManagerTrait.php deleted file mode 100644 index 08089ef..0000000 --- a/vendor/illuminate/support/Traits/CapsuleManagerTrait.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -namespace Illuminate\Support\Traits; - -use Illuminate\Support\Fluent; -use Illuminate\Contracts\Container\Container; - -trait CapsuleManagerTrait -{ - /** - * The current globally used instance. - * - * @var object - */ - protected static $instance; - - /** - * The container instance. - * - * @var \Illuminate\Contracts\Container\Container - */ - protected $container; - - /** - * Setup the IoC container instance. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return void - */ - protected function setupContainer(Container $container) - { - $this->container = $container; - - if (! $this->container->bound('config')) { - $this->container->instance('config', new Fluent); - } - } - - /** - * Make this capsule instance available globally. - * - * @return void - */ - public function setAsGlobal() - { - static::$instance = $this; - } - - /** - * Get the IoC container instance. - * - * @return \Illuminate\Contracts\Container\Container - */ - public function getContainer() - { - return $this->container; - } - - /** - * Set the IoC container instance. - * - * @param \Illuminate\Contracts\Container\Container $container - * @return void - */ - public function setContainer(Container $container) - { - $this->container = $container; - } -} diff --git a/vendor/illuminate/support/Traits/Macroable.php b/vendor/illuminate/support/Traits/Macroable.php deleted file mode 100644 index a7703b1..0000000 --- a/vendor/illuminate/support/Traits/Macroable.php +++ /dev/null @@ -1,107 +0,0 @@ -<?php - -namespace Illuminate\Support\Traits; - -use Closure; -use ReflectionClass; -use ReflectionMethod; -use BadMethodCallException; - -trait Macroable -{ - /** - * The registered string macros. - * - * @var array - */ - protected static $macros = []; - - /** - * Register a custom macro. - * - * @param string $name - * @param object|callable $macro - * - * @return void - */ - public static function macro($name, $macro) - { - static::$macros[$name] = $macro; - } - - /** - * Mix another object into the class. - * - * @param object $mixin - * @return void - */ - public static function mixin($mixin) - { - $methods = (new ReflectionClass($mixin))->getMethods( - ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED - ); - - foreach ($methods as $method) { - $method->setAccessible(true); - - static::macro($method->name, $method->invoke($mixin)); - } - } - - /** - * Checks if macro is registered. - * - * @param string $name - * @return bool - */ - public static function hasMacro($name) - { - return isset(static::$macros[$name]); - } - - /** - * Dynamically handle calls to the class. - * - * @param string $method - * @param array $parameters - * @return mixed - * - * @throws \BadMethodCallException - */ - public static function __callStatic($method, $parameters) - { - if (! static::hasMacro($method)) { - throw new BadMethodCallException("Method {$method} does not exist."); - } - - if (static::$macros[$method] instanceof Closure) { - return call_user_func_array(Closure::bind(static::$macros[$method], null, static::class), $parameters); - } - - return call_user_func_array(static::$macros[$method], $parameters); - } - - /** - * Dynamically handle calls to the class. - * - * @param string $method - * @param array $parameters - * @return mixed - * - * @throws \BadMethodCallException - */ - public function __call($method, $parameters) - { - if (! static::hasMacro($method)) { - throw new BadMethodCallException("Method {$method} does not exist."); - } - - $macro = static::$macros[$method]; - - if ($macro instanceof Closure) { - return call_user_func_array($macro->bindTo($this, static::class), $parameters); - } - - return call_user_func_array($macro, $parameters); - } -} diff --git a/vendor/illuminate/support/ViewErrorBag.php b/vendor/illuminate/support/ViewErrorBag.php deleted file mode 100644 index 0f273b5..0000000 --- a/vendor/illuminate/support/ViewErrorBag.php +++ /dev/null @@ -1,130 +0,0 @@ -<?php - -namespace Illuminate\Support; - -use Countable; -use Illuminate\Contracts\Support\MessageBag as MessageBagContract; - -/** - * @mixin \Illuminate\Contracts\Support\MessageBag - */ -class ViewErrorBag implements Countable -{ - /** - * The array of the view error bags. - * - * @var array - */ - protected $bags = []; - - /** - * Checks if a named MessageBag exists in the bags. - * - * @param string $key - * @return bool - */ - public function hasBag($key = 'default') - { - return isset($this->bags[$key]); - } - - /** - * Get a MessageBag instance from the bags. - * - * @param string $key - * @return \Illuminate\Contracts\Support\MessageBag - */ - public function getBag($key) - { - return Arr::get($this->bags, $key) ?: new MessageBag; - } - - /** - * Get all the bags. - * - * @return array - */ - public function getBags() - { - return $this->bags; - } - - /** - * Add a new MessageBag instance to the bags. - * - * @param string $key - * @param \Illuminate\Contracts\Support\MessageBag $bag - * @return $this - */ - public function put($key, MessageBagContract $bag) - { - $this->bags[$key] = $bag; - - return $this; - } - - /** - * Determine if the default message bag has any messages. - * - * @return bool - */ - public function any() - { - return $this->count() > 0; - } - - /** - * Get the number of messages in the default bag. - * - * @return int - */ - public function count() - { - return $this->getBag('default')->count(); - } - - /** - * Dynamically call methods on the default bag. - * - * @param string $method - * @param array $parameters - * @return mixed - */ - public function __call($method, $parameters) - { - return $this->getBag('default')->$method(...$parameters); - } - - /** - * Dynamically access a view error bag. - * - * @param string $key - * @return \Illuminate\Contracts\Support\MessageBag - */ - public function __get($key) - { - return $this->getBag($key); - } - - /** - * Dynamically set a view error bag. - * - * @param string $key - * @param \Illuminate\Contracts\Support\MessageBag $value - * @return void - */ - public function __set($key, $value) - { - $this->put($key, $value); - } - - /** - * Convert the default bag to its string representation. - * - * @return string - */ - public function __toString() - { - return (string) $this->getBag('default'); - } -} diff --git a/vendor/illuminate/support/composer.json b/vendor/illuminate/support/composer.json deleted file mode 100644 index 35f3ebd..0000000 --- a/vendor/illuminate/support/composer.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "illuminate/support", - "description": "The Illuminate Support package.", - "license": "MIT", - "homepage": "https://laravel.com", - "support": { - "issues": "https://github.com/laravel/framework/issues", - "source": "https://github.com/laravel/framework" - }, - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "require": { - "php": ">=7.0", - "ext-mbstring": "*", - "doctrine/inflector": "~1.1", - "illuminate/contracts": "5.5.*", - "nesbot/carbon": "^1.24.1" - }, - "replace": { - "tightenco/collect": "<5.5.33" - }, - "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - }, - "files": [ - "helpers.php" - ] - }, - "extra": { - "branch-alias": { - "dev-master": "5.5-dev" - } - }, - "suggest": { - "illuminate/filesystem": "Required to use the composer class (5.5.*).", - "symfony/process": "Required to use the composer class (~3.3).", - "symfony/var-dumper": "Required to use the dd function (~3.3)." - }, - "config": { - "sort-packages": true - }, - "minimum-stability": "dev" -} diff --git a/vendor/illuminate/support/helpers.php b/vendor/illuminate/support/helpers.php deleted file mode 100644 index c52fd66..0000000 --- a/vendor/illuminate/support/helpers.php +++ /dev/null @@ -1,1176 +0,0 @@ -<?php - -use Illuminate\Support\Arr; -use Illuminate\Support\Str; -use Illuminate\Support\Optional; -use Illuminate\Support\Collection; -use Illuminate\Support\Debug\Dumper; -use Illuminate\Contracts\Support\Htmlable; -use Illuminate\Support\HigherOrderTapProxy; - -if (! function_exists('append_config')) { - /** - * Assign high numeric IDs to a config item to force appending. - * - * @param array $array - * @return array - */ - function append_config(array $array) - { - $start = 9999; - - foreach ($array as $key => $value) { - if (is_numeric($key)) { - $start++; - - $array[$start] = Arr::pull($array, $key); - } - } - - return $array; - } -} - -if (! function_exists('array_add')) { - /** - * Add an element to an array using "dot" notation if it doesn't exist. - * - * @param array $array - * @param string $key - * @param mixed $value - * @return array - */ - function array_add($array, $key, $value) - { - return Arr::add($array, $key, $value); - } -} - -if (! function_exists('array_collapse')) { - /** - * Collapse an array of arrays into a single array. - * - * @param array $array - * @return array - */ - function array_collapse($array) - { - return Arr::collapse($array); - } -} - -if (! function_exists('array_divide')) { - /** - * Divide an array into two arrays. One with keys and the other with values. - * - * @param array $array - * @return array - */ - function array_divide($array) - { - return Arr::divide($array); - } -} - -if (! function_exists('array_dot')) { - /** - * Flatten a multi-dimensional associative array with dots. - * - * @param array $array - * @param string $prepend - * @return array - */ - function array_dot($array, $prepend = '') - { - return Arr::dot($array, $prepend); - } -} - -if (! function_exists('array_except')) { - /** - * Get all of the given array except for a specified array of keys. - * - * @param array $array - * @param array|string $keys - * @return array - */ - function array_except($array, $keys) - { - return Arr::except($array, $keys); - } -} - -if (! function_exists('array_first')) { - /** - * Return the first element in an array passing a given truth test. - * - * @param array $array - * @param callable|null $callback - * @param mixed $default - * @return mixed - */ - function array_first($array, callable $callback = null, $default = null) - { - return Arr::first($array, $callback, $default); - } -} - -if (! function_exists('array_flatten')) { - /** - * Flatten a multi-dimensional array into a single level. - * - * @param array $array - * @param int $depth - * @return array - */ - function array_flatten($array, $depth = INF) - { - return Arr::flatten($array, $depth); - } -} - -if (! function_exists('array_forget')) { - /** - * Remove one or many array items from a given array using "dot" notation. - * - * @param array $array - * @param array|string $keys - * @return void - */ - function array_forget(&$array, $keys) - { - return Arr::forget($array, $keys); - } -} - -if (! function_exists('array_get')) { - /** - * Get an item from an array using "dot" notation. - * - * @param \ArrayAccess|array $array - * @param string $key - * @param mixed $default - * @return mixed - */ - function array_get($array, $key, $default = null) - { - return Arr::get($array, $key, $default); - } -} - -if (! function_exists('array_has')) { - /** - * Check if an item or items exist in an array using "dot" notation. - * - * @param \ArrayAccess|array $array - * @param string|array $keys - * @return bool - */ - function array_has($array, $keys) - { - return Arr::has($array, $keys); - } -} - -if (! function_exists('array_last')) { - /** - * Return the last element in an array passing a given truth test. - * - * @param array $array - * @param callable|null $callback - * @param mixed $default - * @return mixed - */ - function array_last($array, callable $callback = null, $default = null) - { - return Arr::last($array, $callback, $default); - } -} - -if (! function_exists('array_only')) { - /** - * Get a subset of the items from the given array. - * - * @param array $array - * @param array|string $keys - * @return array - */ - function array_only($array, $keys) - { - return Arr::only($array, $keys); - } -} - -if (! function_exists('array_pluck')) { - /** - * Pluck an array of values from an array. - * - * @param array $array - * @param string|array $value - * @param string|array|null $key - * @return array - */ - function array_pluck($array, $value, $key = null) - { - return Arr::pluck($array, $value, $key); - } -} - -if (! function_exists('array_prepend')) { - /** - * Push an item onto the beginning of an array. - * - * @param array $array - * @param mixed $value - * @param mixed $key - * @return array - */ - function array_prepend($array, $value, $key = null) - { - return Arr::prepend($array, $value, $key); - } -} - -if (! function_exists('array_pull')) { - /** - * Get a value from the array, and remove it. - * - * @param array $array - * @param string $key - * @param mixed $default - * @return mixed - */ - function array_pull(&$array, $key, $default = null) - { - return Arr::pull($array, $key, $default); - } -} - -if (! function_exists('array_random')) { - /** - * Get a random value from an array. - * - * @param array $array - * @param int|null $num - * @return mixed - */ - function array_random($array, $num = null) - { - return Arr::random($array, $num); - } -} - -if (! function_exists('array_set')) { - /** - * Set an array item to a given value using "dot" notation. - * - * If no key is given to the method, the entire array will be replaced. - * - * @param array $array - * @param string $key - * @param mixed $value - * @return array - */ - function array_set(&$array, $key, $value) - { - return Arr::set($array, $key, $value); - } -} - -if (! function_exists('array_sort')) { - /** - * Sort the array by the given callback or attribute name. - * - * @param array $array - * @param callable|string|null $callback - * @return array - */ - function array_sort($array, $callback = null) - { - return Arr::sort($array, $callback); - } -} - -if (! function_exists('array_sort_recursive')) { - /** - * Recursively sort an array by keys and values. - * - * @param array $array - * @return array - */ - function array_sort_recursive($array) - { - return Arr::sortRecursive($array); - } -} - -if (! function_exists('array_where')) { - /** - * Filter the array using the given callback. - * - * @param array $array - * @param callable $callback - * @return array - */ - function array_where($array, callable $callback) - { - return Arr::where($array, $callback); - } -} - -if (! function_exists('array_wrap')) { - /** - * If the given value is not an array, wrap it in one. - * - * @param mixed $value - * @return array - */ - function array_wrap($value) - { - return Arr::wrap($value); - } -} - -if (! function_exists('blank')) { - /** - * Determine if the given value is "blank". - * - * @param mixed $value - * @return bool - */ - function blank($value) - { - if (is_null($value)) { - return true; - } - - if (is_string($value)) { - return trim($value) === ''; - } - - if (is_numeric($value) || is_bool($value)) { - return false; - } - - if ($value instanceof Countable) { - return count($value) === 0; - } - - return empty($value); - } -} - -if (! function_exists('camel_case')) { - /** - * Convert a value to camel case. - * - * @param string $value - * @return string - */ - function camel_case($value) - { - return Str::camel($value); - } -} - -if (! function_exists('class_basename')) { - /** - * Get the class "basename" of the given object / class. - * - * @param string|object $class - * @return string - */ - function class_basename($class) - { - $class = is_object($class) ? get_class($class) : $class; - - return basename(str_replace('\\', '/', $class)); - } -} - -if (! function_exists('class_uses_recursive')) { - /** - * Returns all traits used by a class, its subclasses and trait of their traits. - * - * @param object|string $class - * @return array - */ - function class_uses_recursive($class) - { - if (is_object($class)) { - $class = get_class($class); - } - - $results = []; - - foreach (array_merge([$class => $class], class_parents($class)) as $class) { - $results += trait_uses_recursive($class); - } - - return array_unique($results); - } -} - -if (! function_exists('collect')) { - /** - * Create a collection from the given value. - * - * @param mixed $value - * @return \Illuminate\Support\Collection - */ - function collect($value = null) - { - return new Collection($value); - } -} - -if (! function_exists('data_fill')) { - /** - * Fill in data where it's missing. - * - * @param mixed $target - * @param string|array $key - * @param mixed $value - * @return mixed - */ - function data_fill(&$target, $key, $value) - { - return data_set($target, $key, $value, false); - } -} - -if (! function_exists('data_get')) { - /** - * Get an item from an array or object using "dot" notation. - * - * @param mixed $target - * @param string|array $key - * @param mixed $default - * @return mixed - */ - function data_get($target, $key, $default = null) - { - if (is_null($key)) { - return $target; - } - - $key = is_array($key) ? $key : explode('.', $key); - - while (! is_null($segment = array_shift($key))) { - if ($segment === '*') { - if ($target instanceof Collection) { - $target = $target->all(); - } elseif (! is_array($target)) { - return value($default); - } - - $result = Arr::pluck($target, $key); - - return in_array('*', $key) ? Arr::collapse($result) : $result; - } - - if (Arr::accessible($target) && Arr::exists($target, $segment)) { - $target = $target[$segment]; - } elseif (is_object($target) && isset($target->{$segment})) { - $target = $target->{$segment}; - } else { - return value($default); - } - } - - return $target; - } -} - -if (! function_exists('data_set')) { - /** - * Set an item on an array or object using dot notation. - * - * @param mixed $target - * @param string|array $key - * @param mixed $value - * @param bool $overwrite - * @return mixed - */ - function data_set(&$target, $key, $value, $overwrite = true) - { - $segments = is_array($key) ? $key : explode('.', $key); - - if (($segment = array_shift($segments)) === '*') { - if (! Arr::accessible($target)) { - $target = []; - } - - if ($segments) { - foreach ($target as &$inner) { - data_set($inner, $segments, $value, $overwrite); - } - } elseif ($overwrite) { - foreach ($target as &$inner) { - $inner = $value; - } - } - } elseif (Arr::accessible($target)) { - if ($segments) { - if (! Arr::exists($target, $segment)) { - $target[$segment] = []; - } - - data_set($target[$segment], $segments, $value, $overwrite); - } elseif ($overwrite || ! Arr::exists($target, $segment)) { - $target[$segment] = $value; - } - } elseif (is_object($target)) { - if ($segments) { - if (! isset($target->{$segment})) { - $target->{$segment} = []; - } - - data_set($target->{$segment}, $segments, $value, $overwrite); - } elseif ($overwrite || ! isset($target->{$segment})) { - $target->{$segment} = $value; - } - } else { - $target = []; - - if ($segments) { - data_set($target[$segment], $segments, $value, $overwrite); - } elseif ($overwrite) { - $target[$segment] = $value; - } - } - - return $target; - } -} - -if (! function_exists('dd')) { - /** - * Dump the passed variables and end the script. - * - * @param mixed $args - * @return void - */ - function dd(...$args) - { - http_response_code(500); - - foreach ($args as $x) { - (new Dumper)->dump($x); - } - - die(1); - } -} - -if (! function_exists('e')) { - /** - * Escape HTML special characters in a string. - * - * @param \Illuminate\Contracts\Support\Htmlable|string $value - * @param bool $doubleEncode - * @return string - */ - function e($value, $doubleEncode = false) - { - if ($value instanceof Htmlable) { - return $value->toHtml(); - } - - return htmlspecialchars($value, ENT_QUOTES, 'UTF-8', $doubleEncode); - } -} - -if (! function_exists('ends_with')) { - /** - * Determine if a given string ends with a given substring. - * - * @param string $haystack - * @param string|array $needles - * @return bool - */ - function ends_with($haystack, $needles) - { - return Str::endsWith($haystack, $needles); - } -} - -if (! function_exists('env')) { - /** - * Gets the value of an environment variable. - * - * @param string $key - * @param mixed $default - * @return mixed - */ - function env($key, $default = null) - { - $value = getenv($key); - - if ($value === false) { - return value($default); - } - - switch (strtolower($value)) { - case 'true': - case '(true)': - return true; - case 'false': - case '(false)': - return false; - case 'empty': - case '(empty)': - return ''; - case 'null': - case '(null)': - return; - } - - if (strlen($value) > 1 && Str::startsWith($value, '"') && Str::endsWith($value, '"')) { - return substr($value, 1, -1); - } - - return $value; - } -} - -if (! function_exists('filled')) { - /** - * Determine if a value is "filled". - * - * @param mixed $value - * @return bool - */ - function filled($value) - { - return ! blank($value); - } -} - -if (! function_exists('head')) { - /** - * Get the first element of an array. Useful for method chaining. - * - * @param array $array - * @return mixed - */ - function head($array) - { - return reset($array); - } -} - -if (! function_exists('kebab_case')) { - /** - * Convert a string to kebab case. - * - * @param string $value - * @return string - */ - function kebab_case($value) - { - return Str::kebab($value); - } -} - -if (! function_exists('last')) { - /** - * Get the last element from an array. - * - * @param array $array - * @return mixed - */ - function last($array) - { - return end($array); - } -} - -if (! function_exists('object_get')) { - /** - * Get an item from an object using "dot" notation. - * - * @param object $object - * @param string $key - * @param mixed $default - * @return mixed - */ - function object_get($object, $key, $default = null) - { - if (is_null($key) || trim($key) == '') { - return $object; - } - - foreach (explode('.', $key) as $segment) { - if (! is_object($object) || ! isset($object->{$segment})) { - return value($default); - } - - $object = $object->{$segment}; - } - - return $object; - } -} - -if (! function_exists('optional')) { - /** - * Provide access to optional objects. - * - * @param mixed $value - * @return mixed - */ - function optional($value = null) - { - return new Optional($value); - } -} - -if (! function_exists('preg_replace_array')) { - /** - * Replace a given pattern with each value in the array in sequentially. - * - * @param string $pattern - * @param array $replacements - * @param string $subject - * @return string - */ - function preg_replace_array($pattern, array $replacements, $subject) - { - return preg_replace_callback($pattern, function () use (&$replacements) { - foreach ($replacements as $key => $value) { - return array_shift($replacements); - } - }, $subject); - } -} - -if (! function_exists('retry')) { - /** - * Retry an operation a given number of times. - * - * @param int $times - * @param callable $callback - * @param int $sleep - * @return mixed - * - * @throws \Exception - */ - function retry($times, callable $callback, $sleep = 0) - { - $times--; - - beginning: - try { - return $callback(); - } catch (Exception $e) { - if (! $times) { - throw $e; - } - - $times--; - - if ($sleep) { - usleep($sleep * 1000); - } - - goto beginning; - } - } -} - -if (! function_exists('snake_case')) { - /** - * Convert a string to snake case. - * - * @param string $value - * @param string $delimiter - * @return string - */ - function snake_case($value, $delimiter = '_') - { - return Str::snake($value, $delimiter); - } -} - -if (! function_exists('starts_with')) { - /** - * Determine if a given string starts with a given substring. - * - * @param string $haystack - * @param string|array $needles - * @return bool - */ - function starts_with($haystack, $needles) - { - return Str::startsWith($haystack, $needles); - } -} - -if (! function_exists('str_after')) { - /** - * Return the remainder of a string after a given value. - * - * @param string $subject - * @param string $search - * @return string - */ - function str_after($subject, $search) - { - return Str::after($subject, $search); - } -} - -if (! function_exists('str_before')) { - /** - * Get the portion of a string before a given value. - * - * @param string $subject - * @param string $search - * @return string - */ - function str_before($subject, $search) - { - return Str::before($subject, $search); - } -} - -if (! function_exists('str_contains')) { - /** - * Determine if a given string contains a given substring. - * - * @param string $haystack - * @param string|array $needles - * @return bool - */ - function str_contains($haystack, $needles) - { - return Str::contains($haystack, $needles); - } -} - -if (! function_exists('str_finish')) { - /** - * Cap a string with a single instance of a given value. - * - * @param string $value - * @param string $cap - * @return string - */ - function str_finish($value, $cap) - { - return Str::finish($value, $cap); - } -} - -if (! function_exists('str_is')) { - /** - * Determine if a given string matches a given pattern. - * - * @param string|array $pattern - * @param string $value - * @return bool - */ - function str_is($pattern, $value) - { - return Str::is($pattern, $value); - } -} - -if (! function_exists('str_limit')) { - /** - * Limit the number of characters in a string. - * - * @param string $value - * @param int $limit - * @param string $end - * @return string - */ - function str_limit($value, $limit = 100, $end = '...') - { - return Str::limit($value, $limit, $end); - } -} - -if (! function_exists('str_plural')) { - /** - * Get the plural form of an English word. - * - * @param string $value - * @param int $count - * @return string - */ - function str_plural($value, $count = 2) - { - return Str::plural($value, $count); - } -} - -if (! function_exists('str_random')) { - /** - * Generate a more truly "random" alpha-numeric string. - * - * @param int $length - * @return string - * - * @throws \RuntimeException - */ - function str_random($length = 16) - { - return Str::random($length); - } -} - -if (! function_exists('str_replace_array')) { - /** - * Replace a given value in the string sequentially with an array. - * - * @param string $search - * @param array $replace - * @param string $subject - * @return string - */ - function str_replace_array($search, array $replace, $subject) - { - return Str::replaceArray($search, $replace, $subject); - } -} - -if (! function_exists('str_replace_first')) { - /** - * Replace the first occurrence of a given value in the string. - * - * @param string $search - * @param string $replace - * @param string $subject - * @return string - */ - function str_replace_first($search, $replace, $subject) - { - return Str::replaceFirst($search, $replace, $subject); - } -} - -if (! function_exists('str_replace_last')) { - /** - * Replace the last occurrence of a given value in the string. - * - * @param string $search - * @param string $replace - * @param string $subject - * @return string - */ - function str_replace_last($search, $replace, $subject) - { - return Str::replaceLast($search, $replace, $subject); - } -} - -if (! function_exists('str_singular')) { - /** - * Get the singular form of an English word. - * - * @param string $value - * @return string - */ - function str_singular($value) - { - return Str::singular($value); - } -} - -if (! function_exists('str_slug')) { - /** - * Generate a URL friendly "slug" from a given string. - * - * @param string $title - * @param string $separator - * @param string $language - * @return string - */ - function str_slug($title, $separator = '-', $language = 'en') - { - return Str::slug($title, $separator, $language); - } -} - -if (! function_exists('str_start')) { - /** - * Begin a string with a single instance of a given value. - * - * @param string $value - * @param string $prefix - * @return string - */ - function str_start($value, $prefix) - { - return Str::start($value, $prefix); - } -} - -if (! function_exists('studly_case')) { - /** - * Convert a value to studly caps case. - * - * @param string $value - * @return string - */ - function studly_case($value) - { - return Str::studly($value); - } -} - -if (! function_exists('tap')) { - /** - * Call the given Closure with the given value then return the value. - * - * @param mixed $value - * @param callable|null $callback - * @return mixed - */ - function tap($value, $callback = null) - { - if (is_null($callback)) { - return new HigherOrderTapProxy($value); - } - - $callback($value); - - return $value; - } -} - -if (! function_exists('throw_if')) { - /** - * Throw the given exception if the given condition is true. - * - * @param mixed $condition - * @param \Throwable|string $exception - * @param array ...$parameters - * @return mixed - * @throws \Throwable - */ - function throw_if($condition, $exception, ...$parameters) - { - if ($condition) { - throw (is_string($exception) ? new $exception(...$parameters) : $exception); - } - - return $condition; - } -} - -if (! function_exists('throw_unless')) { - /** - * Throw the given exception unless the given condition is true. - * - * @param mixed $condition - * @param \Throwable|string $exception - * @param array ...$parameters - * @return mixed - * @throws \Throwable - */ - function throw_unless($condition, $exception, ...$parameters) - { - if (! $condition) { - throw (is_string($exception) ? new $exception(...$parameters) : $exception); - } - - return $condition; - } -} - -if (! function_exists('title_case')) { - /** - * Convert a value to title case. - * - * @param string $value - * @return string - */ - function title_case($value) - { - return Str::title($value); - } -} - -if (! function_exists('trait_uses_recursive')) { - /** - * Returns all traits used by a trait and its traits. - * - * @param string $trait - * @return array - */ - function trait_uses_recursive($trait) - { - $traits = class_uses($trait); - - foreach ($traits as $trait) { - $traits += trait_uses_recursive($trait); - } - - return $traits; - } -} - -if (! function_exists('transform')) { - /** - * Transform the given value if it is present. - * - * @param mixed $value - * @param callable $callback - * @param mixed $default - * @return mixed|null - */ - function transform($value, callable $callback, $default = null) - { - if (filled($value)) { - return $callback($value); - } - - if (is_callable($default)) { - return $default($value); - } - - return $default; - } -} - -if (! function_exists('value')) { - /** - * Return the default value of the given value. - * - * @param mixed $value - * @return mixed - */ - function value($value) - { - return $value instanceof Closure ? $value() : $value; - } -} - -if (! function_exists('windows_os')) { - /** - * Determine whether the current environment is Windows based. - * - * @return bool - */ - function windows_os() - { - return strtolower(substr(PHP_OS, 0, 3)) === 'win'; - } -} - -if (! function_exists('with')) { - /** - * Return the given value, optionally passed through the given callback. - * - * @param mixed $value - * @param callable|null $callback - * @return mixed - */ - function with($value, callable $callback = null) - { - return is_null($callback) ? $value : $callback($value); - } -} diff --git a/vendor/kylekatarnls/update-helper/LICENSE b/vendor/kylekatarnls/update-helper/LICENSE deleted file mode 100644 index d55dee5..0000000 --- a/vendor/kylekatarnls/update-helper/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -MIT License - -Copyright (c) 2017 https://github.com/pug-php -Copyright (c) 2017 https://github.com/kylekatarnls - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/kylekatarnls/update-helper/composer.json b/vendor/kylekatarnls/update-helper/composer.json deleted file mode 100644 index ced8527..0000000 --- a/vendor/kylekatarnls/update-helper/composer.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "kylekatarnls/update-helper", - "description": "Update helper", - "type": "composer-plugin", - "license": "MIT", - "minimum-stability": "dev", - "prefer-stable": true, - "authors": [ - { - "name": "Kyle", - "email": "kylekatarnls@gmail.com" - } - ], - "require": { - "php": ">=5.3.0", - "composer-plugin-api": "^1.1.0 || ^2.0.0" - }, - "require-dev": { - "composer/composer": "2.0.x-dev || ^2.0.0-dev", - "phpunit/phpunit": ">=4.8.35 <6.0", - "codeclimate/php-test-reporter": "dev-master" - }, - "autoload": { - "psr-0": { - "UpdateHelper\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "UpdateHelper\\Tests\\": "tests/UpdateHelper/" - } - }, - "scripts": { - "post-install-cmd": [ - "UpdateHelper\\UpdateHelper::check" - ], - "post-update-cmd": [ - "UpdateHelper\\UpdateHelper::check" - ], - "post-package-install": [ - "UpdateHelper\\UpdateHelper::check" - ], - "post-package-update": [ - "UpdateHelper\\UpdateHelper::check" - ] - }, - "extra": { - "class": "UpdateHelper\\ComposerPlugin" - } -} diff --git a/vendor/kylekatarnls/update-helper/src/UpdateHelper/ComposerPlugin.php b/vendor/kylekatarnls/update-helper/src/UpdateHelper/ComposerPlugin.php deleted file mode 100644 index f0e2313..0000000 --- a/vendor/kylekatarnls/update-helper/src/UpdateHelper/ComposerPlugin.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace UpdateHelper; - -use Composer\Composer; -use Composer\EventDispatcher\Event; -use Composer\EventDispatcher\EventSubscriberInterface; -use Composer\IO\IOInterface; -use Composer\Plugin\PluginInterface; - -class ComposerPlugin implements PluginInterface, EventSubscriberInterface -{ - protected $io; - - public function activate(Composer $composer, IOInterface $io) - { - $this->io = $io; - } - - public static function getSubscribedEvents() - { - return array( - 'post-autoload-dump' => array( - array('onAutoloadDump', 0), - ), - ); - } - - public function onAutoloadDump(Event $event) - { - if (!class_exists('UpdateHelper\\UpdateHelper')) { - return; - } - - UpdateHelper::check($event); - } -} diff --git a/vendor/kylekatarnls/update-helper/src/UpdateHelper/NotUpdateInterfaceInstanceException.php b/vendor/kylekatarnls/update-helper/src/UpdateHelper/NotUpdateInterfaceInstanceException.php deleted file mode 100644 index 8213b5e..0000000 --- a/vendor/kylekatarnls/update-helper/src/UpdateHelper/NotUpdateInterfaceInstanceException.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -namespace UpdateHelper; - -use InvalidArgumentException; - -class NotUpdateInterfaceInstanceException extends InvalidArgumentException -{ -} diff --git a/vendor/kylekatarnls/update-helper/src/UpdateHelper/UpdateHelper.php b/vendor/kylekatarnls/update-helper/src/UpdateHelper/UpdateHelper.php deleted file mode 100644 index 3d3f0c0..0000000 --- a/vendor/kylekatarnls/update-helper/src/UpdateHelper/UpdateHelper.php +++ /dev/null @@ -1,385 +0,0 @@ -<?php - -namespace UpdateHelper; - -use Composer\Composer; -use Composer\EventDispatcher\Event; -use Composer\Installer\PackageEvent; -use Composer\IO\IOInterface; -use Composer\Json\JsonFile; -use Composer\Script\Event as ScriptEvent; -use Composer\Semver\Semver; -use Exception; -use InvalidArgumentException; -use RuntimeException; -use Throwable; - -class UpdateHelper -{ - /** @var Event */ - private $event; - /** @var IOInterface|null */ - private $io; - /** @var Composer */ - private $composer; - /** @var array */ - private $dependencies = array(); - /** @var string */ - private $composerFilePath; - /** @var JsonFile */ - private $file; - - protected static function appendConfig(&$classes, $directory, $key = null) - { - $file = $directory.DIRECTORY_SEPARATOR.'composer.json'; - $json = new JsonFile($file); - $key = $key ? $key : 'update-helper'; - - try { - $dependencyConfig = $json->read(); - } catch (Exception $e) { - $dependencyConfig = null; - } - - if (is_array($dependencyConfig) && isset($dependencyConfig['extra'], $dependencyConfig['extra'][$key])) { - $classes[$file] = $dependencyConfig['extra'][$key]; - } - } - - protected static function getUpdateHelperConfig(Composer $composer, $key = null) - { - $vendorDir = $composer->getConfig()->get('vendor-dir'); - - $npm = array(); - - foreach (scandir($vendorDir) as $namespace) { - if ($namespace === '.' || $namespace === '..' || !is_dir($directory = $vendorDir.DIRECTORY_SEPARATOR.$namespace)) { - continue; - } - - foreach (scandir($directory) as $dependency) { - if ($dependency === '.' || $dependency === '..' || !is_dir($subDirectory = $directory.DIRECTORY_SEPARATOR.$dependency)) { - continue; - } - - static::appendConfig($npm, $subDirectory, $key); - } - } - - static::appendConfig($npm, dirname($vendorDir), $key); - - return $npm; - } - - /** - * @param Event $event - * @param IOInterface $io - * @param Composer $composer - * @param string[] $subClasses - */ - protected static function checkHelper($event, IOInterface $io, $composer, $class) - { - if (!is_string($class) || !class_exists($class)) { - throw new NotUpdateInterfaceInstanceException(); - } - - try { - $helper = new $class(); - } catch (Exception $e) { - throw new InvalidArgumentException($e->getMessage(), 1000, $e); - } catch (Throwable $e) { - throw new InvalidArgumentException($e->getMessage(), 1000, $e); - } - - if (!($helper instanceof UpdateHelperInterface)) { - throw new NotUpdateInterfaceInstanceException(); - } - - $helper->check(new static($event, $io, $composer)); - } - - /** - * @param string $file - * @param Event $event - * @param IOInterface $io - * @param Composer $composer - * @param string[] $subClasses - */ - protected static function checkFileHelpers($file, $event, IOInterface $io, $composer, array $subClasses) - { - foreach ($subClasses as $class) { - try { - static::checkHelper($event, $io, $composer, $class); - } catch (InvalidArgumentException $e) { - $io->writeError($e instanceof NotUpdateInterfaceInstanceException - ? 'UpdateHelper error in '.$file.":\n".JsonFile::encode($class).' is not an instance of UpdateHelperInterface.' - : 'UpdateHelper error: '.$e->getPrevious()->getMessage(). - "\nFile: ".$e->getPrevious()->getFile(). - "\nLine:".$e->getPrevious()->getLine(). - "\n\n".$e->getPrevious()->getTraceAsString() - ); - continue; - } - } - } - - public static function check(Event $event) - { - if (!($event instanceof ScriptEvent) && !($event instanceof PackageEvent)) { - return; - } - - $io = $event->getIO(); - $composer = $event->getComposer(); - $autoload = $composer->getConfig()->get('vendor-dir').'/autoload.php'; - - if (file_exists($autoload)) { - include_once $autoload; - } - - $classes = static::getUpdateHelperConfig($composer); - - foreach ($classes as $file => $subClasses) { - static::checkFileHelpers($file, $event, $io, $composer, (array) $subClasses); - } - } - - public function __construct(Event $event, IOInterface $io = null, Composer $composer = null) - { - $this->event = $event; - $this->io = $io ?: (method_exists($event, 'getIO') ? $event->getIO() : null); - $this->composer = $composer ?: (method_exists($event, 'getComposer') ? $event->getComposer() : null); - - if ($this->composer && - ($directory = $this->composer->getConfig()->get('archive-dir')) && - file_exists($file = $directory.'/composer.json') - ) { - $this->composerFilePath = $file; - $this->file = new JsonFile($this->composerFilePath); - $this->dependencies = $this->file->read(); - } - } - - /** - * @return JsonFile - */ - public function getFile() - { - return $this->file; - } - - /** - * @return string - */ - public function getComposerFilePath() - { - return $this->composerFilePath; - } - - /** - * @return Composer - */ - public function getComposer() - { - return $this->composer; - } - - /** - * @return Event - */ - public function getEvent() - { - return $this->event; - } - - /** - * @return IOInterface|null - */ - public function getIo() - { - return $this->io; - } - - /** - * @return array - */ - public function getDependencies() - { - return $this->dependencies; - } - - /** - * @return array - */ - public function getDevDependencies() - { - return isset($this->dependencies['require-dev']) ? $this->dependencies['require-dev'] : array(); - } - - /** - * @return array - */ - public function getProdDependencies() - { - return isset($this->dependencies['require']) ? $this->dependencies['require'] : array(); - } - - /** - * @return array - */ - public function getFlattenDependencies() - { - return array_merge($this->getDevDependencies(), $this->getProdDependencies()); - } - - /** - * @param string $dependency - * - * @return bool - */ - public function hasAsDevDependency($dependency) - { - return isset($this->dependencies['require-dev'][$dependency]); - } - - /** - * @param string $dependency - * - * @return bool - */ - public function hasAsProdDependency($dependency) - { - return isset($this->dependencies['require'][$dependency]); - } - - /** - * @param string $dependency - * - * @return bool - */ - public function hasAsDependency($dependency) - { - return $this->hasAsDevDependency($dependency) || $this->hasAsProdDependency($dependency); - } - - /** - * @param string $dependency - * @param string $version - * - * @return bool - */ - public function isDependencyAtLeast($dependency, $version) - { - if ($this->hasAsProdDependency($dependency)) { - return Semver::satisfies($version, $this->dependencies['require'][$dependency]); - } - - if ($this->hasAsDevDependency($dependency)) { - return Semver::satisfies($version, $this->dependencies['require-dev'][$dependency]); - } - - return false; - } - - /** - * @param string $dependency - * @param string $version - * - * @return bool - */ - public function isDependencyLesserThan($dependency, $version) - { - return !$this->isDependencyAtLeast($dependency, $version); - } - - /** - * @param string $dependency - * @param string $version - * @param array $environments - * - * @throws Exception - * - * @return $this - */ - public function setDependencyVersion($dependency, $version, $environments = array('require', 'require-dev')) - { - return $this->setDependencyVersions(array($dependency => $version), $environments); - } - - /** - * @param array $dependencies - * @param array $environments - * - * @throws Exception - * - * @return $this - */ - public function setDependencyVersions($dependencies, $environments = array('require', 'require-dev')) - { - if (!$this->composerFilePath) { - throw new RuntimeException('No composer instance detected.'); - } - - $touched = false; - - foreach ($environments as $environment) { - foreach ($dependencies as $dependency => $version) { - if (isset($this->dependencies[$environment], $this->dependencies[$environment][$dependency])) { - $this->dependencies[$environment][$dependency] = $version; - $touched = true; - } - } - } - - if ($touched) { - if (!$this->composerFilePath) { - throw new RuntimeException('composer.json not found (custom vendor-dir are not yet supported).'); - } - - $file = new JsonFile($this->composerFilePath); - $file->write($this->dependencies); - } - - return $this; - } - - /** - * @return $this - */ - public function update() - { - $output = shell_exec('composer update --no-scripts'); - - if (!empty($output)) { - $this->write($output); - } - - return $this; - } - - /** - * @param string|array $text - */ - public function write($text) - { - if ($this->io) { - $this->io->write($text); - - return; - } - - if (is_array($text)) { - $text = implode("\n", $text); - } - - echo $text; - } - - /** - * @return bool - */ - public function isInteractive() - { - return $this->io && $this->io->isInteractive(); - } -} diff --git a/vendor/kylekatarnls/update-helper/src/UpdateHelper/UpdateHelperInterface.php b/vendor/kylekatarnls/update-helper/src/UpdateHelper/UpdateHelperInterface.php deleted file mode 100644 index 3809dc0..0000000 --- a/vendor/kylekatarnls/update-helper/src/UpdateHelper/UpdateHelperInterface.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php - -namespace UpdateHelper; - -interface UpdateHelperInterface -{ - public function check(UpdateHelper $helper); -} diff --git a/vendor/nesbot/carbon/LICENSE b/vendor/nesbot/carbon/LICENSE deleted file mode 100644 index 6de45eb..0000000 --- a/vendor/nesbot/carbon/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) Brian Nesbitt - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/nesbot/carbon/bin/upgrade-carbon b/vendor/nesbot/carbon/bin/upgrade-carbon deleted file mode 100644 index 49c4c9a..0000000 --- a/vendor/nesbot/carbon/bin/upgrade-carbon +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env php -<?php - -$dir = __DIR__.'/..'; - -if (!file_exists($dir.'/autoload.php')) { - $dir = __DIR__.'/../vendor'; -} - -if (!file_exists($dir.'/autoload.php')) { - $dir = __DIR__.'/../../..'; -} - -if (!file_exists($dir.'/autoload.php')) { - echo 'Autoload not found.'; - exit(1); -} - -$composerInstalled = false; - -if (!file_exists($dir.'/composer/composer')) { - $composerInstalled = true; - shell_exec('composer require --dev composer/composer'); -} - -include $dir.'/autoload.php'; - -Carbon\Upgrade::upgrade(); - -if ($composerInstalled) { - shell_exec('composer remove --dev composer/composer'); -} - -exit(0); diff --git a/vendor/nesbot/carbon/bin/upgrade-carbon.bat b/vendor/nesbot/carbon/bin/upgrade-carbon.bat deleted file mode 100644 index 428bf4f..0000000 --- a/vendor/nesbot/carbon/bin/upgrade-carbon.bat +++ /dev/null @@ -1,4 +0,0 @@ -@ECHO OFF -setlocal DISABLEDELAYEDEXPANSION -SET BIN_TARGET=%~dp0/upgrade-carbon -php "%BIN_TARGET%" %* diff --git a/vendor/nesbot/carbon/composer.json b/vendor/nesbot/carbon/composer.json deleted file mode 100644 index 991347c..0000000 --- a/vendor/nesbot/carbon/composer.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "nesbot/carbon", - "type": "library", - "description": "A simple API extension for DateTime.", - "keywords": [ - "date", - "time", - "DateTime" - ], - "homepage": "http://carbon.nesbot.com", - "support": { - "issues": "https://github.com/briannesbitt/Carbon/issues", - "source": "https://github.com/briannesbitt/Carbon" - }, - "license": "MIT", - "authors": [ - { - "name": "Brian Nesbitt", - "email": "brian@nesbot.com", - "homepage": "http://nesbot.com" - } - ], - "bin": ["bin/upgrade-carbon"], - "require": { - "php": ">=5.3.9", - "kylekatarnls/update-helper": "^1.1", - "symfony/translation": "~2.6 || ~3.0 || ~4.0" - }, - "require-dev": { - "composer/composer": "^1.2", - "friendsofphp/php-cs-fixer": "~2", - "phpunit/phpunit": "^4.8.35 || ^5.7" - }, - "autoload": { - "psr-4": { - "": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Tests\\": "tests/" - } - }, - "config": { - "sort-packages": true - }, - "scripts": { - "test": [ - "@phpunit", - "@phpcs" - ], - "phpunit": "phpunit --verbose --coverage-clover=coverage.xml", - "phpcs": "php-cs-fixer fix -v --diff --dry-run", - "phpstan": "phpstan analyse --configuration phpstan.neon --level 3 src tests", - "post-autoload-dump": [ - "UpdateHelper\\UpdateHelper::check" - ], - "upgrade-carbon": [ - "Carbon\\Upgrade::upgrade" - ] - }, - "extra": { - "update-helper": "Carbon\\Upgrade", - "laravel": { - "providers": [ - "Carbon\\Laravel\\ServiceProvider" - ] - } - } -} diff --git a/vendor/nesbot/carbon/readme.md b/vendor/nesbot/carbon/readme.md deleted file mode 100644 index 5e9d1cc..0000000 --- a/vendor/nesbot/carbon/readme.md +++ /dev/null @@ -1,94 +0,0 @@ -# Carbon - -[](https://packagist.org/packages/nesbot/carbon) -[](https://packagist.org/packages/nesbot/carbon) -[](https://travis-ci.org/briannesbitt/Carbon) -[](https://styleci.io/repos/5724990) -[](https://codecov.io/github/briannesbitt/Carbon?branch=master) -[](https://php-eye.com/package/nesbot/carbon) -[](https://github.com/phpstan/phpstan) - -A simple PHP API extension for DateTime. [http://carbon.nesbot.com](http://carbon.nesbot.com) - -```php -use Carbon\Carbon; - -printf("Right now is %s", Carbon::now()->toDateTimeString()); -printf("Right now in Vancouver is %s", Carbon::now('America/Vancouver')); //implicit __toString() -$tomorrow = Carbon::now()->addDay(); -$lastWeek = Carbon::now()->subWeek(); -$nextSummerOlympics = Carbon::createFromDate(2016)->addYears(4); - -$officialDate = Carbon::now()->toRfc2822String(); - -$howOldAmI = Carbon::createFromDate(1975, 5, 21)->age; - -$noonTodayLondonTime = Carbon::createFromTime(12, 0, 0, 'Europe/London'); - -$internetWillBlowUpOn = Carbon::create(2038, 01, 19, 3, 14, 7, 'GMT'); - -// Don't really want this to happen so mock now -Carbon::setTestNow(Carbon::createFromDate(2000, 1, 1)); - -// comparisons are always done in UTC -if (Carbon::now()->gte($internetWillBlowUpOn)) { - die(); -} - -// Phew! Return to normal behaviour -Carbon::setTestNow(); - -if (Carbon::now()->isWeekend()) { - echo 'Party!'; -} -echo Carbon::now()->subMinutes(2)->diffForHumans(); // '2 minutes ago' - -// ... but also does 'from now', 'after' and 'before' -// rolling up to seconds, minutes, hours, days, months, years - -$daysSinceEpoch = Carbon::createFromTimestamp(0)->diffInDays(); -``` - -## Installation - -### With Composer - -``` -$ composer require nesbot/carbon -``` - -```json -{ - "require": { - "nesbot/carbon": "~1.21" - } -} -``` - -```php -<?php -require 'vendor/autoload.php'; - -use Carbon\Carbon; - -printf("Now: %s", Carbon::now()); -``` - -<a name="install-nocomposer"/> - -### Without Composer - -Why are you not using [composer](http://getcomposer.org/)? Download [Carbon.php](https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Carbon.php) from the repo and save the file into your project path somewhere. - -```php -<?php -require 'path/to/Carbon.php'; - -use Carbon\Carbon; - -printf("Now: %s", Carbon::now()); -``` - -## Docs - -[http://carbon.nesbot.com/docs](http://carbon.nesbot.com/docs) diff --git a/vendor/nesbot/carbon/src/Carbon/Carbon.php b/vendor/nesbot/carbon/src/Carbon/Carbon.php deleted file mode 100644 index 7b8a5d9..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Carbon.php +++ /dev/null @@ -1,5427 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use Carbon\Exceptions\InvalidDateException; -use Closure; -use DateInterval; -use DatePeriod; -use DateTime; -use DateTimeInterface; -use DateTimeZone; -use InvalidArgumentException; -use JsonSerializable; -use Symfony\Component\Translation\TranslatorInterface; - -/** - * A simple API extension for DateTime - * - * @property int $year - * @property int $yearIso - * @property int $month - * @property int $day - * @property int $hour - * @property int $minute - * @property int $second - * @property int $timestamp seconds since the Unix Epoch - * @property \DateTimeZone $timezone the current timezone - * @property \DateTimeZone $tz alias of timezone - * @property-read int $micro - * @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) - * @property-read int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) - * @property-read int $dayOfYear 0 through 365 - * @property-read int $weekOfMonth 1 through 5 - * @property-read int $weekNumberInMonth 1 through 5 - * @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday - * @property-read int $daysInMonth number of days in the given month - * @property-read int $age does a diffInYears() with default parameters - * @property-read int $quarter the quarter of this instance, 1 - 4 - * @property-read int $offset the timezone offset in seconds from UTC - * @property-read int $offsetHours the timezone offset in hours from UTC - * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise - * @property-read bool $local checks if the timezone is local, true if local, false otherwise - * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise - * @property-read string $timezoneName - * @property-read string $tzName - * @property-read string $englishDayOfWeek the day of week in English - * @property-read string $shortEnglishDayOfWeek the abbreviated day of week in English - * @property-read string $englishMonth the day of week in English - * @property-read string $shortEnglishMonth the abbreviated day of week in English - * @property-read string $localeDayOfWeek the day of week in current locale LC_TIME - * @property-read string $shortLocaleDayOfWeek the abbreviated day of week in current locale LC_TIME - * @property-read string $localeMonth the month in current locale LC_TIME - * @property-read string $shortLocaleMonth the abbreviated month in current locale LC_TIME - */ -class Carbon extends DateTime implements JsonSerializable -{ - const NO_ZERO_DIFF = 01; - const JUST_NOW = 02; - const ONE_DAY_WORDS = 04; - const TWO_DAY_WORDS = 010; - - // Substitutes for Carbon 2 modes - const DIFF_RELATIVE_TO_NOW = 'relative-to-now'; - const DIFF_RELATIVE_TO_OTHER = 'relative-to-other'; - - /** - * The day constants. - */ - const SUNDAY = 0; - const MONDAY = 1; - const TUESDAY = 2; - const WEDNESDAY = 3; - const THURSDAY = 4; - const FRIDAY = 5; - const SATURDAY = 6; - - /** - * Names of days of the week. - * - * @var array - */ - protected static $days = array( - self::SUNDAY => 'Sunday', - self::MONDAY => 'Monday', - self::TUESDAY => 'Tuesday', - self::WEDNESDAY => 'Wednesday', - self::THURSDAY => 'Thursday', - self::FRIDAY => 'Friday', - self::SATURDAY => 'Saturday', - ); - - /** - * Number of X in Y. - */ - const YEARS_PER_MILLENNIUM = 1000; - const YEARS_PER_CENTURY = 100; - const YEARS_PER_DECADE = 10; - const MONTHS_PER_YEAR = 12; - const MONTHS_PER_QUARTER = 3; - const WEEKS_PER_YEAR = 52; - const WEEKS_PER_MONTH = 4; - const DAYS_PER_WEEK = 7; - const HOURS_PER_DAY = 24; - const MINUTES_PER_HOUR = 60; - const SECONDS_PER_MINUTE = 60; - const MICROSECONDS_PER_MILLISECOND = 1000; - const MICROSECONDS_PER_SECOND = 1000000; - - /** - * RFC7231 DateTime format. - * - * @var string - */ - const RFC7231_FORMAT = 'D, d M Y H:i:s \G\M\T'; - - /** - * Default format to use for __toString method when type juggling occurs. - * - * @var string - */ - const DEFAULT_TO_STRING_FORMAT = 'Y-m-d H:i:s'; - - /** - * Format for converting mocked time, includes microseconds. - * - * @var string - */ - const MOCK_DATETIME_FORMAT = 'Y-m-d H:i:s.u'; - - /** - * Customizable PHP_INT_SIZE override. - * - * @var int - */ - public static $PHPIntSize = PHP_INT_SIZE; - - /** - * Format to use for __toString method when type juggling occurs. - * - * @var string - */ - protected static $toStringFormat = self::DEFAULT_TO_STRING_FORMAT; - - /** - * First day of week. - * - * @var int - */ - protected static $weekStartsAt = self::MONDAY; - - /** - * Last day of week. - * - * @var int - */ - protected static $weekEndsAt = self::SUNDAY; - - /** - * Days of weekend. - * - * @var array - */ - protected static $weekendDays = array( - self::SATURDAY, - self::SUNDAY, - ); - - /** - * Midday/noon hour. - * - * @var int - */ - protected static $midDayAt = 12; - - /** - * Format regex patterns. - * - * @var array - */ - protected static $regexFormats = array( - 'd' => '(3[01]|[12][0-9]|0[1-9])', - 'D' => '([a-zA-Z]{3})', - 'j' => '([123][0-9]|[1-9])', - 'l' => '([a-zA-Z]{2,})', - 'N' => '([1-7])', - 'S' => '([a-zA-Z]{2})', - 'w' => '([0-6])', - 'z' => '(36[0-5]|3[0-5][0-9]|[12][0-9]{2}|[1-9]?[0-9])', - 'W' => '(5[012]|[1-4][0-9]|[1-9])', - 'F' => '([a-zA-Z]{2,})', - 'm' => '(1[012]|0[1-9])', - 'M' => '([a-zA-Z]{3})', - 'n' => '(1[012]|[1-9])', - 't' => '(2[89]|3[01])', - 'L' => '(0|1)', - 'o' => '([1-9][0-9]{0,4})', - 'Y' => '([1-9]?[0-9]{4})', - 'y' => '([0-9]{2})', - 'a' => '(am|pm)', - 'A' => '(AM|PM)', - 'B' => '([0-9]{3})', - 'g' => '(1[012]|[1-9])', - 'G' => '(2[0-3]|1?[0-9])', - 'h' => '(1[012]|0[1-9])', - 'H' => '(2[0-3]|[01][0-9])', - 'i' => '([0-5][0-9])', - 's' => '([0-5][0-9])', - 'u' => '([0-9]{1,6})', - 'v' => '([0-9]{1,3})', - 'e' => '([a-zA-Z]{1,5})|([a-zA-Z]*\/[a-zA-Z]*)', - 'I' => '(0|1)', - 'O' => '([\+\-](1[012]|0[0-9])[0134][05])', - 'P' => '([\+\-](1[012]|0[0-9]):[0134][05])', - 'T' => '([a-zA-Z]{1,5})', - 'Z' => '(-?[1-5]?[0-9]{1,4})', - 'U' => '([0-9]*)', - - // The formats below are combinations of the above formats. - 'c' => '(([1-9]?[0-9]{4})\-(1[012]|0[1-9])\-(3[01]|[12][0-9]|0[1-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])[\+\-](1[012]|0[0-9]):([0134][05]))', // Y-m-dTH:i:sP - 'r' => '(([a-zA-Z]{3}), ([123][0-9]|[1-9]) ([a-zA-Z]{3}) ([1-9]?[0-9]{4}) (2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]) [\+\-](1[012]|0[0-9])([0134][05]))', // D, j M Y H:i:s O - ); - - /** - * A test Carbon instance to be returned when now instances are created. - * - * @var \Carbon\Carbon - */ - protected static $testNow; - - /** - * A translator to ... er ... translate stuff. - * - * @var \Symfony\Component\Translation\TranslatorInterface - */ - protected static $translator; - - /** - * The errors that can occur. - * - * @var array - */ - protected static $lastErrors; - - /** - * The custom Carbon JSON serializer. - * - * @var callable|null - */ - protected static $serializer; - - /** - * The registered string macros. - * - * @var array - */ - protected static $localMacros = array(); - - /** - * Will UTF8 encoding be used to print localized date/time ? - * - * @var bool - */ - protected static $utf8 = false; - - /** - * Add microseconds to now on PHP < 7.1 and 7.1.3. true by default. - * - * @var bool - */ - protected static $microsecondsFallback = true; - - /** - * Indicates if months should be calculated with overflow. - * - * @var bool - */ - protected static $monthsOverflow = true; - - /** - * Indicates if years should be calculated with overflow. - * - * @var bool - */ - protected static $yearsOverflow = true; - - /** - * Indicates if years are compared with month by default so isSameMonth and isSameQuarter have $ofSameYear set - * to true by default. - * - * @var bool - */ - protected static $compareYearWithMonth = false; - - /** - * Options for diffForHumans(). - * - * @var int - */ - protected static $humanDiffOptions = self::NO_ZERO_DIFF; - - /** - * @param int $humanDiffOptions - */ - public static function setHumanDiffOptions($humanDiffOptions) - { - static::$humanDiffOptions = $humanDiffOptions; - } - - /** - * @param int $humanDiffOption - */ - public static function enableHumanDiffOption($humanDiffOption) - { - static::$humanDiffOptions = static::getHumanDiffOptions() | $humanDiffOption; - } - - /** - * @param int $humanDiffOption - */ - public static function disableHumanDiffOption($humanDiffOption) - { - static::$humanDiffOptions = static::getHumanDiffOptions() & ~$humanDiffOption; - } - - /** - * @return int - */ - public static function getHumanDiffOptions() - { - return static::$humanDiffOptions; - } - - /** - * Add microseconds to now on PHP < 7.1 and 7.1.3 if set to true, - * let microseconds to 0 on those PHP versions if false. - * - * @param bool $microsecondsFallback - */ - public static function useMicrosecondsFallback($microsecondsFallback = true) - { - static::$microsecondsFallback = $microsecondsFallback; - } - - /** - * Return true if microseconds fallback on PHP < 7.1 and 7.1.3 is - * enabled. false if disabled. - * - * @return bool - */ - public static function isMicrosecondsFallbackEnabled() - { - return static::$microsecondsFallback; - } - - /** - * Indicates if months should be calculated with overflow. - * - * @param bool $monthsOverflow - * - * @return void - */ - public static function useMonthsOverflow($monthsOverflow = true) - { - static::$monthsOverflow = $monthsOverflow; - } - - /** - * Reset the month overflow behavior. - * - * @return void - */ - public static function resetMonthsOverflow() - { - static::$monthsOverflow = true; - } - - /** - * Get the month overflow behavior. - * - * @return bool - */ - public static function shouldOverflowMonths() - { - return static::$monthsOverflow; - } - - /** - * Indicates if years should be calculated with overflow. - * - * @param bool $yearsOverflow - * - * @return void - */ - public static function useYearsOverflow($yearsOverflow = true) - { - static::$yearsOverflow = $yearsOverflow; - } - - /** - * Reset the month overflow behavior. - * - * @return void - */ - public static function resetYearsOverflow() - { - static::$yearsOverflow = true; - } - - /** - * Get the month overflow behavior. - * - * @return bool - */ - public static function shouldOverflowYears() - { - return static::$yearsOverflow; - } - - /** - * Get the month comparison default behavior. - * - * @return bool - */ - public static function compareYearWithMonth($compareYearWithMonth = true) - { - static::$compareYearWithMonth = $compareYearWithMonth; - } - - /** - * Get the month comparison default behavior. - * - * @return bool - */ - public static function shouldCompareYearWithMonth() - { - return static::$compareYearWithMonth; - } - - /** - * Creates a DateTimeZone from a string, DateTimeZone or integer offset. - * - * @param \DateTimeZone|string|int|null $object - * - * @throws \InvalidArgumentException - * - * @return \DateTimeZone - */ - protected static function safeCreateDateTimeZone($object) - { - if ($object === null) { - // Don't return null... avoid Bug #52063 in PHP <5.3.6 - return new DateTimeZone(date_default_timezone_get()); - } - - if ($object instanceof DateTimeZone) { - return $object; - } - - if (is_numeric($object)) { - $tzName = timezone_name_from_abbr(null, $object * 3600, true); - - if ($tzName === false) { - throw new InvalidArgumentException('Unknown or bad timezone ('.$object.')'); - } - - $object = $tzName; - } - - $tz = @timezone_open($object = (string) $object); - - if ($tz !== false) { - return $tz; - } - - // Work-around for a bug fixed in PHP 5.5.10 https://bugs.php.net/bug.php?id=45528 - // See: https://stackoverflow.com/q/14068594/2646927 - // @codeCoverageIgnoreStart - if (strpos($object, ':') !== false) { - try { - return static::createFromFormat('O', $object)->getTimezone(); - } catch (InvalidArgumentException $e) { - // - } - } - // @codeCoverageIgnoreEnd - - throw new InvalidArgumentException('Unknown or bad timezone ('.$object.')'); - } - - /////////////////////////////////////////////////////////////////// - //////////////////////////// CONSTRUCTORS ///////////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * Create a new Carbon instance. - * - * Please see the testing aids section (specifically static::setTestNow()) - * for more on the possibility of this constructor returning a test instance. - * - * @param string|null $time - * @param \DateTimeZone|string|null $tz - */ - public function __construct($time = null, $tz = null) - { - // If the class has a test now set and we are trying to create a now() - // instance then override as required - $isNow = empty($time) || $time === 'now'; - if (static::hasTestNow() && ($isNow || static::hasRelativeKeywords($time))) { - $testInstance = clone static::getTestNow(); - - //shift the time according to the given time zone - if ($tz !== null && $tz !== static::getTestNow()->getTimezone()) { - $testInstance->setTimezone($tz); - } else { - $tz = $testInstance->getTimezone(); - } - - if (static::hasRelativeKeywords($time)) { - $testInstance->modify($time); - } - - $time = $testInstance->format(static::MOCK_DATETIME_FORMAT); - } - - $timezone = static::safeCreateDateTimeZone($tz); - // @codeCoverageIgnoreStart - if ($isNow && !isset($testInstance) && static::isMicrosecondsFallbackEnabled() && ( - version_compare(PHP_VERSION, '7.1.0-dev', '<') - || - version_compare(PHP_VERSION, '7.1.3-dev', '>=') && version_compare(PHP_VERSION, '7.1.4-dev', '<') - ) - ) { - // Get microseconds from microtime() if "now" asked and PHP < 7.1 and PHP 7.1.3 if fallback enabled. - list($microTime, $timeStamp) = explode(' ', microtime()); - $dateTime = new DateTime('now', $timezone); - $dateTime->setTimestamp($timeStamp); // Use the timestamp returned by microtime as now can happen in the next second - $time = $dateTime->format(static::DEFAULT_TO_STRING_FORMAT).substr($microTime, 1, 7); - } - // @codeCoverageIgnoreEnd - - // Work-around for PHP bug https://bugs.php.net/bug.php?id=67127 - if (strpos((string) .1, '.') === false) { - $locale = setlocale(LC_NUMERIC, '0'); - setlocale(LC_NUMERIC, 'C'); - } - parent::__construct($time, $timezone); - if (isset($locale)) { - setlocale(LC_NUMERIC, $locale); - } - static::setLastErrors(parent::getLastErrors()); - } - - /** - * Create a Carbon instance from a DateTime one. - * - * @param \DateTime|\DateTimeInterface $date - * - * @return static - */ - public static function instance($date) - { - if ($date instanceof static) { - return clone $date; - } - - static::expectDateTime($date); - - return new static($date->format('Y-m-d H:i:s.u'), $date->getTimezone()); - } - - /** - * Create a carbon instance from a string. - * - * This is an alias for the constructor that allows better fluent syntax - * as it allows you to do Carbon::parse('Monday next week')->fn() rather - * than (new Carbon('Monday next week'))->fn(). - * - * @param string|null $time - * @param \DateTimeZone|string|null $tz - * - * @return static - */ - public static function parse($time = null, $tz = null) - { - return new static($time, $tz); - } - - /** - * Get a Carbon instance for the current date and time. - * - * @param \DateTimeZone|string|null $tz - * - * @return static - */ - public static function now($tz = null) - { - return new static(null, $tz); - } - - /** - * Create a Carbon instance for today. - * - * @param \DateTimeZone|string|null $tz - * - * @return static - */ - public static function today($tz = null) - { - return static::parse('today', $tz); - } - - /** - * Create a Carbon instance for tomorrow. - * - * @param \DateTimeZone|string|null $tz - * - * @return static - */ - public static function tomorrow($tz = null) - { - return static::parse('tomorrow', $tz); - } - - /** - * Create a Carbon instance for yesterday. - * - * @param \DateTimeZone|string|null $tz - * - * @return static - */ - public static function yesterday($tz = null) - { - return static::parse('yesterday', $tz); - } - - /** - * Create a Carbon instance for the greatest supported date. - * - * @return static - */ - public static function maxValue() - { - if (self::$PHPIntSize === 4) { - // 32 bit - return static::createFromTimestamp(PHP_INT_MAX); // @codeCoverageIgnore - } - - // 64 bit - return static::create(9999, 12, 31, 23, 59, 59); - } - - /** - * Create a Carbon instance for the lowest supported date. - * - * @return static - */ - public static function minValue() - { - if (self::$PHPIntSize === 4) { - // 32 bit - return static::createFromTimestamp(~PHP_INT_MAX); // @codeCoverageIgnore - } - - // 64 bit - return static::create(1, 1, 1, 0, 0, 0); - } - - /** - * Create a new Carbon instance from a specific date and time. - * - * If any of $year, $month or $day are set to null their now() values will - * be used. - * - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * - * If $hour is not null then the default values for $minute and $second - * will be 0. - * - * @param int|null $year - * @param int|null $month - * @param int|null $day - * @param int|null $hour - * @param int|null $minute - * @param int|null $second - * @param \DateTimeZone|string|null $tz - * - * @throws \InvalidArgumentException - * - * @return static - */ - public static function create($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) - { - $now = static::hasTestNow() ? static::getTestNow() : static::now($tz); - - $defaults = array_combine(array( - 'year', - 'month', - 'day', - 'hour', - 'minute', - 'second', - ), explode('-', $now->format('Y-n-j-G-i-s'))); - - $year = $year === null ? $defaults['year'] : $year; - $month = $month === null ? $defaults['month'] : $month; - $day = $day === null ? $defaults['day'] : $day; - - if ($hour === null) { - $hour = $defaults['hour']; - $minute = $minute === null ? $defaults['minute'] : $minute; - $second = $second === null ? $defaults['second'] : $second; - } else { - $minute = $minute === null ? 0 : $minute; - $second = $second === null ? 0 : $second; - } - - $fixYear = null; - - if ($year < 0) { - $fixYear = $year; - $year = 0; - } elseif ($year > 9999) { - $fixYear = $year - 9999; - $year = 9999; - } - - $instance = static::createFromFormat('!Y-n-j G:i:s', sprintf('%s-%s-%s %s:%02s:%02s', $year, $month, $day, $hour, $minute, $second), $tz); - - if ($fixYear !== null) { - $instance->addYears($fixYear); - } - - return $instance; - } - - /** - * Create a new safe Carbon instance from a specific date and time. - * - * If any of $year, $month or $day are set to null their now() values will - * be used. - * - * If $hour is null it will be set to its now() value and the default - * values for $minute and $second will be their now() values. - * - * If $hour is not null then the default values for $minute and $second - * will be 0. - * - * If one of the set values is not valid, an \InvalidArgumentException - * will be thrown. - * - * @param int|null $year - * @param int|null $month - * @param int|null $day - * @param int|null $hour - * @param int|null $minute - * @param int|null $second - * @param \DateTimeZone|string|null $tz - * - * @throws \Carbon\Exceptions\InvalidDateException|\InvalidArgumentException - * - * @return static - */ - public static function createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) - { - $fields = array( - 'year' => array(0, 9999), - 'month' => array(0, 12), - 'day' => array(0, 31), - 'hour' => array(0, 24), - 'minute' => array(0, 59), - 'second' => array(0, 59), - ); - - foreach ($fields as $field => $range) { - if ($$field !== null && (!is_int($$field) || $$field < $range[0] || $$field > $range[1])) { - throw new InvalidDateException($field, $$field); - } - } - - $instance = static::create($year, $month, $day, $hour, $minute, $second, $tz); - - foreach (array_reverse($fields) as $field => $range) { - if ($$field !== null && (!is_int($$field) || $$field !== $instance->$field)) { - throw new InvalidDateException($field, $$field); - } - } - - return $instance; - } - - /** - * Create a Carbon instance from just a date. The time portion is set to now. - * - * @param int|null $year - * @param int|null $month - * @param int|null $day - * @param \DateTimeZone|string|null $tz - * - * @throws \InvalidArgumentException - * - * @return static - */ - public static function createFromDate($year = null, $month = null, $day = null, $tz = null) - { - return static::create($year, $month, $day, null, null, null, $tz); - } - - /** - * Create a Carbon instance from just a date. The time portion is set to midnight. - * - * @param int|null $year - * @param int|null $month - * @param int|null $day - * @param \DateTimeZone|string|null $tz - * - * @return static - */ - public static function createMidnightDate($year = null, $month = null, $day = null, $tz = null) - { - return static::create($year, $month, $day, 0, 0, 0, $tz); - } - - /** - * Create a Carbon instance from just a time. The date portion is set to today. - * - * @param int|null $hour - * @param int|null $minute - * @param int|null $second - * @param \DateTimeZone|string|null $tz - * - * @throws \InvalidArgumentException - * - * @return static - */ - public static function createFromTime($hour = null, $minute = null, $second = null, $tz = null) - { - return static::create(null, null, null, $hour, $minute, $second, $tz); - } - - /** - * Create a Carbon instance from a time string. The date portion is set to today. - * - * @param string $time - * @param \DateTimeZone|string|null $tz - * - * @throws \InvalidArgumentException - * - * @return static - */ - public static function createFromTimeString($time, $tz = null) - { - return static::today($tz)->setTimeFromTimeString($time); - } - - private static function createFromFormatAndTimezone($format, $time, $tz) - { - return $tz !== null - ? parent::createFromFormat($format, $time, static::safeCreateDateTimeZone($tz)) - : parent::createFromFormat($format, $time); - } - - /** - * Create a Carbon instance from a specific format. - * - * @param string $format Datetime format - * @param string $time - * @param \DateTimeZone|string|null $tz - * - * @throws InvalidArgumentException - * - * @return static - */ - public static function createFromFormat($format, $time, $tz = null) - { - // First attempt to create an instance, so that error messages are based on the unmodified format. - $date = self::createFromFormatAndTimezone($format, $time, $tz); - $lastErrors = parent::getLastErrors(); - - if (($mock = static::getTestNow()) && ($date instanceof DateTime || $date instanceof DateTimeInterface)) { - // Set timezone from mock if custom timezone was neither given directly nor as a part of format. - // First let's skip the part that will be ignored by the parser. - $nonEscaped = '(?<!\\\\)(\\\\{2})*'; - - $nonIgnored = preg_replace("/^.*{$nonEscaped}!/s", '', $format); - - if ($tz === null && !preg_match("/{$nonEscaped}[eOPT]/", $nonIgnored)) { - $tz = $mock->getTimezone(); - } - - // Prepend mock datetime only if the format does not contain non escaped unix epoch reset flag. - if (!preg_match("/{$nonEscaped}[!|]/", $format)) { - $format = static::MOCK_DATETIME_FORMAT.' '.$format; - $time = $mock->format(static::MOCK_DATETIME_FORMAT).' '.$time; - } - - // Regenerate date from the modified format to base result on the mocked instance instead of now. - $date = self::createFromFormatAndTimezone($format, $time, $tz); - } - - if ($date instanceof DateTime || $date instanceof DateTimeInterface) { - $instance = static::instance($date); - $instance::setLastErrors($lastErrors); - - return $instance; - } - - throw new InvalidArgumentException(implode(PHP_EOL, $lastErrors['errors'])); - } - - /** - * Set last errors. - * - * @param array $lastErrors - * - * @return void - */ - private static function setLastErrors(array $lastErrors) - { - static::$lastErrors = $lastErrors; - } - - /** - * {@inheritdoc} - */ - public static function getLastErrors() - { - return static::$lastErrors; - } - - /** - * Create a Carbon instance from a timestamp. - * - * @param int $timestamp - * @param \DateTimeZone|string|null $tz - * - * @return static - */ - public static function createFromTimestamp($timestamp, $tz = null) - { - return static::today($tz)->setTimestamp($timestamp); - } - - /** - * Create a Carbon instance from a timestamp in milliseconds. - * - * @param int $timestamp - * @param \DateTimeZone|string|null $tz - * - * @return static - */ - public static function createFromTimestampMs($timestamp, $tz = null) - { - return static::createFromFormat('U.u', sprintf('%F', $timestamp / 1000)) - ->setTimezone($tz); - } - - /** - * Create a Carbon instance from an UTC timestamp. - * - * @param int $timestamp - * - * @return static - */ - public static function createFromTimestampUTC($timestamp) - { - return new static('@'.$timestamp); - } - - /** - * Make a Carbon instance from given variable if possible. - * - * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals - * and recurrences). Throw an exception for invalid format, but otherwise return null. - * - * @param mixed $var - * - * @return static|null - */ - public static function make($var) - { - if ($var instanceof DateTime || $var instanceof DateTimeInterface) { - return static::instance($var); - } - - if (is_string($var)) { - $var = trim($var); - $first = substr($var, 0, 1); - - if (is_string($var) && $first !== 'P' && $first !== 'R' && preg_match('/[a-z0-9]/i', $var)) { - return static::parse($var); - } - } - } - - /** - * Get a copy of the instance. - * - * @return static - */ - public function copy() - { - return clone $this; - } - - /** - * Returns a present instance in the same timezone. - * - * @return static - */ - public function nowWithSameTz() - { - return static::now($this->getTimezone()); - } - - /** - * Throws an exception if the given object is not a DateTime and does not implement DateTimeInterface - * and not in $other. - * - * @param mixed $date - * @param string|array $other - * - * @throws \InvalidArgumentException - */ - protected static function expectDateTime($date, $other = array()) - { - $message = 'Expected '; - foreach ((array) $other as $expect) { - $message .= "{$expect}, "; - } - - if (!$date instanceof DateTime && !$date instanceof DateTimeInterface) { - throw new InvalidArgumentException( - $message.'DateTime or DateTimeInterface, '. - (is_object($date) ? get_class($date) : gettype($date)).' given' - ); - } - } - - /** - * Return the Carbon instance passed through, a now instance in the same timezone - * if null given or parse the input if string given. - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * - * @return static - */ - protected function resolveCarbon($date = null) - { - if (!$date) { - return $this->nowWithSameTz(); - } - - if (is_string($date)) { - return static::parse($date, $this->getTimezone()); - } - - static::expectDateTime($date, array('null', 'string')); - - return $date instanceof self ? $date : static::instance($date); - } - - /////////////////////////////////////////////////////////////////// - ///////////////////////// GETTERS AND SETTERS ///////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * Get a part of the Carbon object - * - * @param string $name - * - * @throws \InvalidArgumentException - * - * @return string|int|bool|\DateTimeZone - */ - public function __get($name) - { - static $formats = array( - 'year' => 'Y', - 'yearIso' => 'o', - 'month' => 'n', - 'day' => 'j', - 'hour' => 'G', - 'minute' => 'i', - 'second' => 's', - 'micro' => 'u', - 'dayOfWeek' => 'w', - 'dayOfWeekIso' => 'N', - 'dayOfYear' => 'z', - 'weekOfYear' => 'W', - 'daysInMonth' => 't', - 'timestamp' => 'U', - 'englishDayOfWeek' => 'l', - 'shortEnglishDayOfWeek' => 'D', - 'englishMonth' => 'F', - 'shortEnglishMonth' => 'M', - 'localeDayOfWeek' => '%A', - 'shortLocaleDayOfWeek' => '%a', - 'localeMonth' => '%B', - 'shortLocaleMonth' => '%b', - ); - - switch (true) { - case isset($formats[$name]): - $format = $formats[$name]; - $method = substr($format, 0, 1) === '%' ? 'formatLocalized' : 'format'; - $value = $this->$method($format); - - return is_numeric($value) ? (int) $value : $value; - - case $name === 'weekOfMonth': - return (int) ceil($this->day / static::DAYS_PER_WEEK); - - case $name === 'weekNumberInMonth': - return (int) ceil(($this->day + $this->copy()->startOfMonth()->dayOfWeek - 1) / static::DAYS_PER_WEEK); - - case $name === 'age': - return $this->diffInYears(); - - case $name === 'quarter': - return (int) ceil($this->month / static::MONTHS_PER_QUARTER); - - case $name === 'offset': - return $this->getOffset(); - - case $name === 'offsetHours': - return $this->getOffset() / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR; - - case $name === 'dst': - return $this->format('I') === '1'; - - case $name === 'local': - return $this->getOffset() === $this->copy()->setTimezone(date_default_timezone_get())->getOffset(); - - case $name === 'utc': - return $this->getOffset() === 0; - - case $name === 'timezone' || $name === 'tz': - return $this->getTimezone(); - - case $name === 'timezoneName' || $name === 'tzName': - return $this->getTimezone()->getName(); - - default: - throw new InvalidArgumentException(sprintf("Unknown getter '%s'", $name)); - } - } - - /** - * Check if an attribute exists on the object - * - * @param string $name - * - * @return bool - */ - public function __isset($name) - { - try { - $this->__get($name); - } catch (InvalidArgumentException $e) { - return false; - } - - return true; - } - - /** - * Set a part of the Carbon object - * - * @param string $name - * @param string|int|\DateTimeZone $value - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function __set($name, $value) - { - switch ($name) { - case 'year': - case 'month': - case 'day': - case 'hour': - case 'minute': - case 'second': - list($year, $month, $day, $hour, $minute, $second) = explode('-', $this->format('Y-n-j-G-i-s')); - $$name = $value; - $this->setDateTime($year, $month, $day, $hour, $minute, $second); - break; - - case 'timestamp': - parent::setTimestamp($value); - break; - - case 'timezone': - case 'tz': - $this->setTimezone($value); - break; - - default: - throw new InvalidArgumentException(sprintf("Unknown setter '%s'", $name)); - } - } - - /** - * Set the instance's year - * - * @param int $value - * - * @return static - */ - public function year($value) - { - $this->year = $value; - - return $this; - } - - /** - * Set the instance's month - * - * @param int $value - * - * @return static - */ - public function month($value) - { - $this->month = $value; - - return $this; - } - - /** - * Set the instance's day - * - * @param int $value - * - * @return static - */ - public function day($value) - { - $this->day = $value; - - return $this; - } - - /** - * Set the instance's hour - * - * @param int $value - * - * @return static - */ - public function hour($value) - { - $this->hour = $value; - - return $this; - } - - /** - * Set the instance's minute - * - * @param int $value - * - * @return static - */ - public function minute($value) - { - $this->minute = $value; - - return $this; - } - - /** - * Set the instance's second - * - * @param int $value - * - * @return static - */ - public function second($value) - { - $this->second = $value; - - return $this; - } - - /** - * Sets the current date of the DateTime object to a different date. - * Calls modify as a workaround for a php bug - * - * @param int $year - * @param int $month - * @param int $day - * - * @return static - * - * @see https://github.com/briannesbitt/Carbon/issues/539 - * @see https://bugs.php.net/bug.php?id=63863 - */ - public function setDate($year, $month, $day) - { - $this->modify('+0 day'); - - return parent::setDate($year, $month, $day); - } - - /** - * Set the date and time all together - * - * @param int $year - * @param int $month - * @param int $day - * @param int $hour - * @param int $minute - * @param int $second - * - * @return static - */ - public function setDateTime($year, $month, $day, $hour, $minute, $second = 0) - { - return $this->setDate($year, $month, $day)->setTime($hour, $minute, $second); - } - - /** - * Set the time by time string - * - * @param string $time - * - * @return static - */ - public function setTimeFromTimeString($time) - { - if (strpos($time, ':') === false) { - $time .= ':0'; - } - - return $this->modify($time); - } - - /** - * Set the instance's timestamp - * - * @param int $value - * - * @return static - */ - public function timestamp($value) - { - return $this->setTimestamp($value); - } - - /** - * Alias for setTimezone() - * - * @param \DateTimeZone|string $value - * - * @return static - */ - public function timezone($value) - { - return $this->setTimezone($value); - } - - /** - * Alias for setTimezone() - * - * @param \DateTimeZone|string $value - * - * @return static - */ - public function tz($value) - { - return $this->setTimezone($value); - } - - /** - * Set the instance's timezone from a string or object - * - * @param \DateTimeZone|string $value - * - * @return static - */ - public function setTimezone($value) - { - parent::setTimezone(static::safeCreateDateTimeZone($value)); - // https://bugs.php.net/bug.php?id=72338 - // just workaround on this bug - $this->getTimestamp(); - - return $this; - } - - /** - * Set the year, month, and date for this instance to that of the passed instance. - * - * @param \Carbon\Carbon|\DateTimeInterface $date - * - * @return static - */ - public function setDateFrom($date) - { - $date = static::instance($date); - - $this->setDate($date->year, $date->month, $date->day); - - return $this; - } - - /** - * Set the hour, day, and time for this instance to that of the passed instance. - * - * @param \Carbon\Carbon|\DateTimeInterface $date - * - * @return static - */ - public function setTimeFrom($date) - { - $date = static::instance($date); - - $this->setTime($date->hour, $date->minute, $date->second); - - return $this; - } - - /** - * Get the days of the week - * - * @return array - */ - public static function getDays() - { - return static::$days; - } - - /////////////////////////////////////////////////////////////////// - /////////////////////// WEEK SPECIAL DAYS ///////////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * Get the first day of week - * - * @return int - */ - public static function getWeekStartsAt() - { - return static::$weekStartsAt; - } - - /** - * Set the first day of week - * - * @param int $day week start day - * - * @throws InvalidArgumentException - * - * @return void - */ - public static function setWeekStartsAt($day) - { - if ($day > static::SATURDAY || $day < static::SUNDAY) { - throw new InvalidArgumentException('Day of a week should be greater than or equal to 0 and less than or equal to 6.'); - } - - static::$weekStartsAt = $day; - } - - /** - * Get the last day of week - * - * @return int - */ - public static function getWeekEndsAt() - { - return static::$weekEndsAt; - } - - /** - * Set the last day of week - * - * @param int $day - * - * @throws InvalidArgumentException - * - * @return void - */ - public static function setWeekEndsAt($day) - { - if ($day > static::SATURDAY || $day < static::SUNDAY) { - throw new InvalidArgumentException('Day of a week should be greater than or equal to 0 and less than or equal to 6.'); - } - - static::$weekEndsAt = $day; - } - - /** - * Get weekend days - * - * @return array - */ - public static function getWeekendDays() - { - return static::$weekendDays; - } - - /** - * Set weekend days - * - * @param array $days - * - * @return void - */ - public static function setWeekendDays($days) - { - static::$weekendDays = $days; - } - - /** - * get midday/noon hour - * - * @return int - */ - public static function getMidDayAt() - { - return static::$midDayAt; - } - - /** - * Set midday/noon hour - * - * @param int $hour midday hour - * - * @return void - */ - public static function setMidDayAt($hour) - { - static::$midDayAt = $hour; - } - - /////////////////////////////////////////////////////////////////// - ///////////////////////// TESTING AIDS //////////////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * Set a Carbon instance (real or mock) to be returned when a "now" - * instance is created. The provided instance will be returned - * specifically under the following conditions: - * - A call to the static now() method, ex. Carbon::now() - * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) - * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') - * - When a string containing the desired time is passed to Carbon::parse(). - * - * Note the timezone parameter was left out of the examples above and - * has no affect as the mock value will be returned regardless of its value. - * - * To clear the test instance call this method using the default - * parameter of null. - * - * @param \Carbon\Carbon|null $testNow real or mock Carbon instance - * @param \Carbon\Carbon|string|null $testNow - */ - public static function setTestNow($testNow = null) - { - static::$testNow = is_string($testNow) ? static::parse($testNow) : $testNow; - } - - /** - * Get the Carbon instance (real or mock) to be returned when a "now" - * instance is created. - * - * @return static the current instance used for testing - */ - public static function getTestNow() - { - return static::$testNow; - } - - /** - * Determine if there is a valid test instance set. A valid test instance - * is anything that is not null. - * - * @return bool true if there is a test instance, otherwise false - */ - public static function hasTestNow() - { - return static::getTestNow() !== null; - } - - /** - * Determine if a time string will produce a relative date. - * - * @param string $time - * - * @return bool true if time match a relative date, false if absolute or invalid time string - */ - public static function hasRelativeKeywords($time) - { - if (strtotime($time) === false) { - return false; - } - - $date1 = new DateTime('2000-01-01T00:00:00Z'); - $date1->modify($time); - $date2 = new DateTime('2001-12-25T00:00:00Z'); - $date2->modify($time); - - return $date1 != $date2; - } - - /////////////////////////////////////////////////////////////////// - /////////////////////// LOCALIZATION ////////////////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * Initialize the translator instance if necessary. - * - * @return \Symfony\Component\Translation\TranslatorInterface - */ - protected static function translator() - { - if (static::$translator === null) { - static::$translator = Translator::get(); - } - - return static::$translator; - } - - /** - * Get the translator instance in use - * - * @return \Symfony\Component\Translation\TranslatorInterface - */ - public static function getTranslator() - { - return static::translator(); - } - - /** - * Set the translator instance to use - * - * @param \Symfony\Component\Translation\TranslatorInterface $translator - * - * @return void - */ - public static function setTranslator(TranslatorInterface $translator) - { - static::$translator = $translator; - } - - /** - * Get the current translator locale - * - * @return string - */ - public static function getLocale() - { - return static::translator()->getLocale(); - } - - /** - * Set the current translator locale and indicate if the source locale file exists - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function setLocale($locale) - { - return static::translator()->setLocale($locale) !== false; - } - - /** - * Set the current locale to the given, execute the passed function, reset the locale to previous one, - * then return the result of the closure (or null if the closure was void). - * - * @param string $locale locale ex. en - * - * @return mixed - */ - public static function executeWithLocale($locale, $func) - { - $currentLocale = static::getLocale(); - $result = call_user_func($func, static::setLocale($locale) ? static::getLocale() : false, static::translator()); - static::setLocale($currentLocale); - - return $result; - } - - /** - * Returns true if the given locale is internally supported and has short-units support. - * Support is considered enabled if either year, day or hour has a short variant translated. - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function localeHasShortUnits($locale) - { - return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { - return $newLocale && - ( - ($y = $translator->trans('y')) !== 'y' && - $y !== $translator->trans('year') - ) || ( - ($y = $translator->trans('d')) !== 'd' && - $y !== $translator->trans('day') - ) || ( - ($y = $translator->trans('h')) !== 'h' && - $y !== $translator->trans('hour') - ); - }); - } - - /** - * Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function localeHasDiffSyntax($locale) - { - return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { - return $newLocale && - $translator->trans('ago') !== 'ago' && - $translator->trans('from_now') !== 'from_now' && - $translator->trans('before') !== 'before' && - $translator->trans('after') !== 'after'; - }); - } - - /** - * Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). - * Support is considered enabled if the 3 words are translated in the given locale. - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function localeHasDiffOneDayWords($locale) - { - return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { - return $newLocale && - $translator->trans('diff_now') !== 'diff_now' && - $translator->trans('diff_yesterday') !== 'diff_yesterday' && - $translator->trans('diff_tomorrow') !== 'diff_tomorrow'; - }); - } - - /** - * Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). - * Support is considered enabled if the 2 words are translated in the given locale. - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function localeHasDiffTwoDayWords($locale) - { - return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { - return $newLocale && - $translator->trans('diff_before_yesterday') !== 'diff_before_yesterday' && - $translator->trans('diff_after_tomorrow') !== 'diff_after_tomorrow'; - }); - } - - /** - * Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). - * Support is considered enabled if the 4 sentences are translated in the given locale. - * - * @param string $locale locale ex. en - * - * @return bool - */ - public static function localeHasPeriodSyntax($locale) - { - return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { - return $newLocale && - $translator->trans('period_recurrences') !== 'period_recurrences' && - $translator->trans('period_interval') !== 'period_interval' && - $translator->trans('period_start_date') !== 'period_start_date' && - $translator->trans('period_end_date') !== 'period_end_date'; - }); - } - - /** - * Returns the list of internally available locales and already loaded custom locales. - * (It will ignore custom translator dynamic loading.) - * - * @return array - */ - public static function getAvailableLocales() - { - $translator = static::translator(); - $locales = array(); - if ($translator instanceof Translator) { - foreach (glob(__DIR__.'/Lang/*.php') as $file) { - $locales[] = substr($file, strrpos($file, '/') + 1, -4); - } - - $locales = array_unique(array_merge($locales, array_keys($translator->getMessages()))); - } - - return $locales; - } - - /////////////////////////////////////////////////////////////////// - /////////////////////// STRING FORMATTING ///////////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * Set if UTF8 will be used for localized date/time - * - * @param bool $utf8 - */ - public static function setUtf8($utf8) - { - static::$utf8 = $utf8; - } - - /** - * Format the instance with the current locale. You can set the current - * locale using setlocale() http://php.net/setlocale. - * - * @param string $format - * - * @return string - */ - public function formatLocalized($format) - { - // Check for Windows to find and replace the %e modifier correctly. - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - $format = preg_replace('#(?<!%)((?:%%)*)%e#', '\1%#d', $format); // @codeCoverageIgnore - } - - $formatted = strftime($format, strtotime($this->toDateTimeString())); - - return static::$utf8 ? utf8_encode($formatted) : $formatted; - } - - /** - * Reset the format used to the default when type juggling a Carbon instance to a string - * - * @return void - */ - public static function resetToStringFormat() - { - static::setToStringFormat(static::DEFAULT_TO_STRING_FORMAT); - } - - /** - * Set the default format used when type juggling a Carbon instance to a string - * - * @param string|Closure $format - * - * @return void - */ - public static function setToStringFormat($format) - { - static::$toStringFormat = $format; - } - - /** - * Format the instance as a string using the set format - * - * @return string - */ - public function __toString() - { - $format = static::$toStringFormat; - - return $this->format($format instanceof Closure ? $format($this) : $format); - } - - /** - * Format the instance as date - * - * @return string - */ - public function toDateString() - { - return $this->format('Y-m-d'); - } - - /** - * Format the instance as a readable date - * - * @return string - */ - public function toFormattedDateString() - { - return $this->format('M j, Y'); - } - - /** - * Format the instance as time - * - * @return string - */ - public function toTimeString() - { - return $this->format('H:i:s'); - } - - /** - * Format the instance as date and time - * - * @return string - */ - public function toDateTimeString() - { - return $this->format('Y-m-d H:i:s'); - } - - /** - * Format the instance as date and time T-separated with no timezone - * - * @example - * ``` - * echo Carbon::now()->toDateTimeLocalString(); - * ``` - * - * @return string - */ - public function toDateTimeLocalString() - { - return $this->format('Y-m-d\TH:i:s'); - } - - /** - * Format the instance with day, date and time - * - * @return string - */ - public function toDayDateTimeString() - { - return $this->format('D, M j, Y g:i A'); - } - - /** - * Format the instance as ATOM - * - * @return string - */ - public function toAtomString() - { - return $this->format(static::ATOM); - } - - /** - * Format the instance as COOKIE - * - * @return string - */ - public function toCookieString() - { - return $this->format(static::COOKIE); - } - - /** - * Format the instance as ISO8601 - * - * @return string - */ - public function toIso8601String() - { - return $this->toAtomString(); - } - - /** - * Format the instance as RFC822 - * - * @return string - */ - public function toRfc822String() - { - return $this->format(static::RFC822); - } - - /** - * Convert the instance to UTC and return as Zulu ISO8601 - * - * @return string - */ - public function toIso8601ZuluString() - { - return $this->copy()->setTimezone('UTC')->format('Y-m-d\TH:i:s\Z'); - } - - /** - * Format the instance as RFC850 - * - * @return string - */ - public function toRfc850String() - { - return $this->format(static::RFC850); - } - - /** - * Format the instance as RFC1036 - * - * @return string - */ - public function toRfc1036String() - { - return $this->format(static::RFC1036); - } - - /** - * Format the instance as RFC1123 - * - * @return string - */ - public function toRfc1123String() - { - return $this->format(static::RFC1123); - } - - /** - * Format the instance as RFC2822 - * - * @return string - */ - public function toRfc2822String() - { - return $this->format(static::RFC2822); - } - - /** - * Format the instance as RFC3339 - * - * @return string - */ - public function toRfc3339String() - { - return $this->format(static::RFC3339); - } - - /** - * Format the instance as RSS - * - * @return string - */ - public function toRssString() - { - return $this->format(static::RSS); - } - - /** - * Format the instance as W3C - * - * @return string - */ - public function toW3cString() - { - return $this->format(static::W3C); - } - - /** - * Format the instance as RFC7231 - * - * @return string - */ - public function toRfc7231String() - { - return $this->copy() - ->setTimezone('GMT') - ->format(static::RFC7231_FORMAT); - } - - /** - * Get default array representation - * - * @return array - */ - public function toArray() - { - return array( - 'year' => $this->year, - 'month' => $this->month, - 'day' => $this->day, - 'dayOfWeek' => $this->dayOfWeek, - 'dayOfYear' => $this->dayOfYear, - 'hour' => $this->hour, - 'minute' => $this->minute, - 'second' => $this->second, - 'micro' => $this->micro, - 'timestamp' => $this->timestamp, - 'formatted' => $this->format(self::DEFAULT_TO_STRING_FORMAT), - 'timezone' => $this->timezone, - ); - } - - /** - * Get default object representation. - * - * @example - * ``` - * var_dump(Carbon::now()->toObject()); - * ``` - * - * @return object - */ - public function toObject() - { - return (object) $this->toArray(); - } - - /** - * Returns english human readable complete date string. - * - * @example - * ``` - * echo Carbon::now()->toString(); - * ``` - * - * @return string - */ - public function toString() - { - return $this->format('D M j Y H:i:s \G\M\TO'); - } - - /** - * Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z, if $keepOffset truthy, offset will be kept: - * 1977-04-22T01:00:00-05:00). - * - * @example - * ``` - * echo Carbon::now('America/Toronto')->toISOString() . "\n"; - * echo Carbon::now('America/Toronto')->toISOString(true) . "\n"; - * ``` - * - * @param bool $keepOffset Pass true to keep the date offset. Else forced to UTC. - * - * @return null|string - */ - public function toISOString($keepOffset = false) - { - if ($this->year === 0) { - return null; - } - - $year = $this->year < 0 || $this->year > 9999 - ? ($this->year < 0 ? '-' : '+').str_pad(abs($this->year), 6, '0', STR_PAD_LEFT) - : str_pad($this->year, 4, '0', STR_PAD_LEFT); - $tz = $keepOffset ? $this->format('P') : 'Z'; - $date = $keepOffset ? $this : $this->copy()->setTimezone('UTC'); - - return $year.$date->format('-m-d\TH:i:s.u').$tz; - } - - /** - * Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z) with UTC timezone. - * - * @example - * ``` - * echo Carbon::now('America/Toronto')->toJSON(); - * ``` - * - * @return null|string - */ - public function toJSON() - { - return $this->toISOString(); - } - - /** - * Return native DateTime PHP object matching the current instance. - * - * @example - * ``` - * var_dump(Carbon::now()->toDateTime()); - * ``` - * - * @return DateTime - */ - public function toDateTime() - { - return new DateTime($this->format('Y-m-d H:i:s.u'), $this->getTimezone()); - } - - /** - * @alias toDateTime - * - * Return native DateTime PHP object matching the current instance. - * - * @example - * ``` - * var_dump(Carbon::now()->toDate()); - * ``` - * - * @return DateTime - */ - public function toDate() - { - return $this->toDateTime(); - } - - /////////////////////////////////////////////////////////////////// - ////////////////////////// COMPARISONS //////////////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * Determines if the instance is equal to another - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function eq($date) - { - return $this == $date; - } - - /** - * Determines if the instance is equal to another - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see eq() - * - * @return bool - */ - public function equalTo($date) - { - return $this->eq($date); - } - - /** - * Determines if the instance is not equal to another - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function ne($date) - { - return !$this->eq($date); - } - - /** - * Determines if the instance is not equal to another - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see ne() - * - * @return bool - */ - public function notEqualTo($date) - { - return $this->ne($date); - } - - /** - * Determines if the instance is greater (after) than another - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function gt($date) - { - return $this > $date; - } - - /** - * Determines if the instance is greater (after) than another - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see gt() - * - * @return bool - */ - public function greaterThan($date) - { - return $this->gt($date); - } - - /** - * Determines if the instance is greater (after) than another - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see gt() - * - * @return bool - */ - public function isAfter($date) - { - return $this->gt($date); - } - - /** - * Determines if the instance is greater (after) than or equal to another - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function gte($date) - { - return $this >= $date; - } - - /** - * Determines if the instance is greater (after) than or equal to another - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see gte() - * - * @return bool - */ - public function greaterThanOrEqualTo($date) - { - return $this->gte($date); - } - - /** - * Determines if the instance is less (before) than another - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function lt($date) - { - return $this < $date; - } - - /** - * Determines if the instance is less (before) than another - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see lt() - * - * @return bool - */ - public function lessThan($date) - { - return $this->lt($date); - } - - /** - * Determines if the instance is less (before) than another - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see lt() - * - * @return bool - */ - public function isBefore($date) - { - return $this->lt($date); - } - - /** - * Determines if the instance is less (before) or equal to another - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @return bool - */ - public function lte($date) - { - return $this <= $date; - } - - /** - * Determines if the instance is less (before) or equal to another - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see lte() - * - * @return bool - */ - public function lessThanOrEqualTo($date) - { - return $this->lte($date); - } - - /** - * Determines if the instance is between two others - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 - * @param bool $equal Indicates if an equal to comparison should be done - * - * @return bool - */ - public function between($date1, $date2, $equal = true) - { - if ($date1->gt($date2)) { - $temp = $date1; - $date1 = $date2; - $date2 = $temp; - } - - if ($equal) { - return $this->gte($date1) && $this->lte($date2); - } - - return $this->gt($date1) && $this->lt($date2); - } - - protected function floatDiffInSeconds($date) - { - $date = $this->resolveCarbon($date); - - return abs($this->diffInRealSeconds($date, false) + ($date->micro - $this->micro) / 1000000); - } - - /** - * Determines if the instance is between two others - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 - * @param bool $equal Indicates if a > and < comparison should be used or <= or >= - * - * @return bool - */ - public function isBetween($date1, $date2, $equal = true) - { - return $this->between($date1, $date2, $equal); - } - - /** - * Get the closest date from the instance. - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 - * - * @return static - */ - public function closest($date1, $date2) - { - return $this->floatDiffInSeconds($date1) < $this->floatDiffInSeconds($date2) ? $date1 : $date2; - } - - /** - * Get the farthest date from the instance. - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 - * - * @return static - */ - public function farthest($date1, $date2) - { - return $this->floatDiffInSeconds($date1) > $this->floatDiffInSeconds($date2) ? $date1 : $date2; - } - - /** - * Get the minimum instance between a given instance (default now) and the current instance. - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * - * @return static - */ - public function min($date = null) - { - $date = $this->resolveCarbon($date); - - return $this->lt($date) ? $this : $date; - } - - /** - * Get the minimum instance between a given instance (default now) and the current instance. - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see min() - * - * @return static - */ - public function minimum($date = null) - { - return $this->min($date); - } - - /** - * Get the maximum instance between a given instance (default now) and the current instance. - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * - * @return static - */ - public function max($date = null) - { - $date = $this->resolveCarbon($date); - - return $this->gt($date) ? $this : $date; - } - - /** - * Get the maximum instance between a given instance (default now) and the current instance. - * - * @param \Carbon\Carbon|\DateTimeInterface|mixed $date - * - * @see max() - * - * @return static - */ - public function maximum($date = null) - { - return $this->max($date); - } - - /** - * Determines if the instance is a weekday. - * - * @return bool - */ - public function isWeekday() - { - return !$this->isWeekend(); - } - - /** - * Determines if the instance is a weekend day. - * - * @return bool - */ - public function isWeekend() - { - return in_array($this->dayOfWeek, static::$weekendDays); - } - - /** - * Determines if the instance is yesterday. - * - * @return bool - */ - public function isYesterday() - { - return $this->toDateString() === static::yesterday($this->getTimezone())->toDateString(); - } - - /** - * Determines if the instance is today. - * - * @return bool - */ - public function isToday() - { - return $this->toDateString() === $this->nowWithSameTz()->toDateString(); - } - - /** - * Determines if the instance is tomorrow. - * - * @return bool - */ - public function isTomorrow() - { - return $this->toDateString() === static::tomorrow($this->getTimezone())->toDateString(); - } - - /** - * Determines if the instance is within the next week. - * - * @return bool - */ - public function isNextWeek() - { - return $this->weekOfYear === $this->nowWithSameTz()->addWeek()->weekOfYear; - } - - /** - * Determines if the instance is within the last week. - * - * @return bool - */ - public function isLastWeek() - { - return $this->weekOfYear === $this->nowWithSameTz()->subWeek()->weekOfYear; - } - - /** - * Determines if the instance is within the next quarter. - * - * @return bool - */ - public function isNextQuarter() - { - return $this->quarter === $this->nowWithSameTz()->addQuarter()->quarter; - } - - /** - * Determines if the instance is within the last quarter. - * - * @return bool - */ - public function isLastQuarter() - { - return $this->quarter === $this->nowWithSameTz()->subQuarter()->quarter; - } - - /** - * Determines if the instance is within the next month. - * - * @return bool - */ - public function isNextMonth() - { - return $this->month === $this->nowWithSameTz()->addMonthNoOverflow()->month; - } - - /** - * Determines if the instance is within the last month. - * - * @return bool - */ - public function isLastMonth() - { - return $this->month === $this->nowWithSameTz()->subMonthNoOverflow()->month; - } - - /** - * Determines if the instance is within next year. - * - * @return bool - */ - public function isNextYear() - { - return $this->year === $this->nowWithSameTz()->addYear()->year; - } - - /** - * Determines if the instance is within the previous year. - * - * @return bool - */ - public function isLastYear() - { - return $this->year === $this->nowWithSameTz()->subYear()->year; - } - - /** - * Determines if the instance is in the future, ie. greater (after) than now. - * - * @return bool - */ - public function isFuture() - { - return $this->gt($this->nowWithSameTz()); - } - - /** - * Determines if the instance is in the past, ie. less (before) than now. - * - * @return bool - */ - public function isPast() - { - return $this->lt($this->nowWithSameTz()); - } - - /** - * Determines if the instance is a leap year. - * - * @return bool - */ - public function isLeapYear() - { - return $this->format('L') === '1'; - } - - /** - * Determines if the instance is a long year - * - * @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates - * - * @return bool - */ - public function isLongYear() - { - return static::create($this->year, 12, 28, 0, 0, 0, $this->tz)->weekOfYear === 53; - } - - /** - * Compares the formatted values of the two dates. - * - * @param string $format The date formats to compare. - * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use current day. - * - * @throws \InvalidArgumentException - * - * @return bool - */ - public function isSameAs($format, $date = null) - { - $date = $date ?: static::now($this->tz); - - static::expectDateTime($date, 'null'); - - return $this->format($format) === $date->format($format); - } - - /** - * Determines if the instance is in the current year. - * - * @return bool - */ - public function isCurrentYear() - { - return $this->isSameYear(); - } - - /** - * Checks if the passed in date is in the same year as the instance year. - * - * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use current day. - * - * @return bool - */ - public function isSameYear($date = null) - { - return $this->isSameAs('Y', $date); - } - - /** - * Determines if the instance is in the current month. - * - * @return bool - */ - public function isCurrentQuarter() - { - return $this->isSameQuarter(); - } - - /** - * Checks if the passed in date is in the same quarter as the instance quarter (and year if needed). - * - * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use current day. - * @param bool $ofSameYear Check if it is the same month in the same year. - * - * @return bool - */ - public function isSameQuarter($date = null, $ofSameYear = null) - { - $date = $date ? static::instance($date) : static::now($this->tz); - - static::expectDateTime($date, 'null'); - - $ofSameYear = is_null($ofSameYear) ? static::shouldCompareYearWithMonth() : $ofSameYear; - - return $this->quarter === $date->quarter && (!$ofSameYear || $this->isSameYear($date)); - } - - /** - * Determines if the instance is in the current month. - * - * @param bool $ofSameYear Check if it is the same month in the same year. - * - * @return bool - */ - public function isCurrentMonth($ofSameYear = null) - { - return $this->isSameMonth(null, $ofSameYear); - } - - /** - * Checks if the passed in date is in the same month as the instance´s month. - * - * Note that this defaults to only comparing the month while ignoring the year. - * To test if it is the same exact month of the same year, pass in true as the second parameter. - * - * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use the current date. - * @param bool $ofSameYear Check if it is the same month in the same year. - * - * @return bool - */ - public function isSameMonth($date = null, $ofSameYear = null) - { - $ofSameYear = is_null($ofSameYear) ? static::shouldCompareYearWithMonth() : $ofSameYear; - - return $this->isSameAs($ofSameYear ? 'Y-m' : 'm', $date); - } - - /** - * Determines if the instance is in the current day. - * - * @return bool - */ - public function isCurrentDay() - { - return $this->isSameDay(); - } - - /** - * Checks if the passed in date is the same exact day as the instance´s day. - * - * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use the current date. - * - * @return bool - */ - public function isSameDay($date = null) - { - return $this->isSameAs('Y-m-d', $date); - } - - /** - * Determines if the instance is in the current hour. - * - * @return bool - */ - public function isCurrentHour() - { - return $this->isSameHour(); - } - - /** - * Checks if the passed in date is the same exact hour as the instance´s hour. - * - * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use the current date. - * - * @return bool - */ - public function isSameHour($date = null) - { - return $this->isSameAs('Y-m-d H', $date); - } - - /** - * Determines if the instance is in the current minute. - * - * @return bool - */ - public function isCurrentMinute() - { - return $this->isSameMinute(); - } - - /** - * Checks if the passed in date is the same exact minute as the instance´s minute. - * - * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use the current date. - * - * @return bool - */ - public function isSameMinute($date = null) - { - return $this->isSameAs('Y-m-d H:i', $date); - } - - /** - * Determines if the instance is in the current second. - * - * @return bool - */ - public function isCurrentSecond() - { - return $this->isSameSecond(); - } - - /** - * Checks if the passed in date is the same exact second as the instance´s second. - * - * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use the current date. - * - * @return bool - */ - public function isSameSecond($date = null) - { - return $this->isSameAs('Y-m-d H:i:s', $date); - } - - /** - * Checks if this day is a specific day of the week. - * - * @param int $dayOfWeek - * - * @return bool - */ - public function isDayOfWeek($dayOfWeek) - { - return $this->dayOfWeek === $dayOfWeek; - } - - /** - * Checks if this day is a Sunday. - * - * @return bool - */ - public function isSunday() - { - return $this->dayOfWeek === static::SUNDAY; - } - - /** - * Checks if this day is a Monday. - * - * @return bool - */ - public function isMonday() - { - return $this->dayOfWeek === static::MONDAY; - } - - /** - * Checks if this day is a Tuesday. - * - * @return bool - */ - public function isTuesday() - { - return $this->dayOfWeek === static::TUESDAY; - } - - /** - * Checks if this day is a Wednesday. - * - * @return bool - */ - public function isWednesday() - { - return $this->dayOfWeek === static::WEDNESDAY; - } - - /** - * Checks if this day is a Thursday. - * - * @return bool - */ - public function isThursday() - { - return $this->dayOfWeek === static::THURSDAY; - } - - /** - * Checks if this day is a Friday. - * - * @return bool - */ - public function isFriday() - { - return $this->dayOfWeek === static::FRIDAY; - } - - /** - * Checks if this day is a Saturday. - * - * @return bool - */ - public function isSaturday() - { - return $this->dayOfWeek === static::SATURDAY; - } - - /** - * Check if its the birthday. Compares the date/month values of the two dates. - * - * @param \Carbon\Carbon|\DateTimeInterface|null $date The instance to compare with or null to use current day. - * - * @return bool - */ - public function isBirthday($date = null) - { - return $this->isSameAs('md', $date); - } - - /** - * Check if today is the last day of the Month - * - * @return bool - */ - public function isLastOfMonth() - { - return $this->day === $this->daysInMonth; - } - - /** - * Check if the instance is start of day / midnight. - * - * @param bool $checkMicroseconds check time at microseconds precision - * /!\ Warning, this is not reliable with PHP < 7.1.4 - * - * @return bool - */ - public function isStartOfDay($checkMicroseconds = false) - { - return $checkMicroseconds - ? $this->format('H:i:s.u') === '00:00:00.000000' - : $this->format('H:i:s') === '00:00:00'; - } - - /** - * Check if the instance is end of day. - * - * @param bool $checkMicroseconds check time at microseconds precision - * /!\ Warning, this is not reliable with PHP < 7.1.4 - * - * @return bool - */ - public function isEndOfDay($checkMicroseconds = false) - { - return $checkMicroseconds - ? $this->format('H:i:s.u') === '23:59:59.999999' - : $this->format('H:i:s') === '23:59:59'; - } - - /** - * Check if the instance is start of day / midnight. - * - * @return bool - */ - public function isMidnight() - { - return $this->isStartOfDay(); - } - - /** - * Check if the instance is midday. - * - * @return bool - */ - public function isMidday() - { - return $this->format('G:i:s') === static::$midDayAt.':00:00'; - } - - /** - * Checks if the (date)time string is in a given format. - * - * @param string $date - * @param string $format - * - * @return bool - */ - public static function hasFormat($date, $format) - { - try { - // Try to create a DateTime object. Throws an InvalidArgumentException if the provided time string - // doesn't match the format in any way. - static::createFromFormat($format, $date); - - // createFromFormat() is known to handle edge cases silently. - // E.g. "1975-5-1" (Y-n-j) will still be parsed correctly when "Y-m-d" is supplied as the format. - // To ensure we're really testing against our desired format, perform an additional regex validation. - $regex = strtr( - preg_quote($format, '/'), - static::$regexFormats - ); - - return (bool) preg_match('/^'.$regex.'$/', $date); - } catch (InvalidArgumentException $e) { - } - - return false; - } - - /////////////////////////////////////////////////////////////////// - /////////////////// ADDITIONS AND SUBTRACTIONS //////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * Add centuries to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value - * - * @return static - */ - public function addCenturies($value) - { - return $this->addYears(static::YEARS_PER_CENTURY * $value); - } - - /** - * Add a century to the instance - * - * @param int $value - * - * @return static - */ - public function addCentury($value = 1) - { - return $this->addCenturies($value); - } - - /** - * Remove centuries from the instance - * - * @param int $value - * - * @return static - */ - public function subCenturies($value) - { - return $this->addCenturies(-1 * $value); - } - - /** - * Remove a century from the instance - * - * @param int $value - * - * @return static - */ - public function subCentury($value = 1) - { - return $this->subCenturies($value); - } - - /** - * Add years to the instance. Positive $value travel forward while - * negative $value travel into the past. - * - * @param int $value - * - * @return static - */ - public function addYears($value) - { - if ($this->shouldOverflowYears()) { - return $this->addYearsWithOverflow($value); - } - - return $this->addYearsNoOverflow($value); - } - - /** - * Add a year to the instance - * - * @param int $value - * - * @return static - */ - public function addYear($value = 1) - { - return $this->addYears($value); - } - - /** - * Add years to the instance with no overflow of months - * Positive $value travel forward while - * negative $value travel into the past. - * - * @param int $value - * - * @return static - */ - public function addYearsNoOverflow($value) - { - return $this->addMonthsNoOverflow($value * static::MONTHS_PER_YEAR); - } - - /** - * Add year with overflow months set to false - * - * @param int $value - * - * @return static - */ - public function addYearNoOverflow($value = 1) - { - return $this->addYearsNoOverflow($value); - } - - /** - * Add years to the instance. - * Positive $value travel forward while - * negative $value travel into the past. - * - * @param int $value - * - * @return static - */ - public function addYearsWithOverflow($value) - { - return $this->modify((int) $value.' year'); - } - - /** - * Add year with overflow. - * - * @param int $value - * - * @return static - */ - public function addYearWithOverflow($value = 1) - { - return $this->addYearsWithOverflow($value); - } - - /** - * Remove years from the instance. - * - * @param int $value - * - * @return static - */ - public function subYears($value) - { - return $this->addYears(-1 * $value); - } - - /** - * Remove a year from the instance - * - * @param int $value - * - * @return static - */ - public function subYear($value = 1) - { - return $this->subYears($value); - } - - /** - * Remove years from the instance with no month overflow. - * - * @param int $value - * - * @return static - */ - public function subYearsNoOverflow($value) - { - return $this->subMonthsNoOverflow($value * static::MONTHS_PER_YEAR); - } - - /** - * Remove year from the instance with no month overflow - * - * @param int $value - * - * @return static - */ - public function subYearNoOverflow($value = 1) - { - return $this->subYearsNoOverflow($value); - } - - /** - * Remove years from the instance. - * - * @param int $value - * - * @return static - */ - public function subYearsWithOverflow($value) - { - return $this->subMonthsWithOverflow($value * static::MONTHS_PER_YEAR); - } - - /** - * Remove year from the instance. - * - * @param int $value - * - * @return static - */ - public function subYearWithOverflow($value = 1) - { - return $this->subYearsWithOverflow($value); - } - - /** - * Add quarters to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value - * - * @return static - */ - public function addQuarters($value) - { - return $this->addMonths(static::MONTHS_PER_QUARTER * $value); - } - - /** - * Add a quarter to the instance - * - * @param int $value - * - * @return static - */ - public function addQuarter($value = 1) - { - return $this->addQuarters($value); - } - - /** - * Remove quarters from the instance - * - * @param int $value - * - * @return static - */ - public function subQuarters($value) - { - return $this->addQuarters(-1 * $value); - } - - /** - * Remove a quarter from the instance - * - * @param int $value - * - * @return static - */ - public function subQuarter($value = 1) - { - return $this->subQuarters($value); - } - - /** - * Add months to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value - * - * @return static - */ - public function addMonths($value) - { - if (static::shouldOverflowMonths()) { - return $this->addMonthsWithOverflow($value); - } - - return $this->addMonthsNoOverflow($value); - } - - /** - * Add a month to the instance - * - * @param int $value - * - * @return static - */ - public function addMonth($value = 1) - { - return $this->addMonths($value); - } - - /** - * Remove months from the instance - * - * @param int $value - * - * @return static - */ - public function subMonths($value) - { - return $this->addMonths(-1 * $value); - } - - /** - * Remove a month from the instance - * - * @param int $value - * - * @return static - */ - public function subMonth($value = 1) - { - return $this->subMonths($value); - } - - /** - * Add months to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value - * - * @return static - */ - public function addMonthsWithOverflow($value) - { - return $this->modify((int) $value.' month'); - } - - /** - * Add a month to the instance - * - * @param int $value - * - * @return static - */ - public function addMonthWithOverflow($value = 1) - { - return $this->addMonthsWithOverflow($value); - } - - /** - * Remove months from the instance - * - * @param int $value - * - * @return static - */ - public function subMonthsWithOverflow($value) - { - return $this->addMonthsWithOverflow(-1 * $value); - } - - /** - * Remove a month from the instance - * - * @param int $value - * - * @return static - */ - public function subMonthWithOverflow($value = 1) - { - return $this->subMonthsWithOverflow($value); - } - - /** - * Add months without overflowing to the instance. Positive $value - * travels forward while negative $value travels into the past. - * - * @param int $value - * - * @return static - */ - public function addMonthsNoOverflow($value) - { - $day = $this->day; - - $this->modify((int) $value.' month'); - - if ($day !== $this->day) { - $this->modify('last day of previous month'); - } - - return $this; - } - - /** - * Add a month with no overflow to the instance - * - * @param int $value - * - * @return static - */ - public function addMonthNoOverflow($value = 1) - { - return $this->addMonthsNoOverflow($value); - } - - /** - * Remove months with no overflow from the instance - * - * @param int $value - * - * @return static - */ - public function subMonthsNoOverflow($value) - { - return $this->addMonthsNoOverflow(-1 * $value); - } - - /** - * Remove a month with no overflow from the instance - * - * @param int $value - * - * @return static - */ - public function subMonthNoOverflow($value = 1) - { - return $this->subMonthsNoOverflow($value); - } - - /** - * Add days to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value - * - * @return static - */ - public function addDays($value) - { - return $this->modify((int) $value.' day'); - } - - /** - * Add a day to the instance - * - * @param int $value - * - * @return static - */ - public function addDay($value = 1) - { - return $this->addDays($value); - } - - /** - * Remove days from the instance - * - * @param int $value - * - * @return static - */ - public function subDays($value) - { - return $this->addDays(-1 * $value); - } - - /** - * Remove a day from the instance - * - * @param int $value - * - * @return static - */ - public function subDay($value = 1) - { - return $this->subDays($value); - } - - /** - * Add weekdays to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value - * - * @return static - */ - public function addWeekdays($value) - { - // Fix for weekday bug https://bugs.php.net/bug.php?id=54909 - $t = $this->toTimeString(); - $this->modify((int) $value.' weekday'); - - return $this->setTimeFromTimeString($t); - } - - /** - * Add a weekday to the instance - * - * @param int $value - * - * @return static - */ - public function addWeekday($value = 1) - { - return $this->addWeekdays($value); - } - - /** - * Remove weekdays from the instance - * - * @param int $value - * - * @return static - */ - public function subWeekdays($value) - { - return $this->addWeekdays(-1 * $value); - } - - /** - * Remove a weekday from the instance - * - * @param int $value - * - * @return static - */ - public function subWeekday($value = 1) - { - return $this->subWeekdays($value); - } - - /** - * Add weeks to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value - * - * @return static - */ - public function addWeeks($value) - { - return $this->modify((int) $value.' week'); - } - - /** - * Add a week to the instance - * - * @param int $value - * - * @return static - */ - public function addWeek($value = 1) - { - return $this->addWeeks($value); - } - - /** - * Remove weeks to the instance - * - * @param int $value - * - * @return static - */ - public function subWeeks($value) - { - return $this->addWeeks(-1 * $value); - } - - /** - * Remove a week from the instance - * - * @param int $value - * - * @return static - */ - public function subWeek($value = 1) - { - return $this->subWeeks($value); - } - - /** - * Add hours to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value - * - * @return static - */ - public function addHours($value) - { - return $this->modify((int) $value.' hour'); - } - - /** - * Add hours to the instance using timestamp. Positive $value travels - * forward while negative $value travels into the past. - * - * @param int $value - * - * @return static - */ - public function addRealHours($value) - { - return $this->addRealMinutes($value * static::MINUTES_PER_HOUR); - } - - /** - * Add an hour to the instance. - * - * @param int $value - * - * @return static - */ - public function addHour($value = 1) - { - return $this->addHours($value); - } - - /** - * Add an hour to the instance using timestamp. - * - * @param int $value - * - * @return static - */ - public function addRealHour($value = 1) - { - return $this->addRealHours($value); - } - - /** - * Remove hours from the instance. - * - * @param int $value - * - * @return static - */ - public function subHours($value) - { - return $this->addHours(-1 * $value); - } - - /** - * Remove hours from the instance using timestamp. - * - * @param int $value - * - * @return static - */ - public function subRealHours($value) - { - return $this->addRealHours(-1 * $value); - } - - /** - * Remove an hour from the instance. - * - * @param int $value - * - * @return static - */ - public function subHour($value = 1) - { - return $this->subHours($value); - } - - /** - * Remove an hour from the instance. - * - * @param int $value - * - * @return static - */ - public function subRealHour($value = 1) - { - return $this->subRealHours($value); - } - - /** - * Add minutes to the instance using timestamp. Positive $value - * travels forward while negative $value travels into the past. - * - * @param int $value - * - * @return static - */ - public function addMinutes($value) - { - return $this->modify((int) $value.' minute'); - } - - /** - * Add minutes to the instance using timestamp. Positive $value travels - * forward while negative $value travels into the past. - * - * @param int $value - * - * @return static - */ - public function addRealMinutes($value) - { - return $this->addRealSeconds($value * static::SECONDS_PER_MINUTE); - } - - /** - * Add a minute to the instance. - * - * @param int $value - * - * @return static - */ - public function addMinute($value = 1) - { - return $this->addMinutes($value); - } - - /** - * Add a minute to the instance using timestamp. - * - * @param int $value - * - * @return static - */ - public function addRealMinute($value = 1) - { - return $this->addRealMinutes($value); - } - - /** - * Remove a minute from the instance. - * - * @param int $value - * - * @return static - */ - public function subMinute($value = 1) - { - return $this->subMinutes($value); - } - - /** - * Remove a minute from the instance using timestamp. - * - * @param int $value - * - * @return static - */ - public function subRealMinute($value = 1) - { - return $this->addRealMinutes(-1 * $value); - } - - /** - * Remove minutes from the instance. - * - * @param int $value - * - * @return static - */ - public function subMinutes($value) - { - return $this->addMinutes(-1 * $value); - } - - /** - * Remove a minute from the instance using timestamp. - * - * @param int $value - * - * @return static - */ - public function subRealMinutes($value = 1) - { - return $this->subRealMinute($value); - } - - /** - * Add seconds to the instance. Positive $value travels forward while - * negative $value travels into the past. - * - * @param int $value - * - * @return static - */ - public function addSeconds($value) - { - return $this->modify((int) $value.' second'); - } - - /** - * Add seconds to the instance using timestamp. Positive $value travels - * forward while negative $value travels into the past. - * - * @param int $value - * - * @return static - */ - public function addRealSeconds($value) - { - return $this->setTimestamp($this->getTimestamp() + $value); - } - - /** - * Add a second to the instance. - * - * @param int $value - * - * @return static - */ - public function addSecond($value = 1) - { - return $this->addSeconds($value); - } - - /** - * Add a second to the instance using timestamp. - * - * @param int $value - * - * @return static - */ - public function addRealSecond($value = 1) - { - return $this->addRealSeconds($value); - } - - /** - * Remove seconds from the instance. - * - * @param int $value - * - * @return static - */ - public function subSeconds($value) - { - return $this->addSeconds(-1 * $value); - } - - /** - * Remove seconds from the instance using timestamp. - * - * @param int $value - * - * @return static - */ - public function subRealSeconds($value) - { - return $this->addRealSeconds(-1 * $value); - } - - /** - * Remove a second from the instance - * - * @param int $value - * - * @return static - */ - public function subSecond($value = 1) - { - return $this->subSeconds($value); - } - - /** - * Remove a second from the instance using timestamp. - * - * @param int $value - * - * @return static - */ - public function subRealSecond($value = 1) - { - return $this->subRealSeconds($value); - } - - /////////////////////////////////////////////////////////////////// - /////////////////////////// DIFFERENCES /////////////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * @param DateInterval $diff - * @param bool $absolute - * @param bool $trimMicroseconds - * - * @return CarbonInterval - */ - protected static function fixDiffInterval(DateInterval $diff, $absolute, $trimMicroseconds) - { - $diff = CarbonInterval::instance($diff, $trimMicroseconds); - - // @codeCoverageIgnoreStart - if (version_compare(PHP_VERSION, '7.1.0-dev', '<')) { - return $diff; - } - - // Work-around for https://bugs.php.net/bug.php?id=77145 - if ($diff->f > 0 && $diff->y === -1 && $diff->m === 11 && $diff->d >= 27 && $diff->h === 23 && $diff->i === 59 && $diff->s === 59) { - $diff->y = 0; - $diff->m = 0; - $diff->d = 0; - $diff->h = 0; - $diff->i = 0; - $diff->s = 0; - $diff->f = (1000000 - round($diff->f * 1000000)) / 1000000; - $diff->invert(); - } elseif ($diff->f < 0) { - if ($diff->s !== 0 || $diff->i !== 0 || $diff->h !== 0 || $diff->d !== 0 || $diff->m !== 0 || $diff->y !== 0) { - $diff->f = (round($diff->f * 1000000) + 1000000) / 1000000; - $diff->s--; - if ($diff->s < 0) { - $diff->s += 60; - $diff->i--; - if ($diff->i < 0) { - $diff->i += 60; - $diff->h--; - if ($diff->h < 0) { - $diff->h += 24; - $diff->d--; - if ($diff->d < 0) { - $diff->d += 30; - $diff->m--; - if ($diff->m < 0) { - $diff->m += 12; - $diff->y--; - } - } - } - } - } - } else { - $diff->f *= -1; - $diff->invert(); - } - } - // @codeCoverageIgnoreEnd - if ($absolute && $diff->invert) { - $diff->invert(); - } - - return $diff; - } - - /** - * Get the difference as a CarbonInterval instance. - * - * Pass false as second argument to get a microseconds-precise interval. Else - * microseconds in the original interval will not be kept. - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * @param bool $trimMicroseconds (true by default) - * - * @return CarbonInterval - */ - public function diffAsCarbonInterval($date = null, $absolute = true, $trimMicroseconds = true) - { - $from = $this; - $to = $this->resolveCarbon($date); - - if ($trimMicroseconds) { - $from = $from->copy()->startOfSecond(); - $to = $to->copy()->startOfSecond(); - } - - return static::fixDiffInterval($from->diff($to, $absolute), $absolute, $trimMicroseconds); - } - - /** - * Get the difference in years - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInYears($date = null, $absolute = true) - { - return (int) $this->diff($this->resolveCarbon($date), $absolute)->format('%r%y'); - } - - /** - * Get the difference in months - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInMonths($date = null, $absolute = true) - { - $date = $this->resolveCarbon($date); - - return $this->diffInYears($date, $absolute) * static::MONTHS_PER_YEAR + (int) $this->diff($date, $absolute)->format('%r%m'); - } - - /** - * Get the difference in weeks - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInWeeks($date = null, $absolute = true) - { - return (int) ($this->diffInDays($date, $absolute) / static::DAYS_PER_WEEK); - } - - /** - * Get the difference in days - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInDays($date = null, $absolute = true) - { - return (int) $this->diff($this->resolveCarbon($date), $absolute)->format('%r%a'); - } - - /** - * Get the difference in days using a filter closure - * - * @param Closure $callback - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInDaysFiltered(Closure $callback, $date = null, $absolute = true) - { - return $this->diffFiltered(CarbonInterval::day(), $callback, $date, $absolute); - } - - /** - * Get the difference in hours using a filter closure - * - * @param Closure $callback - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInHoursFiltered(Closure $callback, $date = null, $absolute = true) - { - return $this->diffFiltered(CarbonInterval::hour(), $callback, $date, $absolute); - } - - /** - * Get the difference by the given interval using a filter closure - * - * @param CarbonInterval $ci An interval to traverse by - * @param Closure $callback - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffFiltered(CarbonInterval $ci, Closure $callback, $date = null, $absolute = true) - { - $start = $this; - $end = $this->resolveCarbon($date); - $inverse = false; - - if ($end < $start) { - $start = $end; - $end = $this; - $inverse = true; - } - - $period = new DatePeriod($start, $ci, $end); - $values = array_filter(iterator_to_array($period), function ($date) use ($callback) { - return call_user_func($callback, Carbon::instance($date)); - }); - - $diff = count($values); - - return $inverse && !$absolute ? -$diff : $diff; - } - - /** - * Get the difference in weekdays - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInWeekdays($date = null, $absolute = true) - { - return $this->diffInDaysFiltered(function (Carbon $date) { - return $date->isWeekday(); - }, $date, $absolute); - } - - /** - * Get the difference in weekend days using a filter - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInWeekendDays($date = null, $absolute = true) - { - return $this->diffInDaysFiltered(function (Carbon $date) { - return $date->isWeekend(); - }, $date, $absolute); - } - - /** - * Get the difference in hours. - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInHours($date = null, $absolute = true) - { - return (int) ($this->diffInSeconds($date, $absolute) / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR); - } - - /** - * Get the difference in hours using timestamps. - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInRealHours($date = null, $absolute = true) - { - return (int) ($this->diffInRealSeconds($date, $absolute) / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR); - } - - /** - * Get the difference in minutes. - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInMinutes($date = null, $absolute = true) - { - return (int) ($this->diffInSeconds($date, $absolute) / static::SECONDS_PER_MINUTE); - } - - /** - * Get the difference in minutes using timestamps. - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInRealMinutes($date = null, $absolute = true) - { - return (int) ($this->diffInRealSeconds($date, $absolute) / static::SECONDS_PER_MINUTE); - } - - /** - * Get the difference in seconds. - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInSeconds($date = null, $absolute = true) - { - $diff = $this->diff($this->resolveCarbon($date)); - if (!$diff->days && version_compare(PHP_VERSION, '5.4.0-dev', '>=')) { - $diff = static::fixDiffInterval($diff, $absolute, false); - } - $value = $diff->days * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE + - $diff->h * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE + - $diff->i * static::SECONDS_PER_MINUTE + - $diff->s; - - return $absolute || !$diff->invert ? $value : -$value; - } - - /** - * Get the difference in seconds using timestamps. - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInRealSeconds($date = null, $absolute = true) - { - $date = $this->resolveCarbon($date); - $value = $date->getTimestamp() - $this->getTimestamp(); - - return $absolute ? abs($value) : $value; - } - - /** - * Get the difference in milliseconds. - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInMilliseconds($date = null, $absolute = true) - { - return (int) ($this->diffInMicroseconds($date, $absolute) / static::MICROSECONDS_PER_MILLISECOND); - } - - /** - * Get the difference in milliseconds using timestamps. - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInRealMilliseconds($date = null, $absolute = true) - { - return (int) ($this->diffInRealMicroseconds($date, $absolute) / static::MICROSECONDS_PER_MILLISECOND); - } - - /** - * Get the difference in microseconds. - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInMicroseconds($date = null, $absolute = true) - { - $diff = $this->diff($this->resolveCarbon($date)); - $micro = isset($diff->f) ? $diff->f : 0; - $value = (int) round((((($diff->days * static::HOURS_PER_DAY) + - $diff->h) * static::MINUTES_PER_HOUR + - $diff->i) * static::SECONDS_PER_MINUTE + - ($micro + $diff->s)) * static::MICROSECONDS_PER_SECOND); - - return $absolute || !$diff->invert ? $value : -$value; - } - - /** - * Get the difference in microseconds using timestamps. - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * @param bool $absolute Get the absolute of the difference - * - * @return int - */ - public function diffInRealMicroseconds($date = null, $absolute = true) - { - /** @var Carbon $date */ - $date = $this->resolveCarbon($date); - $value = ($date->timestamp - $this->timestamp) * static::MICROSECONDS_PER_SECOND + - $date->micro - $this->micro; - - return $absolute ? abs($value) : $value; - } - - /** - * The number of seconds since midnight. - * - * @return int - */ - public function secondsSinceMidnight() - { - return $this->diffInSeconds($this->copy()->startOfDay()); - } - - /** - * The number of seconds until 23:59:59. - * - * @return int - */ - public function secondsUntilEndOfDay() - { - return $this->diffInSeconds($this->copy()->endOfDay()); - } - - /** - * Get the difference in a human readable format in the current locale. - * - * When comparing a value in the past to default now: - * 1 hour ago - * 5 months ago - * - * When comparing a value in the future to default now: - * 1 hour from now - * 5 months from now - * - * When comparing a value in the past to another value: - * 1 hour before - * 5 months before - * - * When comparing a value in the future to another value: - * 1 hour after - * 5 months after - * - * @param Carbon|null $other - * @param bool $absolute removes time difference modifiers ago, after, etc - * @param bool $short displays short format of time units - * @param int $parts displays number of parts in the interval - * - * @return string - */ - public function diffForHumans($other = null, $absolute = false, $short = false, $parts = 1) - { - $isNow = $other === null; - $relativeToNow = $isNow; - - if ($absolute === static::DIFF_RELATIVE_TO_NOW) { - $absolute = false; - $relativeToNow = true; - } elseif ($absolute === static::DIFF_RELATIVE_TO_OTHER) { - $absolute = false; - $relativeToNow = false; - } - - $interval = array(); - - $parts = min(6, max(1, (int) $parts)); - $count = 1; - $unit = $short ? 's' : 'second'; - - if ($isNow) { - $other = $this->nowWithSameTz(); - } elseif (!$other instanceof DateTime && !$other instanceof DateTimeInterface) { - $other = static::parse($other); - } - - $diffInterval = $this->diff($other); - - $diffIntervalArray = array( - array('value' => $diffInterval->y, 'unit' => 'year', 'unitShort' => 'y'), - array('value' => $diffInterval->m, 'unit' => 'month', 'unitShort' => 'm'), - array('value' => $diffInterval->d, 'unit' => 'day', 'unitShort' => 'd'), - array('value' => $diffInterval->h, 'unit' => 'hour', 'unitShort' => 'h'), - array('value' => $diffInterval->i, 'unit' => 'minute', 'unitShort' => 'min'), - array('value' => $diffInterval->s, 'unit' => 'second', 'unitShort' => 's'), - ); - - foreach ($diffIntervalArray as $diffIntervalData) { - if ($diffIntervalData['value'] > 0) { - $unit = $short ? $diffIntervalData['unitShort'] : $diffIntervalData['unit']; - $count = $diffIntervalData['value']; - - if ($diffIntervalData['unit'] === 'day' && $count >= static::DAYS_PER_WEEK) { - $unit = $short ? 'w' : 'week'; - $count = (int) ($count / static::DAYS_PER_WEEK); - - $interval[] = static::translator()->transChoice($unit, $count, array(':count' => $count)); - - // get the count days excluding weeks (might be zero) - $numOfDaysCount = (int) ($diffIntervalData['value'] - ($count * static::DAYS_PER_WEEK)); - - if ($numOfDaysCount > 0 && count($interval) < $parts) { - $unit = $short ? 'd' : 'day'; - $count = $numOfDaysCount; - $interval[] = static::translator()->transChoice($unit, $count, array(':count' => $count)); - } - } else { - $interval[] = static::translator()->transChoice($unit, $count, array(':count' => $count)); - } - } - - // break the loop after we get the required number of parts in array - if (count($interval) >= $parts) { - break; - } - } - - if (count($interval) === 0) { - if ($isNow && static::getHumanDiffOptions() & self::JUST_NOW) { - $key = 'diff_now'; - $translation = static::translator()->trans($key); - if ($translation !== $key) { - return $translation; - } - } - $count = static::getHumanDiffOptions() & self::NO_ZERO_DIFF ? 1 : 0; - $unit = $short ? 's' : 'second'; - $interval[] = static::translator()->transChoice($unit, $count, array(':count' => $count)); - } - - // join the interval parts by a space - $time = implode(' ', $interval); - - unset($diffIntervalArray, $interval); - - if ($absolute) { - return $time; - } - - $isFuture = $diffInterval->invert === 1; - - $transId = $relativeToNow ? ($isFuture ? 'from_now' : 'ago') : ($isFuture ? 'after' : 'before'); - - if ($parts === 1) { - if ($isNow && $unit === 'day') { - if ($count === 1 && static::getHumanDiffOptions() & self::ONE_DAY_WORDS) { - $key = $isFuture ? 'diff_tomorrow' : 'diff_yesterday'; - $translation = static::translator()->trans($key); - if ($translation !== $key) { - return $translation; - } - } - if ($count === 2 && static::getHumanDiffOptions() & self::TWO_DAY_WORDS) { - $key = $isFuture ? 'diff_after_tomorrow' : 'diff_before_yesterday'; - $translation = static::translator()->trans($key); - if ($translation !== $key) { - return $translation; - } - } - } - // Some languages have special pluralization for past and future tense. - $key = $unit.'_'.$transId; - if ($key !== static::translator()->transChoice($key, $count)) { - $time = static::translator()->transChoice($key, $count, array(':count' => $count)); - } - } - - return static::translator()->trans($transId, array(':time' => $time)); - } - - /** - * @alias diffForHumans - * - * Get the difference in a human readable format in the current locale. - * - * When comparing a value in the past to default now: - * 1 hour ago - * 5 months ago - * - * When comparing a value in the future to default now: - * 1 hour from now - * 5 months from now - * - * When comparing a value in the past to another value: - * 1 hour before - * 5 months before - * - * When comparing a value in the future to another value: - * 1 hour after - * 5 months after - * - * @param Carbon|null $other - * @param bool $absolute removes time difference modifiers ago, after, etc - * @param bool $short displays short format of time units - * @param int $parts displays number of parts in the interval - * - * @return string - */ - public function from($other = null, $absolute = false, $short = false, $parts = 1) - { - if (!$other && !$absolute) { - $absolute = static::DIFF_RELATIVE_TO_NOW; - } - - return $this->diffForHumans($other, $absolute, $short, $parts); - } - - /** - * @alias diffForHumans - * - * Get the difference in a human readable format in the current locale. - * - * When comparing a value in the past to default now: - * 1 hour ago - * 5 months ago - * - * When comparing a value in the future to default now: - * 1 hour from now - * 5 months from now - * - * When comparing a value in the past to another value: - * 1 hour before - * 5 months before - * - * When comparing a value in the future to another value: - * 1 hour after - * 5 months after - * - * @param Carbon|null $other - * @param bool $absolute removes time difference modifiers ago, after, etc - * @param bool $short displays short format of time units - * @param int $parts displays number of parts in the interval - * - * @return string - */ - public function since($other = null, $absolute = false, $short = false, $parts = 1) - { - return $this->diffForHumans($other, $absolute, $short, $parts); - } - - /** - * Get the difference in a human readable format in the current locale from an other - * instance given (or now if null given) to current instance. - * - * When comparing a value in the past to default now: - * 1 hour from now - * 5 months from now - * - * When comparing a value in the future to default now: - * 1 hour ago - * 5 months ago - * - * When comparing a value in the past to another value: - * 1 hour after - * 5 months after - * - * When comparing a value in the future to another value: - * 1 hour before - * 5 months before - * - * @param Carbon|null $other - * @param bool $absolute removes time difference modifiers ago, after, etc - * @param bool $short displays short format of time units - * @param int $parts displays number of parts in the interval - * - * @return string - */ - public function to($other = null, $absolute = false, $short = false, $parts = 1) - { - if (!$other && !$absolute) { - $absolute = static::DIFF_RELATIVE_TO_NOW; - } - - return $this->resolveCarbon($other)->diffForHumans($this, $absolute, $short, $parts); - } - - /** - * @alias to - * - * Get the difference in a human readable format in the current locale from an other - * instance given (or now if null given) to current instance. - * - * @param Carbon|null $other - * @param bool $absolute removes time difference modifiers ago, after, etc - * @param bool $short displays short format of time units - * @param int $parts displays number of parts in the interval - * - * @return string - */ - public function until($other = null, $absolute = false, $short = false, $parts = 1) - { - return $this->to($other, $absolute, $short, $parts); - } - - /** - * Get the difference in a human readable format in the current locale from current - * instance to now. - * - * @param bool $absolute removes time difference modifiers ago, after, etc - * @param bool $short displays short format of time units - * @param int $parts displays number of parts in the interval - * - * @return string - */ - public function fromNow($absolute = null, $short = false, $parts = 1) - { - $other = null; - - if ($absolute instanceof DateTimeInterface) { - list($other, $absolute, $short, $parts) = array_pad(func_get_args(), 5, null); - } - - return $this->from($other, $absolute, $short, $parts); - } - - /** - * Get the difference in a human readable format in the current locale from an other - * instance given to now - * - * @param bool $absolute removes time difference modifiers ago, after, etc - * @param bool $short displays short format of time units - * @param int $parts displays number of parts in the interval - * - * @return string - */ - public function toNow($absolute = null, $short = false, $parts = 1) - { - return $this->to(null, $absolute, $short, $parts); - } - - /** - * Get the difference in a human readable format in the current locale from an other - * instance given to now - * - * @param bool $absolute removes time difference modifiers ago, after, etc - * @param bool $short displays short format of time units - * @param int $parts displays number of parts in the interval - * - * @return string - */ - public function ago($absolute = null, $short = false, $parts = 1) - { - $other = null; - - if ($absolute instanceof DateTimeInterface) { - list($other, $absolute, $short, $parts) = array_pad(func_get_args(), 5, null); - } - - return $this->from($other, $absolute, $short, $parts); - } - - /////////////////////////////////////////////////////////////////// - //////////////////////////// MODIFIERS //////////////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * Resets the time to 00:00:00 start of day - * - * @return static - */ - public function startOfDay() - { - return $this->modify('00:00:00.000000'); - } - - /** - * Resets the time to 23:59:59 end of day - * - * @return static - */ - public function endOfDay() - { - return $this->modify('23:59:59.999999'); - } - - /** - * Resets the date to the first day of the month and the time to 00:00:00 - * - * @return static - */ - public function startOfMonth() - { - return $this->setDate($this->year, $this->month, 1)->startOfDay(); - } - - /** - * Resets the date to end of the month and time to 23:59:59 - * - * @return static - */ - public function endOfMonth() - { - return $this->setDate($this->year, $this->month, $this->daysInMonth)->endOfDay(); - } - - /** - * Resets the date to the first day of the quarter and the time to 00:00:00 - * - * @return static - */ - public function startOfQuarter() - { - $month = ($this->quarter - 1) * static::MONTHS_PER_QUARTER + 1; - - return $this->setDate($this->year, $month, 1)->startOfDay(); - } - - /** - * Resets the date to end of the quarter and time to 23:59:59 - * - * @return static - */ - public function endOfQuarter() - { - return $this->startOfQuarter()->addMonths(static::MONTHS_PER_QUARTER - 1)->endOfMonth(); - } - - /** - * Resets the date to the first day of the year and the time to 00:00:00 - * - * @return static - */ - public function startOfYear() - { - return $this->setDate($this->year, 1, 1)->startOfDay(); - } - - /** - * Resets the date to end of the year and time to 23:59:59 - * - * @return static - */ - public function endOfYear() - { - return $this->setDate($this->year, 12, 31)->endOfDay(); - } - - /** - * Resets the date to the first day of the decade and the time to 00:00:00 - * - * @return static - */ - public function startOfDecade() - { - $year = $this->year - $this->year % static::YEARS_PER_DECADE; - - return $this->setDate($year, 1, 1)->startOfDay(); - } - - /** - * Resets the date to end of the decade and time to 23:59:59 - * - * @return static - */ - public function endOfDecade() - { - $year = $this->year - $this->year % static::YEARS_PER_DECADE + static::YEARS_PER_DECADE - 1; - - return $this->setDate($year, 12, 31)->endOfDay(); - } - - /** - * Resets the date to the first day of the century and the time to 00:00:00 - * - * @return static - */ - public function startOfCentury() - { - $year = $this->year - ($this->year - 1) % static::YEARS_PER_CENTURY; - - return $this->setDate($year, 1, 1)->startOfDay(); - } - - /** - * Resets the date to end of the century and time to 23:59:59 - * - * @return static - */ - public function endOfCentury() - { - $year = $this->year - 1 - ($this->year - 1) % static::YEARS_PER_CENTURY + static::YEARS_PER_CENTURY; - - return $this->setDate($year, 12, 31)->endOfDay(); - } - - /** - * Resets the date to the first day of the century and the time to 00:00:00 - * - * @return static - */ - public function startOfMillennium() - { - $year = $this->year - ($this->year - 1) % static::YEARS_PER_MILLENNIUM; - - return $this->setDate($year, 1, 1)->startOfDay(); - } - - /** - * Resets the date to end of the century and time to 23:59:59 - * - * @return static - */ - public function endOfMillennium() - { - $year = $this->year - 1 - ($this->year - 1) % static::YEARS_PER_MILLENNIUM + static::YEARS_PER_MILLENNIUM; - - return $this->setDate($year, 12, 31)->endOfDay(); - } - - /** - * Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00 - * - * @return static - */ - public function startOfWeek() - { - while ($this->dayOfWeek !== static::$weekStartsAt) { - $this->subDay(); - } - - return $this->startOfDay(); - } - - /** - * Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59 - * - * @return static - */ - public function endOfWeek() - { - while ($this->dayOfWeek !== static::$weekEndsAt) { - $this->addDay(); - } - - return $this->endOfDay(); - } - - /** - * Modify to start of current hour, minutes and seconds become 0 - * - * @return static - */ - public function startOfHour() - { - return $this->setTime($this->hour, 0, 0); - } - - /** - * Modify to end of current hour, minutes and seconds become 59 - * - * @return static - */ - public function endOfHour() - { - return $this->modify("$this->hour:59:59.999999"); - } - - /** - * Modify to start of current minute, seconds become 0 - * - * @return static - */ - public function startOfMinute() - { - return $this->setTime($this->hour, $this->minute, 0); - } - - /** - * Modify to end of current minute, seconds become 59 - * - * @return static - */ - public function endOfMinute() - { - return $this->modify("$this->hour:$this->minute:59.999999"); - } - - /** - * Modify to start of current minute, seconds become 0 - * - * @return static - */ - public function startOfSecond() - { - return $this->modify("$this->hour:$this->minute:$this->second.0"); - } - - /** - * Modify to end of current minute, seconds become 59 - * - * @return static - */ - public function endOfSecond() - { - return $this->modify("$this->hour:$this->minute:$this->second.999999"); - } - - /** - * Modify to midday, default to self::$midDayAt - * - * @return static - */ - public function midDay() - { - return $this->setTime(self::$midDayAt, 0, 0); - } - - /** - * Modify to the next occurrence of a given day of the week. - * If no dayOfWeek is provided, modify to the next occurrence - * of the current day of the week. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek - * - * @return static - */ - public function next($dayOfWeek = null) - { - if ($dayOfWeek === null) { - $dayOfWeek = $this->dayOfWeek; - } - - return $this->startOfDay()->modify('next '.static::$days[$dayOfWeek]); - } - - /** - * Go forward or backward to the next week- or weekend-day. - * - * @param bool $weekday - * @param bool $forward - * - * @return $this - */ - private function nextOrPreviousDay($weekday = true, $forward = true) - { - $step = $forward ? 1 : -1; - - do { - $this->addDay($step); - } while ($weekday ? $this->isWeekend() : $this->isWeekday()); - - return $this; - } - - /** - * Go forward to the next weekday. - * - * @return $this - */ - public function nextWeekday() - { - return $this->nextOrPreviousDay(); - } - - /** - * Go backward to the previous weekday. - * - * @return $this - */ - public function previousWeekday() - { - return $this->nextOrPreviousDay(true, false); - } - - /** - * Go forward to the next weekend day. - * - * @return $this - */ - public function nextWeekendDay() - { - return $this->nextOrPreviousDay(false); - } - - /** - * Go backward to the previous weekend day. - * - * @return $this - */ - public function previousWeekendDay() - { - return $this->nextOrPreviousDay(false, false); - } - - /** - * Modify to the previous occurrence of a given day of the week. - * If no dayOfWeek is provided, modify to the previous occurrence - * of the current day of the week. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek - * - * @return static - */ - public function previous($dayOfWeek = null) - { - if ($dayOfWeek === null) { - $dayOfWeek = $this->dayOfWeek; - } - - return $this->startOfDay()->modify('last '.static::$days[$dayOfWeek]); - } - - /** - * Modify to the first occurrence of a given day of the week - * in the current month. If no dayOfWeek is provided, modify to the - * first day of the current month. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek - * - * @return static - */ - public function firstOfMonth($dayOfWeek = null) - { - $this->startOfDay(); - - if ($dayOfWeek === null) { - return $this->day(1); - } - - return $this->modify('first '.static::$days[$dayOfWeek].' of '.$this->format('F').' '.$this->year); - } - - /** - * Modify to the last occurrence of a given day of the week - * in the current month. If no dayOfWeek is provided, modify to the - * last day of the current month. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek - * - * @return static - */ - public function lastOfMonth($dayOfWeek = null) - { - $this->startOfDay(); - - if ($dayOfWeek === null) { - return $this->day($this->daysInMonth); - } - - return $this->modify('last '.static::$days[$dayOfWeek].' of '.$this->format('F').' '.$this->year); - } - - /** - * Modify to the given occurrence of a given day of the week - * in the current month. If the calculated occurrence is outside the scope - * of the current month, then return false and no modifications are made. - * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $nth - * @param int $dayOfWeek - * - * @return mixed - */ - public function nthOfMonth($nth, $dayOfWeek) - { - $date = $this->copy()->firstOfMonth(); - $check = $date->format('Y-m'); - $date->modify('+'.$nth.' '.static::$days[$dayOfWeek]); - - return $date->format('Y-m') === $check ? $this->modify($date) : false; - } - - /** - * Modify to the first occurrence of a given day of the week - * in the current quarter. If no dayOfWeek is provided, modify to the - * first day of the current quarter. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek day of the week default null - * - * @return static - */ - public function firstOfQuarter($dayOfWeek = null) - { - return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER - 2, 1)->firstOfMonth($dayOfWeek); - } - - /** - * Modify to the last occurrence of a given day of the week - * in the current quarter. If no dayOfWeek is provided, modify to the - * last day of the current quarter. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek day of the week default null - * - * @return static - */ - public function lastOfQuarter($dayOfWeek = null) - { - return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER, 1)->lastOfMonth($dayOfWeek); - } - - /** - * Modify to the given occurrence of a given day of the week - * in the current quarter. If the calculated occurrence is outside the scope - * of the current quarter, then return false and no modifications are made. - * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $nth - * @param int $dayOfWeek - * - * @return mixed - */ - public function nthOfQuarter($nth, $dayOfWeek) - { - $date = $this->copy()->day(1)->month($this->quarter * static::MONTHS_PER_QUARTER); - $lastMonth = $date->month; - $year = $date->year; - $date->firstOfQuarter()->modify('+'.$nth.' '.static::$days[$dayOfWeek]); - - return ($lastMonth < $date->month || $year !== $date->year) ? false : $this->modify($date); - } - - /** - * Modify to the first occurrence of a given day of the week - * in the current year. If no dayOfWeek is provided, modify to the - * first day of the current year. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek day of the week default null - * - * @return static - */ - public function firstOfYear($dayOfWeek = null) - { - return $this->month(1)->firstOfMonth($dayOfWeek); - } - - /** - * Modify to the last occurrence of a given day of the week - * in the current year. If no dayOfWeek is provided, modify to the - * last day of the current year. Use the supplied constants - * to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int|null $dayOfWeek day of the week default null - * - * @return static - */ - public function lastOfYear($dayOfWeek = null) - { - return $this->month(static::MONTHS_PER_YEAR)->lastOfMonth($dayOfWeek); - } - - /** - * Modify to the given occurrence of a given day of the week - * in the current year. If the calculated occurrence is outside the scope - * of the current year, then return false and no modifications are made. - * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. - * - * @param int $nth - * @param int $dayOfWeek - * - * @return mixed - */ - public function nthOfYear($nth, $dayOfWeek) - { - $date = $this->copy()->firstOfYear()->modify('+'.$nth.' '.static::$days[$dayOfWeek]); - - return $this->year === $date->year ? $this->modify($date) : false; - } - - /** - * Modify the current instance to the average of a given instance (default now) and the current instance. - * - * @param \Carbon\Carbon|\DateTimeInterface|string|null $date - * - * @return static - */ - public function average($date = null) - { - $date = $this->resolveCarbon($date); - $increment = $this->diffInRealSeconds($date, false) / 2; - $intIncrement = floor($increment); - $microIncrement = (int) (($date->micro - $this->micro) / 2 + 1000000 * ($increment - $intIncrement)); - $micro = (int) ($this->micro + $microIncrement); - while ($micro >= 1000000) { - $micro -= 1000000; - $intIncrement++; - } - $this->addSeconds($intIncrement); - - if (version_compare(PHP_VERSION, '7.1.8-dev', '>=')) { - $this->setTime($this->hour, $this->minute, $this->second, $micro); - } - - return $this; - } - - /////////////////////////////////////////////////////////////////// - /////////////////////////// SERIALIZATION ///////////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * Return a serialized string of the instance. - * - * @return string - */ - public function serialize() - { - return serialize($this); - } - - /** - * Create an instance from a serialized string. - * - * @param string $value - * - * @throws \InvalidArgumentException - * - * @return static - */ - public static function fromSerialized($value) - { - $instance = @unserialize($value); - - if (!$instance instanceof static) { - throw new InvalidArgumentException('Invalid serialized value.'); - } - - return $instance; - } - - /** - * The __set_state handler. - * - * @param array $array - * - * @return static - */ - public static function __set_state($array) - { - return static::instance(parent::__set_state($array)); - } - - /** - * Prepare the object for JSON serialization. - * - * @return array|string - */ - public function jsonSerialize() - { - if (static::$serializer) { - return call_user_func(static::$serializer, $this); - } - - $carbon = $this; - - return call_user_func(function () use ($carbon) { - return get_object_vars($carbon); - }); - } - - /** - * JSON serialize all Carbon instances using the given callback. - * - * @param callable $callback - * - * @return void - */ - public static function serializeUsing($callback) - { - static::$serializer = $callback; - } - - /////////////////////////////////////////////////////////////////// - /////////////////////////////// MACRO ///////////////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * Register a custom macro. - * - * @param string $name - * @param object|callable $macro - * - * @return void - */ - public static function macro($name, $macro) - { - static::$localMacros[$name] = $macro; - } - - /** - * Remove all macros. - */ - public static function resetMacros() - { - static::$localMacros = array(); - } - - /** - * Mix another object into the class. - * - * @param object $mixin - * - * @return void - */ - public static function mixin($mixin) - { - $reflection = new \ReflectionClass($mixin); - $methods = $reflection->getMethods( - \ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED - ); - - foreach ($methods as $method) { - $method->setAccessible(true); - - static::macro($method->name, $method->invoke($mixin)); - } - } - - /** - * Checks if macro is registered. - * - * @param string $name - * - * @return bool - */ - public static function hasMacro($name) - { - return isset(static::$localMacros[$name]); - } - - /** - * Dynamically handle calls to the class. - * - * @param string $method - * @param array $parameters - * - * @throws \BadMethodCallException - * - * @return mixed - */ - public static function __callStatic($method, $parameters) - { - if (!static::hasMacro($method)) { - throw new \BadMethodCallException("Method $method does not exist."); - } - - if (static::$localMacros[$method] instanceof Closure && method_exists('Closure', 'bind')) { - return call_user_func_array(Closure::bind(static::$localMacros[$method], null, get_called_class()), $parameters); - } - - return call_user_func_array(static::$localMacros[$method], $parameters); - } - - /** - * Dynamically handle calls to the class. - * - * @param string $method - * @param array $parameters - * - * @throws \BadMethodCallException|\ReflectionException - * - * @return mixed - */ - public function __call($method, $parameters) - { - if (!static::hasMacro($method)) { - throw new \BadMethodCallException("Method $method does not exist."); - } - - $macro = static::$localMacros[$method]; - - $reflexion = new \ReflectionFunction($macro); - $reflectionParameters = $reflexion->getParameters(); - $expectedCount = count($reflectionParameters); - $actualCount = count($parameters); - if ($expectedCount > $actualCount && $reflectionParameters[$expectedCount - 1]->name === 'self') { - for ($i = $actualCount; $i < $expectedCount - 1; $i++) { - $parameters[] = $reflectionParameters[$i]->getDefaultValue(); - } - $parameters[] = $this; - } - - if ($macro instanceof Closure && method_exists($macro, 'bindTo')) { - return call_user_func_array($macro->bindTo($this, get_class($this)), $parameters); - } - - return call_user_func_array($macro, $parameters); - } - - /** - * Show truthy properties on var_dump(). - * - * @return array - */ - public function __debugInfo() - { - return array_filter(get_object_vars($this), function ($var) { - return $var; - }); - } - - /** - * Cast the current instance into the given class. - * - * @param string $className The $className::instance() method will be called to cast the current object. - * - * @return object - */ - public function cast($className) - { - if (!method_exists($className, 'instance')) { - throw new \InvalidArgumentException("$className has not the instance() method needed to cast the date."); - } - - return $className::instance($this); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php b/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php deleted file mode 100644 index e8c6032..0000000 --- a/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php +++ /dev/null @@ -1,1163 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use Closure; -use DateInterval; -use InvalidArgumentException; -use ReflectionClass; -use ReflectionFunction; -use ReflectionMethod; -use Symfony\Component\Translation\TranslatorInterface; - -/** - * A simple API extension for DateInterval. - * The implementation provides helpers to handle weeks but only days are saved. - * Weeks are calculated based on the total days of the current instance. - * - * @property int $years Total years of the current interval. - * @property int $months Total months of the current interval. - * @property int $weeks Total weeks of the current interval calculated from the days. - * @property int $dayz Total days of the current interval (weeks * 7 + days). - * @property int $hours Total hours of the current interval. - * @property int $minutes Total minutes of the current interval. - * @property int $seconds Total seconds of the current interval. - * @property-read int $dayzExcludeWeeks Total days remaining in the final week of the current instance (days % 7). - * @property-read int $daysExcludeWeeks alias of dayzExcludeWeeks - * @property-read float $totalYears Number of years equivalent to the interval. - * @property-read float $totalMonths Number of months equivalent to the interval. - * @property-read float $totalWeeks Number of weeks equivalent to the interval. - * @property-read float $totalDays Number of days equivalent to the interval. - * @property-read float $totalDayz Alias for totalDays. - * @property-read float $totalHours Number of hours equivalent to the interval. - * @property-read float $totalMinutes Number of minutes equivalent to the interval. - * @property-read float $totalSeconds Number of seconds equivalent to the interval. - * - * @method static CarbonInterval years($years = 1) Create instance specifying a number of years. - * @method static CarbonInterval year($years = 1) Alias for years() - * @method static CarbonInterval months($months = 1) Create instance specifying a number of months. - * @method static CarbonInterval month($months = 1) Alias for months() - * @method static CarbonInterval weeks($weeks = 1) Create instance specifying a number of weeks. - * @method static CarbonInterval week($weeks = 1) Alias for weeks() - * @method static CarbonInterval days($days = 1) Create instance specifying a number of days. - * @method static CarbonInterval dayz($days = 1) Alias for days() - * @method static CarbonInterval day($days = 1) Alias for days() - * @method static CarbonInterval hours($hours = 1) Create instance specifying a number of hours. - * @method static CarbonInterval hour($hours = 1) Alias for hours() - * @method static CarbonInterval minutes($minutes = 1) Create instance specifying a number of minutes. - * @method static CarbonInterval minute($minutes = 1) Alias for minutes() - * @method static CarbonInterval seconds($seconds = 1) Create instance specifying a number of seconds. - * @method static CarbonInterval second($seconds = 1) Alias for seconds() - * @method CarbonInterval years($years = 1) Set the years portion of the current interval. - * @method CarbonInterval year($years = 1) Alias for years(). - * @method CarbonInterval months($months = 1) Set the months portion of the current interval. - * @method CarbonInterval month($months = 1) Alias for months(). - * @method CarbonInterval weeks($weeks = 1) Set the weeks portion of the current interval. Will overwrite dayz value. - * @method CarbonInterval week($weeks = 1) Alias for weeks(). - * @method CarbonInterval days($days = 1) Set the days portion of the current interval. - * @method CarbonInterval dayz($days = 1) Alias for days(). - * @method CarbonInterval day($days = 1) Alias for days(). - * @method CarbonInterval hours($hours = 1) Set the hours portion of the current interval. - * @method CarbonInterval hour($hours = 1) Alias for hours(). - * @method CarbonInterval minutes($minutes = 1) Set the minutes portion of the current interval. - * @method CarbonInterval minute($minutes = 1) Alias for minutes(). - * @method CarbonInterval seconds($seconds = 1) Set the seconds portion of the current interval. - * @method CarbonInterval second($seconds = 1) Alias for seconds(). - */ -class CarbonInterval extends DateInterval -{ - /** - * Interval spec period designators - */ - const PERIOD_PREFIX = 'P'; - const PERIOD_YEARS = 'Y'; - const PERIOD_MONTHS = 'M'; - const PERIOD_DAYS = 'D'; - const PERIOD_TIME_PREFIX = 'T'; - const PERIOD_HOURS = 'H'; - const PERIOD_MINUTES = 'M'; - const PERIOD_SECONDS = 'S'; - - /** - * A translator to ... er ... translate stuff - * - * @var \Symfony\Component\Translation\TranslatorInterface - */ - protected static $translator; - - /** - * @var array|null - */ - protected static $cascadeFactors; - - /** - * @var array|null - */ - private static $flipCascadeFactors; - - /** - * The registered macros. - * - * @var array - */ - protected static $macros = array(); - - /** - * Before PHP 5.4.20/5.5.4 instead of FALSE days will be set to -99999 when the interval instance - * was created by DateTime::diff(). - */ - const PHP_DAYS_FALSE = -99999; - - /** - * Mapping of units and factors for cascading. - * - * Should only be modified by changing the factors or referenced constants. - * - * @return array - */ - public static function getCascadeFactors() - { - return static::$cascadeFactors ?: array( - 'minutes' => array(Carbon::SECONDS_PER_MINUTE, 'seconds'), - 'hours' => array(Carbon::MINUTES_PER_HOUR, 'minutes'), - 'dayz' => array(Carbon::HOURS_PER_DAY, 'hours'), - 'months' => array(Carbon::DAYS_PER_WEEK * Carbon::WEEKS_PER_MONTH, 'dayz'), - 'years' => array(Carbon::MONTHS_PER_YEAR, 'months'), - ); - } - - private static function standardizeUnit($unit) - { - $unit = rtrim($unit, 'sz').'s'; - - return $unit === 'days' ? 'dayz' : $unit; - } - - private static function getFlipCascadeFactors() - { - if (!self::$flipCascadeFactors) { - self::$flipCascadeFactors = array(); - foreach (static::getCascadeFactors() as $to => $tuple) { - list($factor, $from) = $tuple; - - self::$flipCascadeFactors[self::standardizeUnit($from)] = array(self::standardizeUnit($to), $factor); - } - } - - return self::$flipCascadeFactors; - } - - /** - * @param array $cascadeFactors - */ - public static function setCascadeFactors(array $cascadeFactors) - { - self::$flipCascadeFactors = null; - static::$cascadeFactors = $cascadeFactors; - } - - /** - * Determine if the interval was created via DateTime:diff() or not. - * - * @param DateInterval $interval - * - * @return bool - */ - private static function wasCreatedFromDiff(DateInterval $interval) - { - return $interval->days !== false && $interval->days !== static::PHP_DAYS_FALSE; - } - - /////////////////////////////////////////////////////////////////// - //////////////////////////// CONSTRUCTORS ///////////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * Create a new CarbonInterval instance. - * - * @param int $years - * @param int $months - * @param int $weeks - * @param int $days - * @param int $hours - * @param int $minutes - * @param int $seconds - */ - public function __construct($years = 1, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null) - { - $spec = $years; - - if (!is_string($spec) || floatval($years) || preg_match('/^[0-9.]/', $years)) { - $spec = static::PERIOD_PREFIX; - - $spec .= $years > 0 ? $years.static::PERIOD_YEARS : ''; - $spec .= $months > 0 ? $months.static::PERIOD_MONTHS : ''; - - $specDays = 0; - $specDays += $weeks > 0 ? $weeks * static::getDaysPerWeek() : 0; - $specDays += $days > 0 ? $days : 0; - - $spec .= $specDays > 0 ? $specDays.static::PERIOD_DAYS : ''; - - if ($hours > 0 || $minutes > 0 || $seconds > 0) { - $spec .= static::PERIOD_TIME_PREFIX; - $spec .= $hours > 0 ? $hours.static::PERIOD_HOURS : ''; - $spec .= $minutes > 0 ? $minutes.static::PERIOD_MINUTES : ''; - $spec .= $seconds > 0 ? $seconds.static::PERIOD_SECONDS : ''; - } - - if ($spec === static::PERIOD_PREFIX) { - // Allow the zero interval. - $spec .= '0'.static::PERIOD_YEARS; - } - } - - parent::__construct($spec); - } - - /** - * Returns the factor for a given source-to-target couple. - * - * @param string $source - * @param string $target - * - * @return int|null - */ - public static function getFactor($source, $target) - { - $source = self::standardizeUnit($source); - $target = self::standardizeUnit($target); - $factors = static::getFlipCascadeFactors(); - if (isset($factors[$source])) { - list($to, $factor) = $factors[$source]; - if ($to === $target) { - return $factor; - } - } - - return null; - } - - /** - * Returns current config for days per week. - * - * @return int - */ - public static function getDaysPerWeek() - { - return static::getFactor('dayz', 'weeks') ?: Carbon::DAYS_PER_WEEK; - } - - /** - * Returns current config for hours per day. - * - * @return int - */ - public static function getHoursPerDay() - { - return static::getFactor('hours', 'dayz') ?: Carbon::HOURS_PER_DAY; - } - - /** - * Returns current config for minutes per hour. - * - * @return int - */ - public static function getMinutesPerHours() - { - return static::getFactor('minutes', 'hours') ?: Carbon::MINUTES_PER_HOUR; - } - - /** - * Returns current config for seconds per minute. - * - * @return int - */ - public static function getSecondsPerMinutes() - { - return static::getFactor('seconds', 'minutes') ?: Carbon::SECONDS_PER_MINUTE; - } - - /** - * Create a new CarbonInterval instance from specific values. - * This is an alias for the constructor that allows better fluent - * syntax as it allows you to do CarbonInterval::create(1)->fn() rather than - * (new CarbonInterval(1))->fn(). - * - * @param int $years - * @param int $months - * @param int $weeks - * @param int $days - * @param int $hours - * @param int $minutes - * @param int $seconds - * - * @return static - */ - public static function create($years = 1, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null) - { - return new static($years, $months, $weeks, $days, $hours, $minutes, $seconds); - } - - /** - * Get a copy of the instance. - * - * @return static - */ - public function copy() - { - $date = new static($this->spec()); - $date->invert = $this->invert; - - return $date; - } - - /** - * Provide static helpers to create instances. Allows CarbonInterval::years(3). - * - * Note: This is done using the magic method to allow static and instance methods to - * have the same names. - * - * @param string $name - * @param array $args - * - * @return static - */ - public static function __callStatic($name, $args) - { - $arg = count($args) === 0 ? 1 : $args[0]; - - switch ($name) { - case 'years': - case 'year': - return new static($arg); - - case 'months': - case 'month': - return new static(null, $arg); - - case 'weeks': - case 'week': - return new static(null, null, $arg); - - case 'days': - case 'dayz': - case 'day': - return new static(null, null, null, $arg); - - case 'hours': - case 'hour': - return new static(null, null, null, null, $arg); - - case 'minutes': - case 'minute': - return new static(null, null, null, null, null, $arg); - - case 'seconds': - case 'second': - return new static(null, null, null, null, null, null, $arg); - } - - if (static::hasMacro($name)) { - return call_user_func_array( - array(new static(0), $name), $args - ); - } - } - - /** - * Creates a CarbonInterval from string. - * - * Format: - * - * Suffix | Unit | Example | DateInterval expression - * -------|---------|---------|------------------------ - * y | years | 1y | P1Y - * mo | months | 3mo | P3M - * w | weeks | 2w | P2W - * d | days | 28d | P28D - * h | hours | 4h | PT4H - * m | minutes | 12m | PT12M - * s | seconds | 59s | PT59S - * - * e. g. `1w 3d 4h 32m 23s` is converted to 10 days 4 hours 32 minutes and 23 seconds. - * - * Special cases: - * - An empty string will return a zero interval - * - Fractions are allowed for weeks, days, hours and minutes and will be converted - * and rounded to the next smaller value (caution: 0.5w = 4d) - * - * @param string $intervalDefinition - * - * @return static - */ - public static function fromString($intervalDefinition) - { - if (empty($intervalDefinition)) { - return new static(0); - } - - $years = 0; - $months = 0; - $weeks = 0; - $days = 0; - $hours = 0; - $minutes = 0; - $seconds = 0; - - $pattern = '/(\d+(?:\.\d+)?)\h*([^\d\h]*)/i'; - preg_match_all($pattern, $intervalDefinition, $parts, PREG_SET_ORDER); - while ($match = array_shift($parts)) { - list($part, $value, $unit) = $match; - $intValue = intval($value); - $fraction = floatval($value) - $intValue; - switch (strtolower($unit)) { - case 'year': - case 'years': - case 'y': - $years += $intValue; - break; - - case 'month': - case 'months': - case 'mo': - $months += $intValue; - break; - - case 'week': - case 'weeks': - case 'w': - $weeks += $intValue; - if ($fraction) { - $parts[] = array(null, $fraction * static::getDaysPerWeek(), 'd'); - } - break; - - case 'day': - case 'days': - case 'd': - $days += $intValue; - if ($fraction) { - $parts[] = array(null, $fraction * static::getHoursPerDay(), 'h'); - } - break; - - case 'hour': - case 'hours': - case 'h': - $hours += $intValue; - if ($fraction) { - $parts[] = array(null, $fraction * static::getMinutesPerHours(), 'm'); - } - break; - - case 'minute': - case 'minutes': - case 'm': - $minutes += $intValue; - if ($fraction) { - $seconds += round($fraction * static::getSecondsPerMinutes()); - } - break; - - case 'second': - case 'seconds': - case 's': - $seconds += $intValue; - break; - - default: - throw new InvalidArgumentException( - sprintf('Invalid part %s in definition %s', $part, $intervalDefinition) - ); - } - } - - return new static($years, $months, $weeks, $days, $hours, $minutes, $seconds); - } - - /** - * Create a CarbonInterval instance from a DateInterval one. Can not instance - * DateInterval objects created from DateTime::diff() as you can't externally - * set the $days field. - * - * Pass false as second argument to get a microseconds-precise interval. Else - * microseconds in the original interval will not be kept. - * - * @param DateInterval $di - * @param bool $trimMicroseconds (true by default) - * - * @return static - */ - public static function instance(DateInterval $di, $trimMicroseconds = true) - { - $microseconds = $trimMicroseconds || version_compare(PHP_VERSION, '7.1.0-dev', '<') ? 0 : $di->f; - $instance = new static(static::getDateIntervalSpec($di)); - if ($microseconds) { - $instance->f = $microseconds; - } - $instance->invert = $di->invert; - foreach (array('y', 'm', 'd', 'h', 'i', 's') as $unit) { - if ($di->$unit < 0) { - $instance->$unit *= -1; - } - } - - return $instance; - } - - /** - * Make a CarbonInterval instance from given variable if possible. - * - * Always return a new instance. Parse only strings and only these likely to be intervals (skip dates - * and recurrences). Throw an exception for invalid format, but otherwise return null. - * - * @param mixed $var - * - * @return static|null - */ - public static function make($var) - { - if ($var instanceof DateInterval) { - return static::instance($var); - } - - if (is_string($var)) { - $var = trim($var); - - if (substr($var, 0, 1) === 'P') { - return new static($var); - } - - if (preg_match('/^(?:\h*\d+(?:\.\d+)?\h*[a-z]+)+$/i', $var)) { - return static::fromString($var); - } - } - } - - /////////////////////////////////////////////////////////////////// - /////////////////////// LOCALIZATION ////////////////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * Initialize the translator instance if necessary. - * - * @return \Symfony\Component\Translation\TranslatorInterface - */ - protected static function translator() - { - if (static::$translator === null) { - static::$translator = Translator::get(); - } - - return static::$translator; - } - - /** - * Get the translator instance in use. - * - * @return \Symfony\Component\Translation\TranslatorInterface - */ - public static function getTranslator() - { - return static::translator(); - } - - /** - * Set the translator instance to use. - * - * @param TranslatorInterface $translator - */ - public static function setTranslator(TranslatorInterface $translator) - { - static::$translator = $translator; - } - - /** - * Get the current translator locale. - * - * @return string - */ - public static function getLocale() - { - return static::translator()->getLocale(); - } - - /** - * Set the current translator locale. - * - * @param string $locale - */ - public static function setLocale($locale) - { - return static::translator()->setLocale($locale) !== false; - } - - /////////////////////////////////////////////////////////////////// - ///////////////////////// GETTERS AND SETTERS ///////////////////// - /////////////////////////////////////////////////////////////////// - - /** - * Get a part of the CarbonInterval object. - * - * @param string $name - * - * @throws \InvalidArgumentException - * - * @return int|float - */ - public function __get($name) - { - if (substr($name, 0, 5) === 'total') { - return $this->total(substr($name, 5)); - } - - switch ($name) { - case 'years': - return $this->y; - - case 'months': - return $this->m; - - case 'dayz': - return $this->d; - - case 'hours': - return $this->h; - - case 'minutes': - return $this->i; - - case 'seconds': - return $this->s; - - case 'weeks': - return (int) floor($this->d / static::getDaysPerWeek()); - - case 'daysExcludeWeeks': - case 'dayzExcludeWeeks': - return $this->d % static::getDaysPerWeek(); - - default: - throw new InvalidArgumentException(sprintf("Unknown getter '%s'", $name)); - } - } - - /** - * Set a part of the CarbonInterval object. - * - * @param string $name - * @param int $val - * - * @throws \InvalidArgumentException - */ - public function __set($name, $val) - { - switch ($name) { - case 'years': - $this->y = $val; - break; - - case 'months': - $this->m = $val; - break; - - case 'weeks': - $this->d = $val * static::getDaysPerWeek(); - break; - - case 'dayz': - $this->d = $val; - break; - - case 'hours': - $this->h = $val; - break; - - case 'minutes': - $this->i = $val; - break; - - case 'seconds': - $this->s = $val; - break; - } - } - - /** - * Allow setting of weeks and days to be cumulative. - * - * @param int $weeks Number of weeks to set - * @param int $days Number of days to set - * - * @return static - */ - public function weeksAndDays($weeks, $days) - { - $this->dayz = ($weeks * static::getDaysPerWeek()) + $days; - - return $this; - } - - /** - * Register a custom macro. - * - * @param string $name - * @param object|callable $macro - * - * @return void - */ - public static function macro($name, $macro) - { - static::$macros[$name] = $macro; - } - - /** - * Remove all macros. - */ - public static function resetMacros() - { - static::$macros = array(); - } - - /** - * Register macros from a mixin object. - * - * @param object $mixin - * - * @throws \ReflectionException - * - * @return void - */ - public static function mixin($mixin) - { - $reflection = new ReflectionClass($mixin); - - $methods = $reflection->getMethods( - ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED - ); - - foreach ($methods as $method) { - $method->setAccessible(true); - - static::macro($method->name, $method->invoke($mixin)); - } - } - - /** - * Check if macro is registered. - * - * @param string $name - * - * @return bool - */ - public static function hasMacro($name) - { - return isset(static::$macros[$name]); - } - - /** - * Call given macro. - * - * @param string $name - * @param array $parameters - * - * @return mixed - */ - protected function callMacro($name, $parameters) - { - $macro = static::$macros[$name]; - - $reflection = new ReflectionFunction($macro); - - $reflectionParameters = $reflection->getParameters(); - - $expectedCount = count($reflectionParameters); - $actualCount = count($parameters); - - if ($expectedCount > $actualCount && $reflectionParameters[$expectedCount - 1]->name === 'self') { - for ($i = $actualCount; $i < $expectedCount - 1; $i++) { - $parameters[] = $reflectionParameters[$i]->getDefaultValue(); - } - - $parameters[] = $this; - } - - if ($macro instanceof Closure && method_exists($macro, 'bindTo')) { - $macro = $macro->bindTo($this, get_class($this)); - } - - return call_user_func_array($macro, $parameters); - } - - /** - * Allow fluent calls on the setters... CarbonInterval::years(3)->months(5)->day(). - * - * Note: This is done using the magic method to allow static and instance methods to - * have the same names. - * - * @param string $name - * @param array $args - * - * @return static - */ - public function __call($name, $args) - { - if (static::hasMacro($name)) { - return $this->callMacro($name, $args); - } - - $arg = count($args) === 0 ? 1 : $args[0]; - - switch ($name) { - case 'years': - case 'year': - $this->years = $arg; - break; - - case 'months': - case 'month': - $this->months = $arg; - break; - - case 'weeks': - case 'week': - $this->dayz = $arg * static::getDaysPerWeek(); - break; - - case 'days': - case 'dayz': - case 'day': - $this->dayz = $arg; - break; - - case 'hours': - case 'hour': - $this->hours = $arg; - break; - - case 'minutes': - case 'minute': - $this->minutes = $arg; - break; - - case 'seconds': - case 'second': - $this->seconds = $arg; - break; - } - - return $this; - } - - /** - * Get the current interval in a human readable format in the current locale. - * - * @param bool $short (false by default), returns short units if true - * - * @return string - */ - public function forHumans($short = false) - { - $periods = array( - 'year' => array('y', $this->years), - 'month' => array('m', $this->months), - 'week' => array('w', $this->weeks), - 'day' => array('d', $this->daysExcludeWeeks), - 'hour' => array('h', $this->hours), - 'minute' => array('min', $this->minutes), - 'second' => array('s', $this->seconds), - ); - - $parts = array(); - foreach ($periods as $unit => $options) { - list($shortUnit, $count) = $options; - if ($count > 0) { - $parts[] = static::translator()->transChoice($short ? $shortUnit : $unit, $count, array(':count' => $count)); - } - } - - return implode(' ', $parts); - } - - /** - * Format the instance as a string using the forHumans() function. - * - * @return string - */ - public function __toString() - { - return $this->forHumans(); - } - - /** - * Convert the interval to a CarbonPeriod. - * - * @return CarbonPeriod - */ - public function toPeriod() - { - return CarbonPeriod::createFromArray( - array_merge(array($this), func_get_args()) - ); - } - - /** - * Invert the interval. - * - * @return $this - */ - public function invert() - { - $this->invert = $this->invert ? 0 : 1; - - return $this; - } - - /** - * Add the passed interval to the current instance. - * - * @param DateInterval $interval - * - * @return static - */ - public function add(DateInterval $interval) - { - $sign = ($this->invert === 1) !== ($interval->invert === 1) ? -1 : 1; - - if (static::wasCreatedFromDiff($interval)) { - $this->dayz += $interval->days * $sign; - } else { - $this->years += $interval->y * $sign; - $this->months += $interval->m * $sign; - $this->dayz += $interval->d * $sign; - $this->hours += $interval->h * $sign; - $this->minutes += $interval->i * $sign; - $this->seconds += $interval->s * $sign; - } - - if (($this->years || $this->months || $this->dayz || $this->hours || $this->minutes || $this->seconds) && - $this->years <= 0 && $this->months <= 0 && $this->dayz <= 0 && $this->hours <= 0 && $this->minutes <= 0 && $this->seconds <= 0 - ) { - $this->years *= -1; - $this->months *= -1; - $this->dayz *= -1; - $this->hours *= -1; - $this->minutes *= -1; - $this->seconds *= -1; - $this->invert(); - } - - return $this; - } - - /** - * Multiply current instance given number of times - * - * @param float $factor - * - * @return $this - */ - public function times($factor) - { - if ($factor < 0) { - $this->invert = $this->invert ? 0 : 1; - $factor = -$factor; - } - - $this->years = (int) round($this->years * $factor); - $this->months = (int) round($this->months * $factor); - $this->dayz = (int) round($this->dayz * $factor); - $this->hours = (int) round($this->hours * $factor); - $this->minutes = (int) round($this->minutes * $factor); - $this->seconds = (int) round($this->seconds * $factor); - - return $this; - } - - /** - * Get the interval_spec string of a date interval. - * - * @param DateInterval $interval - * - * @return string - */ - public static function getDateIntervalSpec(DateInterval $interval) - { - $date = array_filter(array( - static::PERIOD_YEARS => abs($interval->y), - static::PERIOD_MONTHS => abs($interval->m), - static::PERIOD_DAYS => abs($interval->d), - )); - - $time = array_filter(array( - static::PERIOD_HOURS => abs($interval->h), - static::PERIOD_MINUTES => abs($interval->i), - static::PERIOD_SECONDS => abs($interval->s), - )); - - $specString = static::PERIOD_PREFIX; - - foreach ($date as $key => $value) { - $specString .= $value.$key; - } - - if (count($time) > 0) { - $specString .= static::PERIOD_TIME_PREFIX; - foreach ($time as $key => $value) { - $specString .= $value.$key; - } - } - - return $specString === static::PERIOD_PREFIX ? 'PT0S' : $specString; - } - - /** - * Get the interval_spec string. - * - * @return string - */ - public function spec() - { - return static::getDateIntervalSpec($this); - } - - /** - * Comparing 2 date intervals. - * - * @param DateInterval $a - * @param DateInterval $b - * - * @return int - */ - public static function compareDateIntervals(DateInterval $a, DateInterval $b) - { - $current = Carbon::now(); - $passed = $current->copy()->add($b); - $current->add($a); - - if ($current < $passed) { - return -1; - } - if ($current > $passed) { - return 1; - } - - return 0; - } - - /** - * Comparing with passed interval. - * - * @param DateInterval $interval - * - * @return int - */ - public function compare(DateInterval $interval) - { - return static::compareDateIntervals($this, $interval); - } - - /** - * Convert overflowed values into bigger units. - * - * @return $this - */ - public function cascade() - { - foreach (static::getFlipCascadeFactors() as $source => $cascade) { - list($target, $factor) = $cascade; - - if ($source === 'dayz' && $target === 'weeks') { - continue; - } - - $value = $this->$source; - $this->$source = $modulo = $value % $factor; - $this->$target += ($value - $modulo) / $factor; - } - - return $this; - } - - /** - * Get amount of given unit equivalent to the interval. - * - * @param string $unit - * - * @throws \InvalidArgumentException - * - * @return float - */ - public function total($unit) - { - $realUnit = $unit = strtolower($unit); - - if (in_array($unit, array('days', 'weeks'))) { - $realUnit = 'dayz'; - } elseif (!in_array($unit, array('seconds', 'minutes', 'hours', 'dayz', 'months', 'years'))) { - throw new InvalidArgumentException("Unknown unit '$unit'."); - } - - $result = 0; - $cumulativeFactor = 0; - $unitFound = false; - - foreach (static::getFlipCascadeFactors() as $source => $cascade) { - list($target, $factor) = $cascade; - - if ($source === $realUnit) { - $unitFound = true; - $result += $this->$source; - $cumulativeFactor = 1; - } - - if ($factor === false) { - if ($unitFound) { - break; - } - - $result = 0; - $cumulativeFactor = 0; - - continue; - } - - if ($target === $realUnit) { - $unitFound = true; - } - - if ($cumulativeFactor) { - $cumulativeFactor *= $factor; - $result += $this->$target * $cumulativeFactor; - - continue; - } - - $result = ($result + $this->$source) / $factor; - } - - if (isset($target) && !$cumulativeFactor) { - $result += $this->$target; - } - - if (!$unitFound) { - throw new \InvalidArgumentException("Unit $unit have no configuration to get total from other units."); - } - - if ($unit === 'weeks') { - return $result / static::getDaysPerWeek(); - } - - return $result; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php b/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php deleted file mode 100644 index 808e9d6..0000000 --- a/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php +++ /dev/null @@ -1,1453 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon; - -use BadMethodCallException; -use Closure; -use Countable; -use DateInterval; -use DateTime; -use DateTimeInterface; -use InvalidArgumentException; -use Iterator; -use ReflectionClass; -use ReflectionFunction; -use ReflectionMethod; -use RuntimeException; - -/** - * Substitution of DatePeriod with some modifications and many more features. - * Fully compatible with PHP 5.3+! - * - * @method static CarbonPeriod start($date, $inclusive = null) Create instance specifying start date. - * @method static CarbonPeriod since($date, $inclusive = null) Alias for start(). - * @method static CarbonPeriod sinceNow($inclusive = null) Create instance with start date set to now. - * @method static CarbonPeriod end($date = null, $inclusive = null) Create instance specifying end date. - * @method static CarbonPeriod until($date = null, $inclusive = null) Alias for end(). - * @method static CarbonPeriod untilNow($inclusive = null) Create instance with end date set to now. - * @method static CarbonPeriod dates($start, $end = null) Create instance with start and end date. - * @method static CarbonPeriod between($start, $end = null) Create instance with start and end date. - * @method static CarbonPeriod recurrences($recurrences = null) Create instance with maximum number of recurrences. - * @method static CarbonPeriod times($recurrences = null) Alias for recurrences(). - * @method static CarbonPeriod options($options = null) Create instance with options. - * @method static CarbonPeriod toggle($options, $state = null) Create instance with options toggled on or off. - * @method static CarbonPeriod filter($callback, $name = null) Create instance with filter added to the stack. - * @method static CarbonPeriod push($callback, $name = null) Alias for filter(). - * @method static CarbonPeriod prepend($callback, $name = null) Create instance with filter prepened to the stack. - * @method static CarbonPeriod filters(array $filters) Create instance with filters stack. - * @method static CarbonPeriod interval($interval) Create instance with given date interval. - * @method static CarbonPeriod each($interval) Create instance with given date interval. - * @method static CarbonPeriod every($interval) Create instance with given date interval. - * @method static CarbonPeriod step($interval) Create instance with given date interval. - * @method static CarbonPeriod stepBy($interval) Create instance with given date interval. - * @method static CarbonPeriod invert() Create instance with inverted date interval. - * @method static CarbonPeriod years($years = 1) Create instance specifying a number of years for date interval. - * @method static CarbonPeriod year($years = 1) Alias for years(). - * @method static CarbonPeriod months($months = 1) Create instance specifying a number of months for date interval. - * @method static CarbonPeriod month($months = 1) Alias for months(). - * @method static CarbonPeriod weeks($weeks = 1) Create instance specifying a number of weeks for date interval. - * @method static CarbonPeriod week($weeks = 1) Alias for weeks(). - * @method static CarbonPeriod days($days = 1) Create instance specifying a number of days for date interval. - * @method static CarbonPeriod dayz($days = 1) Alias for days(). - * @method static CarbonPeriod day($days = 1) Alias for days(). - * @method static CarbonPeriod hours($hours = 1) Create instance specifying a number of hours for date interval. - * @method static CarbonPeriod hour($hours = 1) Alias for hours(). - * @method static CarbonPeriod minutes($minutes = 1) Create instance specifying a number of minutes for date interval. - * @method static CarbonPeriod minute($minutes = 1) Alias for minutes(). - * @method static CarbonPeriod seconds($seconds = 1) Create instance specifying a number of seconds for date interval. - * @method static CarbonPeriod second($seconds = 1) Alias for seconds(). - * @method CarbonPeriod start($date, $inclusive = null) Change the period start date. - * @method CarbonPeriod since($date, $inclusive = null) Alias for start(). - * @method CarbonPeriod sinceNow($inclusive = null) Change the period start date to now. - * @method CarbonPeriod end($date = null, $inclusive = null) Change the period end date. - * @method CarbonPeriod until($date = null, $inclusive = null) Alias for end(). - * @method CarbonPeriod untilNow($inclusive = null) Change the period end date to now. - * @method CarbonPeriod dates($start, $end = null) Change the period start and end date. - * @method CarbonPeriod recurrences($recurrences = null) Change the maximum number of recurrences. - * @method CarbonPeriod times($recurrences = null) Alias for recurrences(). - * @method CarbonPeriod options($options = null) Change the period options. - * @method CarbonPeriod toggle($options, $state = null) Toggle given options on or off. - * @method CarbonPeriod filter($callback, $name = null) Add a filter to the stack. - * @method CarbonPeriod push($callback, $name = null) Alias for filter(). - * @method CarbonPeriod prepend($callback, $name = null) Prepend a filter to the stack. - * @method CarbonPeriod filters(array $filters = array()) Set filters stack. - * @method CarbonPeriod interval($interval) Change the period date interval. - * @method CarbonPeriod invert() Invert the period date interval. - * @method CarbonPeriod years($years = 1) Set the years portion of the date interval. - * @method CarbonPeriod year($years = 1) Alias for years(). - * @method CarbonPeriod months($months = 1) Set the months portion of the date interval. - * @method CarbonPeriod month($months = 1) Alias for months(). - * @method CarbonPeriod weeks($weeks = 1) Set the weeks portion of the date interval. - * @method CarbonPeriod week($weeks = 1) Alias for weeks(). - * @method CarbonPeriod days($days = 1) Set the days portion of the date interval. - * @method CarbonPeriod dayz($days = 1) Alias for days(). - * @method CarbonPeriod day($days = 1) Alias for days(). - * @method CarbonPeriod hours($hours = 1) Set the hours portion of the date interval. - * @method CarbonPeriod hour($hours = 1) Alias for hours(). - * @method CarbonPeriod minutes($minutes = 1) Set the minutes portion of the date interval. - * @method CarbonPeriod minute($minutes = 1) Alias for minutes(). - * @method CarbonPeriod seconds($seconds = 1) Set the seconds portion of the date interval. - * @method CarbonPeriod second($seconds = 1) Alias for seconds(). - */ -class CarbonPeriod implements Iterator, Countable -{ - /** - * Built-in filters. - * - * @var string - */ - const RECURRENCES_FILTER = 'Carbon\CarbonPeriod::filterRecurrences'; - const END_DATE_FILTER = 'Carbon\CarbonPeriod::filterEndDate'; - - /** - * Special value which can be returned by filters to end iteration. Also a filter. - * - * @var string - */ - const END_ITERATION = 'Carbon\CarbonPeriod::endIteration'; - - /** - * Available options. - * - * @var int - */ - const EXCLUDE_START_DATE = 1; - const EXCLUDE_END_DATE = 2; - - /** - * Number of maximum attempts before giving up on finding next valid date. - * - * @var int - */ - const NEXT_MAX_ATTEMPTS = 1000; - - /** - * The registered macros. - * - * @var array - */ - protected static $macros = array(); - - /** - * Underlying date interval instance. Always present, one day by default. - * - * @var CarbonInterval - */ - protected $dateInterval; - - /** - * Whether current date interval was set by default. - * - * @var bool - */ - protected $isDefaultInterval; - - /** - * The filters stack. - * - * @var array - */ - protected $filters = array(); - - /** - * Period start date. Applied on rewind. Always present, now by default. - * - * @var Carbon - */ - protected $startDate; - - /** - * Period end date. For inverted interval should be before the start date. Applied via a filter. - * - * @var Carbon|null - */ - protected $endDate; - - /** - * Limit for number of recurrences. Applied via a filter. - * - * @var int|null - */ - protected $recurrences; - - /** - * Iteration options. - * - * @var int - */ - protected $options; - - /** - * Index of current date. Always sequential, even if some dates are skipped by filters. - * Equal to null only before the first iteration. - * - * @var int - */ - protected $key; - - /** - * Current date. May temporarily hold unaccepted value when looking for a next valid date. - * Equal to null only before the first iteration. - * - * @var Carbon - */ - protected $current; - - /** - * Timezone of current date. Taken from the start date. - * - * @var \DateTimeZone|null - */ - protected $timezone; - - /** - * The cached validation result for current date. - * - * @var bool|string|null - */ - protected $validationResult; - - /** - * Create a new instance. - * - * @return static - */ - public static function create() - { - return static::createFromArray(func_get_args()); - } - - /** - * Create a new instance from an array of parameters. - * - * @param array $params - * - * @return static - */ - public static function createFromArray(array $params) - { - // PHP 5.3 equivalent of new static(...$params). - $reflection = new ReflectionClass(get_class()); - /** @var static $instance */ - $instance = $reflection->newInstanceArgs($params); - - return $instance; - } - - /** - * Create CarbonPeriod from ISO 8601 string. - * - * @param string $iso - * @param int|null $options - * - * @return static - */ - public static function createFromIso($iso, $options = null) - { - $params = static::parseIso8601($iso); - - $instance = static::createFromArray($params); - - if ($options !== null) { - $instance->setOptions($options); - } - - return $instance; - } - - /** - * Return whether given interval contains non zero value of any time unit. - * - * @param \DateInterval $interval - * - * @return bool - */ - protected static function intervalHasTime(DateInterval $interval) - { - // The array_key_exists and get_object_vars are used as a workaround to check microsecond support. - // Both isset and property_exists will fail on PHP 7.0.14 - 7.0.21 due to the following bug: - // https://bugs.php.net/bug.php?id=74852 - return $interval->h || $interval->i || $interval->s || array_key_exists('f', get_object_vars($interval)) && $interval->f; - } - - /** - * Return whether given callable is a string pointing to one of Carbon's is* methods - * and should be automatically converted to a filter callback. - * - * @param callable $callable - * - * @return bool - */ - protected static function isCarbonPredicateMethod($callable) - { - return is_string($callable) && substr($callable, 0, 2) === 'is' && (method_exists('Carbon\Carbon', $callable) || Carbon::hasMacro($callable)); - } - - /** - * Return whether given variable is an ISO 8601 specification. - * - * Note: Check is very basic, as actual validation will be done later when parsing. - * We just want to ensure that variable is not any other type of a valid parameter. - * - * @param mixed $var - * - * @return bool - */ - protected static function isIso8601($var) - { - if (!is_string($var)) { - return false; - } - - // Match slash but not within a timezone name. - $part = '[a-z]+(?:[_-][a-z]+)*'; - - preg_match("#\b$part/$part\b|(/)#i", $var, $match); - - return isset($match[1]); - } - - /** - * Parse given ISO 8601 string into an array of arguments. - * - * @param string $iso - * - * @return array - */ - protected static function parseIso8601($iso) - { - $result = array(); - - $interval = null; - $start = null; - $end = null; - - foreach (explode('/', $iso) as $key => $part) { - if ($key === 0 && preg_match('/^R([0-9]*)$/', $part, $match)) { - $parsed = strlen($match[1]) ? (int) $match[1] : null; - } elseif ($interval === null && $parsed = CarbonInterval::make($part)) { - $interval = $part; - } elseif ($start === null && $parsed = Carbon::make($part)) { - $start = $part; - } elseif ($end === null && $parsed = Carbon::make(static::addMissingParts($start, $part))) { - $end = $part; - } else { - throw new InvalidArgumentException("Invalid ISO 8601 specification: $iso."); - } - - $result[] = $parsed; - } - - return $result; - } - - /** - * Add missing parts of the target date from the soure date. - * - * @param string $source - * @param string $target - * - * @return string - */ - protected static function addMissingParts($source, $target) - { - $pattern = '/'.preg_replace('/[0-9]+/', '[0-9]+', preg_quote($target, '/')).'$/'; - - $result = preg_replace($pattern, $target, $source, 1, $count); - - return $count ? $result : $target; - } - - /** - * Register a custom macro. - * - * @param string $name - * @param object|callable $macro - * - * @return void - */ - public static function macro($name, $macro) - { - static::$macros[$name] = $macro; - } - - /** - * Remove all macros. - */ - public static function resetMacros() - { - static::$macros = array(); - } - - /** - * Register macros from a mixin object. - * - * @param object $mixin - * - * @throws \ReflectionException - * - * @return void - */ - public static function mixin($mixin) - { - $reflection = new ReflectionClass($mixin); - - $methods = $reflection->getMethods( - ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED - ); - - foreach ($methods as $method) { - $method->setAccessible(true); - - static::macro($method->name, $method->invoke($mixin)); - } - } - - /** - * Check if macro is registered. - * - * @param string $name - * - * @return bool - */ - public static function hasMacro($name) - { - return isset(static::$macros[$name]); - } - - /** - * Provide static proxy for instance aliases. - * - * @param string $method - * @param array $parameters - * - * @return mixed - */ - public static function __callStatic($method, $parameters) - { - return call_user_func_array( - array(new static, $method), $parameters - ); - } - - /** - * CarbonPeriod constructor. - * - * @throws InvalidArgumentException - */ - public function __construct() - { - // Parse and assign arguments one by one. First argument may be an ISO 8601 spec, - // which will be first parsed into parts and then processed the same way. - $arguments = func_get_args(); - - if (count($arguments) && static::isIso8601($iso = $arguments[0])) { - array_splice($arguments, 0, 1, static::parseIso8601($iso)); - } - - foreach ($arguments as $argument) { - if ($this->dateInterval === null && $parsed = CarbonInterval::make($argument)) { - $this->setDateInterval($parsed); - } elseif ($this->startDate === null && $parsed = Carbon::make($argument)) { - $this->setStartDate($parsed); - } elseif ($this->endDate === null && $parsed = Carbon::make($argument)) { - $this->setEndDate($parsed); - } elseif ($this->recurrences === null && $this->endDate === null && is_numeric($argument)) { - $this->setRecurrences($argument); - } elseif ($this->options === null && (is_int($argument) || $argument === null)) { - $this->setOptions($argument); - } else { - throw new InvalidArgumentException('Invalid constructor parameters.'); - } - } - - if ($this->startDate === null) { - $this->setStartDate(Carbon::now()); - } - - if ($this->dateInterval === null) { - $this->setDateInterval(CarbonInterval::day()); - - $this->isDefaultInterval = true; - } - - if ($this->options === null) { - $this->setOptions(0); - } - } - - /** - * Change the period date interval. - * - * @param DateInterval|string $interval - * - * @throws \InvalidArgumentException - * - * @return $this - */ - public function setDateInterval($interval) - { - if (!$interval = CarbonInterval::make($interval)) { - throw new InvalidArgumentException('Invalid interval.'); - } - - if ($interval->spec() === 'PT0S') { - throw new InvalidArgumentException('Empty interval is not accepted.'); - } - - $this->dateInterval = $interval; - - $this->isDefaultInterval = false; - - $this->handleChangedParameters(); - - return $this; - } - - /** - * Invert the period date interval. - * - * @return $this - */ - public function invertDateInterval() - { - $interval = $this->dateInterval->invert(); - - return $this->setDateInterval($interval); - } - - /** - * Set start and end date. - * - * @param DateTime|DateTimeInterface|string $start - * @param DateTime|DateTimeInterface|string|null $end - * - * @return $this - */ - public function setDates($start, $end) - { - $this->setStartDate($start); - $this->setEndDate($end); - - return $this; - } - - /** - * Change the period options. - * - * @param int|null $options - * - * @throws \InvalidArgumentException - * - * @return $this - */ - public function setOptions($options) - { - if (!is_int($options) && !is_null($options)) { - throw new InvalidArgumentException('Invalid options.'); - } - - $this->options = $options ?: 0; - - $this->handleChangedParameters(); - - return $this; - } - - /** - * Get the period options. - * - * @return int - */ - public function getOptions() - { - return $this->options; - } - - /** - * Toggle given options on or off. - * - * @param int $options - * @param bool|null $state - * - * @throws \InvalidArgumentException - * - * @return $this - */ - public function toggleOptions($options, $state = null) - { - if ($state === null) { - $state = ($this->options & $options) !== $options; - } - - return $this->setOptions($state ? - $this->options | $options : - $this->options & ~$options - ); - } - - /** - * Toggle EXCLUDE_START_DATE option. - * - * @param bool $state - * - * @return $this - */ - public function excludeStartDate($state = true) - { - return $this->toggleOptions(static::EXCLUDE_START_DATE, $state); - } - - /** - * Toggle EXCLUDE_END_DATE option. - * - * @param bool $state - * - * @return $this - */ - public function excludeEndDate($state = true) - { - return $this->toggleOptions(static::EXCLUDE_END_DATE, $state); - } - - /** - * Get the underlying date interval. - * - * @return CarbonInterval - */ - public function getDateInterval() - { - return $this->dateInterval->copy(); - } - - /** - * Get start date of the period. - * - * @return Carbon - */ - public function getStartDate() - { - return $this->startDate->copy(); - } - - /** - * Get end date of the period. - * - * @return Carbon|null - */ - public function getEndDate() - { - if ($this->endDate) { - return $this->endDate->copy(); - } - } - - /** - * Get number of recurrences. - * - * @return int|null - */ - public function getRecurrences() - { - return $this->recurrences; - } - - /** - * Returns true if the start date should be excluded. - * - * @return bool - */ - public function isStartExcluded() - { - return ($this->options & static::EXCLUDE_START_DATE) !== 0; - } - - /** - * Returns true if the end date should be excluded. - * - * @return bool - */ - public function isEndExcluded() - { - return ($this->options & static::EXCLUDE_END_DATE) !== 0; - } - - /** - * Add a filter to the stack. - * - * @param callable $callback - * @param string $name - * - * @return $this - */ - public function addFilter($callback, $name = null) - { - $tuple = $this->createFilterTuple(func_get_args()); - - $this->filters[] = $tuple; - - $this->handleChangedParameters(); - - return $this; - } - - /** - * Prepend a filter to the stack. - * - * @param callable $callback - * @param string $name - * - * @return $this - */ - public function prependFilter($callback, $name = null) - { - $tuple = $this->createFilterTuple(func_get_args()); - - array_unshift($this->filters, $tuple); - - $this->handleChangedParameters(); - - return $this; - } - - /** - * Create a filter tuple from raw parameters. - * - * Will create an automatic filter callback for one of Carbon's is* methods. - * - * @param array $parameters - * - * @return array - */ - protected function createFilterTuple(array $parameters) - { - $method = array_shift($parameters); - - if (!$this->isCarbonPredicateMethod($method)) { - return array($method, array_shift($parameters)); - } - - return array(function ($date) use ($method, $parameters) { - return call_user_func_array(array($date, $method), $parameters); - }, $method); - } - - /** - * Remove a filter by instance or name. - * - * @param callable|string $filter - * - * @return $this - */ - public function removeFilter($filter) - { - $key = is_callable($filter) ? 0 : 1; - - $this->filters = array_values(array_filter( - $this->filters, - function ($tuple) use ($key, $filter) { - return $tuple[$key] !== $filter; - } - )); - - $this->updateInternalState(); - - $this->handleChangedParameters(); - - return $this; - } - - /** - * Return whether given instance or name is in the filter stack. - * - * @param callable|string $filter - * - * @return bool - */ - public function hasFilter($filter) - { - $key = is_callable($filter) ? 0 : 1; - - foreach ($this->filters as $tuple) { - if ($tuple[$key] === $filter) { - return true; - } - } - - return false; - } - - /** - * Get filters stack. - * - * @return array - */ - public function getFilters() - { - return $this->filters; - } - - /** - * Set filters stack. - * - * @param array $filters - * - * @return $this - */ - public function setFilters(array $filters) - { - $this->filters = $filters; - - $this->updateInternalState(); - - $this->handleChangedParameters(); - - return $this; - } - - /** - * Reset filters stack. - * - * @return $this - */ - public function resetFilters() - { - $this->filters = array(); - - if ($this->endDate !== null) { - $this->filters[] = array(static::END_DATE_FILTER, null); - } - - if ($this->recurrences !== null) { - $this->filters[] = array(static::RECURRENCES_FILTER, null); - } - - $this->handleChangedParameters(); - - return $this; - } - - /** - * Update properties after removing built-in filters. - * - * @return void - */ - protected function updateInternalState() - { - if (!$this->hasFilter(static::END_DATE_FILTER)) { - $this->endDate = null; - } - - if (!$this->hasFilter(static::RECURRENCES_FILTER)) { - $this->recurrences = null; - } - } - - /** - * Add a recurrences filter (set maximum number of recurrences). - * - * @param int|null $recurrences - * - * @throws \InvalidArgumentException - * - * @return $this - */ - public function setRecurrences($recurrences) - { - if (!is_numeric($recurrences) && !is_null($recurrences) || $recurrences < 0) { - throw new InvalidArgumentException('Invalid number of recurrences.'); - } - - if ($recurrences === null) { - return $this->removeFilter(static::RECURRENCES_FILTER); - } - - $this->recurrences = (int) $recurrences; - - if (!$this->hasFilter(static::RECURRENCES_FILTER)) { - return $this->addFilter(static::RECURRENCES_FILTER); - } - - $this->handleChangedParameters(); - - return $this; - } - - /** - * Recurrences filter callback (limits number of recurrences). - * - * @param \Carbon\Carbon $current - * @param int $key - * - * @return bool|string - */ - protected function filterRecurrences($current, $key) - { - if ($key < $this->recurrences) { - return true; - } - - return static::END_ITERATION; - } - - /** - * Change the period start date. - * - * @param DateTime|DateTimeInterface|string $date - * @param bool|null $inclusive - * - * @throws \InvalidArgumentException - * - * @return $this - */ - public function setStartDate($date, $inclusive = null) - { - if (!$date = Carbon::make($date)) { - throw new InvalidArgumentException('Invalid start date.'); - } - - $this->startDate = $date; - - if ($inclusive !== null) { - $this->toggleOptions(static::EXCLUDE_START_DATE, !$inclusive); - } - - return $this; - } - - /** - * Change the period end date. - * - * @param DateTime|DateTimeInterface|string|null $date - * @param bool|null $inclusive - * - * @throws \InvalidArgumentException - * - * @return $this - */ - public function setEndDate($date, $inclusive = null) - { - if (!is_null($date) && !$date = Carbon::make($date)) { - throw new InvalidArgumentException('Invalid end date.'); - } - - if (!$date) { - return $this->removeFilter(static::END_DATE_FILTER); - } - - $this->endDate = $date; - - if ($inclusive !== null) { - $this->toggleOptions(static::EXCLUDE_END_DATE, !$inclusive); - } - - if (!$this->hasFilter(static::END_DATE_FILTER)) { - return $this->addFilter(static::END_DATE_FILTER); - } - - $this->handleChangedParameters(); - - return $this; - } - - /** - * End date filter callback. - * - * @param \Carbon\Carbon $current - * - * @return bool|string - */ - protected function filterEndDate($current) - { - if (!$this->isEndExcluded() && $current == $this->endDate) { - return true; - } - - if ($this->dateInterval->invert ? $current > $this->endDate : $current < $this->endDate) { - return true; - } - - return static::END_ITERATION; - } - - /** - * End iteration filter callback. - * - * @return string - */ - protected function endIteration() - { - return static::END_ITERATION; - } - - /** - * Handle change of the parameters. - */ - protected function handleChangedParameters() - { - $this->validationResult = null; - } - - /** - * Validate current date and stop iteration when necessary. - * - * Returns true when current date is valid, false if it is not, or static::END_ITERATION - * when iteration should be stopped. - * - * @return bool|string - */ - protected function validateCurrentDate() - { - if ($this->current === null) { - $this->rewind(); - } - - // Check after the first rewind to avoid repeating the initial validation. - if ($this->validationResult !== null) { - return $this->validationResult; - } - - return $this->validationResult = $this->checkFilters(); - } - - /** - * Check whether current value and key pass all the filters. - * - * @return bool|string - */ - protected function checkFilters() - { - $current = $this->prepareForReturn($this->current); - - foreach ($this->filters as $tuple) { - $result = call_user_func( - $tuple[0], $current->copy(), $this->key, $this - ); - - if ($result === static::END_ITERATION) { - return static::END_ITERATION; - } - - if (!$result) { - return false; - } - } - - return true; - } - - /** - * Prepare given date to be returned to the external logic. - * - * @param Carbon $date - * - * @return Carbon - */ - protected function prepareForReturn(Carbon $date) - { - $date = $date->copy(); - - if ($this->timezone) { - $date->setTimezone($this->timezone); - } - - return $date; - } - - /** - * Check if the current position is valid. - * - * @return bool - */ - public function valid() - { - return $this->validateCurrentDate() === true; - } - - /** - * Return the current key. - * - * @return int|null - */ - public function key() - { - if ($this->valid()) { - return $this->key; - } - } - - /** - * Return the current date. - * - * @return Carbon|null - */ - public function current() - { - if ($this->valid()) { - return $this->prepareForReturn($this->current); - } - } - - /** - * Move forward to the next date. - * - * @throws \RuntimeException - * - * @return void - */ - public function next() - { - if ($this->current === null) { - $this->rewind(); - } - - if ($this->validationResult !== static::END_ITERATION) { - $this->key++; - - $this->incrementCurrentDateUntilValid(); - } - } - - /** - * Rewind to the start date. - * - * Iterating over a date in the UTC timezone avoids bug during backward DST change. - * - * @see https://bugs.php.net/bug.php?id=72255 - * @see https://bugs.php.net/bug.php?id=74274 - * @see https://wiki.php.net/rfc/datetime_and_daylight_saving_time - * - * @throws \RuntimeException - * - * @return void - */ - public function rewind() - { - $this->key = 0; - $this->current = $this->startDate->copy(); - $this->timezone = static::intervalHasTime($this->dateInterval) ? $this->current->getTimezone() : null; - - if ($this->timezone) { - $this->current->setTimezone('UTC'); - } - - $this->validationResult = null; - - if ($this->isStartExcluded() || $this->validateCurrentDate() === false) { - $this->incrementCurrentDateUntilValid(); - } - } - - /** - * Skip iterations and returns iteration state (false if ended, true if still valid). - * - * @param int $count steps number to skip (1 by default) - * - * @return bool - */ - public function skip($count = 1) - { - for ($i = $count; $this->valid() && $i > 0; $i--) { - $this->next(); - } - - return $this->valid(); - } - - /** - * Keep incrementing the current date until a valid date is found or the iteration is ended. - * - * @throws \RuntimeException - * - * @return void - */ - protected function incrementCurrentDateUntilValid() - { - $attempts = 0; - - do { - $this->current->add($this->dateInterval); - - $this->validationResult = null; - - if (++$attempts > static::NEXT_MAX_ATTEMPTS) { - throw new RuntimeException('Could not find next valid date.'); - } - } while ($this->validateCurrentDate() === false); - } - - /** - * Format the date period as ISO 8601. - * - * @return string - */ - public function toIso8601String() - { - $parts = array(); - - if ($this->recurrences !== null) { - $parts[] = 'R'.$this->recurrences; - } - - $parts[] = $this->startDate->toIso8601String(); - - $parts[] = $this->dateInterval->spec(); - - if ($this->endDate !== null) { - $parts[] = $this->endDate->toIso8601String(); - } - - return implode('/', $parts); - } - - /** - * Convert the date period into a string. - * - * @return string - */ - public function toString() - { - $translator = Carbon::getTranslator(); - - $parts = array(); - - $format = !$this->startDate->isStartOfDay() || $this->endDate && !$this->endDate->isStartOfDay() - ? 'Y-m-d H:i:s' - : 'Y-m-d'; - - if ($this->recurrences !== null) { - $parts[] = $translator->transChoice('period_recurrences', $this->recurrences, array(':count' => $this->recurrences)); - } - - $parts[] = $translator->trans('period_interval', array(':interval' => $this->dateInterval->forHumans())); - - $parts[] = $translator->trans('period_start_date', array(':date' => $this->startDate->format($format))); - - if ($this->endDate !== null) { - $parts[] = $translator->trans('period_end_date', array(':date' => $this->endDate->format($format))); - } - - $result = implode(' ', $parts); - - return mb_strtoupper(mb_substr($result, 0, 1)).mb_substr($result, 1); - } - - /** - * Format the date period as ISO 8601. - * - * @return string - */ - public function spec() - { - return $this->toIso8601String(); - } - - /** - * Convert the date period into an array without changing current iteration state. - * - * @return array - */ - public function toArray() - { - $state = array( - $this->key, - $this->current ? $this->current->copy() : null, - $this->validationResult, - ); - - $result = iterator_to_array($this); - - list( - $this->key, - $this->current, - $this->validationResult - ) = $state; - - return $result; - } - - /** - * Count dates in the date period. - * - * @return int - */ - public function count() - { - return count($this->toArray()); - } - - /** - * Return the first date in the date period. - * - * @return Carbon|null - */ - public function first() - { - if ($array = $this->toArray()) { - return $array[0]; - } - } - - /** - * Return the last date in the date period. - * - * @return Carbon|null - */ - public function last() - { - if ($array = $this->toArray()) { - return $array[count($array) - 1]; - } - } - - /** - * Call given macro. - * - * @param string $name - * @param array $parameters - * - * @return mixed - */ - protected function callMacro($name, $parameters) - { - $macro = static::$macros[$name]; - - $reflection = new ReflectionFunction($macro); - - $reflectionParameters = $reflection->getParameters(); - - $expectedCount = count($reflectionParameters); - $actualCount = count($parameters); - - if ($expectedCount > $actualCount && $reflectionParameters[$expectedCount - 1]->name === 'self') { - for ($i = $actualCount; $i < $expectedCount - 1; $i++) { - $parameters[] = $reflectionParameters[$i]->getDefaultValue(); - } - - $parameters[] = $this; - } - - if ($macro instanceof Closure && method_exists($macro, 'bindTo')) { - $macro = $macro->bindTo($this, get_class($this)); - } - - return call_user_func_array($macro, $parameters); - } - - /** - * Convert the date period into a string. - * - * @return string - */ - public function __toString() - { - return $this->toString(); - } - - /** - * Add aliases for setters. - * - * CarbonPeriod::days(3)->hours(5)->invert() - * ->sinceNow()->until('2010-01-10') - * ->filter(...) - * ->count() - * - * Note: We use magic method to let static and instance aliases with the same names. - * - * @param string $method - * @param array $parameters - * - * @return mixed - */ - public function __call($method, $parameters) - { - if (static::hasMacro($method)) { - return $this->callMacro($method, $parameters); - } - - $first = count($parameters) >= 1 ? $parameters[0] : null; - $second = count($parameters) >= 2 ? $parameters[1] : null; - - switch ($method) { - case 'start': - case 'since': - return $this->setStartDate($first, $second); - - case 'sinceNow': - return $this->setStartDate(new Carbon, $first); - - case 'end': - case 'until': - return $this->setEndDate($first, $second); - - case 'untilNow': - return $this->setEndDate(new Carbon, $first); - - case 'dates': - case 'between': - return $this->setDates($first, $second); - - case 'recurrences': - case 'times': - return $this->setRecurrences($first); - - case 'options': - return $this->setOptions($first); - - case 'toggle': - return $this->toggleOptions($first, $second); - - case 'filter': - case 'push': - return $this->addFilter($first, $second); - - case 'prepend': - return $this->prependFilter($first, $second); - - case 'filters': - return $this->setFilters($first ?: array()); - - case 'interval': - case 'each': - case 'every': - case 'step': - case 'stepBy': - return $this->setDateInterval($first); - - case 'invert': - return $this->invertDateInterval(); - - case 'years': - case 'year': - case 'months': - case 'month': - case 'weeks': - case 'week': - case 'days': - case 'dayz': - case 'day': - case 'hours': - case 'hour': - case 'minutes': - case 'minute': - case 'seconds': - case 'second': - return $this->setDateInterval(call_user_func( - // Override default P1D when instantiating via fluent setters. - array($this->isDefaultInterval ? new CarbonInterval('PT0S') : $this->dateInterval, $method), - count($parameters) === 0 ? 1 : $first - )); - } - - throw new BadMethodCallException("Method $method does not exist."); - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php b/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php deleted file mode 100644 index 1b0d473..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Carbon\Exceptions; - -use Exception; -use InvalidArgumentException; - -class InvalidDateException extends InvalidArgumentException -{ - /** - * The invalid field. - * - * @var string - */ - private $field; - - /** - * The invalid value. - * - * @var mixed - */ - private $value; - - /** - * Constructor. - * - * @param string $field - * @param mixed $value - * @param int $code - * @param \Exception|null $previous - */ - public function __construct($field, $value, $code = 0, Exception $previous = null) - { - $this->field = $field; - $this->value = $value; - parent::__construct($field.' : '.$value.' is not a valid value.', $code, $previous); - } - - /** - * Get the invalid field. - * - * @return string - */ - public function getField() - { - return $this->field; - } - - /** - * Get the invalid value. - * - * @return mixed - */ - public function getValue() - { - return $this->value; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/af.php b/vendor/nesbot/carbon/src/Carbon/Lang/af.php deleted file mode 100644 index 5cf6a8d..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/af.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count jaar|:count jare', - 'y' => ':count jaar|:count jare', - 'month' => ':count maand|:count maande', - 'm' => ':count maand|:count maande', - 'week' => ':count week|:count weke', - 'w' => ':count week|:count weke', - 'day' => ':count dag|:count dae', - 'd' => ':count dag|:count dae', - 'hour' => ':count uur|:count ure', - 'h' => ':count uur|:count ure', - 'minute' => ':count minuut|:count minute', - 'min' => ':count minuut|:count minute', - 'second' => ':count sekond|:count sekondes', - 's' => ':count sekond|:count sekondes', - 'ago' => ':time terug', - 'from_now' => ':time van nou af', - 'after' => ':time na', - 'before' => ':time voor', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar.php deleted file mode 100644 index de8f6b8..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => '{0}سنة|{1}سنة|{2}سنتين|[3,10]:count سنوات|[11,Inf]:count سنة', - 'y' => '{0}سنة|{1}سنة|{2}سنتين|[3,10]:count سنوات|[11,Inf]:count سنة', - 'month' => '{0}شهر|{1} شهر|{2}شهرين|[3,10]:count أشهر|[11,Inf]:count شهر', - 'm' => '{0}شهر|{1} شهر|{2}شهرين|[3,10]:count أشهر|[11,Inf]:count شهر', - 'week' => '{0}أسبوع|{1}أسبوع|{2}أسبوعين|[3,10]:count أسابيع|[11,Inf]:count أسبوع', - 'w' => '{0}أسبوع|{1}أسبوع|{2}أسبوعين|[3,10]:count أسابيع|[11,Inf]:count أسبوع', - 'day' => '{0}يوم|{1}يوم|{2}يومين|[3,10]:count أيام|[11,Inf] يوم', - 'd' => '{0}يوم|{1}يوم|{2}يومين|[3,10]:count أيام|[11,Inf] يوم', - 'hour' => '{0}ساعة|{1}ساعة|{2}ساعتين|[3,10]:count ساعات|[11,Inf]:count ساعة', - 'h' => '{0}ساعة|{1}ساعة|{2}ساعتين|[3,10]:count ساعات|[11,Inf]:count ساعة', - 'minute' => '{0}دقيقة|{1}دقيقة|{2}دقيقتين|[3,10]:count دقائق|[11,Inf]:count دقيقة', - 'min' => '{0}دقيقة|{1}دقيقة|{2}دقيقتين|[3,10]:count دقائق|[11,Inf]:count دقيقة', - 'second' => '{0}ثانية|{1}ثانية|{2}ثانيتين|[3,10]:count ثوان|[11,Inf]:count ثانية', - 's' => '{0}ثانية|{1}ثانية|{2}ثانيتين|[3,10]:count ثوان|[11,Inf]:count ثانية', - 'ago' => 'منذ :time', - 'from_now' => ':time من الآن', - 'after' => 'بعد :time', - 'before' => 'قبل :time', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ar_Shakl.php b/vendor/nesbot/carbon/src/Carbon/Lang/ar_Shakl.php deleted file mode 100644 index 846ae02..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ar_Shakl.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/** - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => '[0,1] سَنَة|{2} سَنَتَيْن|[3,10]:count سَنَوَات|[11,Inf]:count سَنَة', - 'y' => '[0,1] سَنَة|{2} سَنَتَيْن|[3,10]:count سَنَوَات|[11,Inf]:count سَنَة', - 'month' => '[0,1] شَهْرَ|{2} شَهْرَيْن|[3,10]:count أَشْهُر|[11,Inf]:count شَهْرَ', - 'm' => '[0,1] شَهْرَ|{2} شَهْرَيْن|[3,10]:count أَشْهُر|[11,Inf]:count شَهْرَ', - 'week' => '[0,1] أُسْبُوع|{2} أُسْبُوعَيْن|[3,10]:count أَسَابِيع|[11,Inf]:count أُسْبُوع', - 'w' => '[0,1] أُسْبُوع|{2} أُسْبُوعَيْن|[3,10]:count أَسَابِيع|[11,Inf]:count أُسْبُوع', - 'day' => '[0,1] يَوْم|{2} يَوْمَيْن|[3,10]:count أَيَّام|[11,Inf] يَوْم', - 'd' => '[0,1] يَوْم|{2} يَوْمَيْن|[3,10]:count أَيَّام|[11,Inf] يَوْم', - 'hour' => '[0,1] سَاعَة|{2} سَاعَتَيْن|[3,10]:count سَاعَات|[11,Inf]:count سَاعَة', - 'h' => '[0,1] سَاعَة|{2} سَاعَتَيْن|[3,10]:count سَاعَات|[11,Inf]:count سَاعَة', - 'minute' => '[0,1] دَقِيقَة|{2} دَقِيقَتَيْن|[3,10]:count دَقَائِق|[11,Inf]:count دَقِيقَة', - 'min' => '[0,1] دَقِيقَة|{2} دَقِيقَتَيْن|[3,10]:count دَقَائِق|[11,Inf]:count دَقِيقَة', - 'second' => '[0,1] ثَانِيَة|{2} ثَانِيَتَيْن|[3,10]:count ثَوَان|[11,Inf]:count ثَانِيَة', - 's' => '[0,1] ثَانِيَة|{2} ثَانِيَتَيْن|[3,10]:count ثَوَان|[11,Inf]:count ثَانِيَة', - 'ago' => 'مُنْذُ :time', - 'from_now' => 'مِنَ الْآن :time', - 'after' => 'بَعْدَ :time', - 'before' => 'قَبْلَ :time', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/az.php b/vendor/nesbot/carbon/src/Carbon/Lang/az.php deleted file mode 100644 index 25f5c4a..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/az.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count il', - 'y' => ':count il', - 'month' => ':count ay', - 'm' => ':count ay', - 'week' => ':count həftə', - 'w' => ':count həftə', - 'day' => ':count gün', - 'd' => ':count gün', - 'hour' => ':count saat', - 'h' => ':count saat', - 'minute' => ':count dəqiqə', - 'min' => ':count dəqiqə', - 'second' => ':count saniyə', - 's' => ':count saniyə', - 'ago' => ':time əvvəl', - 'from_now' => ':time sonra', - 'after' => ':time sonra', - 'before' => ':time əvvəl', - 'diff_now' => 'indi', - 'diff_yesterday' => 'dünən', - 'diff_tomorrow' => 'sabah', - 'diff_before_yesterday' => 'srağagün', - 'diff_after_tomorrow' => 'birisi gün', - 'period_recurrences' => ':count dəfədən bir', - 'period_interval' => 'hər :interval', - 'period_start_date' => ':date tarixindən başlayaraq', - 'period_end_date' => ':date tarixinədək', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bg.php b/vendor/nesbot/carbon/src/Carbon/Lang/bg.php deleted file mode 100644 index d9e510b..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bg.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count година|:count години', - 'y' => ':count година|:count години', - 'month' => ':count месец|:count месеца', - 'm' => ':count месец|:count месеца', - 'week' => ':count седмица|:count седмици', - 'w' => ':count седмица|:count седмици', - 'day' => ':count ден|:count дни', - 'd' => ':count ден|:count дни', - 'hour' => ':count час|:count часа', - 'h' => ':count час|:count часа', - 'minute' => ':count минута|:count минути', - 'min' => ':count минута|:count минути', - 'second' => ':count секунда|:count секунди', - 's' => ':count секунда|:count секунди', - 'ago' => 'преди :time', - 'from_now' => ':time от сега', - 'after' => 'след :time', - 'before' => 'преди :time', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bn.php b/vendor/nesbot/carbon/src/Carbon/Lang/bn.php deleted file mode 100644 index 5817599..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bn.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => '১ বছর|:count বছর', - 'y' => '১ বছর|:count বছর', - 'month' => '১ মাস|:count মাস', - 'm' => '১ মাস|:count মাস', - 'week' => '১ সপ্তাহ|:count সপ্তাহ', - 'w' => '১ সপ্তাহ|:count সপ্তাহ', - 'day' => '১ দিন|:count দিন', - 'd' => '১ দিন|:count দিন', - 'hour' => '১ ঘন্টা|:count ঘন্টা', - 'h' => '১ ঘন্টা|:count ঘন্টা', - 'minute' => '১ মিনিট|:count মিনিট', - 'min' => '১ মিনিট|:count মিনিট', - 'second' => '১ সেকেন্ড|:count সেকেন্ড', - 's' => '১ সেকেন্ড|:count সেকেন্ড', - 'ago' => ':time পূর্বে', - 'from_now' => 'এখন থেকে :time', - 'after' => ':time পরে', - 'before' => ':time আগে', - 'diff_now' => 'এখন', - 'diff_yesterday' => 'গতকাল', - 'diff_tomorrow' => 'আগামীকাল', - 'period_recurrences' => ':count বার|:count বার', - 'period_interval' => 'প্রতি :interval', - 'period_start_date' => ':date থেকে', - 'period_end_date' => ':date পর্যন্ত', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php b/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php deleted file mode 100644 index 7a9b05a..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count godina|:count godine|:count godina', - 'y' => ':count godina|:count godine|:count godina', - 'month' => ':count mjesec|:count mjeseca|:count mjeseci', - 'm' => ':count mjesec|:count mjeseca|:count mjeseci', - 'week' => ':count nedjelja|:count nedjelje|:count nedjelja', - 'w' => ':count nedjelja|:count nedjelje|:count nedjelja', - 'day' => ':count dan|:count dana|:count dana', - 'd' => ':count dan|:count dana|:count dana', - 'hour' => ':count sat|:count sata|:count sati', - 'h' => ':count sat|:count sata|:count sati', - 'minute' => ':count minut|:count minuta|:count minuta', - 'min' => ':count minut|:count minuta|:count minuta', - 'second' => ':count sekund|:count sekunda|:count sekundi', - 's' => ':count sekund|:count sekunda|:count sekundi', - 'ago' => 'prije :time', - 'from_now' => 'za :time', - 'after' => 'nakon :time', - 'before' => ':time ranije', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ca.php b/vendor/nesbot/carbon/src/Carbon/Lang/ca.php deleted file mode 100644 index c854b5a..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ca.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count any|:count anys', - 'y' => ':count any|:count anys', - 'month' => ':count mes|:count mesos', - 'm' => ':count mes|:count mesos', - 'week' => ':count setmana|:count setmanes', - 'w' => ':count setmana|:count setmanes', - 'day' => ':count dia|:count dies', - 'd' => ':count dia|:count dies', - 'hour' => ':count hora|:count hores', - 'h' => ':count hora|:count hores', - 'minute' => ':count minut|:count minuts', - 'min' => ':count minut|:count minuts', - 'second' => ':count segon|:count segons', - 's' => ':count segon|:count segons', - 'ago' => 'fa :time', - 'from_now' => 'd\'aquí :time', - 'after' => ':time després', - 'before' => ':time abans', - 'diff_now' => 'ara mateix', - 'diff_yesterday' => 'ahir', - 'diff_tomorrow' => 'demà', - 'diff_before_yesterday' => "abans d'ahir", - 'diff_after_tomorrow' => 'demà passat', - 'period_recurrences' => ':count cop|:count cops', - 'period_interval' => 'cada :interval', - 'period_start_date' => 'de :date', - 'period_end_date' => 'fins a :date', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cs.php b/vendor/nesbot/carbon/src/Carbon/Lang/cs.php deleted file mode 100644 index a447ce2..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cs.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count rok|:count roky|:count let', - 'y' => ':count rok|:count roky|:count let', - 'month' => ':count měsíc|:count měsíce|:count měsíců', - 'm' => ':count měsíc|:count měsíce|:count měsíců', - 'week' => ':count týden|:count týdny|:count týdnů', - 'w' => ':count týden|:count týdny|:count týdnů', - 'day' => ':count den|:count dny|:count dní', - 'd' => ':count den|:count dny|:count dní', - 'hour' => ':count hodinu|:count hodiny|:count hodin', - 'h' => ':count hodinu|:count hodiny|:count hodin', - 'minute' => ':count minutu|:count minuty|:count minut', - 'min' => ':count minutu|:count minuty|:count minut', - 'second' => ':count sekundu|:count sekundy|:count sekund', - 's' => ':count sekundu|:count sekundy|:count sekund', - 'ago' => ':time nazpět', - 'from_now' => 'za :time', - 'after' => ':time později', - 'before' => ':time předtím', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/cy.php b/vendor/nesbot/carbon/src/Carbon/Lang/cy.php deleted file mode 100644 index c93750e..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/cy.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -return array( - 'year' => '1 flwyddyn|:count blynedd', - 'y' => ':countbl', - 'month' => '1 mis|:count fis', - 'm' => ':countmi', - 'week' => ':count wythnos', - 'w' => ':countw', - 'day' => ':count diwrnod', - 'd' => ':countd', - 'hour' => ':count awr', - 'h' => ':counth', - 'minute' => ':count munud', - 'min' => ':countm', - 'second' => ':count eiliad', - 's' => ':counts', - 'ago' => ':time yn ôl', - 'from_now' => ':time o hyn ymlaen', - 'after' => ':time ar ôl', - 'before' => ':time o\'r blaen', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/da.php b/vendor/nesbot/carbon/src/Carbon/Lang/da.php deleted file mode 100644 index 86507b0..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/da.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count år|:count år', - 'y' => ':count år|:count år', - 'month' => ':count måned|:count måneder', - 'm' => ':count måned|:count måneder', - 'week' => ':count uge|:count uger', - 'w' => ':count uge|:count uger', - 'day' => ':count dag|:count dage', - 'd' => ':count dag|:count dage', - 'hour' => ':count time|:count timer', - 'h' => ':count time|:count timer', - 'minute' => ':count minut|:count minutter', - 'min' => ':count minut|:count minutter', - 'second' => ':count sekund|:count sekunder', - 's' => ':count sekund|:count sekunder', - 'ago' => ':time siden', - 'from_now' => 'om :time', - 'after' => ':time efter', - 'before' => ':time før', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/de.php b/vendor/nesbot/carbon/src/Carbon/Lang/de.php deleted file mode 100644 index 5ea2a03..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/de.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count Jahr|:count Jahre', - 'y' => ':countJ|:countJ', - 'month' => ':count Monat|:count Monate', - 'm' => ':countMon|:countMon', - 'week' => ':count Woche|:count Wochen', - 'w' => ':countWo|:countWo', - 'day' => ':count Tag|:count Tage', - 'd' => ':countTg|:countTg', - 'hour' => ':count Stunde|:count Stunden', - 'h' => ':countStd|:countStd', - 'minute' => ':count Minute|:count Minuten', - 'min' => ':countMin|:countMin', - 'second' => ':count Sekunde|:count Sekunden', - 's' => ':countSek|:countSek', - 'ago' => 'vor :time', - 'from_now' => 'in :time', - 'after' => ':time später', - 'before' => ':time zuvor', - - 'year_from_now' => ':count Jahr|:count Jahren', - 'month_from_now' => ':count Monat|:count Monaten', - 'week_from_now' => ':count Woche|:count Wochen', - 'day_from_now' => ':count Tag|:count Tagen', - 'year_ago' => ':count Jahr|:count Jahren', - 'month_ago' => ':count Monat|:count Monaten', - 'week_ago' => ':count Woche|:count Wochen', - 'day_ago' => ':count Tag|:count Tagen', - - 'diff_now' => 'Gerade eben', - 'diff_yesterday' => 'Gestern', - 'diff_tomorrow' => 'Heute', - 'diff_before_yesterday' => 'Vorgestern', - 'diff_after_tomorrow' => 'Übermorgen', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php b/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php deleted file mode 100644 index e3c50b3..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Ahmed Ali <ajaaibu@gmail.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => '{0}އަހަރެއް|[1,Inf]:count އަހަރު', - 'y' => '{0}އަހަރެއް|[1,Inf]:count އަހަރު', - 'month' => '{0}މައްސަރެއް|[1,Inf]:count މަސް', - 'm' => '{0}މައްސަރެއް|[1,Inf]:count މަސް', - 'week' => '{0}ހަފްތާއެއް|[1,Inf]:count ހަފްތާ', - 'w' => '{0}ހަފްތާއެއް|[1,Inf]:count ހަފްތާ', - 'day' => '{0}ދުވަސް|[1,Inf]:count ދުވަސް', - 'd' => '{0}ދުވަސް|[1,Inf]:count ދުވަސް', - 'hour' => '{0}ގަޑިއިރެއް|[1,Inf]:count ގަޑި', - 'h' => '{0}ގަޑިއިރެއް|[1,Inf]:count ގަޑި', - 'minute' => '{0}މިނެޓެއް|[1,Inf]:count މިނެޓް', - 'min' => '{0}މިނެޓެއް|[1,Inf]:count މިނެޓް', - 'second' => '{0}ސިކުންތެއް|[1,Inf]:count ސިކުންތު', - 's' => '{0}ސިކުންތެއް|[1,Inf]:count ސިކުންތު', - 'ago' => ':time ކުރިން', - 'from_now' => ':time ފަހުން', - 'after' => ':time ފަހުން', - 'before' => ':time ކުރި', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/el.php b/vendor/nesbot/carbon/src/Carbon/Lang/el.php deleted file mode 100644 index 16b3f44..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/el.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count χρόνος|:count χρόνια', - 'y' => ':count χρόνος|:count χρόνια', - 'month' => ':count μήνας|:count μήνες', - 'm' => ':count μήνας|:count μήνες', - 'week' => ':count εβδομάδα|:count εβδομάδες', - 'w' => ':count εβδομάδα|:count εβδομάδες', - 'day' => ':count μέρα|:count μέρες', - 'd' => ':count μέρα|:count μέρες', - 'hour' => ':count ώρα|:count ώρες', - 'h' => ':count ώρα|:count ώρες', - 'minute' => ':count λεπτό|:count λεπτά', - 'min' => ':count λεπτό|:count λεπτά', - 'second' => ':count δευτερόλεπτο|:count δευτερόλεπτα', - 's' => ':count δευτερόλεπτο|:count δευτερόλεπτα', - 'ago' => 'πριν από :time', - 'from_now' => 'σε :time από τώρα', - 'after' => ':time μετά', - 'before' => ':time πριν', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/en.php b/vendor/nesbot/carbon/src/Carbon/Lang/en.php deleted file mode 100644 index a15c131..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/en.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count year|:count years', - 'y' => ':countyr|:countyrs', - 'month' => ':count month|:count months', - 'm' => ':countmo|:countmos', - 'week' => ':count week|:count weeks', - 'w' => ':countw|:countw', - 'day' => ':count day|:count days', - 'd' => ':countd|:countd', - 'hour' => ':count hour|:count hours', - 'h' => ':counth|:counth', - 'minute' => ':count minute|:count minutes', - 'min' => ':countm|:countm', - 'second' => ':count second|:count seconds', - 's' => ':counts|:counts', - 'ago' => ':time ago', - 'from_now' => ':time from now', - 'after' => ':time after', - 'before' => ':time before', - 'diff_now' => 'just now', - 'diff_yesterday' => 'yesterday', - 'diff_tomorrow' => 'tomorrow', - 'diff_before_yesterday' => 'before yesterday', - 'diff_after_tomorrow' => 'after tomorrow', - 'period_recurrences' => 'once|:count times', - 'period_interval' => 'every :interval', - 'period_start_date' => 'from :date', - 'period_end_date' => 'to :date', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/eo.php b/vendor/nesbot/carbon/src/Carbon/Lang/eo.php deleted file mode 100644 index c5b90b3..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/eo.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count jaro|:count jaroj', - 'y' => ':count jaro|:count jaroj', - 'month' => ':count monato|:count monatoj', - 'm' => ':count monato|:count monatoj', - 'week' => ':count semajno|:count semajnoj', - 'w' => ':count semajno|:count semajnoj', - 'day' => ':count tago|:count tagoj', - 'd' => ':count tago|:count tagoj', - 'hour' => ':count horo|:count horoj', - 'h' => ':count horo|:count horoj', - 'minute' => ':count minuto|:count minutoj', - 'min' => ':count minuto|:count minutoj', - 'second' => ':count sekundo|:count sekundoj', - 's' => ':count sekundo|:count sekundoj', - 'ago' => 'antaŭ :time', - 'from_now' => 'je :time', - 'after' => ':time poste', - 'before' => ':time antaŭe', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/es.php b/vendor/nesbot/carbon/src/Carbon/Lang/es.php deleted file mode 100644 index 567a280..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/es.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count año|:count años', - 'y' => ':count año|:count años', - 'month' => ':count mes|:count meses', - 'm' => ':count mes|:count meses', - 'week' => ':count semana|:count semanas', - 'w' => ':count semana|:count semanas', - 'day' => ':count día|:count días', - 'd' => ':count día|:count días', - 'hour' => ':count hora|:count horas', - 'h' => ':count hora|:count horas', - 'minute' => ':count minuto|:count minutos', - 'min' => ':count minuto|:count minutos', - 'second' => ':count segundo|:count segundos', - 's' => ':count segundo|:count segundos', - 'ago' => 'hace :time', - 'from_now' => 'dentro de :time', - 'after' => ':time después', - 'before' => ':time antes', - 'diff_now' => 'ahora mismo', - 'diff_yesterday' => 'ayer', - 'diff_tomorrow' => 'mañana', - 'diff_before_yesterday' => 'antier', - 'diff_after_tomorrow' => 'pasado mañana', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/et.php b/vendor/nesbot/carbon/src/Carbon/Lang/et.php deleted file mode 100644 index 2d9291e..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/et.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count aasta|:count aastat', - 'y' => ':count aasta|:count aastat', - 'month' => ':count kuu|:count kuud', - 'm' => ':count kuu|:count kuud', - 'week' => ':count nädal|:count nädalat', - 'w' => ':count nädal|:count nädalat', - 'day' => ':count päev|:count päeva', - 'd' => ':count päev|:count päeva', - 'hour' => ':count tund|:count tundi', - 'h' => ':count tund|:count tundi', - 'minute' => ':count minut|:count minutit', - 'min' => ':count minut|:count minutit', - 'second' => ':count sekund|:count sekundit', - 's' => ':count sekund|:count sekundit', - 'ago' => ':time tagasi', - 'from_now' => ':time pärast', - 'after' => ':time pärast', - 'before' => ':time enne', - 'year_from_now' => ':count aasta', - 'month_from_now' => ':count kuu', - 'week_from_now' => ':count nädala', - 'day_from_now' => ':count päeva', - 'hour_from_now' => ':count tunni', - 'minute_from_now' => ':count minuti', - 'second_from_now' => ':count sekundi', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/eu.php b/vendor/nesbot/carbon/src/Carbon/Lang/eu.php deleted file mode 100644 index 1cb6b7c..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/eu.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => 'Urte 1|:count urte', - 'y' => 'Urte 1|:count urte', - 'month' => 'Hile 1|:count hile', - 'm' => 'Hile 1|:count hile', - 'week' => 'Aste 1|:count aste', - 'w' => 'Aste 1|:count aste', - 'day' => 'Egun 1|:count egun', - 'd' => 'Egun 1|:count egun', - 'hour' => 'Ordu 1|:count ordu', - 'h' => 'Ordu 1|:count ordu', - 'minute' => 'Minutu 1|:count minutu', - 'min' => 'Minutu 1|:count minutu', - 'second' => 'Segundu 1|:count segundu', - 's' => 'Segundu 1|:count segundu', - 'ago' => 'Orain dela :time', - 'from_now' => ':time barru', - 'after' => ':time geroago', - 'before' => ':time lehenago', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fa.php b/vendor/nesbot/carbon/src/Carbon/Lang/fa.php deleted file mode 100644 index 31bec88..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fa.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count سال', - 'y' => ':count سال', - 'month' => ':count ماه', - 'm' => ':count ماه', - 'week' => ':count هفته', - 'w' => ':count هفته', - 'day' => ':count روز', - 'd' => ':count روز', - 'hour' => ':count ساعت', - 'h' => ':count ساعت', - 'minute' => ':count دقیقه', - 'min' => ':count دقیقه', - 'second' => ':count ثانیه', - 's' => ':count ثانیه', - 'ago' => ':time پیش', - 'from_now' => ':time بعد', - 'after' => ':time پس از', - 'before' => ':time پیش از', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fi.php b/vendor/nesbot/carbon/src/Carbon/Lang/fi.php deleted file mode 100644 index 4818804..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fi.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count vuosi|:count vuotta', - 'y' => ':count vuosi|:count vuotta', - 'month' => ':count kuukausi|:count kuukautta', - 'm' => ':count kuukausi|:count kuukautta', - 'week' => ':count viikko|:count viikkoa', - 'w' => ':count viikko|:count viikkoa', - 'day' => ':count päivä|:count päivää', - 'd' => ':count päivä|:count päivää', - 'hour' => ':count tunti|:count tuntia', - 'h' => ':count tunti|:count tuntia', - 'minute' => ':count minuutti|:count minuuttia', - 'min' => ':count minuutti|:count minuuttia', - 'second' => ':count sekunti|:count sekuntia', - 's' => ':count sekunti|:count sekuntia', - 'ago' => ':time sitten', - 'from_now' => ':time tästä hetkestä', - 'after' => ':time sen jälkeen', - 'before' => ':time ennen', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fo.php b/vendor/nesbot/carbon/src/Carbon/Lang/fo.php deleted file mode 100644 index d91104b..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fo.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count ár|:count ár', - 'y' => ':count ár|:count ár', - 'month' => ':count mánaður|:count mánaðir', - 'm' => ':count mánaður|:count mánaðir', - 'week' => ':count vika|:count vikur', - 'w' => ':count vika|:count vikur', - 'day' => ':count dag|:count dagar', - 'd' => ':count dag|:count dagar', - 'hour' => ':count tími|:count tímar', - 'h' => ':count tími|:count tímar', - 'minute' => ':count minutt|:count minuttir', - 'min' => ':count minutt|:count minuttir', - 'second' => ':count sekund|:count sekundir', - 's' => ':count sekund|:count sekundir', - 'ago' => ':time síðan', - 'from_now' => 'um :time', - 'after' => ':time aftaná', - 'before' => ':time áðrenn', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/fr.php b/vendor/nesbot/carbon/src/Carbon/Lang/fr.php deleted file mode 100644 index 0b20cdd..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/fr.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count an|:count ans', - 'y' => ':count an|:count ans', - 'month' => ':count mois', - 'm' => ':count mois', - 'week' => ':count semaine|:count semaines', - 'w' => ':count sem.', - 'day' => ':count jour|:count jours', - 'd' => ':count j.', - 'hour' => ':count heure|:count heures', - 'h' => ':count h.', - 'minute' => ':count minute|:count minutes', - 'min' => ':count min.', - 'second' => ':count seconde|:count secondes', - 's' => ':count sec.', - 'ago' => 'il y a :time', - 'from_now' => 'dans :time', - 'after' => ':time après', - 'before' => ':time avant', - 'diff_now' => "à l'instant", - 'diff_yesterday' => 'hier', - 'diff_tomorrow' => 'demain', - 'diff_before_yesterday' => 'avant-hier', - 'diff_after_tomorrow' => 'après-demain', - 'period_recurrences' => ':count fois', - 'period_interval' => 'tous les :interval', - 'period_start_date' => 'de :date', - 'period_end_date' => 'à :date', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gl.php b/vendor/nesbot/carbon/src/Carbon/Lang/gl.php deleted file mode 100644 index cd22a31..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gl.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count ano|:count anos', - 'month' => ':count mes|:count meses', - 'week' => ':count semana|:count semanas', - 'day' => ':count día|:count días', - 'hour' => ':count hora|:count horas', - 'minute' => ':count minuto|:count minutos', - 'second' => ':count segundo|:count segundos', - 'ago' => 'fai :time', - 'from_now' => 'dentro de :time', - 'after' => ':time despois', - 'before' => ':time antes', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/gu.php b/vendor/nesbot/carbon/src/Carbon/Lang/gu.php deleted file mode 100644 index 7759dfc..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/gu.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count વર્ષ|:count વર્ષો', - 'y' => ':countવર્ષ|:countવર્ષો', - 'month' => ':count મહિનો|:count મહિના', - 'm' => ':countમહિનો|:countમહિના', - 'week' => ':count અઠવાડિયું|:count અઠવાડિયા', - 'w' => ':countઅઠ.|:countઅઠ.', - 'day' => ':count દિવસ|:count દિવસો', - 'd' => ':countદિ.|:countદિ.', - 'hour' => ':count કલાક|:count કલાકો', - 'h' => ':countક.|:countક.', - 'minute' => ':count મિનિટ|:count મિનિટ', - 'min' => ':countમિ.|:countમિ.', - 'second' => ':count સેકેન્ડ|:count સેકેન્ડ', - 's' => ':countસે.|:countસે.', - 'ago' => ':time પહેલા', - 'from_now' => ':time અત્યારથી', - 'after' => ':time પછી', - 'before' => ':time પહેલા', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/he.php b/vendor/nesbot/carbon/src/Carbon/Lang/he.php deleted file mode 100644 index 2d4f4f8..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/he.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => 'שנה|{2}שנתיים|:count שנים', - 'y' => 'שנה|{2}שנתיים|:count שנים', - 'month' => 'חודש|{2}חודשיים|:count חודשים', - 'm' => 'חודש|{2}חודשיים|:count חודשים', - 'week' => 'שבוע|{2}שבועיים|:count שבועות', - 'w' => 'שבוע|{2}שבועיים|:count שבועות', - 'day' => 'יום|{2}יומיים|:count ימים', - 'd' => 'יום|{2}יומיים|:count ימים', - 'hour' => 'שעה|{2}שעתיים|:count שעות', - 'h' => 'שעה|{2}שעתיים|:count שעות', - 'minute' => 'דקה|{2}דקותיים|:count דקות', - 'min' => 'דקה|{2}דקותיים|:count דקות', - 'second' => 'שניה|:count שניות', - 's' => 'שניה|:count שניות', - 'ago' => 'לפני :time', - 'from_now' => 'בעוד :time', - 'after' => 'אחרי :time', - 'before' => 'לפני :time', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hi.php b/vendor/nesbot/carbon/src/Carbon/Lang/hi.php deleted file mode 100644 index 6c670ee..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hi.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => '1 वर्ष|:count वर्षों', - 'y' => '1 वर्ष|:count वर्षों', - 'month' => '1 माह|:count महीने', - 'm' => '1 माह|:count महीने', - 'week' => '1 सप्ताह|:count सप्ताह', - 'w' => '1 सप्ताह|:count सप्ताह', - 'day' => '1 दिन|:count दिनों', - 'd' => '1 दिन|:count दिनों', - 'hour' => '1 घंटा|:count घंटे', - 'h' => '1 घंटा|:count घंटे', - 'minute' => '1 मिनट|:count मिनटों', - 'min' => '1 मिनट|:count मिनटों', - 'second' => '1 सेकंड|:count सेकंड', - 's' => '1 सेकंड|:count सेकंड', - 'ago' => ':time पूर्व', - 'from_now' => ':time से', - 'after' => ':time के बाद', - 'before' => ':time के पहले', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hr.php b/vendor/nesbot/carbon/src/Carbon/Lang/hr.php deleted file mode 100644 index 1a339de..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hr.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count godinu|:count godine|:count godina', - 'y' => ':count godinu|:count godine|:count godina', - 'month' => ':count mjesec|:count mjeseca|:count mjeseci', - 'm' => ':count mjesec|:count mjeseca|:count mjeseci', - 'week' => ':count tjedan|:count tjedna|:count tjedana', - 'w' => ':count tjedan|:count tjedna|:count tjedana', - 'day' => ':count dan|:count dana|:count dana', - 'd' => ':count dan|:count dana|:count dana', - 'hour' => ':count sat|:count sata|:count sati', - 'h' => ':count sat|:count sata|:count sati', - 'minute' => ':count minutu|:count minute |:count minuta', - 'min' => ':count minutu|:count minute |:count minuta', - 'second' => ':count sekundu|:count sekunde|:count sekundi', - 's' => ':count sekundu|:count sekunde|:count sekundi', - 'ago' => 'prije :time', - 'from_now' => 'za :time', - 'after' => 'za :time', - 'before' => 'prije :time', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hu.php b/vendor/nesbot/carbon/src/Carbon/Lang/hu.php deleted file mode 100644 index 45daf41..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hu.php +++ /dev/null @@ -1,52 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count év', - 'y' => ':count év', - 'month' => ':count hónap', - 'm' => ':count hónap', - 'week' => ':count hét', - 'w' => ':count hét', - 'day' => ':count nap', - 'd' => ':count nap', - 'hour' => ':count óra', - 'h' => ':count óra', - 'minute' => ':count perc', - 'min' => ':count perc', - 'second' => ':count másodperc', - 's' => ':count másodperc', - 'ago' => ':time', - 'from_now' => ':time múlva', - 'after' => ':time később', - 'before' => ':time korábban', - 'year_ago' => ':count éve', - 'month_ago' => ':count hónapja', - 'week_ago' => ':count hete', - 'day_ago' => ':count napja', - 'hour_ago' => ':count órája', - 'minute_ago' => ':count perce', - 'second_ago' => ':count másodperce', - 'year_after' => ':count évvel', - 'month_after' => ':count hónappal', - 'week_after' => ':count héttel', - 'day_after' => ':count nappal', - 'hour_after' => ':count órával', - 'minute_after' => ':count perccel', - 'second_after' => ':count másodperccel', - 'year_before' => ':count évvel', - 'month_before' => ':count hónappal', - 'week_before' => ':count héttel', - 'day_before' => ':count nappal', - 'hour_before' => ':count órával', - 'minute_before' => ':count perccel', - 'second_before' => ':count másodperccel', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/hy.php b/vendor/nesbot/carbon/src/Carbon/Lang/hy.php deleted file mode 100644 index d2665f2..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/hy.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count տարի', - 'y' => ':countտ', - 'month' => ':count ամիս', - 'm' => ':countամ', - 'week' => ':count շաբաթ', - 'w' => ':countշ', - 'day' => ':count օր', - 'd' => ':countօր', - 'hour' => ':count ժամ', - 'h' => ':countժ', - 'minute' => ':count րոպե', - 'min' => ':countր', - 'second' => ':count վարկյան', - 's' => ':countվրկ', - 'ago' => ':time առաջ', - 'from_now' => ':time ներկա պահից', - 'after' => ':time հետո', - 'before' => ':time առաջ', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/id.php b/vendor/nesbot/carbon/src/Carbon/Lang/id.php deleted file mode 100644 index 7f7114f..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/id.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count tahun', - 'y' => ':count tahun', - 'month' => ':count bulan', - 'm' => ':count bulan', - 'week' => ':count minggu', - 'w' => ':count minggu', - 'day' => ':count hari', - 'd' => ':count hari', - 'hour' => ':count jam', - 'h' => ':count jam', - 'minute' => ':count menit', - 'min' => ':count menit', - 'second' => ':count detik', - 's' => ':count detik', - 'ago' => ':time yang lalu', - 'from_now' => ':time dari sekarang', - 'after' => ':time setelah', - 'before' => ':time sebelum', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/is.php b/vendor/nesbot/carbon/src/Carbon/Lang/is.php deleted file mode 100644 index 94c76a7..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/is.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => '1 ár|:count ár', - 'y' => '1 ár|:count ár', - 'month' => '1 mánuður|:count mánuðir', - 'm' => '1 mánuður|:count mánuðir', - 'week' => '1 vika|:count vikur', - 'w' => '1 vika|:count vikur', - 'day' => '1 dagur|:count dagar', - 'd' => '1 dagur|:count dagar', - 'hour' => '1 klukkutími|:count klukkutímar', - 'h' => '1 klukkutími|:count klukkutímar', - 'minute' => '1 mínúta|:count mínútur', - 'min' => '1 mínúta|:count mínútur', - 'second' => '1 sekúnda|:count sekúndur', - 's' => '1 sekúnda|:count sekúndur', - 'ago' => ':time síðan', - 'from_now' => ':time síðan', - 'after' => ':time eftir', - 'before' => ':time fyrir', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/it.php b/vendor/nesbot/carbon/src/Carbon/Lang/it.php deleted file mode 100644 index 70bc6d7..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/it.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count anno|:count anni', - 'y' => ':count anno|:count anni', - 'month' => ':count mese|:count mesi', - 'm' => ':count mese|:count mesi', - 'week' => ':count settimana|:count settimane', - 'w' => ':count settimana|:count settimane', - 'day' => ':count giorno|:count giorni', - 'd' => ':count giorno|:count giorni', - 'hour' => ':count ora|:count ore', - 'h' => ':count ora|:count ore', - 'minute' => ':count minuto|:count minuti', - 'min' => ':count minuto|:count minuti', - 'second' => ':count secondo|:count secondi', - 's' => ':count secondo|:count secondi', - 'ago' => ':time fa', - 'from_now' => 'tra :time', - 'after' => ':time dopo', - 'before' => ':time prima', - 'diff_now' => 'proprio ora', - 'diff_yesterday' => 'ieri', - 'diff_tomorrow' => 'domani', - 'diff_before_yesterday' => "l'altro ieri", - 'diff_after_tomorrow' => 'dopodomani', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ja.php b/vendor/nesbot/carbon/src/Carbon/Lang/ja.php deleted file mode 100644 index 7119547..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ja.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count年', - 'y' => ':count年', - 'month' => ':countヶ月', - 'm' => ':countヶ月', - 'week' => ':count週間', - 'w' => ':count週間', - 'day' => ':count日', - 'd' => ':count日', - 'hour' => ':count時間', - 'h' => ':count時間', - 'minute' => ':count分', - 'min' => ':count分', - 'second' => ':count秒', - 's' => ':count秒', - 'ago' => ':time前', - 'from_now' => '今から:time', - 'after' => ':time後', - 'before' => ':time前', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ka.php b/vendor/nesbot/carbon/src/Carbon/Lang/ka.php deleted file mode 100644 index a8dde7e..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ka.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count წლის', - 'y' => ':count წლის', - 'month' => ':count თვის', - 'm' => ':count თვის', - 'week' => ':count კვირის', - 'w' => ':count კვირის', - 'day' => ':count დღის', - 'd' => ':count დღის', - 'hour' => ':count საათის', - 'h' => ':count საათის', - 'minute' => ':count წუთის', - 'min' => ':count წუთის', - 'second' => ':count წამის', - 's' => ':count წამის', - 'ago' => ':time უკან', - 'from_now' => ':time შემდეგ', - 'after' => ':time შემდეგ', - 'before' => ':time უკან', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/kk.php b/vendor/nesbot/carbon/src/Carbon/Lang/kk.php deleted file mode 100644 index 8d113af..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/kk.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -return array( - 'year' => ':count жыл', - 'y' => ':count жыл', - 'month' => ':count ай', - 'm' => ':count ай', - 'week' => ':count апта', - 'w' => ':count апта', - 'day' => ':count күн', - 'd' => ':count күн', - 'hour' => ':count сағат', - 'h' => ':count сағат', - 'minute' => ':count минут', - 'min' => ':count минут', - 'second' => ':count секунд', - 's' => ':count секунд', - 'ago' => ':time бұрын', - 'from_now' => ':time кейін', - 'after' => ':time кейін', - 'before' => ':time бұрын', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/km.php b/vendor/nesbot/carbon/src/Carbon/Lang/km.php deleted file mode 100644 index a104e06..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/km.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count ឆ្នាំ', - 'y' => ':count ឆ្នាំ', - 'month' => ':count ខែ', - 'm' => ':count ខែ', - 'week' => ':count សប្ដាហ៍', - 'w' => ':count សប្ដាហ៍', - 'day' => ':count ថ្ងៃ', - 'd' => ':count ថ្ងៃ', - 'hour' => ':count ម៉ោង', - 'h' => ':count ម៉ោង', - 'minute' => ':count នាទី', - 'min' => ':count នាទី', - 'second' => ':count វិនាទី', - 's' => ':count វិនាទី', - 'ago' => ':timeមុន', - 'from_now' => ':timeពីឥឡូវ', - 'after' => 'នៅក្រោយ :time', - 'before' => 'នៅមុន :time', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ko.php b/vendor/nesbot/carbon/src/Carbon/Lang/ko.php deleted file mode 100644 index 0209164..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ko.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count 년', - 'y' => ':count 년', - 'month' => ':count 개월', - 'm' => ':count 개월', - 'week' => ':count 주일', - 'w' => ':count 주일', - 'day' => ':count 일', - 'd' => ':count 일', - 'hour' => ':count 시간', - 'h' => ':count 시간', - 'minute' => ':count 분', - 'min' => ':count 분', - 'second' => ':count 초', - 's' => ':count 초', - 'ago' => ':time 전', - 'from_now' => ':time 후', - 'after' => ':time 이후', - 'before' => ':time 이전', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lt.php b/vendor/nesbot/carbon/src/Carbon/Lang/lt.php deleted file mode 100644 index 3f2fd1e..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lt.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count metus|:count metus|:count metų', - 'y' => ':count metus|:count metus|:count metų', - 'month' => ':count mėnesį|:count mėnesius|:count mėnesių', - 'm' => ':count mėnesį|:count mėnesius|:count mėnesių', - 'week' => ':count savaitę|:count savaites|:count savaičių', - 'w' => ':count savaitę|:count savaites|:count savaičių', - 'day' => ':count dieną|:count dienas|:count dienų', - 'd' => ':count dieną|:count dienas|:count dienų', - 'hour' => ':count valandą|:count valandas|:count valandų', - 'h' => ':count valandą|:count valandas|:count valandų', - 'minute' => ':count minutę|:count minutes|:count minučių', - 'min' => ':count minutę|:count minutes|:count minučių', - 'second' => ':count sekundę|:count sekundes|:count sekundžių', - 's' => ':count sekundę|:count sekundes|:count sekundžių', - 'second_from_now' => ':count sekundės|:count sekundžių|:count sekundžių', - 'minute_from_now' => ':count minutės|:count minučių|:count minučių', - 'hour_from_now' => ':count valandos|:count valandų|:count valandų', - 'day_from_now' => ':count dienos|:count dienų|:count dienų', - 'week_from_now' => ':count savaitės|:count savaičių|:count savaičių', - 'month_from_now' => ':count mėnesio|:count mėnesių|:count mėnesių', - 'year_from_now' => ':count metų', - 'ago' => 'prieš :time', - 'from_now' => 'už :time', - 'after' => 'po :time', - 'before' => ':time nuo dabar', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/lv.php b/vendor/nesbot/carbon/src/Carbon/Lang/lv.php deleted file mode 100644 index 363193d..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/lv.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => '0 gadiem|:count gada|:count gadiem', - 'y' => '0 gadiem|:count gada|:count gadiem', - 'month' => '0 mēnešiem|:count mēneša|:count mēnešiem', - 'm' => '0 mēnešiem|:count mēneša|:count mēnešiem', - 'week' => '0 nedēļām|:count nedēļas|:count nedēļām', - 'w' => '0 nedēļām|:count nedēļas|:count nedēļām', - 'day' => '0 dienām|:count dienas|:count dienām', - 'd' => '0 dienām|:count dienas|:count dienām', - 'hour' => '0 stundām|:count stundas|:count stundām', - 'h' => '0 stundām|:count stundas|:count stundām', - 'minute' => '0 minūtēm|:count minūtes|:count minūtēm', - 'min' => '0 minūtēm|:count minūtes|:count minūtēm', - 'second' => '0 sekundēm|:count sekundes|:count sekundēm', - 's' => '0 sekundēm|:count sekundes|:count sekundēm', - 'ago' => 'pirms :time', - 'from_now' => 'pēc :time', - 'after' => ':time vēlāk', - 'before' => ':time pirms', - - 'year_after' => '0 gadus|:count gadu|:count gadus', - 'month_after' => '0 mēnešus|:count mēnesi|:count mēnešus', - 'week_after' => '0 nedēļas|:count nedēļu|:count nedēļas', - 'day_after' => '0 dienas|:count dienu|:count dienas', - 'hour_after' => '0 stundas|:count stundu|:count stundas', - 'minute_after' => '0 minūtes|:count minūti|:count minūtes', - 'second_after' => '0 sekundes|:count sekundi|:count sekundes', - - 'year_before' => '0 gadus|:count gadu|:count gadus', - 'month_before' => '0 mēnešus|:count mēnesi|:count mēnešus', - 'week_before' => '0 nedēļas|:count nedēļu|:count nedēļas', - 'day_before' => '0 dienas|:count dienu|:count dienas', - 'hour_before' => '0 stundas|:count stundu|:count stundas', - 'minute_before' => '0 minūtes|:count minūti|:count minūtes', - 'second_before' => '0 sekundes|:count sekundi|:count sekundes', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mk.php b/vendor/nesbot/carbon/src/Carbon/Lang/mk.php deleted file mode 100644 index c5ec12d..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mk.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count година|:count години', - 'month' => ':count месец|:count месеци', - 'week' => ':count седмица|:count седмици', - 'day' => ':count ден|:count дена', - 'hour' => ':count час|:count часа', - 'minute' => ':count минута|:count минути', - 'second' => ':count секунда|:count секунди', - 'ago' => 'пред :time', - 'from_now' => ':time од сега', - 'after' => 'по :time', - 'before' => 'пред :time', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/mn.php b/vendor/nesbot/carbon/src/Carbon/Lang/mn.php deleted file mode 100644 index b26dce5..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/mn.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - * - * @translator Batmandakh Erdenebileg <batmandakh.e@icloud.com> - */ - -return array( - 'year' => ':count жил', - 'y' => ':count жил', - 'month' => ':count сар', - 'm' => ':count сар', - 'week' => ':count долоо хоног', - 'w' => ':count долоо хоног', - 'day' => ':count өдөр', - 'd' => ':count өдөр', - 'hour' => ':count цаг', - 'h' => ':countц', - 'minute' => ':count минут', - 'min' => ':countм', - 'second' => ':count секунд', - 's' => ':countс', - - 'ago' => ':timeн өмнө', - 'year_ago' => ':count жилий', - 'month_ago' => ':count сары', - 'day_ago' => ':count хоногий', - 'hour_ago' => ':count цагий', - 'minute_ago' => ':count минуты', - 'second_ago' => ':count секунды', - - 'from_now' => 'одоогоос :time', - 'year_from_now' => ':count жилийн дараа', - 'month_from_now' => ':count сарын дараа', - 'day_from_now' => ':count хоногийн дараа', - 'hour_from_now' => ':count цагийн дараа', - 'minute_from_now' => ':count минутын дараа', - 'second_from_now' => ':count секундын дараа', - - // Does it required to make translation for before, after as follows? hmm, I think we've made it with ago and from now keywords already. Anyway, I've included it just in case of undesired action... - 'after' => ':timeн дараа', - 'year_after' => ':count жилий', - 'month_after' => ':count сары', - 'day_after' => ':count хоногий', - 'hour_after' => ':count цагий', - 'minute_after' => ':count минуты', - 'second_after' => ':count секунды', - 'before' => ':timeн өмнө', - 'year_before' => ':count жилий', - 'month_before' => ':count сары', - 'day_before' => ':count хоногий', - 'hour_before' => ':count цагий', - 'minute_before' => ':count минуты', - 'second_before' => ':count секунды', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ms.php b/vendor/nesbot/carbon/src/Carbon/Lang/ms.php deleted file mode 100644 index ef57422..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ms.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count tahun', - 'y' => ':count tahun', - 'month' => ':count bulan', - 'm' => ':count bulan', - 'week' => ':count minggu', - 'w' => ':count minggu', - 'day' => ':count hari', - 'd' => ':count hari', - 'hour' => ':count jam', - 'h' => ':count jam', - 'minute' => ':count minit', - 'min' => ':count minit', - 'second' => ':count saat', - 's' => ':count saat', - 'ago' => ':time yang lalu', - 'from_now' => ':time dari sekarang', - 'after' => ':time selepas', - 'before' => ':time sebelum', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/my.php b/vendor/nesbot/carbon/src/Carbon/Lang/my.php deleted file mode 100644 index e8e491e..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/my.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count နှစ်|:count နှစ်', - 'y' => ':count နှစ်|:count နှစ်', - 'month' => ':count လ|:count လ', - 'm' => ':count လ|:count လ', - 'week' => ':count ပတ်|:count ပတ်', - 'w' => ':count ပတ်|:count ပတ်', - 'day' => ':count ရက်|:count ရက်', - 'd' => ':count ရက်|:count ရက်', - 'hour' => ':count နာရီ|:count နာရီ', - 'h' => ':count နာရီ|:count နာရီ', - 'minute' => ':count မိနစ်|:count မိနစ်', - 'min' => ':count မိနစ်|:count မိနစ်', - 'second' => ':count စက္ကန့်|:count စက္ကန့်', - 's' => ':count စက္ကန့်|:count စက္ကန့်', - 'ago' => 'လွန်ခဲ့သော :time က', - 'from_now' => 'ယခုမှစ၍နောက် :time အကြာ', - 'after' => ':time ကြာပြီးနောက်', - 'before' => ':time မတိုင်ခင်', - 'diff_now' => 'အခုလေးတင်', - 'diff_yesterday' => 'မနေ့က', - 'diff_tomorrow' => 'မနက်ဖြန်', - 'diff_before_yesterday' => 'တမြန်နေ့က', - 'diff_after_tomorrow' => 'တဘက်ခါ', - 'period_recurrences' => ':count ကြိမ်', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ne.php b/vendor/nesbot/carbon/src/Carbon/Lang/ne.php deleted file mode 100644 index 0b528df..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ne.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count वर्ष', - 'y' => ':count वर्ष', - 'month' => ':count महिना', - 'm' => ':count महिना', - 'week' => ':count हप्ता', - 'w' => ':count हप्ता', - 'day' => ':count दिन', - 'd' => ':count दिन', - 'hour' => ':count घण्टा', - 'h' => ':count घण्टा', - 'minute' => ':count मिनेट', - 'min' => ':count मिनेट', - 'second' => ':count सेकेण्ड', - 's' => ':count सेकेण्ड', - 'ago' => ':time पहिले', - 'from_now' => ':time देखि', - 'after' => ':time पछि', - 'before' => ':time अघि', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/nl.php b/vendor/nesbot/carbon/src/Carbon/Lang/nl.php deleted file mode 100644 index ec5a88e..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/nl.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count jaar', - 'y' => ':count jaar', - 'month' => ':count maand|:count maanden', - 'm' => ':count maand|:count maanden', - 'week' => ':count week|:count weken', - 'w' => ':count week|:count weken', - 'day' => ':count dag|:count dagen', - 'd' => ':count dag|:count dagen', - 'hour' => ':count uur', - 'h' => ':count uur', - 'minute' => ':count minuut|:count minuten', - 'min' => ':count minuut|:count minuten', - 'second' => ':count seconde|:count seconden', - 's' => ':count seconde|:count seconden', - 'ago' => ':time geleden', - 'from_now' => 'over :time', - 'after' => ':time later', - 'before' => ':time eerder', - 'diff_now' => 'nu', - 'diff_yesterday' => 'gisteren', - 'diff_tomorrow' => 'morgen', - 'diff_after_tomorrow' => 'overmorgen', - 'diff_before_yesterday' => 'eergisteren', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/no.php b/vendor/nesbot/carbon/src/Carbon/Lang/no.php deleted file mode 100644 index a6ece06..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/no.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count år|:count år', - 'y' => ':count år|:count år', - 'month' => ':count måned|:count måneder', - 'm' => ':count måned|:count måneder', - 'week' => ':count uke|:count uker', - 'w' => ':count uke|:count uker', - 'day' => ':count dag|:count dager', - 'd' => ':count dag|:count dager', - 'hour' => ':count time|:count timer', - 'h' => ':count time|:count timer', - 'minute' => ':count minutt|:count minutter', - 'min' => ':count minutt|:count minutter', - 'second' => ':count sekund|:count sekunder', - 's' => ':count sekund|:count sekunder', - 'ago' => ':time siden', - 'from_now' => 'om :time', - 'after' => ':time etter', - 'before' => ':time før', - 'diff_now' => 'akkurat nå', - 'diff_yesterday' => 'i går', - 'diff_tomorrow' => 'i morgen', - 'diff_before_yesterday' => 'i forgårs', - 'diff_after_tomorrow' => 'i overmorgen', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/oc.php b/vendor/nesbot/carbon/src/Carbon/Lang/oc.php deleted file mode 100644 index e89e94c..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/oc.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -\Symfony\Component\Translation\PluralizationRules::set(function ($number) { - return $number == 1 ? 0 : 1; -}, 'oc'); - -return array( - 'year' => ':count an|:count ans', - 'y' => ':count an|:count ans', - 'month' => ':count mes|:count meses', - 'm' => ':count mes|:count meses', - 'week' => ':count setmana|:count setmanas', - 'w' => ':count setmana|:count setmanas', - 'day' => ':count jorn|:count jorns', - 'd' => ':count jorn|:count jorns', - 'hour' => ':count ora|:count oras', - 'h' => ':count ora|:count oras', - 'minute' => ':count minuta|:count minutas', - 'min' => ':count minuta|:count minutas', - 'second' => ':count segonda|:count segondas', - 's' => ':count segonda|:count segondas', - 'ago' => 'fa :time', - 'from_now' => 'dins :time', - 'after' => ':time aprèp', - 'before' => ':time abans', - 'diff_now' => 'ara meteis', - 'diff_yesterday' => 'ièr', - 'diff_tomorrow' => 'deman', - 'diff_before_yesterday' => 'ièr delà', - 'diff_after_tomorrow' => 'deman passat', - 'period_recurrences' => ':count còp|:count còps', - 'period_interval' => 'cada :interval', - 'period_start_date' => 'de :date', - 'period_end_date' => 'fins a :date', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pl.php b/vendor/nesbot/carbon/src/Carbon/Lang/pl.php deleted file mode 100644 index 2308af2..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pl.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count rok|:count lata|:count lat', - 'y' => ':countr|:countl', - 'month' => ':count miesiąc|:count miesiące|:count miesięcy', - 'm' => ':countmies', - 'week' => ':count tydzień|:count tygodnie|:count tygodni', - 'w' => ':counttyg', - 'day' => ':count dzień|:count dni|:count dni', - 'd' => ':countd', - 'hour' => ':count godzina|:count godziny|:count godzin', - 'h' => ':countg', - 'minute' => ':count minuta|:count minuty|:count minut', - 'min' => ':countm', - 'second' => ':count sekunda|:count sekundy|:count sekund', - 's' => ':counts', - 'ago' => ':time temu', - 'from_now' => ':time od teraz', - 'after' => ':time po', - 'before' => ':time przed', - 'diff_now' => 'przed chwilą', - 'diff_yesterday' => 'wczoraj', - 'diff_tomorrow' => 'jutro', - 'diff_before_yesterday' => 'przedwczoraj', - 'diff_after_tomorrow' => 'pojutrze', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ps.php b/vendor/nesbot/carbon/src/Carbon/Lang/ps.php deleted file mode 100644 index 15c3296..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ps.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count کال|:count کاله', - 'y' => ':countکال|:countکاله', - 'month' => ':count مياشت|:count مياشتي', - 'm' => ':countمياشت|:countمياشتي', - 'week' => ':count اونۍ|:count اونۍ', - 'w' => ':countاونۍ|:countاونۍ', - 'day' => ':count ورځ|:count ورځي', - 'd' => ':countورځ|:countورځي', - 'hour' => ':count ساعت|:count ساعته', - 'h' => ':countساعت|:countساعته', - 'minute' => ':count دقيقه|:count دقيقې', - 'min' => ':countدقيقه|:countدقيقې', - 'second' => ':count ثانيه|:count ثانيې', - 's' => ':countثانيه|:countثانيې', - 'ago' => ':time دمخه', - 'from_now' => ':time له اوس څخه', - 'after' => ':time وروسته', - 'before' => ':time دمخه', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt.php deleted file mode 100644 index 392b121..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count ano|:count anos', - 'y' => ':count ano|:count anos', - 'month' => ':count mês|:count meses', - 'm' => ':count mês|:count meses', - 'week' => ':count semana|:count semanas', - 'w' => ':count semana|:count semanas', - 'day' => ':count dia|:count dias', - 'd' => ':count dia|:count dias', - 'hour' => ':count hora|:count horas', - 'h' => ':count hora|:count horas', - 'minute' => ':count minuto|:count minutos', - 'min' => ':count minuto|:count minutos', - 'second' => ':count segundo|:count segundos', - 's' => ':count segundo|:count segundos', - 'ago' => ':time atrás', - 'from_now' => 'em :time', - 'after' => ':time depois', - 'before' => ':time antes', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/pt_BR.php b/vendor/nesbot/carbon/src/Carbon/Lang/pt_BR.php deleted file mode 100644 index 1f84eac..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/pt_BR.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count ano|:count anos', - 'y' => ':counta|:counta', - 'month' => ':count mês|:count meses', - 'm' => ':countm|:countm', - 'week' => ':count semana|:count semanas', - 'w' => ':countsem|:countsem', - 'day' => ':count dia|:count dias', - 'd' => ':countd|:countd', - 'hour' => ':count hora|:count horas', - 'h' => ':counth|:counth', - 'minute' => ':count minuto|:count minutos', - 'min' => ':countmin|:countmin', - 'second' => ':count segundo|:count segundos', - 's' => ':counts|:counts', - 'ago' => 'há :time', - 'from_now' => 'em :time', - 'after' => 'após :time', - 'before' => ':time atrás', - 'diff_now' => 'agora', - 'diff_yesterday' => 'ontem', - 'diff_tomorrow' => 'amanhã', - 'diff_before_yesterday' => 'anteontem', - 'diff_after_tomorrow' => 'depois de amanhã', - 'period_recurrences' => 'uma|:count vez', - 'period_interval' => 'toda :interval', - 'period_start_date' => 'de :date', - 'period_end_date' => 'até :date', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ro.php b/vendor/nesbot/carbon/src/Carbon/Lang/ro.php deleted file mode 100644 index cc16724..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ro.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => 'un an|:count ani|:count ani', - 'y' => 'un an|:count ani|:count ani', - 'month' => 'o lună|:count luni|:count luni', - 'm' => 'o lună|:count luni|:count luni', - 'week' => 'o săptămână|:count săptămâni|:count săptămâni', - 'w' => 'o săptămână|:count săptămâni|:count săptămâni', - 'day' => 'o zi|:count zile|:count zile', - 'd' => 'o zi|:count zile|:count zile', - 'hour' => 'o oră|:count ore|:count ore', - 'h' => 'o oră|:count ore|:count ore', - 'minute' => 'un minut|:count minute|:count minute', - 'min' => 'un minut|:count minute|:count minute', - 'second' => 'o secundă|:count secunde|:count secunde', - 's' => 'o secundă|:count secunde|:count secunde', - 'ago' => 'acum :time', - 'from_now' => ':time de acum', - 'after' => 'peste :time', - 'before' => 'acum :time', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ru.php b/vendor/nesbot/carbon/src/Carbon/Lang/ru.php deleted file mode 100644 index 6a83fb1..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ru.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count год|:count года|:count лет', - 'y' => ':count г|:count г|:count л', - 'month' => ':count месяц|:count месяца|:count месяцев', - 'm' => ':count м|:count м|:count м', - 'week' => ':count неделю|:count недели|:count недель', - 'w' => ':count н|:count н|:count н', - 'day' => ':count день|:count дня|:count дней', - 'd' => ':count д|:count д|:count д', - 'hour' => ':count час|:count часа|:count часов', - 'h' => ':count ч|:count ч|:count ч', - 'minute' => ':count минуту|:count минуты|:count минут', - 'min' => ':count мин|:count мин|:count мин', - 'second' => ':count секунду|:count секунды|:count секунд', - 's' => ':count с|:count с|:count с', - 'ago' => ':time назад', - 'from_now' => 'через :time', - 'after' => ':time после', - 'before' => ':time до', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sh.php b/vendor/nesbot/carbon/src/Carbon/Lang/sh.php deleted file mode 100644 index 57f287a..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sh.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -\Symfony\Component\Translation\PluralizationRules::set(function ($number) { - return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); -}, 'sh'); - -return array( - 'year' => ':count godina|:count godine|:count godina', - 'y' => ':count godina|:count godine|:count godina', - 'month' => ':count mesec|:count meseca|:count meseci', - 'm' => ':count mesec|:count meseca|:count meseci', - 'week' => ':count nedelja|:count nedelje|:count nedelja', - 'w' => ':count nedelja|:count nedelje|:count nedelja', - 'day' => ':count dan|:count dana|:count dana', - 'd' => ':count dan|:count dana|:count dana', - 'hour' => ':count čas|:count časa|:count časova', - 'h' => ':count čas|:count časa|:count časova', - 'minute' => ':count minut|:count minuta|:count minuta', - 'min' => ':count minut|:count minuta|:count minuta', - 'second' => ':count sekund|:count sekunda|:count sekundi', - 's' => ':count sekund|:count sekunda|:count sekundi', - 'ago' => 'pre :time', - 'from_now' => 'za :time', - 'after' => 'nakon :time', - 'before' => ':time raniјe', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sk.php b/vendor/nesbot/carbon/src/Carbon/Lang/sk.php deleted file mode 100644 index 6101344..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sk.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => 'rok|:count roky|:count rokov', - 'y' => 'rok|:count roky|:count rokov', - 'month' => 'mesiac|:count mesiace|:count mesiacov', - 'm' => 'mesiac|:count mesiace|:count mesiacov', - 'week' => 'týždeň|:count týždne|:count týždňov', - 'w' => 'týždeň|:count týždne|:count týždňov', - 'day' => 'deň|:count dni|:count dní', - 'd' => 'deň|:count dni|:count dní', - 'hour' => 'hodinu|:count hodiny|:count hodín', - 'h' => 'hodinu|:count hodiny|:count hodín', - 'minute' => 'minútu|:count minúty|:count minút', - 'min' => 'minútu|:count minúty|:count minút', - 'second' => 'sekundu|:count sekundy|:count sekúnd', - 's' => 'sekundu|:count sekundy|:count sekúnd', - 'ago' => 'pred :time', - 'from_now' => 'za :time', - 'after' => 'o :time neskôr', - 'before' => ':time predtým', - 'year_ago' => 'rokom|:count rokmi|:count rokmi', - 'month_ago' => 'mesiacom|:count mesiacmi|:count mesiacmi', - 'week_ago' => 'týždňom|:count týždňami|:count týždňami', - 'day_ago' => 'dňom|:count dňami|:count dňami', - 'hour_ago' => 'hodinou|:count hodinami|:count hodinami', - 'minute_ago' => 'minútou|:count minútami|:count minútami', - 'second_ago' => 'sekundou|:count sekundami|:count sekundami', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sl.php b/vendor/nesbot/carbon/src/Carbon/Lang/sl.php deleted file mode 100644 index 06686d1..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sl.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count leto|:count leti|:count leta|:count let', - 'y' => ':count leto|:count leti|:count leta|:count let', - 'month' => ':count mesec|:count meseca|:count mesece|:count mesecev', - 'm' => ':count mesec|:count meseca|:count mesece|:count mesecev', - 'week' => ':count teden|:count tedna|:count tedne|:count tednov', - 'w' => ':count teden|:count tedna|:count tedne|:count tednov', - 'day' => ':count dan|:count dni|:count dni|:count dni', - 'd' => ':count dan|:count dni|:count dni|:count dni', - 'hour' => ':count uro|:count uri|:count ure|:count ur', - 'h' => ':count uro|:count uri|:count ure|:count ur', - 'minute' => ':count minuto|:count minuti|:count minute|:count minut', - 'min' => ':count minuto|:count minuti|:count minute|:count minut', - 'second' => ':count sekundo|:count sekundi|:count sekunde|:count sekund', - 's' => ':count sekundo|:count sekundi|:count sekunde|:count sekund', - 'year_ago' => ':count letom|:count leti|:count leti|:count leti', - 'month_ago' => ':count mesecem|:count meseci|:count meseci|:count meseci', - 'week_ago' => ':count tednom|:count tednoma|:count tedni|:count tedni', - 'day_ago' => ':count dnem|:count dnevoma|:count dnevi|:count dnevi', - 'hour_ago' => ':count uro|:count urama|:count urami|:count urami', - 'minute_ago' => ':count minuto|:count minutama|:count minutami|:count minutami', - 'second_ago' => ':count sekundo|:count sekundama|:count sekundami|:count sekundami', - 'ago' => 'pred :time', - 'from_now' => 'čez :time', - 'after' => 'čez :time', - 'before' => 'pred :time', - 'diff_now' => 'ravnokar', - 'diff_yesterday' => 'včeraj', - 'diff_tomorrow' => 'jutri', - 'diff_before_yesterday' => 'predvčerajšnjim', - 'diff_after_tomorrow' => 'pojutrišnjem', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sq.php b/vendor/nesbot/carbon/src/Carbon/Lang/sq.php deleted file mode 100644 index 6e138a0..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sq.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count vit|:count vjet', - 'y' => ':count vit|:count vjet', - 'month' => ':count muaj|:count muaj', - 'm' => ':count muaj|:count muaj', - 'week' => ':count javë|:count javë', - 'w' => ':count javë|:count javë', - 'day' => ':count ditë|:count ditë', - 'd' => ':count ditë|:count ditë', - 'hour' => ':count orë|:count orë', - 'h' => ':count orë|:count orë', - 'minute' => ':count minutë|:count minuta', - 'min' => ':count minutë|:count minuta', - 'second' => ':count sekondë|:count sekonda', - 's' => ':count sekondë|:count sekonda', - 'ago' => ':time më parë', - 'from_now' => ':time nga tani', - 'after' => ':time pas', - 'before' => ':time para', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr.php deleted file mode 100644 index 5a10642..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count godina|:count godine|:count godina', - 'y' => ':count godina|:count godine|:count godina', - 'month' => ':count mesec|:count meseca|:count meseci', - 'm' => ':count mesec|:count meseca|:count meseci', - 'week' => ':count nedelja|:count nedelje|:count nedelja', - 'w' => ':count nedelja|:count nedelje|:count nedelja', - 'day' => ':count dan|:count dana|:count dana', - 'd' => ':count dan|:count dana|:count dana', - 'hour' => ':count sat|:count sata|:count sati', - 'h' => ':count sat|:count sata|:count sati', - 'minute' => ':count minut|:count minuta |:count minuta', - 'min' => ':count minut|:count minuta |:count minuta', - 'second' => ':count sekund|:count sekunde|:count sekunde', - 's' => ':count sekund|:count sekunde|:count sekunde', - 'ago' => 'pre :time', - 'from_now' => ':time od sada', - 'after' => 'nakon :time', - 'before' => 'pre :time', - - 'year_from_now' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina', - 'year_ago' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina', - - 'week_from_now' => '{1} :count nedelju|{2,3,4} :count nedelje|[5,Inf[ :count nedelja', - 'week_ago' => '{1} :count nedelju|{2,3,4} :count nedelje|[5,Inf[ :count nedelja', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php deleted file mode 100644 index 2db83ed..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Nikola Zeravcic <office@bytenet.rs> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[ :count година', - 'y' => ':count г.', - 'month' => '{1} :count месец|{2,3,4}:count месеца|[5,Inf[ :count месеци', - 'm' => ':count м.', - 'week' => '{1} :count недеља|{2,3,4}:count недеље|[5,Inf[ :count недеља', - 'w' => ':count нед.', - 'day' => '{1,21,31} :count дан|[2,Inf[ :count дана', - 'd' => ':count д.', - 'hour' => '{1,21} :count сат|{2,3,4,22,23,24}:count сата|[5,Inf[ :count сати', - 'h' => ':count ч.', - 'minute' => '{1,21,31,41,51} :count минут|[2,Inf[ :count минута', - 'min' => ':count мин.', - 'second' => '{1,21,31,41,51} :count секунд|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count секунде|[5,Inf[:count секунди', - 's' => ':count сек.', - 'ago' => 'пре :time', - 'from_now' => 'за :time', - 'after' => ':time након', - 'before' => ':time пре', - - 'year_from_now' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година', - 'year_ago' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година', - - 'week_from_now' => '{1} :count недељу|{2,3,4} :count недеље|[5,Inf[ :count недеља', - 'week_ago' => '{1} :count недељу|{2,3,4} :count недеље|[5,Inf[ :count недеља', - - 'diff_now' => 'управо сада', - 'diff_yesterday' => 'јуче', - 'diff_tomorrow' => 'сутра', - 'diff_before_yesterday' => 'прекјуче', - 'diff_after_tomorrow' => 'прекосутра', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php deleted file mode 100644 index 18214c4..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[ :count година', - 'y' => ':count г.', - 'month' => '{1} :count мјесец|{2,3,4}:count мјесеца|[5,Inf[ :count мјесеци', - 'm' => ':count мј.', - 'week' => '{1} :count недјеља|{2,3,4}:count недјеље|[5,Inf[ :count недјеља', - 'w' => ':count нед.', - 'day' => '{1,21,31} :count дан|[2,Inf[ :count дана', - 'd' => ':count д.', - 'hour' => '{1,21} :count сат|{2,3,4,22,23,24}:count сата|[5,Inf[ :count сати', - 'h' => ':count ч.', - 'minute' => '{1,21,31,41,51} :count минут|[2,Inf[ :count минута', - 'min' => ':count мин.', - 'second' => '{1,21,31,41,51} :count секунд|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count секунде|[5,Inf[:count секунди', - 's' => ':count сек.', - 'ago' => 'прије :time', - 'from_now' => 'за :time', - 'after' => ':time након', - 'before' => ':time прије', - - 'year_from_now' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година', - 'year_ago' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година', - - 'week_from_now' => '{1} :count недјељу|{2,3,4} :count недјеље|[5,Inf[ :count недјеља', - 'week_ago' => '{1} :count недјељу|{2,3,4} :count недјеље|[5,Inf[ :count недјеља', - - 'diff_now' => 'управо сада', - 'diff_yesterday' => 'јуче', - 'diff_tomorrow' => 'сутра', - 'diff_before_yesterday' => 'прекјуче', - 'diff_after_tomorrow' => 'прекосјутра', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php deleted file mode 100644 index 2d2e288..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count godine|[0,Inf[ :count godina', - 'y' => ':count g.', - 'month' => '{1} :count mjesec|{2,3,4}:count mjeseca|[5,Inf[ :count mjeseci', - 'm' => ':count mj.', - 'week' => '{1} :count nedjelja|{2,3,4}:count nedjelje|[5,Inf[ :count nedjelja', - 'w' => ':count ned.', - 'day' => '{1,21,31} :count dan|[2,Inf[ :count dana', - 'd' => ':count d.', - 'hour' => '{1,21} :count sat|{2,3,4,22,23,24}:count sata|[5,Inf[ :count sati', - 'h' => ':count č.', - 'minute' => '{1,21,31,41,51} :count minut|[2,Inf[ :count minuta', - 'min' => ':count min.', - 'second' => '{1,21,31,41,51} :count sekund|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count sekunde|[5,Inf[:count sekundi', - 's' => ':count sek.', - 'ago' => 'prije :time', - 'from_now' => 'za :time', - 'after' => ':time nakon', - 'before' => ':time prije', - - 'year_from_now' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina', - 'year_ago' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina', - - 'week_from_now' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja', - 'week_ago' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja', - - 'diff_now' => 'upravo sada', - 'diff_yesterday' => 'juče', - 'diff_tomorrow' => 'sutra', - 'diff_before_yesterday' => 'prekjuče', - 'diff_after_tomorrow' => 'preksutra', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php b/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php deleted file mode 100644 index 7ebf6f0..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return require __DIR__.'/sr_Latn_ME.php'; diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sv.php b/vendor/nesbot/carbon/src/Carbon/Lang/sv.php deleted file mode 100644 index 89a03b4..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sv.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count år|:count år', - 'y' => ':count år|:count år', - 'month' => ':count månad|:count månader', - 'm' => ':count månad|:count månader', - 'week' => ':count vecka|:count veckor', - 'w' => ':count vecka|:count veckor', - 'day' => ':count dag|:count dagar', - 'd' => ':count dag|:count dagar', - 'hour' => ':count timme|:count timmar', - 'h' => ':count timme|:count timmar', - 'minute' => ':count minut|:count minuter', - 'min' => ':count minut|:count minuter', - 'second' => ':count sekund|:count sekunder', - 's' => ':count sekund|:count sekunder', - 'ago' => ':time sedan', - 'from_now' => 'om :time', - 'after' => ':time efter', - 'before' => ':time före', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/sw.php b/vendor/nesbot/carbon/src/Carbon/Lang/sw.php deleted file mode 100644 index 52f0342..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/sw.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => 'mwaka 1|miaka :count', - 'y' => 'mwaka 1|miaka :count', - 'month' => 'mwezi 1|miezi :count', - 'm' => 'mwezi 1|miezi :count', - 'week' => 'wiki 1|wiki :count', - 'w' => 'wiki 1|wiki :count', - 'day' => 'siku 1|siku :count', - 'd' => 'siku 1|siku :count', - 'hour' => 'saa 1|masaa :count', - 'h' => 'saa 1|masaa :count', - 'minute' => 'dakika 1|dakika :count', - 'min' => 'dakika 1|dakika :count', - 'second' => 'sekunde 1|sekunde :count', - 's' => 'sekunde 1|sekunde :count', - 'ago' => ':time ziliyopita', - 'from_now' => ':time kwanzia sasa', - 'after' => ':time baada', - 'before' => ':time kabla', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/th.php b/vendor/nesbot/carbon/src/Carbon/Lang/th.php deleted file mode 100644 index 88bb4ac..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/th.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count ปี', - 'y' => ':count ปี', - 'month' => ':count เดือน', - 'm' => ':count เดือน', - 'week' => ':count สัปดาห์', - 'w' => ':count สัปดาห์', - 'day' => ':count วัน', - 'd' => ':count วัน', - 'hour' => ':count ชั่วโมง', - 'h' => ':count ชั่วโมง', - 'minute' => ':count นาที', - 'min' => ':count นาที', - 'second' => ':count วินาที', - 's' => ':count วินาที', - 'ago' => ':timeที่แล้ว', - 'from_now' => ':timeต่อจากนี้', - 'after' => ':timeหลังจากนี้', - 'before' => ':timeก่อน', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/tr.php b/vendor/nesbot/carbon/src/Carbon/Lang/tr.php deleted file mode 100644 index 6a9dfed..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/tr.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count yıl', - 'y' => ':count yıl', - 'month' => ':count ay', - 'm' => ':count ay', - 'week' => ':count hafta', - 'w' => ':count hafta', - 'day' => ':count gün', - 'd' => ':count gün', - 'hour' => ':count saat', - 'h' => ':count saat', - 'minute' => ':count dakika', - 'min' => ':count dakika', - 'second' => ':count saniye', - 's' => ':count saniye', - 'ago' => ':time önce', - 'from_now' => ':time sonra', - 'after' => ':time sonra', - 'before' => ':time önce', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uk.php b/vendor/nesbot/carbon/src/Carbon/Lang/uk.php deleted file mode 100644 index 8d08eaa..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uk.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count рік|:count роки|:count років', - 'y' => ':count рік|:count роки|:count років', - 'month' => ':count місяць|:count місяці|:count місяців', - 'm' => ':count місяць|:count місяці|:count місяців', - 'week' => ':count тиждень|:count тижні|:count тижнів', - 'w' => ':count тиждень|:count тижні|:count тижнів', - 'day' => ':count день|:count дні|:count днів', - 'd' => ':count день|:count дні|:count днів', - 'hour' => ':count година|:count години|:count годин', - 'h' => ':count година|:count години|:count годин', - 'minute' => ':count хвилину|:count хвилини|:count хвилин', - 'min' => ':count хвилину|:count хвилини|:count хвилин', - 'second' => ':count секунду|:count секунди|:count секунд', - 's' => ':count секунду|:count секунди|:count секунд', - 'ago' => ':time тому', - 'from_now' => 'через :time', - 'after' => ':time після', - 'before' => ':time до', - 'diff_now' => 'щойно', - 'diff_yesterday' => 'вчора', - 'diff_tomorrow' => 'завтра', - 'diff_before_yesterday' => 'позавчора', - 'diff_after_tomorrow' => 'післязавтра', - 'period_recurrences' => 'один раз|:count рази|:count разів', - 'period_interval' => 'кожні :interval', - 'period_start_date' => 'з :date', - 'period_end_date' => 'до :date', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/ur.php b/vendor/nesbot/carbon/src/Carbon/Lang/ur.php deleted file mode 100644 index 3c5f7ed..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/ur.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count سال', - 'month' => ':count ماه', - 'week' => ':count ہفتے', - 'day' => ':count روز', - 'hour' => ':count گھنٹے', - 'minute' => ':count منٹ', - 'second' => ':count سیکنڈ', - 'ago' => ':time پہلے', - 'from_now' => ':time بعد', - 'after' => ':time بعد', - 'before' => ':time پہلے', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/uz.php b/vendor/nesbot/carbon/src/Carbon/Lang/uz.php deleted file mode 100644 index 1cb6f71..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/uz.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count yil', - 'y' => ':count yil', - 'month' => ':count oy', - 'm' => ':count oy', - 'week' => ':count hafta', - 'w' => ':count hafta', - 'day' => ':count kun', - 'd' => ':count kun', - 'hour' => ':count soat', - 'h' => ':count soat', - 'minute' => ':count daqiqa', - 'min' => ':count daq', - 'second' => ':count soniya', - 's' => ':count s', - 'ago' => ':time avval', - 'from_now' => ':time dan keyin', - 'after' => ':time keyin', - 'before' => ':time oldin', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/vi.php b/vendor/nesbot/carbon/src/Carbon/Lang/vi.php deleted file mode 100644 index 3f9838d..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/vi.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count năm', - 'y' => ':count năm', - 'month' => ':count tháng', - 'm' => ':count tháng', - 'week' => ':count tuần', - 'w' => ':count tuần', - 'day' => ':count ngày', - 'd' => ':count ngày', - 'hour' => ':count giờ', - 'h' => ':count giờ', - 'minute' => ':count phút', - 'min' => ':count phút', - 'second' => ':count giây', - 's' => ':count giây', - 'ago' => ':time trước', - 'from_now' => ':time từ bây giờ', - 'after' => ':time sau', - 'before' => ':time trước', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh.php deleted file mode 100644 index 9e1f6ca..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count年', - 'y' => ':count年', - 'month' => ':count个月', - 'm' => ':count个月', - 'week' => ':count周', - 'w' => ':count周', - 'day' => ':count天', - 'd' => ':count天', - 'hour' => ':count小时', - 'h' => ':count小时', - 'minute' => ':count分钟', - 'min' => ':count分钟', - 'second' => ':count秒', - 's' => ':count秒', - 'ago' => ':time前', - 'from_now' => '距现在:time', - 'after' => ':time后', - 'before' => ':time前', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Lang/zh_TW.php b/vendor/nesbot/carbon/src/Carbon/Lang/zh_TW.php deleted file mode 100644 index c848723..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Lang/zh_TW.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -/* - * This file is part of the Carbon package. - * - * (c) Brian Nesbitt <brian@nesbot.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return array( - 'year' => ':count年', - 'y' => ':count年', - 'month' => ':count月', - 'm' => ':count月', - 'week' => ':count週', - 'w' => ':count週', - 'day' => ':count天', - 'd' => ':count天', - 'hour' => ':count小時', - 'h' => ':count小時', - 'minute' => ':count分鐘', - 'min' => ':count分鐘', - 'second' => ':count秒', - 's' => ':count秒', - 'ago' => ':time前', - 'from_now' => '距現在:time', - 'after' => ':time後', - 'before' => ':time前', -); diff --git a/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php b/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php deleted file mode 100644 index 4d83b0c..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -namespace Carbon\Laravel; - -use Carbon\Carbon; -use Illuminate\Events\Dispatcher; -use Illuminate\Events\EventDispatcher; -use Illuminate\Translation\Translator as IlluminateTranslator; -use Symfony\Component\Translation\Translator; - -class ServiceProvider extends \Illuminate\Support\ServiceProvider -{ - public function boot() - { - $service = $this; - $events = $this->app['events']; - if ($events instanceof EventDispatcher || $events instanceof Dispatcher) { - $events->listen(class_exists('Illuminate\Foundation\Events\LocaleUpdated') ? 'Illuminate\Foundation\Events\LocaleUpdated' : 'locale.changed', function () use ($service) { - $service->updateLocale(); - }); - $service->updateLocale(); - } - } - - public function updateLocale() - { - $translator = $this->app['translator']; - if ($translator instanceof Translator || $translator instanceof IlluminateTranslator) { - Carbon::setLocale($translator->getLocale()); - } - } - - public function register() - { - // Needed for Laravel < 5.3 compatibility - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Translator.php b/vendor/nesbot/carbon/src/Carbon/Translator.php deleted file mode 100644 index 12115b0..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Translator.php +++ /dev/null @@ -1,143 +0,0 @@ -<?php - -namespace Carbon; - -use Symfony\Component\Translation; - -class Translator extends Translation\Translator -{ - /** - * Singleton for Translator. - * - * @var static - */ - protected static $singleton; - - /** - * List of custom localized messages. - * - * @var array - */ - protected static $messages = array(); - - /** - * Return a singleton instance of Translator. - * - * @param string|null $locale optional initial locale ("en" - english by default) - * - * @return static - */ - public static function get($locale = null) - { - if (static::$singleton === null) { - static::$singleton = new static($locale ?: 'en'); - } - - return static::$singleton; - } - - public function __construct($locale, Translation\Formatter\MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false) - { - $this->addLoader('array', new Translation\Loader\ArrayLoader()); - parent::__construct($locale, $formatter, $cacheDir, $debug); - } - - /** - * Reset messages of a locale (all locale if no locale passed). - * Remove custom messages and reload initial messages from matching - * file in Lang directory. - * - * @param string|null $locale - * - * @return bool - */ - public function resetMessages($locale = null) - { - if ($locale === null) { - static::$messages = array(); - - return true; - } - - if (file_exists($filename = __DIR__.'/Lang/'.$locale.'.php')) { - static::$messages[$locale] = require $filename; - $this->addResource('array', static::$messages[$locale], $locale); - - return true; - } - - return false; - } - - /** - * Init messages language from matching file in Lang directory. - * - * @param string $locale - * - * @return bool - */ - protected function loadMessagesFromFile($locale) - { - if (isset(static::$messages[$locale])) { - return true; - } - - return $this->resetMessages($locale); - } - - /** - * Set messages of a locale and take file first if present. - * - * @param string $locale - * @param array $messages - * - * @return $this - */ - public function setMessages($locale, $messages) - { - $this->loadMessagesFromFile($locale); - $this->addResource('array', $messages, $locale); - static::$messages[$locale] = array_merge( - isset(static::$messages[$locale]) ? static::$messages[$locale] : array(), - $messages - ); - - return $this; - } - - /** - * Get messages of a locale, if none given, return all the - * languages. - * - * @param string|null $locale - * - * @return array - */ - public function getMessages($locale = null) - { - return $locale === null ? static::$messages : static::$messages[$locale]; - } - - /** - * Set the current translator locale and indicate if the source locale file exists - * - * @param string $locale locale ex. en - * - * @return bool - */ - public function setLocale($locale) - { - $locale = preg_replace_callback('/[-_]([a-z]{2,})/', function ($matches) { - // _2-letters is a region, _3+-letters is a variant - return '_'.call_user_func(strlen($matches[1]) > 2 ? 'ucfirst' : 'strtoupper', $matches[1]); - }, strtolower($locale)); - - if ($this->loadMessagesFromFile($locale)) { - parent::setLocale($locale); - - return true; - } - - return false; - } -} diff --git a/vendor/nesbot/carbon/src/Carbon/Upgrade.php b/vendor/nesbot/carbon/src/Carbon/Upgrade.php deleted file mode 100644 index 26449ff..0000000 --- a/vendor/nesbot/carbon/src/Carbon/Upgrade.php +++ /dev/null @@ -1,150 +0,0 @@ -<?php - -namespace Carbon; - -use Composer\Composer; -use Composer\Config; -use Composer\IO\ConsoleIO; -use Composer\Script\Event as ScriptEvent; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Helper\QuestionHelper; -use Symfony\Component\Console\Input\StringInput; -use Symfony\Component\Console\Output\ConsoleOutput; -use UpdateHelper\UpdateHelper; -use UpdateHelper\UpdateHelperInterface; - -class Upgrade implements UpdateHelperInterface -{ - const ASK_ON_UPDATE = false; - const SUGGEST_ON_UPDATE = false; - - protected static $laravelLibraries = array( - 'laravel/framework' => '5.8.0', - 'laravel/cashier' => '9.0.1', - 'illuminate/support' => '5.8.0', - 'laravel/dusk' => '5.0.0', - ); - - protected static $otherLibraries = array( - 'spatie/laravel-analytics' => '3.6.4', - 'jenssegers/date' => '3.5.0', - ); - - /** - * @param \UpdateHelper\UpdateHelper $helper - */ - public function check(UpdateHelper $helper) - { - $helper->write(array( - 'Carbon 1 is deprecated, see how to migrate to Carbon 2.', - 'https://carbon.nesbot.com/docs/#api-carbon-2', - )); - - if (static::SUGGEST_ON_UPDATE || static::ASK_ON_UPDATE || $helper->getIo()->isVerbose()) { - $laravelUpdate = array(); - - foreach (static::$laravelLibraries as $name => $version) { - if ($helper->hasAsDependency($name) && $helper->isDependencyLesserThan($name, $version)) { - $laravelUpdate[$name] = $version; - } - } - - if (count($laravelUpdate)) { - $output = array( - ' Please consider upgrading your Laravel dependencies to be compatible with Carbon 2:', - ); - - foreach ($laravelUpdate as $name => $version) { - $output[] = " - $name at least to version $version"; - } - - $output[] = ''; - $output[] = " If you can't update Laravel, check https://carbon.nesbot.com/ to see how to"; - $output[] = ' install Carbon 2 using alias version and our adapter kylekatarnls/laravel-carbon-2'; - $output[] = ''; - - $helper->write($output); - } - - foreach (static::$otherLibraries as $name => $version) { - if ($helper->hasAsDependency($name) && $helper->isDependencyLesserThan($name, $version)) { - $helper->write(" Please consider upgrading $name at least to $version to be compatible with Carbon 2.\n"); - } - } - - if (static::ASK_ON_UPDATE) { - static::askForUpgrade($helper); - - return; - } - } - - $path = implode(DIRECTORY_SEPARATOR, array('.', 'vendor', 'bin', 'upgrade-carbon')); - - if (!file_exists($path)) { - $path = realpath(__DIR__.'/../../bin/upgrade-carbon'); - } - - $helper->write( - ' You can run '.escapeshellarg($path). - ' to get help in updating carbon and other frameworks and libraries that depend on it.' - ); - } - - private static function getUpgradeQuestion($upgrades) - { - $message = "Do you want us to try the following upgrade:\n"; - - foreach ($upgrades as $name => $version) { - $message .= " - $name: $version\n"; - } - - return $message.'[Y/N] '; - } - - public static function askForUpgrade(UpdateHelper $helper, $upgradeIfNotInteractive = false) - { - $upgrades = array( - 'nesbot/carbon' => '^2.0.0', - ); - - foreach (array(static::$laravelLibraries, static::$otherLibraries) as $libraries) { - foreach ($libraries as $name => $version) { - if ($helper->hasAsDependency($name) && $helper->isDependencyLesserThan($name, $version)) { - $upgrades[$name] = "^$version"; - } - } - } - - $shouldUpgrade = $helper->isInteractive() - ? $helper->getIo()->askConfirmation(static::getUpgradeQuestion($upgrades)) - : $upgradeIfNotInteractive; - - if ($shouldUpgrade) { - $helper->setDependencyVersions($upgrades)->update(); - } - } - - public static function upgrade(ScriptEvent $event = null) - { - if (!$event) { - $composer = new Composer(); - $baseDir = __DIR__.'/../..'; - - if (file_exists("$baseDir/autoload.php")) { - $baseDir .= '/..'; - } - - $composer->setConfig(new Config(true, $baseDir)); - $event = new ScriptEvent( - 'upgrade-carbon', - $composer, - new ConsoleIO(new StringInput(''), new ConsoleOutput(), new HelperSet(array( - new QuestionHelper(), - ))) - ); - } - - static::askForUpgrade(new UpdateHelper($event), true); - } -} diff --git a/vendor/nesbot/carbon/src/JsonSerializable.php b/vendor/nesbot/carbon/src/JsonSerializable.php deleted file mode 100644 index d34060b..0000000 --- a/vendor/nesbot/carbon/src/JsonSerializable.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -if (!interface_exists('JsonSerializable')) { - interface JsonSerializable - { - /** - * Specify data which should be serialized to JSON. - * - * @link http://php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed data which can be serialized by <b>json_encode</b>, - * which is a value of any type other than a resource. - * - * @since 5.4.0 - */ - public function jsonSerialize(); - } -} diff --git a/vendor/psr/container/.gitignore b/vendor/psr/container/.gitignore deleted file mode 100644 index b2395aa..0000000 --- a/vendor/psr/container/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -composer.lock -composer.phar -/vendor/ diff --git a/vendor/psr/container/LICENSE b/vendor/psr/container/LICENSE deleted file mode 100644 index 2877a48..0000000 --- a/vendor/psr/container/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-2016 container-interop -Copyright (c) 2016 PHP Framework Interoperability Group - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/psr/container/README.md b/vendor/psr/container/README.md deleted file mode 100644 index 084f6df..0000000 --- a/vendor/psr/container/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# PSR Container - -This repository holds all interfaces/classes/traits related to [PSR-11](https://github.com/container-interop/fig-standards/blob/master/proposed/container.md). - -Note that this is not a container implementation of its own. See the specification for more details. diff --git a/vendor/psr/container/composer.json b/vendor/psr/container/composer.json deleted file mode 100644 index b8ee012..0000000 --- a/vendor/psr/container/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "psr/container", - "type": "library", - "description": "Common Container Interface (PHP FIG PSR-11)", - "keywords": ["psr", "psr-11", "container", "container-interop", "container-interface"], - "homepage": "https://github.com/php-fig/container", - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "require": { - "php": ">=5.3.0" - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/vendor/psr/container/src/ContainerExceptionInterface.php b/vendor/psr/container/src/ContainerExceptionInterface.php deleted file mode 100644 index d35c6b4..0000000 --- a/vendor/psr/container/src/ContainerExceptionInterface.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file) - */ - -namespace Psr\Container; - -/** - * Base interface representing a generic exception in a container. - */ -interface ContainerExceptionInterface -{ -} diff --git a/vendor/psr/container/src/ContainerInterface.php b/vendor/psr/container/src/ContainerInterface.php deleted file mode 100644 index c3a7206..0000000 --- a/vendor/psr/container/src/ContainerInterface.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php -/** - * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file) - */ - -namespace Psr\Container; - -/** - * Describes the interface of a container that exposes methods to read its entries. - */ -interface ContainerInterface -{ - /** - * Finds an entry of the container by its identifier and returns it. - * - * @param string $id Identifier of the entry to look for. - * - * @throws NotFoundExceptionInterface No entry was found for **this** identifier. - * @throws ContainerExceptionInterface Error while retrieving the entry. - * - * @return mixed Entry. - */ - public function get($id); - - /** - * Returns true if the container can return an entry for the given identifier. - * Returns false otherwise. - * - * `has($id)` returning true does not mean that `get($id)` will not throw an exception. - * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`. - * - * @param string $id Identifier of the entry to look for. - * - * @return bool - */ - public function has($id); -} diff --git a/vendor/psr/container/src/NotFoundExceptionInterface.php b/vendor/psr/container/src/NotFoundExceptionInterface.php deleted file mode 100644 index 6566704..0000000 --- a/vendor/psr/container/src/NotFoundExceptionInterface.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php -/** - * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file) - */ - -namespace Psr\Container; - -/** - * No entry was found in the container. - */ -interface NotFoundExceptionInterface extends ContainerExceptionInterface -{ -} diff --git a/vendor/psr/simple-cache/.editorconfig b/vendor/psr/simple-cache/.editorconfig deleted file mode 100644 index 48542cb..0000000 --- a/vendor/psr/simple-cache/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -; This file is for unifying the coding style for different editors and IDEs. -; More information at http://editorconfig.org - -root = true - -[*] -charset = utf-8 -indent_size = 4 -indent_style = space -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true diff --git a/vendor/psr/simple-cache/LICENSE.md b/vendor/psr/simple-cache/LICENSE.md deleted file mode 100644 index e49a7c8..0000000 --- a/vendor/psr/simple-cache/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -# The MIT License (MIT) - -Copyright (c) 2016 PHP Framework Interoperability Group - -> Permission is hereby granted, free of charge, to any person obtaining a copy -> of this software and associated documentation files (the "Software"), to deal -> in the Software without restriction, including without limitation the rights -> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -> copies of the Software, and to permit persons to whom the Software is -> furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in -> all copies or substantial portions of the Software. -> -> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -> THE SOFTWARE. diff --git a/vendor/psr/simple-cache/README.md b/vendor/psr/simple-cache/README.md deleted file mode 100644 index 43641d1..0000000 --- a/vendor/psr/simple-cache/README.md +++ /dev/null @@ -1,8 +0,0 @@ -PHP FIG Simple Cache PSR -======================== - -This repository holds all interfaces related to PSR-16. - -Note that this is not a cache implementation of its own. It is merely an interface that describes a cache implementation. See [the specification](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-16-simple-cache.md) for more details. - -You can find implementations of the specification by looking for packages providing the [psr/simple-cache-implementation](https://packagist.org/providers/psr/simple-cache-implementation) virtual package. diff --git a/vendor/psr/simple-cache/composer.json b/vendor/psr/simple-cache/composer.json deleted file mode 100644 index 2978fa5..0000000 --- a/vendor/psr/simple-cache/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "psr/simple-cache", - "description": "Common interfaces for simple caching", - "keywords": ["psr", "psr-16", "cache", "simple-cache", "caching"], - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "require": { - "php": ">=5.3.0" - }, - "autoload": { - "psr-4": { - "Psr\\SimpleCache\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - } -} diff --git a/vendor/psr/simple-cache/src/CacheException.php b/vendor/psr/simple-cache/src/CacheException.php deleted file mode 100644 index eba5381..0000000 --- a/vendor/psr/simple-cache/src/CacheException.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -namespace Psr\SimpleCache; - -/** - * Interface used for all types of exceptions thrown by the implementing library. - */ -interface CacheException -{ -} diff --git a/vendor/psr/simple-cache/src/CacheInterface.php b/vendor/psr/simple-cache/src/CacheInterface.php deleted file mode 100644 index 99e8d95..0000000 --- a/vendor/psr/simple-cache/src/CacheInterface.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php - -namespace Psr\SimpleCache; - -interface CacheInterface -{ - /** - * Fetches a value from the cache. - * - * @param string $key The unique key of this item in the cache. - * @param mixed $default Default value to return if the key does not exist. - * - * @return mixed The value of the item from the cache, or $default in case of cache miss. - * - * @throws \Psr\SimpleCache\InvalidArgumentException - * MUST be thrown if the $key string is not a legal value. - */ - public function get($key, $default = null); - - /** - * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. - * - * @param string $key The key of the item to store. - * @param mixed $value The value of the item to store, must be serializable. - * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and - * the driver supports TTL then the library may set a default value - * for it or let the driver take care of that. - * - * @return bool True on success and false on failure. - * - * @throws \Psr\SimpleCache\InvalidArgumentException - * MUST be thrown if the $key string is not a legal value. - */ - public function set($key, $value, $ttl = null); - - /** - * Delete an item from the cache by its unique key. - * - * @param string $key The unique cache key of the item to delete. - * - * @return bool True if the item was successfully removed. False if there was an error. - * - * @throws \Psr\SimpleCache\InvalidArgumentException - * MUST be thrown if the $key string is not a legal value. - */ - public function delete($key); - - /** - * Wipes clean the entire cache's keys. - * - * @return bool True on success and false on failure. - */ - public function clear(); - - /** - * Obtains multiple cache items by their unique keys. - * - * @param iterable $keys A list of keys that can obtained in a single operation. - * @param mixed $default Default value to return for keys that do not exist. - * - * @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value. - * - * @throws \Psr\SimpleCache\InvalidArgumentException - * MUST be thrown if $keys is neither an array nor a Traversable, - * or if any of the $keys are not a legal value. - */ - public function getMultiple($keys, $default = null); - - /** - * Persists a set of key => value pairs in the cache, with an optional TTL. - * - * @param iterable $values A list of key => value pairs for a multiple-set operation. - * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and - * the driver supports TTL then the library may set a default value - * for it or let the driver take care of that. - * - * @return bool True on success and false on failure. - * - * @throws \Psr\SimpleCache\InvalidArgumentException - * MUST be thrown if $values is neither an array nor a Traversable, - * or if any of the $values are not a legal value. - */ - public function setMultiple($values, $ttl = null); - - /** - * Deletes multiple cache items in a single operation. - * - * @param iterable $keys A list of string-based keys to be deleted. - * - * @return bool True if the items were successfully removed. False if there was an error. - * - * @throws \Psr\SimpleCache\InvalidArgumentException - * MUST be thrown if $keys is neither an array nor a Traversable, - * or if any of the $keys are not a legal value. - */ - public function deleteMultiple($keys); - - /** - * Determines whether an item is present in the cache. - * - * NOTE: It is recommended that has() is only to be used for cache warming type purposes - * and not to be used within your live applications operations for get/set, as this method - * is subject to a race condition where your has() will return true and immediately after, - * another script can remove it making the state of your app out of date. - * - * @param string $key The cache item key. - * - * @return bool - * - * @throws \Psr\SimpleCache\InvalidArgumentException - * MUST be thrown if the $key string is not a legal value. - */ - public function has($key); -} diff --git a/vendor/psr/simple-cache/src/InvalidArgumentException.php b/vendor/psr/simple-cache/src/InvalidArgumentException.php deleted file mode 100644 index 6a9524a..0000000 --- a/vendor/psr/simple-cache/src/InvalidArgumentException.php +++ /dev/null @@ -1,13 +0,0 @@ -<?php - -namespace Psr\SimpleCache; - -/** - * Exception interface for invalid cache arguments. - * - * When an invalid argument is passed it must throw an exception which implements - * this interface - */ -interface InvalidArgumentException extends CacheException -{ -} diff --git a/vendor/slim/slim/.gitignore b/vendor/slim/slim/.gitignore deleted file mode 100644 index 485dee6..0000000 --- a/vendor/slim/slim/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.idea diff --git a/vendor/slim/slim/.travis.yml b/vendor/slim/slim/.travis.yml deleted file mode 100644 index c741e40..0000000 --- a/vendor/slim/slim/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: php - -php: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - hhvm - -script: phpunit --coverage-text diff --git a/vendor/slim/slim/CONTRIBUTING.md b/vendor/slim/slim/CONTRIBUTING.md deleted file mode 100644 index 9bbb6b1..0000000 --- a/vendor/slim/slim/CONTRIBUTING.md +++ /dev/null @@ -1,20 +0,0 @@ -# How to Contribute - -## Pull Requests - -1. Fork the Slim Framework repository -2. Create a new branch for each feature or improvement -3. Send a pull request from each feature branch to the **develop** branch - -It is very important to separate new features or improvements into separate feature branches, and to send a -pull request for each branch. This allows me to review and pull in new features or improvements individually. - -## Style Guide - -All pull requests must adhere to the [PSR-2 standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md). - -## Unit Testing - -All pull requests must be accompanied by passing unit tests and complete code coverage. The Slim Framework uses phpunit for testing. - -[Learn about PHPUnit](https://github.com/sebastianbergmann/phpunit/) diff --git a/vendor/slim/slim/LICENSE b/vendor/slim/slim/LICENSE deleted file mode 100644 index fa59876..0000000 --- a/vendor/slim/slim/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2012-2017 Josh Lockhart - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/slim/slim/README.markdown b/vendor/slim/slim/README.markdown deleted file mode 100644 index 34a0c80..0000000 --- a/vendor/slim/slim/README.markdown +++ /dev/null @@ -1,212 +0,0 @@ -# Slim Framework - -[](https://travis-ci.org/slimphp/Slim) - -Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs. -Slim is easy to use for both beginners and professionals. Slim favors cleanliness over terseness and common cases -over edge cases. Its interface is simple, intuitive, and extensively documented — both online and in the code itself. -Thank you for choosing the Slim Framework for your next project. I think you're going to love it. - -## Features - -* Powerful router - * Standard and custom HTTP methods - * Route parameters with wildcards and conditions - * Route redirect, halt, and pass - * Route middleware -* Resource Locator and DI container -* Template rendering with custom views -* Flash messages -* Encrypt cookie data -* HTTP caching -* Logging with custom log writers -* Error handling and debugging -* Middleware and hook architecture -* Simple configuration - -## Getting Started - -### Install - -You may install the Slim Framework with Composer (recommended) or manually. - -[Read how to install Slim](http://docs.slimframework.com/#Installation) - -### System Requirements - -You need **PHP >= 5.3.0**. If you use encrypted cookies, you'll also need the `mcrypt` extension. - -### Hello World Tutorial - -Instantiate a Slim application: -```php -$app = new \Slim\Slim(); -``` -Define a HTTP GET route: -```php -$app->get('/hello/:name', function ($name) { - echo "Hello, $name"; -}); -``` -Run the Slim application: -```php -$app->run(); -``` -### Setup your web server - -#### Apache - -Ensure the `.htaccess` and `index.php` files are in the same public-accessible directory. The `.htaccess` file -should contain this code: -``` -RewriteEngine On -RewriteCond %{REQUEST_FILENAME} !-f -RewriteRule ^ index.php [QSA,L] -``` -Additionally, make sure your virtual host is configured with the AllowOverride option so that the .htaccess rewrite rules can be used: -``` -AllowOverride All -``` -#### Nginx - -The nginx configuration file should contain this code (along with other settings you may need) in your `location` block: -``` -try_files $uri $uri/ /index.php?$args; -``` -This assumes that Slim's `index.php` is in the root folder of your project (www root). - -#### HipHop Virtual Machine for PHP - -Your HipHop Virtual Machine configuration file should contain this code (along with other settings you may need). -Be sure you change the `ServerRoot` setting to point to your Slim app's document root directory. -``` -Server { - SourceRoot = /path/to/public/directory -} - -ServerVariables { - SCRIPT_NAME = /index.php -} - -VirtualHost { - * { - Pattern = .* - RewriteRules { - * { - pattern = ^(.*)$ - to = index.php/$1 - qsa = true - } - } - } -} -``` -#### lighttpd #### - -Your lighttpd configuration file should contain this code (along with other settings you may need). This code requires -lighttpd >= 1.4.24. -``` -url.rewrite-if-not-file = ("(.*)" => "/index.php/$0") -``` -This assumes that Slim's `index.php` is in the root folder of your project (www root). - -#### IIS - -Ensure the `Web.config` and `index.php` files are in the same public-accessible directory. The `Web.config` file should contain this code: -```xml -<?xml version="1.0" encoding="UTF-8"?> -<configuration> - <system.webServer> - <rewrite> - <rules> - <rule name="slim" patternSyntax="Wildcard"> - <match url="*" /> - <conditions> - <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> - <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> - </conditions> - <action type="Rewrite" url="index.php" /> - </rule> - </rules> - </rewrite> - </system.webServer> -</configuration> -``` -#### Google App Engine - -Two steps are required to successfully run your Slim application on Google App Engine. First, ensure the `app.yaml` file includes a default handler to `index.php`: -``` -application: your-app-name -version: 1 -runtime: php -api_version: 1 - -handlers: -# ... -- url: /.* - script: public_html/index.php -``` -Next, edit your `index.php` file so Slim knows about the incoming URI: -```php -$app = new Slim(); - -// Google App Engine doesn't set $_SERVER['PATH_INFO'] -$app->environment['PATH_INFO'] = $_SERVER['REQUEST_URI']; - -// ... -$app->run(); -``` - -## Documentation - -<http://docs.slimframework.com/> - -## How to Contribute - - -*NOTE: We are only accepting security fixes for Slim 2 (master branch). All development is concentrated on Slim 3 which is on the develop branch.* - - -### Pull Requests - -1. Fork the Slim Framework repository -2. Create a new branch for each feature or improvement -3. Send a pull request from each feature branch to the **develop** branch - -It is very important to separate new features or improvements into separate feature branches, and to send a pull -request for each branch. This allows me to review and pull in new features or improvements individually. - -### Style Guide - -All pull requests must adhere to the [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) standard. - -### Unit Testing - -All pull requests must be accompanied by passing unit tests and complete code coverage. The Slim Framework uses -`phpunit` for testing. - -[Learn about PHPUnit](https://github.com/sebastianbergmann/phpunit/) - -## Community - -### Forum and Knowledgebase - -Visit Slim's official forum and knowledge base at <http://help.slimframework.com> where you can find announcements, -chat with fellow Slim users, ask questions, help others, or show off your cool Slim Framework apps. - -### Twitter - -Follow [@slimphp](http://www.twitter.com/slimphp) on Twitter to receive news and updates about the framework. - -## Author - -The Slim Framework is created and maintained by [Josh Lockhart](http://www.joshlockhart.com). Josh is a senior -web developer at [New Media Campaigns](http://www.newmediacampaigns.com/). Josh also created and maintains -[PHP: The Right Way](http://www.phptherightway.com/), a popular movement in the PHP community to introduce new -PHP programmers to best practices and good information. - -## License - -The Slim Framework is released under the MIT public license. - -<https://github.com/slimphp/Slim/blob/master/LICENSE> diff --git a/vendor/slim/slim/Slim/Environment.php b/vendor/slim/slim/Slim/Environment.php deleted file mode 100644 index 09c379a..0000000 --- a/vendor/slim/slim/Slim/Environment.php +++ /dev/null @@ -1,228 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim; - -/** - * Environment - * - * This class creates and returns a key/value array of common - * environment variables for the current HTTP request. - * - * This is a singleton class; derived environment variables will - * be common across multiple Slim applications. - * - * This class matches the Rack (Ruby) specification as closely - * as possible. More information available below. - * - * @package Slim - * @author Josh Lockhart - * @since 1.6.0 - */ -class Environment implements \ArrayAccess, \IteratorAggregate -{ - /** - * @var array - */ - protected $properties; - - /** - * @var \Slim\Environment - */ - protected static $environment; - - /** - * Get environment instance (singleton) - * - * This creates and/or returns an environment instance (singleton) - * derived from $_SERVER variables. You may override the global server - * variables by using `\Slim\Environment::mock()` instead. - * - * @param bool $refresh Refresh properties using global server variables? - * @return \Slim\Environment - */ - public static function getInstance($refresh = false) - { - if (is_null(self::$environment) || $refresh) { - self::$environment = new self(); - } - - return self::$environment; - } - - /** - * Get mock environment instance - * - * @param array $userSettings - * @return \Slim\Environment - */ - public static function mock($userSettings = array()) - { - $defaults = array( - 'REQUEST_METHOD' => 'GET', - 'SCRIPT_NAME' => '', - 'PATH_INFO' => '', - 'QUERY_STRING' => '', - 'SERVER_NAME' => 'localhost', - 'SERVER_PORT' => 80, - 'ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', - 'ACCEPT_LANGUAGE' => 'en-US,en;q=0.8', - 'ACCEPT_CHARSET' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', - 'USER_AGENT' => 'Slim Framework', - 'REMOTE_ADDR' => '127.0.0.1', - 'slim.url_scheme' => 'http', - 'slim.input' => '', - 'slim.errors' => @fopen('php://stderr', 'w') - ); - self::$environment = new self(array_merge($defaults, $userSettings)); - - return self::$environment; - } - - /** - * Constructor (private access) - * - * @param array|null $settings If present, these are used instead of global server variables - */ - private function __construct($settings = null) - { - if ($settings) { - $this->properties = $settings; - } else { - $env = array(); - - //The HTTP request method - $env['REQUEST_METHOD'] = $_SERVER['REQUEST_METHOD']; - - //The IP - $env['REMOTE_ADDR'] = $_SERVER['REMOTE_ADDR']; - - // Server params - $scriptName = $_SERVER['SCRIPT_NAME']; // <-- "/foo/index.php" - $requestUri = $_SERVER['REQUEST_URI']; // <-- "/foo/bar?test=abc" or "/foo/index.php/bar?test=abc" - $queryString = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : ''; // <-- "test=abc" or "" - - // Physical path - if (strpos($requestUri, $scriptName) !== false) { - $physicalPath = $scriptName; // <-- Without rewriting - } else { - $physicalPath = str_replace('\\', '', dirname($scriptName)); // <-- With rewriting - } - $env['SCRIPT_NAME'] = rtrim($physicalPath, '/'); // <-- Remove trailing slashes - - // Virtual path - $env['PATH_INFO'] = $requestUri; - if (substr($requestUri, 0, strlen($physicalPath)) == $physicalPath) { - $env['PATH_INFO'] = substr($requestUri, strlen($physicalPath)); // <-- Remove physical path - } - $env['PATH_INFO'] = str_replace('?' . $queryString, '', $env['PATH_INFO']); // <-- Remove query string - $env['PATH_INFO'] = '/' . ltrim($env['PATH_INFO'], '/'); // <-- Ensure leading slash - - // Query string (without leading "?") - $env['QUERY_STRING'] = $queryString; - - //Name of server host that is running the script - $env['SERVER_NAME'] = $_SERVER['SERVER_NAME']; - - //Number of server port that is running the script - //Fixes: https://github.com/slimphp/Slim/issues/962 - $env['SERVER_PORT'] = isset($_SERVER['SERVER_PORT']) ? $_SERVER['SERVER_PORT'] : 80; - - //HTTP request headers (retains HTTP_ prefix to match $_SERVER) - $headers = \Slim\Http\Headers::extract($_SERVER); - foreach ($headers as $key => $value) { - $env[$key] = $value; - } - - //Is the application running under HTTPS or HTTP protocol? - $env['slim.url_scheme'] = empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] === 'off' ? 'http' : 'https'; - - //Input stream (readable one time only; not available for multipart/form-data requests) - $rawInput = @file_get_contents('php://input'); - if (!$rawInput) { - $rawInput = ''; - } - $env['slim.input'] = $rawInput; - - //Error stream - $env['slim.errors'] = @fopen('php://stderr', 'w'); - - $this->properties = $env; - } - } - - /** - * Array Access: Offset Exists - */ - public function offsetExists($offset) - { - return isset($this->properties[$offset]); - } - - /** - * Array Access: Offset Get - */ - public function offsetGet($offset) - { - if (isset($this->properties[$offset])) { - return $this->properties[$offset]; - } - - return null; - } - - /** - * Array Access: Offset Set - */ - public function offsetSet($offset, $value) - { - $this->properties[$offset] = $value; - } - - /** - * Array Access: Offset Unset - */ - public function offsetUnset($offset) - { - unset($this->properties[$offset]); - } - - /** - * IteratorAggregate - * - * @return \ArrayIterator - */ - public function getIterator() - { - return new \ArrayIterator($this->properties); - } -} diff --git a/vendor/slim/slim/Slim/Exception/Pass.php b/vendor/slim/slim/Slim/Exception/Pass.php deleted file mode 100644 index 749cc50..0000000 --- a/vendor/slim/slim/Slim/Exception/Pass.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim\Exception; - -/** - * Pass Exception - * - * This Exception will cause the Router::dispatch method - * to skip the current matching route and continue to the next - * matching route. If no subsequent routes are found, a - * HTTP 404 Not Found response will be sent to the client. - * - * @package Slim - * @author Josh Lockhart - * @since 1.0.0 - */ -class Pass extends \Exception -{ -} diff --git a/vendor/slim/slim/Slim/Exception/Stop.php b/vendor/slim/slim/Slim/Exception/Stop.php deleted file mode 100644 index 6299361..0000000 --- a/vendor/slim/slim/Slim/Exception/Stop.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim\Exception; - -/** - * Stop Exception - * - * This Exception is thrown when the Slim application needs to abort - * processing and return control flow to the outer PHP script. - * - * @package Slim - * @author Josh Lockhart - * @since 1.0.0 - */ -class Stop extends \Exception -{ -} diff --git a/vendor/slim/slim/Slim/Helper/Set.php b/vendor/slim/slim/Slim/Helper/Set.php deleted file mode 100644 index 44a0fe2..0000000 --- a/vendor/slim/slim/Slim/Helper/Set.php +++ /dev/null @@ -1,246 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim\Helper; - -class Set implements \ArrayAccess, \Countable, \IteratorAggregate -{ - /** - * Key-value array of arbitrary data - * @var array - */ - protected $data = array(); - - /** - * Constructor - * @param array $items Pre-populate set with this key-value array - */ - public function __construct($items = array()) - { - $this->replace($items); - } - - /** - * Normalize data key - * - * Used to transform data key into the necessary - * key format for this set. Used in subclasses - * like \Slim\Http\Headers. - * - * @param string $key The data key - * @return mixed The transformed/normalized data key - */ - protected function normalizeKey($key) - { - return $key; - } - - /** - * Set data key to value - * @param string $key The data key - * @param mixed $value The data value - */ - public function set($key, $value) - { - $this->data[$this->normalizeKey($key)] = $value; - } - - /** - * Get data value with key - * @param string $key The data key - * @param mixed $default The value to return if data key does not exist - * @return mixed The data value, or the default value - */ - public function get($key, $default = null) - { - if ($this->has($key)) { - $isInvokable = is_object($this->data[$this->normalizeKey($key)]) && method_exists($this->data[$this->normalizeKey($key)], '__invoke'); - - return $isInvokable ? $this->data[$this->normalizeKey($key)]($this) : $this->data[$this->normalizeKey($key)]; - } - - return $default; - } - - /** - * Add data to set - * @param array $items Key-value array of data to append to this set - */ - public function replace($items) - { - foreach ($items as $key => $value) { - $this->set($key, $value); // Ensure keys are normalized - } - } - - /** - * Fetch set data - * @return array This set's key-value data array - */ - public function all() - { - return $this->data; - } - - /** - * Fetch set data keys - * @return array This set's key-value data array keys - */ - public function keys() - { - return array_keys($this->data); - } - - /** - * Does this set contain a key? - * @param string $key The data key - * @return boolean - */ - public function has($key) - { - return array_key_exists($this->normalizeKey($key), $this->data); - } - - /** - * Remove value with key from this set - * @param string $key The data key - */ - public function remove($key) - { - unset($this->data[$this->normalizeKey($key)]); - } - - /** - * Property Overloading - */ - - public function __get($key) - { - return $this->get($key); - } - - public function __set($key, $value) - { - $this->set($key, $value); - } - - public function __isset($key) - { - return $this->has($key); - } - - public function __unset($key) - { - $this->remove($key); - } - - /** - * Clear all values - */ - public function clear() - { - $this->data = array(); - } - - /** - * Array Access - */ - - public function offsetExists($offset) - { - return $this->has($offset); - } - - public function offsetGet($offset) - { - return $this->get($offset); - } - - public function offsetSet($offset, $value) - { - $this->set($offset, $value); - } - - public function offsetUnset($offset) - { - $this->remove($offset); - } - - /** - * Countable - */ - - public function count() - { - return count($this->data); - } - - /** - * IteratorAggregate - */ - - public function getIterator() - { - return new \ArrayIterator($this->data); - } - - /** - * Ensure a value or object will remain globally unique - * @param string $key The value or object name - * @param \Closure $value The closure that defines the object - * @return mixed - */ - public function singleton($key, $value) - { - $this->set($key, function ($c) use ($value) { - static $object; - - if (null === $object) { - $object = $value($c); - } - - return $object; - }); - } - - /** - * Protect closure from being directly invoked - * @param \Closure $callable A closure to keep from being invoked and evaluated - * @return \Closure - */ - public function protect(\Closure $callable) - { - return function () use ($callable) { - return $callable; - }; - } -} diff --git a/vendor/slim/slim/Slim/Http/Cookies.php b/vendor/slim/slim/Slim/Http/Cookies.php deleted file mode 100644 index 3472c93..0000000 --- a/vendor/slim/slim/Slim/Http/Cookies.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim\Http; - -class Cookies extends \Slim\Helper\Set -{ - /** - * Default cookie settings - * @var array - */ - protected $defaults = array( - 'value' => '', - 'domain' => null, - 'path' => null, - 'expires' => null, - 'secure' => false, - 'httponly' => false - ); - - /** - * Set cookie - * - * The second argument may be a single scalar value, in which case - * it will be merged with the default settings and considered the `value` - * of the merged result. - * - * The second argument may also be an array containing any or all of - * the keys shown in the default settings above. This array will be - * merged with the defaults shown above. - * - * @param string $key Cookie name - * @param mixed $value Cookie settings - */ - public function set($key, $value) - { - if (is_array($value)) { - $cookieSettings = array_replace($this->defaults, $value); - } else { - $cookieSettings = array_replace($this->defaults, array('value' => $value)); - } - parent::set($key, $cookieSettings); - } - - /** - * Remove cookie - * - * Unlike \Slim\Helper\Set, this will actually *set* a cookie with - * an expiration date in the past. This expiration date will force - * the client-side cache to remove its cookie with the given name - * and settings. - * - * @param string $key Cookie name - * @param array $settings Optional cookie settings - */ - public function remove($key, $settings = array()) - { - $settings['value'] = ''; - $settings['expires'] = time() - 86400; - $this->set($key, array_replace($this->defaults, $settings)); - } -} diff --git a/vendor/slim/slim/Slim/Http/Headers.php b/vendor/slim/slim/Slim/Http/Headers.php deleted file mode 100644 index 4745625..0000000 --- a/vendor/slim/slim/Slim/Http/Headers.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim\Http; - - /** - * HTTP Headers - * - * @package Slim - * @author Josh Lockhart - * @since 1.6.0 - */ -class Headers extends \Slim\Helper\Set -{ - /******************************************************************************** - * Static interface - *******************************************************************************/ - - /** - * Special-case HTTP headers that are otherwise unidentifiable as HTTP headers. - * Typically, HTTP headers in the $_SERVER array will be prefixed with - * `HTTP_` or `X_`. These are not so we list them here for later reference. - * - * @var array - */ - protected static $special = array( - 'CONTENT_TYPE', - 'CONTENT_LENGTH', - 'PHP_AUTH_USER', - 'PHP_AUTH_PW', - 'PHP_AUTH_DIGEST', - 'AUTH_TYPE' - ); - - /** - * Extract HTTP headers from an array of data (e.g. $_SERVER) - * @param array $data - * @return array - */ - public static function extract($data) - { - $results = array(); - foreach ($data as $key => $value) { - $key = strtoupper($key); - if (strpos($key, 'X_') === 0 || strpos($key, 'HTTP_') === 0 || in_array($key, static::$special)) { - if ($key === 'HTTP_CONTENT_LENGTH') { - continue; - } - $results[$key] = $value; - } - } - - return $results; - } - - /******************************************************************************** - * Instance interface - *******************************************************************************/ - - /** - * Transform header name into canonical form - * @param string $key - * @return string - */ - protected function normalizeKey($key) - { - $key = strtolower($key); - $key = str_replace(array('-', '_'), ' ', $key); - $key = preg_replace('#^http #', '', $key); - $key = ucwords($key); - $key = str_replace(' ', '-', $key); - - return $key; - } -} diff --git a/vendor/slim/slim/Slim/Http/Request.php b/vendor/slim/slim/Slim/Http/Request.php deleted file mode 100644 index a369466..0000000 --- a/vendor/slim/slim/Slim/Http/Request.php +++ /dev/null @@ -1,621 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim\Http; - -/** - * Slim HTTP Request - * - * This class provides a human-friendly interface to the Slim environment variables; - * environment variables are passed by reference and will be modified directly. - * - * @package Slim - * @author Josh Lockhart - * @since 1.0.0 - */ -class Request -{ - const METHOD_HEAD = 'HEAD'; - const METHOD_GET = 'GET'; - const METHOD_POST = 'POST'; - const METHOD_PUT = 'PUT'; - const METHOD_PATCH = 'PATCH'; - const METHOD_DELETE = 'DELETE'; - const METHOD_OPTIONS = 'OPTIONS'; - const METHOD_OVERRIDE = '_METHOD'; - - /** - * @var array - */ - protected static $formDataMediaTypes = array('application/x-www-form-urlencoded'); - - /** - * Application Environment - * @var \Slim\Environment - */ - protected $env; - - /** - * HTTP Headers - * @var \Slim\Http\Headers - */ - public $headers; - - /** - * HTTP Cookies - * @var \Slim\Helper\Set - */ - public $cookies; - - /** - * Constructor - * @param \Slim\Environment $env - */ - public function __construct(\Slim\Environment $env) - { - $this->env = $env; - $this->headers = new \Slim\Http\Headers(\Slim\Http\Headers::extract($env)); - $this->cookies = new \Slim\Helper\Set(\Slim\Http\Util::parseCookieHeader($env['HTTP_COOKIE'])); - } - - /** - * Get HTTP method - * @return string - */ - public function getMethod() - { - return $this->env['REQUEST_METHOD']; - } - - /** - * Is this a GET request? - * @return bool - */ - public function isGet() - { - return $this->getMethod() === self::METHOD_GET; - } - - /** - * Is this a POST request? - * @return bool - */ - public function isPost() - { - return $this->getMethod() === self::METHOD_POST; - } - - /** - * Is this a PUT request? - * @return bool - */ - public function isPut() - { - return $this->getMethod() === self::METHOD_PUT; - } - - /** - * Is this a PATCH request? - * @return bool - */ - public function isPatch() - { - return $this->getMethod() === self::METHOD_PATCH; - } - - /** - * Is this a DELETE request? - * @return bool - */ - public function isDelete() - { - return $this->getMethod() === self::METHOD_DELETE; - } - - /** - * Is this a HEAD request? - * @return bool - */ - public function isHead() - { - return $this->getMethod() === self::METHOD_HEAD; - } - - /** - * Is this a OPTIONS request? - * @return bool - */ - public function isOptions() - { - return $this->getMethod() === self::METHOD_OPTIONS; - } - - /** - * Is this an AJAX request? - * @return bool - */ - public function isAjax() - { - if ($this->params('isajax')) { - return true; - } elseif (isset($this->headers['X_REQUESTED_WITH']) && $this->headers['X_REQUESTED_WITH'] === 'XMLHttpRequest') { - return true; - } - - return false; - } - - /** - * Is this an XHR request? (alias of Slim_Http_Request::isAjax) - * @return bool - */ - public function isXhr() - { - return $this->isAjax(); - } - - /** - * Fetch GET and POST data - * - * This method returns a union of GET and POST data as a key-value array, or the value - * of the array key if requested; if the array key does not exist, NULL is returned, - * unless there is a default value specified. - * - * @param string $key - * @param mixed $default - * @return array|mixed|null - */ - public function params($key = null, $default = null) - { - $union = array_merge($this->get(), $this->post()); - if ($key) { - return isset($union[$key]) ? $union[$key] : $default; - } - - return $union; - } - - /** - * Fetch GET data - * - * This method returns a key-value array of data sent in the HTTP request query string, or - * the value of the array key if requested; if the array key does not exist, NULL is returned. - * - * @param string $key - * @param mixed $default Default return value when key does not exist - * @return array|mixed|null - */ - public function get($key = null, $default = null) - { - if (!isset($this->env['slim.request.query_hash'])) { - $output = array(); - if (function_exists('mb_parse_str') && !isset($this->env['slim.tests.ignore_multibyte'])) { - mb_parse_str($this->env['QUERY_STRING'], $output); - } else { - parse_str($this->env['QUERY_STRING'], $output); - } - $this->env['slim.request.query_hash'] = Util::stripSlashesIfMagicQuotes($output); - } - if ($key) { - if (isset($this->env['slim.request.query_hash'][$key])) { - return $this->env['slim.request.query_hash'][$key]; - } else { - return $default; - } - } else { - return $this->env['slim.request.query_hash']; - } - } - - /** - * Fetch POST data - * - * This method returns a key-value array of data sent in the HTTP request body, or - * the value of a hash key if requested; if the array key does not exist, NULL is returned. - * - * @param string $key - * @param mixed $default Default return value when key does not exist - * @return array|mixed|null - * @throws \RuntimeException If environment input is not available - */ - public function post($key = null, $default = null) - { - if (!isset($this->env['slim.input'])) { - throw new \RuntimeException('Missing slim.input in environment variables'); - } - if (!isset($this->env['slim.request.form_hash'])) { - $this->env['slim.request.form_hash'] = array(); - if ($this->isFormData() && is_string($this->env['slim.input'])) { - $output = array(); - if (function_exists('mb_parse_str') && !isset($this->env['slim.tests.ignore_multibyte'])) { - mb_parse_str($this->env['slim.input'], $output); - } else { - parse_str($this->env['slim.input'], $output); - } - $this->env['slim.request.form_hash'] = Util::stripSlashesIfMagicQuotes($output); - } else { - $this->env['slim.request.form_hash'] = Util::stripSlashesIfMagicQuotes($_POST); - } - } - if ($key) { - if (isset($this->env['slim.request.form_hash'][$key])) { - return $this->env['slim.request.form_hash'][$key]; - } else { - return $default; - } - } else { - return $this->env['slim.request.form_hash']; - } - } - - /** - * Fetch PUT data (alias for \Slim\Http\Request::post) - * @param string $key - * @param mixed $default Default return value when key does not exist - * @return array|mixed|null - */ - public function put($key = null, $default = null) - { - return $this->post($key, $default); - } - - /** - * Fetch PATCH data (alias for \Slim\Http\Request::post) - * @param string $key - * @param mixed $default Default return value when key does not exist - * @return array|mixed|null - */ - public function patch($key = null, $default = null) - { - return $this->post($key, $default); - } - - /** - * Fetch DELETE data (alias for \Slim\Http\Request::post) - * @param string $key - * @param mixed $default Default return value when key does not exist - * @return array|mixed|null - */ - public function delete($key = null, $default = null) - { - return $this->post($key, $default); - } - - /** - * Fetch COOKIE data - * - * This method returns a key-value array of Cookie data sent in the HTTP request, or - * the value of a array key if requested; if the array key does not exist, NULL is returned. - * - * @param string $key - * @return array|string|null - */ - public function cookies($key = null) - { - if ($key) { - return $this->cookies->get($key); - } - - return $this->cookies; - // if (!isset($this->env['slim.request.cookie_hash'])) { - // $cookieHeader = isset($this->env['COOKIE']) ? $this->env['COOKIE'] : ''; - // $this->env['slim.request.cookie_hash'] = Util::parseCookieHeader($cookieHeader); - // } - // if ($key) { - // if (isset($this->env['slim.request.cookie_hash'][$key])) { - // return $this->env['slim.request.cookie_hash'][$key]; - // } else { - // return null; - // } - // } else { - // return $this->env['slim.request.cookie_hash']; - // } - } - - /** - * Does the Request body contain parsed form data? - * @return bool - */ - public function isFormData() - { - $method = isset($this->env['slim.method_override.original_method']) ? $this->env['slim.method_override.original_method'] : $this->getMethod(); - - return ($method === self::METHOD_POST && is_null($this->getContentType())) || in_array($this->getMediaType(), self::$formDataMediaTypes); - } - - /** - * Get Headers - * - * This method returns a key-value array of headers sent in the HTTP request, or - * the value of a hash key if requested; if the array key does not exist, NULL is returned. - * - * @param string $key - * @param mixed $default The default value returned if the requested header is not available - * @return mixed - */ - public function headers($key = null, $default = null) - { - if ($key) { - return $this->headers->get($key, $default); - } - - return $this->headers; - // if ($key) { - // $key = strtoupper($key); - // $key = str_replace('-', '_', $key); - // $key = preg_replace('@^HTTP_@', '', $key); - // if (isset($this->env[$key])) { - // return $this->env[$key]; - // } else { - // return $default; - // } - // } else { - // $headers = array(); - // foreach ($this->env as $key => $value) { - // if (strpos($key, 'slim.') !== 0) { - // $headers[$key] = $value; - // } - // } - // - // return $headers; - // } - } - - /** - * Get Body - * @return string - */ - public function getBody() - { - return $this->env['slim.input']; - } - - /** - * Get Content Type - * @return string|null - */ - public function getContentType() - { - return $this->headers->get('CONTENT_TYPE'); - } - - /** - * Get Media Type (type/subtype within Content Type header) - * @return string|null - */ - public function getMediaType() - { - $contentType = $this->getContentType(); - if ($contentType) { - $contentTypeParts = preg_split('/\s*[;,]\s*/', $contentType); - - return strtolower($contentTypeParts[0]); - } - - return null; - } - - /** - * Get Media Type Params - * @return array - */ - public function getMediaTypeParams() - { - $contentType = $this->getContentType(); - $contentTypeParams = array(); - if ($contentType) { - $contentTypeParts = preg_split('/\s*[;,]\s*/', $contentType); - $contentTypePartsLength = count($contentTypeParts); - for ($i = 1; $i < $contentTypePartsLength; $i++) { - $paramParts = explode('=', $contentTypeParts[$i]); - $contentTypeParams[strtolower($paramParts[0])] = $paramParts[1]; - } - } - - return $contentTypeParams; - } - - /** - * Get Content Charset - * @return string|null - */ - public function getContentCharset() - { - $mediaTypeParams = $this->getMediaTypeParams(); - if (isset($mediaTypeParams['charset'])) { - return $mediaTypeParams['charset']; - } - - return null; - } - - /** - * Get Content-Length - * @return int - */ - public function getContentLength() - { - return $this->headers->get('CONTENT_LENGTH', 0); - } - - /** - * Get Host - * @return string - */ - public function getHost() - { - if (isset($this->env['HTTP_HOST'])) { - if(preg_match('/^(\[[a-fA-F0-9:.]+\])(:\d+)?\z/', $this->env['HTTP_HOST'], $matches)) { - return $matches[1]; - } else { - if (strpos($this->env['HTTP_HOST'], ':') !== false) { - $hostParts = explode(':', $this->env['HTTP_HOST']); - - return $hostParts[0]; - } - } - - return $this->env['HTTP_HOST']; - } - - return $this->env['SERVER_NAME']; - } - - /** - * Get Host with Port - * @return string - */ - public function getHostWithPort() - { - return sprintf('%s:%s', $this->getHost(), $this->getPort()); - } - - /** - * Get Port - * @return int - */ - public function getPort() - { - return (int)$this->env['SERVER_PORT']; - } - - /** - * Get Scheme (https or http) - * @return string - */ - public function getScheme() - { - return $this->env['slim.url_scheme']; - } - - /** - * Get Script Name (physical path) - * @return string - */ - public function getScriptName() - { - return $this->env['SCRIPT_NAME']; - } - - /** - * LEGACY: Get Root URI (alias for Slim_Http_Request::getScriptName) - * @return string - */ - public function getRootUri() - { - return $this->getScriptName(); - } - - /** - * Get Path (physical path + virtual path) - * @return string - */ - public function getPath() - { - return $this->getScriptName() . $this->getPathInfo(); - } - - /** - * Get Path Info (virtual path) - * @return string - */ - public function getPathInfo() - { - return $this->env['PATH_INFO']; - } - - /** - * LEGACY: Get Resource URI (alias for Slim_Http_Request::getPathInfo) - * @return string - */ - public function getResourceUri() - { - return $this->getPathInfo(); - } - - /** - * Get URL (scheme + host [ + port if non-standard ]) - * @return string - */ - public function getUrl() - { - $url = $this->getScheme() . '://' . $this->getHost(); - if (($this->getScheme() === 'https' && $this->getPort() !== 443) || ($this->getScheme() === 'http' && $this->getPort() !== 80)) { - $url .= sprintf(':%s', $this->getPort()); - } - - return $url; - } - - /** - * Get IP - * @return string - */ - public function getIp() - { - $keys = array('X_FORWARDED_FOR', 'HTTP_X_FORWARDED_FOR', 'CLIENT_IP', 'REMOTE_ADDR'); - foreach ($keys as $key) { - if (isset($this->env[$key])) { - return $this->env[$key]; - } - } - - return $this->env['REMOTE_ADDR']; - } - - /** - * Get Referrer - * @return string|null - */ - public function getReferrer() - { - return $this->headers->get('HTTP_REFERER'); - } - - /** - * Get Referer (for those who can't spell) - * @return string|null - */ - public function getReferer() - { - return $this->getReferrer(); - } - - /** - * Get User Agent - * @return string|null - */ - public function getUserAgent() - { - return $this->headers->get('HTTP_USER_AGENT'); - } -} diff --git a/vendor/slim/slim/Slim/Http/Response.php b/vendor/slim/slim/Slim/Http/Response.php deleted file mode 100644 index 1a5dedb..0000000 --- a/vendor/slim/slim/Slim/Http/Response.php +++ /dev/null @@ -1,520 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim\Http; - -/** - * Response - * - * This is a simple abstraction over top an HTTP response. This - * provides methods to set the HTTP status, the HTTP headers, - * and the HTTP body. - * - * @package Slim - * @author Josh Lockhart - * @since 1.0.0 - */ -class Response implements \ArrayAccess, \Countable, \IteratorAggregate -{ - /** - * @var int HTTP status code - */ - protected $status; - - /** - * @var \Slim\Http\Headers - */ - public $headers; - - /** - * @var \Slim\Http\Cookies - */ - public $cookies; - - /** - * @var string HTTP response body - */ - protected $body; - - /** - * @var int Length of HTTP response body - */ - protected $length; - - /** - * @var array HTTP response codes and messages - */ - protected static $messages = array( - //Informational 1xx - 100 => '100 Continue', - 101 => '101 Switching Protocols', - //Successful 2xx - 200 => '200 OK', - 201 => '201 Created', - 202 => '202 Accepted', - 203 => '203 Non-Authoritative Information', - 204 => '204 No Content', - 205 => '205 Reset Content', - 206 => '206 Partial Content', - 226 => '226 IM Used', - //Redirection 3xx - 300 => '300 Multiple Choices', - 301 => '301 Moved Permanently', - 302 => '302 Found', - 303 => '303 See Other', - 304 => '304 Not Modified', - 305 => '305 Use Proxy', - 306 => '306 (Unused)', - 307 => '307 Temporary Redirect', - //Client Error 4xx - 400 => '400 Bad Request', - 401 => '401 Unauthorized', - 402 => '402 Payment Required', - 403 => '403 Forbidden', - 404 => '404 Not Found', - 405 => '405 Method Not Allowed', - 406 => '406 Not Acceptable', - 407 => '407 Proxy Authentication Required', - 408 => '408 Request Timeout', - 409 => '409 Conflict', - 410 => '410 Gone', - 411 => '411 Length Required', - 412 => '412 Precondition Failed', - 413 => '413 Request Entity Too Large', - 414 => '414 Request-URI Too Long', - 415 => '415 Unsupported Media Type', - 416 => '416 Requested Range Not Satisfiable', - 417 => '417 Expectation Failed', - 418 => '418 I\'m a teapot', - 422 => '422 Unprocessable Entity', - 423 => '423 Locked', - 426 => '426 Upgrade Required', - 428 => '428 Precondition Required', - 429 => '429 Too Many Requests', - 431 => '431 Request Header Fields Too Large', - //Server Error 5xx - 500 => '500 Internal Server Error', - 501 => '501 Not Implemented', - 502 => '502 Bad Gateway', - 503 => '503 Service Unavailable', - 504 => '504 Gateway Timeout', - 505 => '505 HTTP Version Not Supported', - 506 => '506 Variant Also Negotiates', - 510 => '510 Not Extended', - 511 => '511 Network Authentication Required' - ); - - /** - * Constructor - * @param string $body The HTTP response body - * @param int $status The HTTP response status - * @param \Slim\Http\Headers|array $headers The HTTP response headers - */ - public function __construct($body = '', $status = 200, $headers = array()) - { - $this->setStatus($status); - $this->headers = new \Slim\Http\Headers(array('Content-Type' => 'text/html')); - $this->headers->replace($headers); - $this->cookies = new \Slim\Http\Cookies(); - $this->write($body); - } - - public function getStatus() - { - return $this->status; - } - - public function setStatus($status) - { - $this->status = (int)$status; - } - - /** - * DEPRECATION WARNING! Use `getStatus` or `setStatus` instead. - * - * Get and set status - * @param int|null $status - * @return int - */ - public function status($status = null) - { - if (!is_null($status)) { - $this->status = (int) $status; - } - - return $this->status; - } - - /** - * DEPRECATION WARNING! Access `headers` property directly. - * - * Get and set header - * @param string $name Header name - * @param string|null $value Header value - * @return string Header value - */ - public function header($name, $value = null) - { - if (!is_null($value)) { - $this->headers->set($name, $value); - } - - return $this->headers->get($name); - } - - /** - * DEPRECATION WARNING! Access `headers` property directly. - * - * Get headers - * @return \Slim\Http\Headers - */ - public function headers() - { - return $this->headers; - } - - public function getBody() - { - return $this->body; - } - - public function setBody($content) - { - $this->write($content, true); - } - - /** - * DEPRECATION WARNING! use `getBody` or `setBody` instead. - * - * Get and set body - * @param string|null $body Content of HTTP response body - * @return string - */ - public function body($body = null) - { - if (!is_null($body)) { - $this->write($body, true); - } - - return $this->body; - } - - /** - * Append HTTP response body - * @param string $body Content to append to the current HTTP response body - * @param bool $replace Overwrite existing response body? - * @return string The updated HTTP response body - */ - public function write($body, $replace = false) - { - if ($replace) { - $this->body = $body; - } else { - $this->body .= (string)$body; - } - $this->length = strlen($this->body); - - return $this->body; - } - - public function getLength() - { - return $this->length; - } - - /** - * DEPRECATION WARNING! Use `getLength` or `write` or `body` instead. - * - * Get and set length - * @param int|null $length - * @return int - */ - public function length($length = null) - { - if (!is_null($length)) { - $this->length = (int) $length; - } - - return $this->length; - } - - /** - * Finalize - * - * This prepares this response and returns an array - * of [status, headers, body]. This array is passed to outer middleware - * if available or directly to the Slim run method. - * - * @return array[int status, array headers, string body] - */ - public function finalize() - { - // Prepare response - if (in_array($this->status, array(204, 304))) { - $this->headers->remove('Content-Type'); - $this->headers->remove('Content-Length'); - $this->setBody(''); - } - - return array($this->status, $this->headers, $this->body); - } - - /** - * DEPRECATION WARNING! Access `cookies` property directly. - * - * Set cookie - * - * Instead of using PHP's `setcookie()` function, Slim manually constructs the HTTP `Set-Cookie` - * header on its own and delegates this responsibility to the `Slim_Http_Util` class. This - * response's header is passed by reference to the utility class and is directly modified. By not - * relying on PHP's native implementation, Slim allows middleware the opportunity to massage or - * analyze the raw header before the response is ultimately delivered to the HTTP client. - * - * @param string $name The name of the cookie - * @param string|array $value If string, the value of cookie; if array, properties for - * cookie including: value, expire, path, domain, secure, httponly - */ - public function setCookie($name, $value) - { - // Util::setCookieHeader($this->header, $name, $value); - $this->cookies->set($name, $value); - } - - /** - * DEPRECATION WARNING! Access `cookies` property directly. - * - * Delete cookie - * - * Instead of using PHP's `setcookie()` function, Slim manually constructs the HTTP `Set-Cookie` - * header on its own and delegates this responsibility to the `Slim_Http_Util` class. This - * response's header is passed by reference to the utility class and is directly modified. By not - * relying on PHP's native implementation, Slim allows middleware the opportunity to massage or - * analyze the raw header before the response is ultimately delivered to the HTTP client. - * - * This method will set a cookie with the given name that has an expiration time in the past; this will - * prompt the HTTP client to invalidate and remove the client-side cookie. Optionally, you may - * also pass a key/value array as the second argument. If the "domain" key is present in this - * array, only the Cookie with the given name AND domain will be removed. The invalidating cookie - * sent with this response will adopt all properties of the second argument. - * - * @param string $name The name of the cookie - * @param array $settings Properties for cookie including: value, expire, path, domain, secure, httponly - */ - public function deleteCookie($name, $settings = array()) - { - $this->cookies->remove($name, $settings); - // Util::deleteCookieHeader($this->header, $name, $value); - } - - /** - * Redirect - * - * This method prepares this response to return an HTTP Redirect response - * to the HTTP client. - * - * @param string $url The redirect destination - * @param int $status The redirect HTTP status code - */ - public function redirect ($url, $status = 302) - { - $this->setStatus($status); - $this->headers->set('Location', $url); - } - - /** - * Helpers: Empty? - * @return bool - */ - public function isEmpty() - { - return in_array($this->status, array(201, 204, 304)); - } - - /** - * Helpers: Informational? - * @return bool - */ - public function isInformational() - { - return $this->status >= 100 && $this->status < 200; - } - - /** - * Helpers: OK? - * @return bool - */ - public function isOk() - { - return $this->status === 200; - } - - /** - * Helpers: Successful? - * @return bool - */ - public function isSuccessful() - { - return $this->status >= 200 && $this->status < 300; - } - - /** - * Helpers: Redirect? - * @return bool - */ - public function isRedirect() - { - return in_array($this->status, array(301, 302, 303, 307)); - } - - /** - * Helpers: Redirection? - * @return bool - */ - public function isRedirection() - { - return $this->status >= 300 && $this->status < 400; - } - - /** - * Helpers: Forbidden? - * @return bool - */ - public function isForbidden() - { - return $this->status === 403; - } - - /** - * Helpers: Not Found? - * @return bool - */ - public function isNotFound() - { - return $this->status === 404; - } - - /** - * Helpers: Client error? - * @return bool - */ - public function isClientError() - { - return $this->status >= 400 && $this->status < 500; - } - - /** - * Helpers: Server Error? - * @return bool - */ - public function isServerError() - { - return $this->status >= 500 && $this->status < 600; - } - - /** - * DEPRECATION WARNING! ArrayAccess interface will be removed from \Slim\Http\Response. - * Iterate `headers` or `cookies` properties directly. - */ - - /** - * Array Access: Offset Exists - */ - public function offsetExists($offset) - { - return isset($this->headers[$offset]); - } - - /** - * Array Access: Offset Get - */ - public function offsetGet($offset) - { - return $this->headers[$offset]; - } - - /** - * Array Access: Offset Set - */ - public function offsetSet($offset, $value) - { - $this->headers[$offset] = $value; - } - - /** - * Array Access: Offset Unset - */ - public function offsetUnset($offset) - { - unset($this->headers[$offset]); - } - - /** - * DEPRECATION WARNING! Countable interface will be removed from \Slim\Http\Response. - * Call `count` on `headers` or `cookies` properties directly. - * - * Countable: Count - */ - public function count() - { - return count($this->headers); - } - - /** - * DEPRECATION WARNING! IteratorAggregate interface will be removed from \Slim\Http\Response. - * Iterate `headers` or `cookies` properties directly. - * - * Get Iterator - * - * This returns the contained `\Slim\Http\Headers` instance which - * is itself iterable. - * - * @return \Slim\Http\Headers - */ - public function getIterator() - { - return $this->headers->getIterator(); - } - - /** - * Get message for HTTP status code - * @param int $status - * @return string|null - */ - public static function getMessageForCode($status) - { - if (isset(self::$messages[$status])) { - return self::$messages[$status]; - } else { - return null; - } - } -} diff --git a/vendor/slim/slim/Slim/Http/Util.php b/vendor/slim/slim/Slim/Http/Util.php deleted file mode 100644 index ff53d7e..0000000 --- a/vendor/slim/slim/Slim/Http/Util.php +++ /dev/null @@ -1,434 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim\Http; - -/** - * Slim HTTP Utilities - * - * This class provides useful methods for handling HTTP requests. - * - * @package Slim - * @author Josh Lockhart - * @since 1.0.0 - */ -class Util -{ - /** - * Strip slashes from string or array - * - * This method strips slashes from its input. By default, this method will only - * strip slashes from its input if magic quotes are enabled. Otherwise, you may - * override the magic quotes setting with either TRUE or FALSE as the send argument - * to force this method to strip or not strip slashes from its input. - * - * @param array|string $rawData - * @param bool $overrideStripSlashes - * @return array|string - */ - public static function stripSlashesIfMagicQuotes($rawData, $overrideStripSlashes = null) - { - $strip = is_null($overrideStripSlashes) ? get_magic_quotes_gpc() : $overrideStripSlashes; - if ($strip) { - return self::stripSlashes($rawData); - } - - return $rawData; - } - - /** - * Strip slashes from string or array - * @param array|string $rawData - * @return array|string - */ - protected static function stripSlashes($rawData) - { - return is_array($rawData) ? array_map(array('self', 'stripSlashes'), $rawData) : stripslashes($rawData); - } - - /** - * Encrypt data - * - * This method will encrypt data using a given key, vector, and cipher. - * By default, this will encrypt data using the RIJNDAEL/AES 256 bit cipher. You - * may override the default cipher and cipher mode by passing your own desired - * cipher and cipher mode as the final key-value array argument. - * - * @param string $data The unencrypted data - * @param string $key The encryption key - * @param string $iv The encryption initialization vector - * @param array $settings Optional key-value array with custom algorithm and mode - * @return string - */ - public static function encrypt($data, $key, $iv, $settings = array()) - { - if ($data === '' || !extension_loaded('mcrypt')) { - return $data; - } - - //Merge settings with defaults - $defaults = array( - 'algorithm' => MCRYPT_RIJNDAEL_256, - 'mode' => MCRYPT_MODE_CBC - ); - $settings = array_merge($defaults, $settings); - - //Get module - $module = mcrypt_module_open($settings['algorithm'], '', $settings['mode'], ''); - - //Validate IV - $ivSize = mcrypt_enc_get_iv_size($module); - if (strlen($iv) > $ivSize) { - $iv = substr($iv, 0, $ivSize); - } - - //Validate key - $keySize = mcrypt_enc_get_key_size($module); - if (strlen($key) > $keySize) { - $key = substr($key, 0, $keySize); - } - - //Encrypt value - mcrypt_generic_init($module, $key, $iv); - $res = @mcrypt_generic($module, $data); - mcrypt_generic_deinit($module); - - return $res; - } - - /** - * Decrypt data - * - * This method will decrypt data using a given key, vector, and cipher. - * By default, this will decrypt data using the RIJNDAEL/AES 256 bit cipher. You - * may override the default cipher and cipher mode by passing your own desired - * cipher and cipher mode as the final key-value array argument. - * - * @param string $data The encrypted data - * @param string $key The encryption key - * @param string $iv The encryption initialization vector - * @param array $settings Optional key-value array with custom algorithm and mode - * @return string - */ - public static function decrypt($data, $key, $iv, $settings = array()) - { - if ($data === '' || !extension_loaded('mcrypt')) { - return $data; - } - - //Merge settings with defaults - $defaults = array( - 'algorithm' => MCRYPT_RIJNDAEL_256, - 'mode' => MCRYPT_MODE_CBC - ); - $settings = array_merge($defaults, $settings); - - //Get module - $module = mcrypt_module_open($settings['algorithm'], '', $settings['mode'], ''); - - //Validate IV - $ivSize = mcrypt_enc_get_iv_size($module); - if (strlen($iv) > $ivSize) { - $iv = substr($iv, 0, $ivSize); - } - - //Validate key - $keySize = mcrypt_enc_get_key_size($module); - if (strlen($key) > $keySize) { - $key = substr($key, 0, $keySize); - } - - //Decrypt value - mcrypt_generic_init($module, $key, $iv); - $decryptedData = @mdecrypt_generic($module, $data); - $res = rtrim($decryptedData, "\0"); - mcrypt_generic_deinit($module); - - return $res; - } - - /** - * Serialize Response cookies into raw HTTP header - * @param \Slim\Http\Headers $headers The Response headers - * @param \Slim\Http\Cookies $cookies The Response cookies - * @param array $config The Slim app settings - */ - public static function serializeCookies(\Slim\Http\Headers &$headers, \Slim\Http\Cookies $cookies, array $config) - { - if ($config['cookies.encrypt']) { - foreach ($cookies as $name => $settings) { - if (is_string($settings['expires'])) { - $expires = strtotime($settings['expires']); - } else { - $expires = (int) $settings['expires']; - } - - $settings['value'] = static::encodeSecureCookie( - $settings['value'], - $expires, - $config['cookies.secret_key'], - $config['cookies.cipher'], - $config['cookies.cipher_mode'] - ); - static::setCookieHeader($headers, $name, $settings); - } - } else { - foreach ($cookies as $name => $settings) { - static::setCookieHeader($headers, $name, $settings); - } - } - } - - /** - * Encode secure cookie value - * - * This method will create the secure value of an HTTP cookie. The - * cookie value is encrypted and hashed so that its value is - * secure and checked for integrity when read in subsequent requests. - * - * @param string $value The insecure HTTP cookie value - * @param int $expires The UNIX timestamp at which this cookie will expire - * @param string $secret The secret key used to hash the cookie value - * @param int $algorithm The algorithm to use for encryption - * @param int $mode The algorithm mode to use for encryption - * @return string - */ - public static function encodeSecureCookie($value, $expires, $secret, $algorithm, $mode) - { - $key = hash_hmac('sha1', (string) $expires, $secret); - $iv = self::getIv($expires, $secret); - $secureString = base64_encode( - self::encrypt( - $value, - $key, - $iv, - array( - 'algorithm' => $algorithm, - 'mode' => $mode - ) - ) - ); - $verificationString = hash_hmac('sha1', $expires . $value, $key); - - return implode('|', array($expires, $secureString, $verificationString)); - } - - /** - * Decode secure cookie value - * - * This method will decode the secure value of an HTTP cookie. The - * cookie value is encrypted and hashed so that its value is - * secure and checked for integrity when read in subsequent requests. - * - * @param string $value The secure HTTP cookie value - * @param string $secret The secret key used to hash the cookie value - * @param int $algorithm The algorithm to use for encryption - * @param int $mode The algorithm mode to use for encryption - * @return bool|string - */ - public static function decodeSecureCookie($value, $secret, $algorithm, $mode) - { - if ($value) { - $value = explode('|', $value); - if (count($value) === 3 && ((int) $value[0] === 0 || (int) $value[0] > time())) { - $key = hash_hmac('sha1', $value[0], $secret); - $iv = self::getIv($value[0], $secret); - $data = self::decrypt( - base64_decode($value[1]), - $key, - $iv, - array( - 'algorithm' => $algorithm, - 'mode' => $mode - ) - ); - $verificationString = hash_hmac('sha1', $value[0] . $data, $key); - if ($verificationString === $value[2]) { - return $data; - } - } - } - - return false; - } - - /** - * Set HTTP cookie header - * - * This method will construct and set the HTTP `Set-Cookie` header. Slim - * uses this method instead of PHP's native `setcookie` method. This allows - * more control of the HTTP header irrespective of the native implementation's - * dependency on PHP versions. - * - * This method accepts the Slim_Http_Headers object by reference as its - * first argument; this method directly modifies this object instead of - * returning a value. - * - * @param array $header - * @param string $name - * @param string $value - */ - public static function setCookieHeader(&$header, $name, $value) - { - //Build cookie header - if (is_array($value)) { - $domain = ''; - $path = ''; - $expires = ''; - $secure = ''; - $httponly = ''; - if (isset($value['domain']) && $value['domain']) { - $domain = '; domain=' . $value['domain']; - } - if (isset($value['path']) && $value['path']) { - $path = '; path=' . $value['path']; - } - if (isset($value['expires'])) { - if (is_string($value['expires'])) { - $timestamp = strtotime($value['expires']); - } else { - $timestamp = (int) $value['expires']; - } - if ($timestamp !== 0) { - $expires = '; expires=' . gmdate('D, d-M-Y H:i:s e', $timestamp); - } - } - if (isset($value['secure']) && $value['secure']) { - $secure = '; secure'; - } - if (isset($value['httponly']) && $value['httponly']) { - $httponly = '; HttpOnly'; - } - $cookie = sprintf('%s=%s%s', urlencode($name), urlencode((string) $value['value']), $domain . $path . $expires . $secure . $httponly); - } else { - $cookie = sprintf('%s=%s', urlencode($name), urlencode((string) $value)); - } - - //Set cookie header - if (!isset($header['Set-Cookie']) || $header['Set-Cookie'] === '') { - $header['Set-Cookie'] = $cookie; - } else { - $header['Set-Cookie'] = implode("\n", array($header['Set-Cookie'], $cookie)); - } - } - - /** - * Delete HTTP cookie header - * - * This method will construct and set the HTTP `Set-Cookie` header to invalidate - * a client-side HTTP cookie. If a cookie with the same name (and, optionally, domain) - * is already set in the HTTP response, it will also be removed. Slim uses this method - * instead of PHP's native `setcookie` method. This allows more control of the HTTP header - * irrespective of PHP's native implementation's dependency on PHP versions. - * - * This method accepts the Slim_Http_Headers object by reference as its - * first argument; this method directly modifies this object instead of - * returning a value. - * - * @param array $header - * @param string $name - * @param array $value - */ - public static function deleteCookieHeader(&$header, $name, $value = array()) - { - //Remove affected cookies from current response header - $cookiesOld = array(); - $cookiesNew = array(); - if (isset($header['Set-Cookie'])) { - $cookiesOld = explode("\n", $header['Set-Cookie']); - } - foreach ($cookiesOld as $c) { - if (isset($value['domain']) && $value['domain']) { - $regex = sprintf('@%s=.*domain=%s@', urlencode($name), preg_quote($value['domain'])); - } else { - $regex = sprintf('@%s=@', urlencode($name)); - } - if (preg_match($regex, $c) === 0) { - $cookiesNew[] = $c; - } - } - if ($cookiesNew) { - $header['Set-Cookie'] = implode("\n", $cookiesNew); - } else { - unset($header['Set-Cookie']); - } - - //Set invalidating cookie to clear client-side cookie - self::setCookieHeader($header, $name, array_merge(array('value' => '', 'path' => null, 'domain' => null, 'expires' => time() - 100), $value)); - } - - /** - * Parse cookie header - * - * This method will parse the HTTP request's `Cookie` header - * and extract cookies into an associative array. - * - * @param string - * @return array - */ - public static function parseCookieHeader($header) - { - $cookies = array(); - $header = rtrim($header, "\r\n"); - $headerPieces = preg_split('@\s*[;,]\s*@', $header); - foreach ($headerPieces as $c) { - $cParts = explode('=', $c, 2); - if (count($cParts) === 2) { - $key = urldecode($cParts[0]); - $value = urldecode($cParts[1]); - if (!isset($cookies[$key])) { - $cookies[$key] = $value; - } - } - } - - return $cookies; - } - - /** - * Generate a random IV - * - * This method will generate a non-predictable IV for use with - * the cookie encryption - * - * @param int $expires The UNIX timestamp at which this cookie will expire - * @param string $secret The secret key used to hash the cookie value - * @return string Hash - */ - private static function getIv($expires, $secret) - { - $data1 = hash_hmac('sha1', 'a'.$expires.'b', $secret); - $data2 = hash_hmac('sha1', 'z'.$expires.'y', $secret); - - return pack("h*", $data1.$data2); - } -} diff --git a/vendor/slim/slim/Slim/Log.php b/vendor/slim/slim/Slim/Log.php deleted file mode 100644 index 57e1f35..0000000 --- a/vendor/slim/slim/Slim/Log.php +++ /dev/null @@ -1,354 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim; - -/** - * Log - * - * This is the primary logger for a Slim application. You may provide - * a Log Writer in conjunction with this Log to write to various output - * destinations (e.g. a file). This class provides this interface: - * - * debug( mixed $object, array $context ) - * info( mixed $object, array $context ) - * notice( mixed $object, array $context ) - * warning( mixed $object, array $context ) - * error( mixed $object, array $context ) - * critical( mixed $object, array $context ) - * alert( mixed $object, array $context ) - * emergency( mixed $object, array $context ) - * log( mixed $level, mixed $object, array $context ) - * - * This class assumes only that your Log Writer has a public `write()` method - * that accepts any object as its one and only argument. The Log Writer - * class may write or send its argument anywhere: a file, STDERR, - * a remote web API, etc. The possibilities are endless. - * - * @package Slim - * @author Josh Lockhart - * @since 1.0.0 - */ -class Log -{ - const EMERGENCY = 1; - const ALERT = 2; - const CRITICAL = 3; - const FATAL = 3; //DEPRECATED replace with CRITICAL - const ERROR = 4; - const WARN = 5; - const NOTICE = 6; - const INFO = 7; - const DEBUG = 8; - - /** - * @var array - */ - protected static $levels = array( - self::EMERGENCY => 'EMERGENCY', - self::ALERT => 'ALERT', - self::CRITICAL => 'CRITICAL', - self::ERROR => 'ERROR', - self::WARN => 'WARNING', - self::NOTICE => 'NOTICE', - self::INFO => 'INFO', - self::DEBUG => 'DEBUG' - ); - - /** - * @var mixed - */ - protected $writer; - - /** - * @var bool - */ - protected $enabled; - - /** - * @var int - */ - protected $level; - - /** - * Constructor - * @param mixed $writer - */ - public function __construct($writer) - { - $this->writer = $writer; - $this->enabled = true; - $this->level = self::DEBUG; - } - - /** - * Is logging enabled? - * @return bool - */ - public function getEnabled() - { - return $this->enabled; - } - - /** - * Enable or disable logging - * @param bool $enabled - */ - public function setEnabled($enabled) - { - if ($enabled) { - $this->enabled = true; - } else { - $this->enabled = false; - } - } - - /** - * Set level - * @param int $level - * @throws \InvalidArgumentException If invalid log level specified - */ - public function setLevel($level) - { - if (!isset(self::$levels[$level])) { - throw new \InvalidArgumentException('Invalid log level'); - } - $this->level = $level; - } - - /** - * Get level - * @return int - */ - public function getLevel() - { - return $this->level; - } - - /** - * Set writer - * @param mixed $writer - */ - public function setWriter($writer) - { - $this->writer = $writer; - } - - /** - * Get writer - * @return mixed - */ - public function getWriter() - { - return $this->writer; - } - - /** - * Is logging enabled? - * @return bool - */ - public function isEnabled() - { - return $this->enabled; - } - - /** - * Log debug message - * @param mixed $object - * @param array $context - * @return mixed|bool What the Logger returns, or false if Logger not set or not enabled - */ - public function debug($object, $context = array()) - { - return $this->log(self::DEBUG, $object, $context); - } - - /** - * Log info message - * @param mixed $object - * @param array $context - * @return mixed|bool What the Logger returns, or false if Logger not set or not enabled - */ - public function info($object, $context = array()) - { - return $this->log(self::INFO, $object, $context); - } - - /** - * Log notice message - * @param mixed $object - * @param array $context - * @return mixed|bool What the Logger returns, or false if Logger not set or not enabled - */ - public function notice($object, $context = array()) - { - return $this->log(self::NOTICE, $object, $context); - } - - /** - * Log warning message - * @param mixed $object - * @param array $context - * @return mixed|bool What the Logger returns, or false if Logger not set or not enabled - */ - public function warning($object, $context = array()) - { - return $this->log(self::WARN, $object, $context); - } - - /** - * DEPRECATED for function warning - * Log warning message - * @param mixed $object - * @param array $context - * @return mixed|bool What the Logger returns, or false if Logger not set or not enabled - */ - public function warn($object, $context = array()) - { - return $this->log(self::WARN, $object, $context); - } - - /** - * Log error message - * @param mixed $object - * @param array $context - * @return mixed|bool What the Logger returns, or false if Logger not set or not enabled - */ - public function error($object, $context = array()) - { - return $this->log(self::ERROR, $object, $context); - } - - /** - * Log critical message - * @param mixed $object - * @param array $context - * @return mixed|bool What the Logger returns, or false if Logger not set or not enabled - */ - public function critical($object, $context = array()) - { - return $this->log(self::CRITICAL, $object, $context); - } - - /** - * DEPRECATED for function critical - * Log fatal message - * @param mixed $object - * @param array $context - * @return mixed|bool What the Logger returns, or false if Logger not set or not enabled - */ - public function fatal($object, $context = array()) - { - return $this->log(self::CRITICAL, $object, $context); - } - - /** - * Log alert message - * @param mixed $object - * @param array $context - * @return mixed|bool What the Logger returns, or false if Logger not set or not enabled - */ - public function alert($object, $context = array()) - { - return $this->log(self::ALERT, $object, $context); - } - - /** - * Log emergency message - * @param mixed $object - * @param array $context - * @return mixed|bool What the Logger returns, or false if Logger not set or not enabled - */ - public function emergency($object, $context = array()) - { - return $this->log(self::EMERGENCY, $object, $context); - } - - /** - * Log message - * @param mixed $level - * @param mixed $object - * @param array $context - * @return mixed|bool What the Logger returns, or false if Logger not set or not enabled - * @throws \InvalidArgumentException If invalid log level - */ - public function log($level, $object, $context = array()) - { - if (!isset(self::$levels[$level])) { - throw new \InvalidArgumentException('Invalid log level supplied to function'); - } else if ($this->enabled && $this->writer && $level <= $this->level) { - if (is_array($object) || (is_object($object) && !method_exists($object, "__toString"))) { - $message = print_r($object, true); - } else { - $message = (string) $object; - } - - if (count($context) > 0) { - if (isset($context['exception']) && $context['exception'] instanceof \Exception) { - $message .= ' - ' . $context['exception']; - unset($context['exception']); - } - $message = $this->interpolate($message, $context); - } - return $this->writer->write($message, $level); - } else { - return false; - } - } - - /** - * DEPRECATED for function log - * Log message - * @param mixed $object The object to log - * @param int $level The message level - * @return int|bool - */ - protected function write($object, $level) - { - return $this->log($level, $object); - } - - /** - * Interpolate log message - * @param mixed $message The log message - * @param array $context An array of placeholder values - * @return string The processed string - */ - protected function interpolate($message, $context = array()) - { - $replace = array(); - foreach ($context as $key => $value) { - $replace['{' . $key . '}'] = $value; - } - return strtr($message, $replace); - } -} diff --git a/vendor/slim/slim/Slim/LogWriter.php b/vendor/slim/slim/Slim/LogWriter.php deleted file mode 100644 index 821ad9d..0000000 --- a/vendor/slim/slim/Slim/LogWriter.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim; - -/** - * Log Writer - * - * This class is used by Slim_Log to write log messages to a valid, writable - * resource handle (e.g. a file or STDERR). - * - * @package Slim - * @author Josh Lockhart - * @since 1.6.0 - */ -class LogWriter -{ - /** - * @var resource - */ - protected $resource; - - /** - * Constructor - * @param resource $resource - * @throws \InvalidArgumentException If invalid resource - */ - public function __construct($resource) - { - if (!is_resource($resource)) { - throw new \InvalidArgumentException('Cannot create LogWriter. Invalid resource handle.'); - } - $this->resource = $resource; - } - - /** - * Write message - * @param mixed $message - * @param int $level - * @return int|bool - */ - public function write($message, $level = null) - { - return fwrite($this->resource, (string) $message . PHP_EOL); - } -} diff --git a/vendor/slim/slim/Slim/Middleware.php b/vendor/slim/slim/Slim/Middleware.php deleted file mode 100644 index 4b972fe..0000000 --- a/vendor/slim/slim/Slim/Middleware.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim; - -/** - * Middleware - * - * @package Slim - * @author Josh Lockhart - * @since 1.6.0 - */ -abstract class Middleware -{ - /** - * @var \Slim\Slim Reference to the primary application instance - */ - protected $app; - - /** - * @var mixed Reference to the next downstream middleware - */ - protected $next; - - /** - * Set application - * - * This method injects the primary Slim application instance into - * this middleware. - * - * @param \Slim\Slim $application - */ - final public function setApplication($application) - { - $this->app = $application; - } - - /** - * Get application - * - * This method retrieves the application previously injected - * into this middleware. - * - * @return \Slim\Slim - */ - final public function getApplication() - { - return $this->app; - } - - /** - * Set next middleware - * - * This method injects the next downstream middleware into - * this middleware so that it may optionally be called - * when appropriate. - * - * @param \Slim|\Slim\Middleware - */ - final public function setNextMiddleware($nextMiddleware) - { - $this->next = $nextMiddleware; - } - - /** - * Get next middleware - * - * This method retrieves the next downstream middleware - * previously injected into this middleware. - * - * @return \Slim\Slim|\Slim\Middleware - */ - final public function getNextMiddleware() - { - return $this->next; - } - - /** - * Call - * - * Perform actions specific to this middleware and optionally - * call the next downstream middleware. - */ - abstract public function call(); -} diff --git a/vendor/slim/slim/Slim/Middleware/ContentTypes.php b/vendor/slim/slim/Slim/Middleware/ContentTypes.php deleted file mode 100644 index 0abc0ea..0000000 --- a/vendor/slim/slim/Slim/Middleware/ContentTypes.php +++ /dev/null @@ -1,174 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim\Middleware; - - /** - * Content Types - * - * This is middleware for a Slim application that intercepts - * the HTTP request body and parses it into the appropriate - * PHP data structure if possible; else it returns the HTTP - * request body unchanged. This is particularly useful - * for preparing the HTTP request body for an XML or JSON API. - * - * @package Slim - * @author Josh Lockhart - * @since 1.6.0 - */ -class ContentTypes extends \Slim\Middleware -{ - /** - * @var array - */ - protected $contentTypes; - - /** - * Constructor - * @param array $settings - */ - public function __construct($settings = array()) - { - $defaults = array( - 'application/json' => array($this, 'parseJson'), - 'application/xml' => array($this, 'parseXml'), - 'text/xml' => array($this, 'parseXml'), - 'text/csv' => array($this, 'parseCsv') - ); - $this->contentTypes = array_merge($defaults, $settings); - } - - /** - * Call - */ - public function call() - { - $mediaType = $this->app->request()->getMediaType(); - if ($mediaType) { - $env = $this->app->environment(); - $env['slim.input_original'] = $env['slim.input']; - $env['slim.input'] = $this->parse($env['slim.input'], $mediaType); - } - $this->next->call(); - } - - /** - * Parse input - * - * This method will attempt to parse the request body - * based on its content type if available. - * - * @param string $input - * @param string $contentType - * @return mixed - */ - protected function parse ($input, $contentType) - { - if (isset($this->contentTypes[$contentType]) && is_callable($this->contentTypes[$contentType])) { - $result = call_user_func($this->contentTypes[$contentType], $input); - if ($result) { - return $result; - } - } - - return $input; - } - - /** - * Parse JSON - * - * This method converts the raw JSON input - * into an associative array. - * - * @param string $input - * @return array|string - */ - protected function parseJson($input) - { - if (function_exists('json_decode')) { - $result = json_decode($input, true); - if(json_last_error() === JSON_ERROR_NONE) { - return $result; - } - } - } - - /** - * Parse XML - * - * This method creates a SimpleXMLElement - * based upon the XML input. If the SimpleXML - * extension is not available, the raw input - * will be returned unchanged. - * - * @param string $input - * @return \SimpleXMLElement|string - */ - protected function parseXml($input) - { - if (class_exists('SimpleXMLElement')) { - try { - $backup = libxml_disable_entity_loader(true); - $result = new \SimpleXMLElement($input); - libxml_disable_entity_loader($backup); - return $result; - } catch (\Exception $e) { - // Do nothing - } - } - - return $input; - } - - /** - * Parse CSV - * - * This method parses CSV content into a numeric array - * containing an array of data for each CSV line. - * - * @param string $input - * @return array - */ - protected function parseCsv($input) - { - $temp = fopen('php://memory', 'rw'); - fwrite($temp, $input); - fseek($temp, 0); - $res = array(); - while (($data = fgetcsv($temp)) !== false) { - $res[] = $data; - } - fclose($temp); - - return $res; - } -} diff --git a/vendor/slim/slim/Slim/Middleware/Flash.php b/vendor/slim/slim/Slim/Middleware/Flash.php deleted file mode 100644 index ad9ae69..0000000 --- a/vendor/slim/slim/Slim/Middleware/Flash.php +++ /dev/null @@ -1,212 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim\Middleware; - - /** - * Flash - * - * This is middleware for a Slim application that enables - * Flash messaging between HTTP requests. This allows you - * set Flash messages for the current request, for the next request, - * or to retain messages from the previous request through to - * the next request. - * - * @package Slim - * @author Josh Lockhart - * @since 1.6.0 - */ -class Flash extends \Slim\Middleware implements \ArrayAccess, \IteratorAggregate, \Countable -{ - /** - * @var array - */ - protected $settings; - - /** - * @var array - */ - protected $messages; - - /** - * Constructor - * @param array $settings - */ - public function __construct($settings = array()) - { - $this->settings = array_merge(array('key' => 'slim.flash'), $settings); - $this->messages = array( - 'prev' => array(), //flash messages from prev request (loaded when middleware called) - 'next' => array(), //flash messages for next request - 'now' => array() //flash messages for current request - ); - } - - /** - * Call - */ - public function call() - { - //Read flash messaging from previous request if available - $this->loadMessages(); - - //Prepare flash messaging for current request - $env = $this->app->environment(); - $env['slim.flash'] = $this; - $this->next->call(); - $this->save(); - } - - /** - * Now - * - * Specify a flash message for a given key to be shown for the current request - * - * @param string $key - * @param string $value - */ - public function now($key, $value) - { - $this->messages['now'][(string) $key] = $value; - } - - /** - * Set - * - * Specify a flash message for a given key to be shown for the next request - * - * @param string $key - * @param string $value - */ - public function set($key, $value) - { - $this->messages['next'][(string) $key] = $value; - } - - /** - * Keep - * - * Retain flash messages from the previous request for the next request - */ - public function keep() - { - foreach ($this->messages['prev'] as $key => $val) { - $this->messages['next'][$key] = $val; - } - } - - /** - * Save - */ - public function save() - { - $_SESSION[$this->settings['key']] = $this->messages['next']; - } - - /** - * Load messages from previous request if available - */ - public function loadMessages() - { - if (isset($_SESSION[$this->settings['key']])) { - $this->messages['prev'] = $_SESSION[$this->settings['key']]; - } - } - - /** - * Return array of flash messages to be shown for the current request - * - * @return array - */ - public function getMessages() - { - return array_merge($this->messages['prev'], $this->messages['now']); - } - - /** - * Array Access: Offset Exists - */ - public function offsetExists($offset) - { - $messages = $this->getMessages(); - - return isset($messages[$offset]); - } - - /** - * Array Access: Offset Get - */ - public function offsetGet($offset) - { - $messages = $this->getMessages(); - - return isset($messages[$offset]) ? $messages[$offset] : null; - } - - /** - * Array Access: Offset Set - */ - public function offsetSet($offset, $value) - { - $this->now($offset, $value); - } - - /** - * Array Access: Offset Unset - */ - public function offsetUnset($offset) - { - unset($this->messages['prev'][$offset], $this->messages['now'][$offset]); - } - - /** - * Iterator Aggregate: Get Iterator - * @return \ArrayIterator - */ - public function getIterator() - { - $messages = $this->getMessages(); - - return new \ArrayIterator($messages); - } - - /** - * Countable: Count - */ - public function count() - { - return count($this->getMessages()); - } - - - -} diff --git a/vendor/slim/slim/Slim/Middleware/MethodOverride.php b/vendor/slim/slim/Slim/Middleware/MethodOverride.php deleted file mode 100644 index 99f8b05..0000000 --- a/vendor/slim/slim/Slim/Middleware/MethodOverride.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim\Middleware; - - /** - * HTTP Method Override - * - * This is middleware for a Slim application that allows traditional - * desktop browsers to submit pseudo PUT and DELETE requests by relying - * on a pre-determined request parameter. Without this middleware, - * desktop browsers are only able to submit GET and POST requests. - * - * This middleware is included automatically! - * - * @package Slim - * @author Josh Lockhart - * @since 1.6.0 - */ -class MethodOverride extends \Slim\Middleware -{ - /** - * @var array - */ - protected $settings; - - /** - * Constructor - * @param array $settings - */ - public function __construct($settings = array()) - { - $this->settings = array_merge(array('key' => '_METHOD'), $settings); - } - - /** - * Call - * - * Implements Slim middleware interface. This method is invoked and passed - * an array of environment variables. This middleware inspects the environment - * variables for the HTTP method override parameter; if found, this middleware - * modifies the environment settings so downstream middleware and/or the Slim - * application will treat the request with the desired HTTP method. - * - * @return array[status, header, body] - */ - public function call() - { - $env = $this->app->environment(); - if (isset($env['HTTP_X_HTTP_METHOD_OVERRIDE'])) { - // Header commonly used by Backbone.js and others - $env['slim.method_override.original_method'] = $env['REQUEST_METHOD']; - $env['REQUEST_METHOD'] = strtoupper($env['HTTP_X_HTTP_METHOD_OVERRIDE']); - } elseif (isset($env['REQUEST_METHOD']) && $env['REQUEST_METHOD'] === 'POST') { - // HTML Form Override - $req = new \Slim\Http\Request($env); - $method = $req->post($this->settings['key']); - if ($method) { - $env['slim.method_override.original_method'] = $env['REQUEST_METHOD']; - $env['REQUEST_METHOD'] = strtoupper($method); - } - } - $this->next->call(); - } -} diff --git a/vendor/slim/slim/Slim/Middleware/PrettyExceptions.php b/vendor/slim/slim/Slim/Middleware/PrettyExceptions.php deleted file mode 100644 index 3cebceb..0000000 --- a/vendor/slim/slim/Slim/Middleware/PrettyExceptions.php +++ /dev/null @@ -1,116 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim\Middleware; - -/** - * Pretty Exceptions - * - * This middleware catches any Exception thrown by the surrounded - * application and displays a developer-friendly diagnostic screen. - * - * @package Slim - * @author Josh Lockhart - * @since 1.0.0 - */ -class PrettyExceptions extends \Slim\Middleware -{ - /** - * @var array - */ - protected $settings; - - /** - * Constructor - * @param array $settings - */ - public function __construct($settings = array()) - { - $this->settings = $settings; - } - - /** - * Call - */ - public function call() - { - try { - $this->next->call(); - } catch (\Exception $e) { - $log = $this->app->getLog(); // Force Slim to append log to env if not already - $env = $this->app->environment(); - $env['slim.log'] = $log; - $env['slim.log']->error($e); - $this->app->contentType('text/html'); - $this->app->response()->status(500); - $this->app->response()->body($this->renderBody($env, $e)); - } - } - - /** - * Render response body - * @param array $env - * @param \Exception $exception - * @return string - */ - protected function renderBody(&$env, $exception) - { - $title = 'Slim Application Error'; - $code = $exception->getCode(); - $message = htmlspecialchars($exception->getMessage()); - $file = $exception->getFile(); - $line = $exception->getLine(); - $trace = str_replace(array('#', "\n"), array('<div>#', '</div>'), htmlspecialchars($exception->getTraceAsString())); - $html = sprintf('<h1>%s</h1>', $title); - $html .= '<p>The application could not run because of the following error:</p>'; - $html .= '<h2>Details</h2>'; - $html .= sprintf('<div><strong>Type:</strong> %s</div>', get_class($exception)); - if ($code) { - $html .= sprintf('<div><strong>Code:</strong> %s</div>', $code); - } - if ($message) { - $html .= sprintf('<div><strong>Message:</strong> %s</div>', $message); - } - if ($file) { - $html .= sprintf('<div><strong>File:</strong> %s</div>', $file); - } - if ($line) { - $html .= sprintf('<div><strong>Line:</strong> %s</div>', $line); - } - if ($trace) { - $html .= '<h2>Trace</h2>'; - $html .= sprintf('<pre>%s</pre>', $trace); - } - - return sprintf("<html><head><title>%s</title><style>body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;}h1{margin:0;font-size:48px;font-weight:normal;line-height:48px;}strong{display:inline-block;width:65px;}</style></head><body>%s</body></html>", $title, $html); - } -} diff --git a/vendor/slim/slim/Slim/Middleware/SessionCookie.php b/vendor/slim/slim/Slim/Middleware/SessionCookie.php deleted file mode 100644 index 5b244b3..0000000 --- a/vendor/slim/slim/Slim/Middleware/SessionCookie.php +++ /dev/null @@ -1,205 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim\Middleware; - -/** - * Session Cookie - * - * This class provides an HTTP cookie storage mechanism - * for session data. This class avoids using a PHP session - * and instead serializes/unserializes the $_SESSION global - * variable to/from an HTTP cookie. - * - * You should NEVER store sensitive data in a client-side cookie - * in any format, encrypted (with cookies.encrypt) or not. If you - * need to store sensitive user information in a session, you should - * rely on PHP's native session implementation, or use other middleware - * to store session data in a database or alternative server-side cache. - * - * Because this class stores serialized session data in an HTTP cookie, - * you are inherently limited to 4 Kb. If you attempt to store - * more than this amount, serialization will fail. - * - * @package Slim - * @author Josh Lockhart - * @since 1.6.0 - */ -class SessionCookie extends \Slim\Middleware -{ - /** - * @var array - */ - protected $settings; - - /** - * Constructor - * - * @param array $settings - */ - public function __construct($settings = array()) - { - $defaults = array( - 'expires' => '20 minutes', - 'path' => '/', - 'domain' => null, - 'secure' => false, - 'httponly' => false, - 'name' => 'slim_session', - ); - $this->settings = array_merge($defaults, $settings); - if (is_string($this->settings['expires'])) { - $this->settings['expires'] = strtotime($this->settings['expires']); - } - - /** - * Session - * - * We must start a native PHP session to initialize the $_SESSION superglobal. - * However, we won't be using the native session store for persistence, so we - * disable the session cookie and cache limiter. We also set the session - * handler to this class instance to avoid PHP's native session file locking. - */ - ini_set('session.use_cookies', 0); - session_cache_limiter(false); - session_set_save_handler( - array($this, 'open'), - array($this, 'close'), - array($this, 'read'), - array($this, 'write'), - array($this, 'destroy'), - array($this, 'gc') - ); - } - - /** - * Call - */ - public function call() - { - $this->loadSession(); - $this->next->call(); - $this->saveSession(); - } - - /** - * Load session - */ - protected function loadSession() - { - if (session_id() === '') { - session_start(); - } - $value = $this->app->getCookie($this->settings['name']); - if ($value) { - $value = json_decode($value, true); - $_SESSION = is_array($value) ? $value : array(); - } else { - $_SESSION = array(); - } - } - - /** - * Save session - */ - protected function saveSession() - { - $value = json_encode($_SESSION); - - if (strlen($value) > 4096) { - $this->app->getLog()->error('WARNING! Slim\Middleware\SessionCookie data size is larger than 4KB. Content save failed.'); - } else { - $this->app->setCookie( - $this->settings['name'], - $value, - $this->settings['expires'], - $this->settings['path'], - $this->settings['domain'], - $this->settings['secure'], - $this->settings['httponly'] - ); - } - // session_destroy(); - } - - /******************************************************************************** - * Session Handler - *******************************************************************************/ - - /** - * @codeCoverageIgnore - */ - public function open($savePath, $sessionName) - { - return true; - } - - /** - * @codeCoverageIgnore - */ - public function close() - { - return true; - } - - /** - * @codeCoverageIgnore - */ - public function read($id) - { - return ''; - } - - /** - * @codeCoverageIgnore - */ - public function write($id, $data) - { - return true; - } - - /** - * @codeCoverageIgnore - */ - public function destroy($id) - { - return true; - } - - /** - * @codeCoverageIgnore - */ - public function gc($maxlifetime) - { - return true; - } -} diff --git a/vendor/slim/slim/Slim/Route.php b/vendor/slim/slim/Slim/Route.php deleted file mode 100644 index e404fac..0000000 --- a/vendor/slim/slim/Slim/Route.php +++ /dev/null @@ -1,471 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim; - -/** - * Route - * @package Slim - * @author Josh Lockhart, Thomas Bley - * @since 1.0.0 - */ -class Route -{ - /** - * @var string The route pattern (e.g. "/books/:id") - */ - protected $pattern; - - /** - * @var mixed The route callable - */ - protected $callable; - - /** - * @var array Conditions for this route's URL parameters - */ - protected $conditions = array(); - - /** - * @var array Default conditions applied to all route instances - */ - protected static $defaultConditions = array(); - - /** - * @var string The name of this route (optional) - */ - protected $name; - - /** - * @var array Key-value array of URL parameters - */ - protected $params = array(); - - /** - * @var array value array of URL parameter names - */ - protected $paramNames = array(); - - /** - * @var array key array of URL parameter names with + at the end - */ - protected $paramNamesPath = array(); - - /** - * @var array HTTP methods supported by this Route - */ - protected $methods = array(); - - /** - * @var array[Callable] Middleware to be run before only this route instance - */ - protected $middleware = array(); - - /** - * @var bool Whether or not this route should be matched in a case-sensitive manner - */ - protected $caseSensitive; - - /** - * Constructor - * @param string $pattern The URL pattern (e.g. "/books/:id") - * @param mixed $callable Anything that returns TRUE for is_callable() - * @param bool $caseSensitive Whether or not this route should be matched in a case-sensitive manner - */ - public function __construct($pattern, $callable, $caseSensitive = true) - { - $this->setPattern($pattern); - $this->setCallable($callable); - $this->setConditions(self::getDefaultConditions()); - $this->caseSensitive = $caseSensitive; - } - - /** - * Set default route conditions for all instances - * @param array $defaultConditions - */ - public static function setDefaultConditions(array $defaultConditions) - { - self::$defaultConditions = $defaultConditions; - } - - /** - * Get default route conditions for all instances - * @return array - */ - public static function getDefaultConditions() - { - return self::$defaultConditions; - } - - /** - * Get route pattern - * @return string - */ - public function getPattern() - { - return $this->pattern; - } - - /** - * Set route pattern - * @param string $pattern - */ - public function setPattern($pattern) - { - $this->pattern = $pattern; - } - - /** - * Get route callable - * @return mixed - */ - public function getCallable() - { - return $this->callable; - } - - /** - * Set route callable - * @param mixed $callable - * @throws \InvalidArgumentException If argument is not callable - */ - public function setCallable($callable) - { - $matches = array(); - if (is_string($callable) && preg_match('!^([^\:]+)\:([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)$!', $callable, $matches)) { - $class = $matches[1]; - $method = $matches[2]; - $callable = function() use ($class, $method) { - static $obj = null; - if ($obj === null) { - $obj = new $class; - } - return call_user_func_array(array($obj, $method), func_get_args()); - }; - } - - if (!is_callable($callable)) { - throw new \InvalidArgumentException('Route callable must be callable'); - } - - $this->callable = $callable; - } - - /** - * Get route conditions - * @return array - */ - public function getConditions() - { - return $this->conditions; - } - - /** - * Set route conditions - * @param array $conditions - */ - public function setConditions(array $conditions) - { - $this->conditions = $conditions; - } - - /** - * Get route name - * @return string|null - */ - public function getName() - { - return $this->name; - } - - /** - * Set route name - * @param string $name - */ - public function setName($name) - { - $this->name = (string)$name; - } - - /** - * Get route parameters - * @return array - */ - public function getParams() - { - return $this->params; - } - - /** - * Set route parameters - * @param array $params - */ - public function setParams($params) - { - $this->params = $params; - } - - /** - * Get route parameter value - * @param string $index Name of URL parameter - * @return string - * @throws \InvalidArgumentException If route parameter does not exist at index - */ - public function getParam($index) - { - if (!isset($this->params[$index])) { - throw new \InvalidArgumentException('Route parameter does not exist at specified index'); - } - - return $this->params[$index]; - } - - /** - * Set route parameter value - * @param string $index Name of URL parameter - * @param mixed $value The new parameter value - * @throws \InvalidArgumentException If route parameter does not exist at index - */ - public function setParam($index, $value) - { - if (!isset($this->params[$index])) { - throw new \InvalidArgumentException('Route parameter does not exist at specified index'); - } - $this->params[$index] = $value; - } - - /** - * Add supported HTTP method(s) - */ - public function setHttpMethods() - { - $args = func_get_args(); - $this->methods = $args; - } - - /** - * Get supported HTTP methods - * @return array - */ - public function getHttpMethods() - { - return $this->methods; - } - - /** - * Append supported HTTP methods - */ - public function appendHttpMethods() - { - $args = func_get_args(); - if(count($args) && is_array($args[0])){ - $args = $args[0]; - } - $this->methods = array_merge($this->methods, $args); - } - - /** - * Append supported HTTP methods (alias for Route::appendHttpMethods) - * @return \Slim\Route - */ - public function via() - { - $args = func_get_args(); - if(count($args) && is_array($args[0])){ - $args = $args[0]; - } - $this->methods = array_merge($this->methods, $args); - - return $this; - } - - /** - * Detect support for an HTTP method - * @param string $method - * @return bool - */ - public function supportsHttpMethod($method) - { - return in_array($method, $this->methods); - } - - /** - * Get middleware - * @return array[Callable] - */ - public function getMiddleware() - { - return $this->middleware; - } - - /** - * Set middleware - * - * This method allows middleware to be assigned to a specific Route. - * If the method argument `is_callable` (including callable arrays!), - * we directly append the argument to `$this->middleware`. Else, we - * assume the argument is an array of callables and merge the array - * with `$this->middleware`. Each middleware is checked for is_callable() - * and an InvalidArgumentException is thrown immediately if it isn't. - * - * @param Callable|array[Callable] - * @return \Slim\Route - * @throws \InvalidArgumentException If argument is not callable or not an array of callables. - */ - public function setMiddleware($middleware) - { - if (is_callable($middleware)) { - $this->middleware[] = $middleware; - } elseif (is_array($middleware)) { - foreach ($middleware as $callable) { - if (!is_callable($callable)) { - throw new \InvalidArgumentException('All Route middleware must be callable'); - } - } - $this->middleware = array_merge($this->middleware, $middleware); - } else { - throw new \InvalidArgumentException('Route middleware must be callable or an array of callables'); - } - - return $this; - } - - /** - * Matches URI? - * - * Parse this route's pattern, and then compare it to an HTTP resource URI - * This method was modeled after the techniques demonstrated by Dan Sosedoff at: - * - * http://blog.sosedoff.com/2009/09/20/rails-like-php-url-router/ - * - * @param string $resourceUri A Request URI - * @return bool - */ - public function matches($resourceUri) - { - //Convert URL params into regex patterns, construct a regex for this route, init params - $patternAsRegex = preg_replace_callback( - '#:([\w]+)\+?#', - array($this, 'matchesCallback'), - str_replace(')', ')?', (string)$this->pattern) - ); - if (substr($this->pattern, -1) === '/') { - $patternAsRegex .= '?'; - } - - $regex = '#^' . $patternAsRegex . '$#'; - - if ($this->caseSensitive === false) { - $regex .= 'i'; - } - - //Cache URL params' names and values if this route matches the current HTTP request - if (!preg_match($regex, $resourceUri, $paramValues)) { - return false; - } - foreach ($this->paramNames as $name) { - if (isset($paramValues[$name])) { - if (isset($this->paramNamesPath[$name])) { - $this->params[$name] = explode('/', urldecode($paramValues[$name])); - } else { - $this->params[$name] = urldecode($paramValues[$name]); - } - } - } - - return true; - } - - /** - * Convert a URL parameter (e.g. ":id", ":id+") into a regular expression - * @param array $m URL parameters - * @return string Regular expression for URL parameter - */ - protected function matchesCallback($m) - { - $this->paramNames[] = $m[1]; - if (isset($this->conditions[$m[1]])) { - return '(?P<' . $m[1] . '>' . $this->conditions[$m[1]] . ')'; - } - if (substr($m[0], -1) === '+') { - $this->paramNamesPath[$m[1]] = 1; - - return '(?P<' . $m[1] . '>.+)'; - } - - return '(?P<' . $m[1] . '>[^/]+)'; - } - - /** - * Set route name - * @param string $name The name of the route - * @return \Slim\Route - */ - public function name($name) - { - $this->setName($name); - - return $this; - } - - /** - * Merge route conditions - * @param array $conditions Key-value array of URL parameter conditions - * @return \Slim\Route - */ - public function conditions(array $conditions) - { - $this->conditions = array_merge($this->conditions, $conditions); - - return $this; - } - - /** - * Dispatch route - * - * This method invokes the route object's callable. If middleware is - * registered for the route, each callable middleware is invoked in - * the order specified. - * - * @return bool - */ - public function dispatch() - { - foreach ($this->middleware as $mw) { - call_user_func_array($mw, array($this)); - } - - $return = call_user_func_array($this->getCallable(), array_values($this->getParams())); - return ($return === false) ? false : true; - } -} diff --git a/vendor/slim/slim/Slim/Router.php b/vendor/slim/slim/Slim/Router.php deleted file mode 100644 index 624f924..0000000 --- a/vendor/slim/slim/Slim/Router.php +++ /dev/null @@ -1,257 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim; - -/** - * Router - * - * This class organizes, iterates, and dispatches \Slim\Route objects. - * - * @package Slim - * @author Josh Lockhart - * @since 1.0.0 - */ -class Router -{ - /** - * @var Route The current route (most recently dispatched) - */ - protected $currentRoute; - - /** - * @var array Lookup hash of all route objects - */ - protected $routes; - - /** - * @var array Lookup hash of named route objects, keyed by route name (lazy-loaded) - */ - protected $namedRoutes; - - /** - * @var array Array of route objects that match the request URI (lazy-loaded) - */ - protected $matchedRoutes; - - /** - * @var array Array containing all route groups - */ - protected $routeGroups; - - /** - * Constructor - */ - public function __construct() - { - $this->routes = array(); - $this->routeGroups = array(); - } - - /** - * Get Current Route object or the first matched one if matching has been performed - * @return \Slim\Route|null - */ - public function getCurrentRoute() - { - if ($this->currentRoute !== null) { - return $this->currentRoute; - } - - if (is_array($this->matchedRoutes) && count($this->matchedRoutes) > 0) { - return $this->matchedRoutes[0]; - } - - return null; - } - - /** - * Return route objects that match the given HTTP method and URI - * @param string $httpMethod The HTTP method to match against - * @param string $resourceUri The resource URI to match against - * @param bool $reload Should matching routes be re-parsed? - * @return array[\Slim\Route] - */ - public function getMatchedRoutes($httpMethod, $resourceUri, $reload = false) - { - if ($reload || is_null($this->matchedRoutes)) { - $this->matchedRoutes = array(); - foreach ($this->routes as $route) { - if (!$route->supportsHttpMethod($httpMethod) && !$route->supportsHttpMethod("ANY")) { - continue; - } - - if ($route->matches($resourceUri)) { - $this->matchedRoutes[] = $route; - } - } - } - - return $this->matchedRoutes; - } - - /** - * Add a route object to the router - * @param \Slim\Route $route The Slim Route - */ - public function map(\Slim\Route $route) - { - list($groupPattern, $groupMiddleware) = $this->processGroups(); - - $route->setPattern($groupPattern . $route->getPattern()); - $this->routes[] = $route; - - - foreach ($groupMiddleware as $middleware) { - $route->setMiddleware($middleware); - } - } - - /** - * A helper function for processing the group's pattern and middleware - * @return array Returns an array with the elements: pattern, middlewareArr - */ - protected function processGroups() - { - $pattern = ""; - $middleware = array(); - foreach ($this->routeGroups as $group) { - $k = key($group); - $pattern .= $k; - if (is_array($group[$k])) { - $middleware = array_merge($middleware, $group[$k]); - } - } - return array($pattern, $middleware); - } - - /** - * Add a route group to the array - * @param string $group The group pattern (ie. "/books/:id") - * @param array|null $middleware Optional parameter array of middleware - * @return int The index of the new group - */ - public function pushGroup($group, $middleware = array()) - { - return array_push($this->routeGroups, array($group => $middleware)); - } - - /** - * Removes the last route group from the array - * @return bool True if successful, else False - */ - public function popGroup() - { - return (array_pop($this->routeGroups) !== null); - } - - /** - * Get URL for named route - * @param string $name The name of the route - * @param array $params Associative array of URL parameter names and replacement values - * @throws \RuntimeException If named route not found - * @return string The URL for the given route populated with provided replacement values - */ - public function urlFor($name, $params = array()) - { - if (!$this->hasNamedRoute($name)) { - throw new \RuntimeException('Named route not found for name: ' . $name); - } - $search = array(); - foreach ($params as $key => $value) { - $search[] = '#:' . preg_quote($key, '#') . '\+?(?!\w)#'; - } - $pattern = preg_replace($search, $params, $this->getNamedRoute($name)->getPattern()); - - //Remove remnants of unpopulated, trailing optional pattern segments, escaped special characters - return preg_replace('#\(/?:.+\)|\(|\)|\\\\#', '', $pattern); - } - - /** - * Add named route - * @param string $name The route name - * @param \Slim\Route $route The route object - * @throws \RuntimeException If a named route already exists with the same name - */ - public function addNamedRoute($name, \Slim\Route $route) - { - if ($this->hasNamedRoute($name)) { - throw new \RuntimeException('Named route already exists with name: ' . $name); - } - $this->namedRoutes[(string) $name] = $route; - } - - /** - * Has named route - * @param string $name The route name - * @return bool - */ - public function hasNamedRoute($name) - { - $this->getNamedRoutes(); - - return isset($this->namedRoutes[(string) $name]); - } - - /** - * Get named route - * @param string $name - * @return \Slim\Route|null - */ - public function getNamedRoute($name) - { - $this->getNamedRoutes(); - if ($this->hasNamedRoute($name)) { - return $this->namedRoutes[(string) $name]; - } - - return null; - } - - /** - * Get named routes - * @return \ArrayIterator - */ - public function getNamedRoutes() - { - if (is_null($this->namedRoutes)) { - $this->namedRoutes = array(); - foreach ($this->routes as $route) { - if ($route->getName() !== null) { - $this->addNamedRoute($route->getName(), $route); - } - } - } - - return new \ArrayIterator($this->namedRoutes); - } -} diff --git a/vendor/slim/slim/Slim/Slim.php b/vendor/slim/slim/Slim/Slim.php deleted file mode 100644 index cf5ed02..0000000 --- a/vendor/slim/slim/Slim/Slim.php +++ /dev/null @@ -1,1443 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim; - -// Ensure mcrypt constants are defined even if mcrypt extension is not loaded -if (!defined('MCRYPT_MODE_CBC')) define('MCRYPT_MODE_CBC', 0); -if (!defined('MCRYPT_RIJNDAEL_256')) define('MCRYPT_RIJNDAEL_256', 0); - -/** - * Slim - * @package Slim - * @author Josh Lockhart - * @since 1.0.0 - * - * @property \Slim\Environment $environment - * @property \Slim\Http\Response $response - * @property \Slim\Http\Request $request - * @property \Slim\Router $router - */ -class Slim -{ - /** - * @const string - */ - const VERSION = '2.6.3'; - - /** - * @var \Slim\Helper\Set - */ - public $container; - - /** - * @var array[\Slim] - */ - protected static $apps = array(); - - /** - * @var string - */ - protected $name; - - /** - * @var array - */ - protected $middleware; - - /** - * @var mixed Callable to be invoked if application error - */ - protected $error; - - /** - * @var mixed Callable to be invoked if no matching routes are found - */ - protected $notFound; - - /** - * @var array - */ - protected $hooks = array( - 'slim.before' => array(array()), - 'slim.before.router' => array(array()), - 'slim.before.dispatch' => array(array()), - 'slim.after.dispatch' => array(array()), - 'slim.after.router' => array(array()), - 'slim.after' => array(array()) - ); - - /******************************************************************************** - * PSR-0 Autoloader - * - * Do not use if you are using Composer to autoload dependencies. - *******************************************************************************/ - - /** - * Slim PSR-0 autoloader - */ - public static function autoload($className) - { - $thisClass = str_replace(__NAMESPACE__.'\\', '', __CLASS__); - - $baseDir = __DIR__; - - if (substr($baseDir, -strlen($thisClass)) === $thisClass) { - $baseDir = substr($baseDir, 0, -strlen($thisClass)); - } - - $className = ltrim($className, '\\'); - $fileName = $baseDir; - $namespace = ''; - if ($lastNsPos = strripos($className, '\\')) { - $namespace = substr($className, 0, $lastNsPos); - $className = substr($className, $lastNsPos + 1); - $fileName .= str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; - } - $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; - - if (file_exists($fileName)) { - require $fileName; - } - } - - /** - * Register Slim's PSR-0 autoloader - */ - public static function registerAutoloader() - { - spl_autoload_register(__NAMESPACE__ . "\\Slim::autoload"); - } - - /******************************************************************************** - * Instantiation and Configuration - *******************************************************************************/ - - /** - * Constructor - * @param array $userSettings Associative array of application settings - */ - public function __construct(array $userSettings = array()) - { - // Setup IoC container - $this->container = new \Slim\Helper\Set(); - $this->container['settings'] = array_merge(static::getDefaultSettings(), $userSettings); - - // Default environment - $this->container->singleton('environment', function ($c) { - return \Slim\Environment::getInstance(); - }); - - // Default request - $this->container->singleton('request', function ($c) { - return new \Slim\Http\Request($c['environment']); - }); - - // Default response - $this->container->singleton('response', function ($c) { - return new \Slim\Http\Response(); - }); - - // Default router - $this->container->singleton('router', function ($c) { - return new \Slim\Router(); - }); - - // Default view - $this->container->singleton('view', function ($c) { - $viewClass = $c['settings']['view']; - $templatesPath = $c['settings']['templates.path']; - - $view = ($viewClass instanceOf \Slim\View) ? $viewClass : new $viewClass; - $view->setTemplatesDirectory($templatesPath); - return $view; - }); - - // Default log writer - $this->container->singleton('logWriter', function ($c) { - $logWriter = $c['settings']['log.writer']; - - return is_object($logWriter) ? $logWriter : new \Slim\LogWriter($c['environment']['slim.errors']); - }); - - // Default log - $this->container->singleton('log', function ($c) { - $log = new \Slim\Log($c['logWriter']); - $log->setEnabled($c['settings']['log.enabled']); - $log->setLevel($c['settings']['log.level']); - $env = $c['environment']; - $env['slim.log'] = $log; - - return $log; - }); - - // Default mode - $this->container['mode'] = function ($c) { - $mode = $c['settings']['mode']; - - if (isset($_ENV['SLIM_MODE'])) { - $mode = $_ENV['SLIM_MODE']; - } else { - $envMode = getenv('SLIM_MODE'); - if ($envMode !== false) { - $mode = $envMode; - } - } - - return $mode; - }; - - // Define default middleware stack - $this->middleware = array($this); - $this->add(new \Slim\Middleware\Flash()); - $this->add(new \Slim\Middleware\MethodOverride()); - - // Make default if first instance - if (is_null(static::getInstance())) { - $this->setName('default'); - } - } - - public function __get($name) - { - return $this->container->get($name); - } - - public function __set($name, $value) - { - $this->container->set($name, $value); - } - - public function __isset($name) - { - return $this->container->has($name); - } - - public function __unset($name) - { - $this->container->remove($name); - } - - /** - * Get application instance by name - * @param string $name The name of the Slim application - * @return \Slim\Slim|null - */ - public static function getInstance($name = 'default') - { - return isset(static::$apps[$name]) ? static::$apps[$name] : null; - } - - /** - * Set Slim application name - * @param string $name The name of this Slim application - */ - public function setName($name) - { - $this->name = $name; - static::$apps[$name] = $this; - } - - /** - * Get Slim application name - * @return string|null - */ - public function getName() - { - return $this->name; - } - - /** - * Get default application settings - * @return array - */ - public static function getDefaultSettings() - { - return array( - // Application - 'mode' => 'development', - // Debugging - 'debug' => true, - // Logging - 'log.writer' => null, - 'log.level' => \Slim\Log::DEBUG, - 'log.enabled' => true, - // View - 'templates.path' => './templates', - 'view' => '\Slim\View', - // Cookies - 'cookies.encrypt' => false, - 'cookies.lifetime' => '20 minutes', - 'cookies.path' => '/', - 'cookies.domain' => null, - 'cookies.secure' => false, - 'cookies.httponly' => false, - // Encryption - 'cookies.secret_key' => 'CHANGE_ME', - 'cookies.cipher' => MCRYPT_RIJNDAEL_256, - 'cookies.cipher_mode' => MCRYPT_MODE_CBC, - // HTTP - 'http.version' => '1.1', - // Routing - 'routes.case_sensitive' => true - ); - } - - /** - * Configure Slim Settings - * - * This method defines application settings and acts as a setter and a getter. - * - * If only one argument is specified and that argument is a string, the value - * of the setting identified by the first argument will be returned, or NULL if - * that setting does not exist. - * - * If only one argument is specified and that argument is an associative array, - * the array will be merged into the existing application settings. - * - * If two arguments are provided, the first argument is the name of the setting - * to be created or updated, and the second argument is the setting value. - * - * @param string|array $name If a string, the name of the setting to set or retrieve. Else an associated array of setting names and values - * @param mixed $value If name is a string, the value of the setting identified by $name - * @return mixed The value of a setting if only one argument is a string - */ - public function config($name, $value = null) - { - $c = $this->container; - - if (is_array($name)) { - if (true === $value) { - $c['settings'] = array_merge_recursive($c['settings'], $name); - } else { - $c['settings'] = array_merge($c['settings'], $name); - } - } elseif (func_num_args() === 1) { - return isset($c['settings'][$name]) ? $c['settings'][$name] : null; - } else { - $settings = $c['settings']; - $settings[$name] = $value; - $c['settings'] = $settings; - } - } - - /******************************************************************************** - * Application Modes - *******************************************************************************/ - - /** - * Get application mode - * - * This method determines the application mode. It first inspects the $_ENV - * superglobal for key `SLIM_MODE`. If that is not found, it queries - * the `getenv` function. Else, it uses the application `mode` setting. - * - * @return string - */ - public function getMode() - { - return $this->mode; - } - - /** - * Configure Slim for a given mode - * - * This method will immediately invoke the callable if - * the specified mode matches the current application mode. - * Otherwise, the callable is ignored. This should be called - * only _after_ you initialize your Slim app. - * - * @param string $mode - * @param mixed $callable - * @return void - */ - public function configureMode($mode, $callable) - { - if ($mode === $this->getMode() && is_callable($callable)) { - call_user_func($callable); - } - } - - /******************************************************************************** - * Logging - *******************************************************************************/ - - /** - * Get application log - * @return \Slim\Log - */ - public function getLog() - { - return $this->log; - } - - /******************************************************************************** - * Routing - *******************************************************************************/ - - /** - * Add GET|POST|PUT|PATCH|DELETE route - * - * Adds a new route to the router with associated callable. This - * route will only be invoked when the HTTP request's method matches - * this route's method. - * - * ARGUMENTS: - * - * First: string The URL pattern (REQUIRED) - * In-Between: mixed Anything that returns TRUE for `is_callable` (OPTIONAL) - * Last: mixed Anything that returns TRUE for `is_callable` (REQUIRED) - * - * The first argument is required and must always be the - * route pattern (ie. '/books/:id'). - * - * The last argument is required and must always be the callable object - * to be invoked when the route matches an HTTP request. - * - * You may also provide an unlimited number of in-between arguments; - * each interior argument must be callable and will be invoked in the - * order specified before the route's callable is invoked. - * - * USAGE: - * - * Slim::get('/foo'[, middleware, middleware, ...], callable); - * - * @param array (See notes above) - * @return \Slim\Route - */ - protected function mapRoute($args) - { - $pattern = array_shift($args); - $callable = array_pop($args); - $route = new \Slim\Route($pattern, $callable, $this->settings['routes.case_sensitive']); - $this->router->map($route); - if (count($args) > 0) { - $route->setMiddleware($args); - } - - return $route; - } - - /** - * Add generic route without associated HTTP method - * @see mapRoute() - * @return \Slim\Route - */ - public function map() - { - $args = func_get_args(); - - return $this->mapRoute($args); - } - - /** - * Add GET route - * @see mapRoute() - * @return \Slim\Route - */ - public function get() - { - $args = func_get_args(); - - return $this->mapRoute($args)->via(\Slim\Http\Request::METHOD_GET, \Slim\Http\Request::METHOD_HEAD); - } - - /** - * Add POST route - * @see mapRoute() - * @return \Slim\Route - */ - public function post() - { - $args = func_get_args(); - - return $this->mapRoute($args)->via(\Slim\Http\Request::METHOD_POST); - } - - /** - * Add PUT route - * @see mapRoute() - * @return \Slim\Route - */ - public function put() - { - $args = func_get_args(); - - return $this->mapRoute($args)->via(\Slim\Http\Request::METHOD_PUT); - } - - /** - * Add PATCH route - * @see mapRoute() - * @return \Slim\Route - */ - public function patch() - { - $args = func_get_args(); - - return $this->mapRoute($args)->via(\Slim\Http\Request::METHOD_PATCH); - } - - /** - * Add DELETE route - * @see mapRoute() - * @return \Slim\Route - */ - public function delete() - { - $args = func_get_args(); - - return $this->mapRoute($args)->via(\Slim\Http\Request::METHOD_DELETE); - } - - /** - * Add OPTIONS route - * @see mapRoute() - * @return \Slim\Route - */ - public function options() - { - $args = func_get_args(); - - return $this->mapRoute($args)->via(\Slim\Http\Request::METHOD_OPTIONS); - } - - /** - * Route Groups - * - * This method accepts a route pattern and a callback all Route - * declarations in the callback will be prepended by the group(s) - * that it is in - * - * Accepts the same parameters as a standard route so: - * (pattern, middleware1, middleware2, ..., $callback) - */ - public function group() - { - $args = func_get_args(); - $pattern = array_shift($args); - $callable = array_pop($args); - $this->router->pushGroup($pattern, $args); - if (is_callable($callable)) { - call_user_func($callable); - } - $this->router->popGroup(); - } - - /* - * Add route for any HTTP method - * @see mapRoute() - * @return \Slim\Route - */ - public function any() - { - $args = func_get_args(); - - return $this->mapRoute($args)->via("ANY"); - } - - /** - * Not Found Handler - * - * This method defines or invokes the application-wide Not Found handler. - * There are two contexts in which this method may be invoked: - * - * 1. When declaring the handler: - * - * If the $callable parameter is not null and is callable, this - * method will register the callable to be invoked when no - * routes match the current HTTP request. It WILL NOT invoke the callable. - * - * 2. When invoking the handler: - * - * If the $callable parameter is null, Slim assumes you want - * to invoke an already-registered handler. If the handler has been - * registered and is callable, it is invoked and sends a 404 HTTP Response - * whose body is the output of the Not Found handler. - * - * @param mixed $callable Anything that returns true for is_callable() - */ - public function notFound ($callable = null) - { - if (is_callable($callable)) { - $this->notFound = $callable; - } else { - ob_start(); - if (is_callable($this->notFound)) { - call_user_func($this->notFound); - } else { - call_user_func(array($this, 'defaultNotFound')); - } - $this->halt(404, ob_get_clean()); - } - } - - /** - * Error Handler - * - * This method defines or invokes the application-wide Error handler. - * There are two contexts in which this method may be invoked: - * - * 1. When declaring the handler: - * - * If the $argument parameter is callable, this - * method will register the callable to be invoked when an uncaught - * Exception is detected, or when otherwise explicitly invoked. - * The handler WILL NOT be invoked in this context. - * - * 2. When invoking the handler: - * - * If the $argument parameter is not callable, Slim assumes you want - * to invoke an already-registered handler. If the handler has been - * registered and is callable, it is invoked and passed the caught Exception - * as its one and only argument. The error handler's output is captured - * into an output buffer and sent as the body of a 500 HTTP Response. - * - * @param mixed $argument Callable|\Exception - */ - public function error($argument = null) - { - if (is_callable($argument)) { - //Register error handler - $this->error = $argument; - } else { - //Invoke error handler - $this->response->status(500); - $this->response->body(''); - $this->response->write($this->callErrorHandler($argument)); - $this->stop(); - } - } - - /** - * Call error handler - * - * This will invoke the custom or default error handler - * and RETURN its output. - * - * @param \Exception|null $argument - * @return string - */ - protected function callErrorHandler($argument = null) - { - ob_start(); - if (is_callable($this->error)) { - call_user_func_array($this->error, array($argument)); - } else { - call_user_func_array(array($this, 'defaultError'), array($argument)); - } - - return ob_get_clean(); - } - - /******************************************************************************** - * Application Accessors - *******************************************************************************/ - - /** - * Get a reference to the Environment object - * @return \Slim\Environment - */ - public function environment() - { - return $this->environment; - } - - /** - * Get the Request object - * @return \Slim\Http\Request - */ - public function request() - { - return $this->request; - } - - /** - * Get the Response object - * @return \Slim\Http\Response - */ - public function response() - { - return $this->response; - } - - /** - * Get the Router object - * @return \Slim\Router - */ - public function router() - { - return $this->router; - } - - /** - * Get and/or set the View - * - * This method declares the View to be used by the Slim application. - * If the argument is a string, Slim will instantiate a new object - * of the same class. If the argument is an instance of View or a subclass - * of View, Slim will use the argument as the View. - * - * If a View already exists and this method is called to create a - * new View, data already set in the existing View will be - * transferred to the new View. - * - * @param string|\Slim\View $viewClass The name or instance of a \Slim\View subclass - * @return \Slim\View - */ - public function view($viewClass = null) - { - if (!is_null($viewClass)) { - $existingData = is_null($this->view) ? array() : $this->view->getData(); - if ($viewClass instanceOf \Slim\View) { - $this->view = $viewClass; - } else { - $this->view = new $viewClass(); - } - $this->view->appendData($existingData); - $this->view->setTemplatesDirectory($this->config('templates.path')); - } - - return $this->view; - } - - /******************************************************************************** - * Rendering - *******************************************************************************/ - - /** - * Render a template - * - * Call this method within a GET, POST, PUT, PATCH, DELETE, NOT FOUND, or ERROR - * callable to render a template whose output is appended to the - * current HTTP response body. How the template is rendered is - * delegated to the current View. - * - * @param string $template The name of the template passed into the view's render() method - * @param array $data Associative array of data made available to the view - * @param int $status The HTTP response status code to use (optional) - */ - public function render($template, $data = array(), $status = null) - { - if (!is_null($status)) { - $this->response->status($status); - } - $this->view->appendData($data); - $this->view->display($template); - } - - /******************************************************************************** - * HTTP Caching - *******************************************************************************/ - - /** - * Set Last-Modified HTTP Response Header - * - * Set the HTTP 'Last-Modified' header and stop if a conditional - * GET request's `If-Modified-Since` header matches the last modified time - * of the resource. The `time` argument is a UNIX timestamp integer value. - * When the current request includes an 'If-Modified-Since' header that - * matches the specified last modified time, the application will stop - * and send a '304 Not Modified' response to the client. - * - * @param int $time The last modified UNIX timestamp - * @throws \InvalidArgumentException If provided timestamp is not an integer - */ - public function lastModified($time) - { - if (is_integer($time)) { - $this->response->headers->set('Last-Modified', gmdate('D, d M Y H:i:s T', $time)); - if ($time === strtotime($this->request->headers->get('IF_MODIFIED_SINCE'))) { - $this->halt(304); - } - } else { - throw new \InvalidArgumentException('Slim::lastModified only accepts an integer UNIX timestamp value.'); - } - } - - /** - * Set ETag HTTP Response Header - * - * Set the etag header and stop if the conditional GET request matches. - * The `value` argument is a unique identifier for the current resource. - * The `type` argument indicates whether the etag should be used as a strong or - * weak cache validator. - * - * When the current request includes an 'If-None-Match' header with - * a matching etag, execution is immediately stopped. If the request - * method is GET or HEAD, a '304 Not Modified' response is sent. - * - * @param string $value The etag value - * @param string $type The type of etag to create; either "strong" or "weak" - * @throws \InvalidArgumentException If provided type is invalid - */ - public function etag($value, $type = 'strong') - { - //Ensure type is correct - if (!in_array($type, array('strong', 'weak'))) { - throw new \InvalidArgumentException('Invalid Slim::etag type. Expected "strong" or "weak".'); - } - - //Set etag value - $value = '"' . $value . '"'; - if ($type === 'weak') { - $value = 'W/'.$value; - } - $this->response['ETag'] = $value; - - //Check conditional GET - if ($etagsHeader = $this->request->headers->get('IF_NONE_MATCH')) { - $etags = preg_split('@\s*,\s*@', $etagsHeader); - if (in_array($value, $etags) || in_array('*', $etags)) { - $this->halt(304); - } - } - } - - /** - * Set Expires HTTP response header - * - * The `Expires` header tells the HTTP client the time at which - * the current resource should be considered stale. At that time the HTTP - * client will send a conditional GET request to the server; the server - * may return a 200 OK if the resource has changed, else a 304 Not Modified - * if the resource has not changed. The `Expires` header should be used in - * conjunction with the `etag()` or `lastModified()` methods above. - * - * @param string|int $time If string, a time to be parsed by `strtotime()`; - * If int, a UNIX timestamp; - */ - public function expires($time) - { - if (is_string($time)) { - $time = strtotime($time); - } - $this->response->headers->set('Expires', gmdate('D, d M Y H:i:s T', $time)); - } - - /******************************************************************************** - * HTTP Cookies - *******************************************************************************/ - - /** - * Set HTTP cookie to be sent with the HTTP response - * - * @param string $name The cookie name - * @param string $value The cookie value - * @param int|string $time The duration of the cookie; - * If integer, should be UNIX timestamp; - * If string, converted to UNIX timestamp with `strtotime`; - * @param string $path The path on the server in which the cookie will be available on - * @param string $domain The domain that the cookie is available to - * @param bool $secure Indicates that the cookie should only be transmitted over a secure - * HTTPS connection to/from the client - * @param bool $httponly When TRUE the cookie will be made accessible only through the HTTP protocol - */ - public function setCookie($name, $value, $time = null, $path = null, $domain = null, $secure = null, $httponly = null) - { - $settings = array( - 'value' => $value, - 'expires' => is_null($time) ? $this->config('cookies.lifetime') : $time, - 'path' => is_null($path) ? $this->config('cookies.path') : $path, - 'domain' => is_null($domain) ? $this->config('cookies.domain') : $domain, - 'secure' => is_null($secure) ? $this->config('cookies.secure') : $secure, - 'httponly' => is_null($httponly) ? $this->config('cookies.httponly') : $httponly - ); - $this->response->cookies->set($name, $settings); - } - - /** - * Get value of HTTP cookie from the current HTTP request - * - * Return the value of a cookie from the current HTTP request, - * or return NULL if cookie does not exist. Cookies created during - * the current request will not be available until the next request. - * - * @param string $name - * @param bool $deleteIfInvalid - * @return string|null - */ - public function getCookie($name, $deleteIfInvalid = true) - { - // Get cookie value - $value = $this->request->cookies->get($name); - - // Decode if encrypted - if ($this->config('cookies.encrypt')) { - $value = \Slim\Http\Util::decodeSecureCookie( - $value, - $this->config('cookies.secret_key'), - $this->config('cookies.cipher'), - $this->config('cookies.cipher_mode') - ); - if ($value === false && $deleteIfInvalid) { - $this->deleteCookie($name); - } - } - - /* - * transform $value to @return doc requirement. - * \Slim\Http\Util::decodeSecureCookie - is able - * to return false and we have to cast it to null. - */ - return $value === false ? null : $value; - } - - /** - * DEPRECATION WARNING! Use `setCookie` with the `cookies.encrypt` app setting set to `true`. - * - * Set encrypted HTTP cookie - * - * @param string $name The cookie name - * @param mixed $value The cookie value - * @param mixed $expires The duration of the cookie; - * If integer, should be UNIX timestamp; - * If string, converted to UNIX timestamp with `strtotime`; - * @param string $path The path on the server in which the cookie will be available on - * @param string $domain The domain that the cookie is available to - * @param bool $secure Indicates that the cookie should only be transmitted over a secure - * HTTPS connection from the client - * @param bool $httponly When TRUE the cookie will be made accessible only through the HTTP protocol - */ - public function setEncryptedCookie($name, $value, $expires = null, $path = null, $domain = null, $secure = false, $httponly = false) - { - $this->setCookie($name, $value, $expires, $path, $domain, $secure, $httponly); - } - - /** - * DEPRECATION WARNING! Use `getCookie` with the `cookies.encrypt` app setting set to `true`. - * - * Get value of encrypted HTTP cookie - * - * Return the value of an encrypted cookie from the current HTTP request, - * or return NULL if cookie does not exist. Encrypted cookies created during - * the current request will not be available until the next request. - * - * @param string $name - * @param bool $deleteIfInvalid - * @return string|bool - */ - public function getEncryptedCookie($name, $deleteIfInvalid = true) - { - return $this->getCookie($name, $deleteIfInvalid); - } - - /** - * Delete HTTP cookie (encrypted or unencrypted) - * - * Remove a Cookie from the client. This method will overwrite an existing Cookie - * with a new, empty, auto-expiring Cookie. This method's arguments must match - * the original Cookie's respective arguments for the original Cookie to be - * removed. If any of this method's arguments are omitted or set to NULL, the - * default Cookie setting values (set during Slim::init) will be used instead. - * - * @param string $name The cookie name - * @param string $path The path on the server in which the cookie will be available on - * @param string $domain The domain that the cookie is available to - * @param bool $secure Indicates that the cookie should only be transmitted over a secure - * HTTPS connection from the client - * @param bool $httponly When TRUE the cookie will be made accessible only through the HTTP protocol - */ - public function deleteCookie($name, $path = null, $domain = null, $secure = null, $httponly = null) - { - $settings = array( - 'domain' => is_null($domain) ? $this->config('cookies.domain') : $domain, - 'path' => is_null($path) ? $this->config('cookies.path') : $path, - 'secure' => is_null($secure) ? $this->config('cookies.secure') : $secure, - 'httponly' => is_null($httponly) ? $this->config('cookies.httponly') : $httponly - ); - $this->response->cookies->remove($name, $settings); - } - - /******************************************************************************** - * Helper Methods - *******************************************************************************/ - - /** - * Get the absolute path to this Slim application's root directory - * - * This method returns the absolute path to the Slim application's - * directory. If the Slim application is installed in a public-accessible - * sub-directory, the sub-directory path will be included. This method - * will always return an absolute path WITH a trailing slash. - * - * @return string - */ - public function root() - { - return rtrim($_SERVER['DOCUMENT_ROOT'], '/') . rtrim($this->request->getRootUri(), '/') . '/'; - } - - /** - * Clean current output buffer - */ - protected function cleanBuffer() - { - if (ob_get_level() !== 0) { - ob_clean(); - } - } - - /** - * Stop - * - * The thrown exception will be caught in application's `call()` method - * and the response will be sent as is to the HTTP client. - * - * @throws \Slim\Exception\Stop - */ - public function stop() - { - throw new \Slim\Exception\Stop(); - } - - /** - * Halt - * - * Stop the application and immediately send the response with a - * specific status and body to the HTTP client. This may send any - * type of response: info, success, redirect, client error, or server error. - * If you need to render a template AND customize the response status, - * use the application's `render()` method instead. - * - * @param int $status The HTTP response status - * @param string $message The HTTP response body - */ - public function halt($status, $message = '') - { - $this->cleanBuffer(); - $this->response->status($status); - $this->response->body($message); - $this->stop(); - } - - /** - * Pass - * - * The thrown exception is caught in the application's `call()` method causing - * the router's current iteration to stop and continue to the subsequent route if available. - * If no subsequent matching routes are found, a 404 response will be sent to the client. - * - * @throws \Slim\Exception\Pass - */ - public function pass() - { - $this->cleanBuffer(); - throw new \Slim\Exception\Pass(); - } - - /** - * Set the HTTP response Content-Type - * @param string $type The Content-Type for the Response (ie. text/html) - */ - public function contentType($type) - { - $this->response->headers->set('Content-Type', $type); - } - - /** - * Set the HTTP response status code - * @param int $code The HTTP response status code - */ - public function status($code) - { - $this->response->setStatus($code); - } - - /** - * Get the URL for a named route - * @param string $name The route name - * @param array $params Associative array of URL parameters and replacement values - * @throws \RuntimeException If named route does not exist - * @return string - */ - public function urlFor($name, $params = array()) - { - return $this->request->getRootUri() . $this->router->urlFor($name, $params); - } - - /** - * Redirect - * - * This method immediately redirects to a new URL. By default, - * this issues a 302 Found response; this is considered the default - * generic redirect response. You may also specify another valid - * 3xx status code if you want. This method will automatically set the - * HTTP Location header for you using the URL parameter. - * - * @param string $url The destination URL - * @param int $status The HTTP redirect status code (optional) - */ - public function redirect($url, $status = 302) - { - $this->response->redirect($url, $status); - $this->halt($status); - } - - /** - * RedirectTo - * - * Redirects to a specific named route - * - * @param string $route The route name - * @param array $params Associative array of URL parameters and replacement values - */ - public function redirectTo($route, $params = array(), $status = 302){ - $this->redirect($this->urlFor($route, $params), $status); - } - - /******************************************************************************** - * Flash Messages - *******************************************************************************/ - - /** - * Set flash message for subsequent request - * @param string $key - * @param mixed $value - */ - public function flash($key, $value) - { - if (isset($this->environment['slim.flash'])) { - $this->environment['slim.flash']->set($key, $value); - } - } - - /** - * Set flash message for current request - * @param string $key - * @param mixed $value - */ - public function flashNow($key, $value) - { - if (isset($this->environment['slim.flash'])) { - $this->environment['slim.flash']->now($key, $value); - } - } - - /** - * Keep flash messages from previous request for subsequent request - */ - public function flashKeep() - { - if (isset($this->environment['slim.flash'])) { - $this->environment['slim.flash']->keep(); - } - } - - /** - * Get all flash messages - */ - public function flashData() - { - if (isset($this->environment['slim.flash'])) { - return $this->environment['slim.flash']->getMessages(); - } - } - - /******************************************************************************** - * Hooks - *******************************************************************************/ - - /** - * Assign hook - * @param string $name The hook name - * @param mixed $callable A callable object - * @param int $priority The hook priority; 0 = high, 10 = low - */ - public function hook($name, $callable, $priority = 10) - { - if (!isset($this->hooks[$name])) { - $this->hooks[$name] = array(array()); - } - if (is_callable($callable)) { - $this->hooks[$name][(int) $priority][] = $callable; - } - } - - /** - * Invoke hook - * @param string $name The hook name - * @param mixed ... (Optional) Argument(s) for hooked functions, can specify multiple arguments - */ - public function applyHook($name) - { - if (!isset($this->hooks[$name])) { - $this->hooks[$name] = array(array()); - } - if (!empty($this->hooks[$name])) { - // Sort by priority, low to high, if there's more than one priority - if (count($this->hooks[$name]) > 1) { - ksort($this->hooks[$name]); - } - - $args = func_get_args(); - array_shift($args); - - foreach ($this->hooks[$name] as $priority) { - if (!empty($priority)) { - foreach ($priority as $callable) { - call_user_func_array($callable, $args); - } - } - } - } - } - - /** - * Get hook listeners - * - * Return an array of registered hooks. If `$name` is a valid - * hook name, only the listeners attached to that hook are returned. - * Else, all listeners are returned as an associative array whose - * keys are hook names and whose values are arrays of listeners. - * - * @param string $name A hook name (Optional) - * @return array|null - */ - public function getHooks($name = null) - { - if (!is_null($name)) { - return isset($this->hooks[(string) $name]) ? $this->hooks[(string) $name] : null; - } else { - return $this->hooks; - } - } - - /** - * Clear hook listeners - * - * Clear all listeners for all hooks. If `$name` is - * a valid hook name, only the listeners attached - * to that hook will be cleared. - * - * @param string $name A hook name (Optional) - */ - public function clearHooks($name = null) - { - if (!is_null($name) && isset($this->hooks[(string) $name])) { - $this->hooks[(string) $name] = array(array()); - } else { - foreach ($this->hooks as $key => $value) { - $this->hooks[$key] = array(array()); - } - } - } - - /******************************************************************************** - * Middleware - *******************************************************************************/ - - /** - * Add middleware - * - * This method prepends new middleware to the application middleware stack. - * The argument must be an instance that subclasses Slim_Middleware. - * - * @param \Slim\Middleware - */ - public function add(\Slim\Middleware $newMiddleware) - { - if(in_array($newMiddleware, $this->middleware)) { - $middleware_class = get_class($newMiddleware); - throw new \RuntimeException("Circular Middleware setup detected. Tried to queue the same Middleware instance ({$middleware_class}) twice."); - } - $newMiddleware->setApplication($this); - $newMiddleware->setNextMiddleware($this->middleware[0]); - array_unshift($this->middleware, $newMiddleware); - } - - /******************************************************************************** - * Runner - *******************************************************************************/ - - /** - * Run - * - * This method invokes the middleware stack, including the core Slim application; - * the result is an array of HTTP status, header, and body. These three items - * are returned to the HTTP client. - */ - public function run() - { - set_error_handler(array('\Slim\Slim', 'handleErrors')); - - //Apply final outer middleware layers - if ($this->config('debug')) { - //Apply pretty exceptions only in debug to avoid accidental information leakage in production - $this->add(new \Slim\Middleware\PrettyExceptions()); - } - - //Invoke middleware and application stack - $this->middleware[0]->call(); - - //Fetch status, header, and body - list($status, $headers, $body) = $this->response->finalize(); - - // Serialize cookies (with optional encryption) - \Slim\Http\Util::serializeCookies($headers, $this->response->cookies, $this->settings); - - //Send headers - if (headers_sent() === false) { - //Send status - if (strpos(PHP_SAPI, 'cgi') === 0) { - header(sprintf('Status: %s', \Slim\Http\Response::getMessageForCode($status))); - } else { - header(sprintf('HTTP/%s %s', $this->config('http.version'), \Slim\Http\Response::getMessageForCode($status))); - } - - //Send headers - foreach ($headers as $name => $value) { - $hValues = explode("\n", $value); - foreach ($hValues as $hVal) { - header("$name: $hVal", false); - } - } - } - - //Send body, but only if it isn't a HEAD request - if (!$this->request->isHead()) { - echo $body; - } - - $this->applyHook('slim.after'); - - restore_error_handler(); - } - - /** - * Call - * - * This method finds and iterates all route objects that match the current request URI. - */ - public function call() - { - try { - if (isset($this->environment['slim.flash'])) { - $this->view()->setData('flash', $this->environment['slim.flash']); - } - $this->applyHook('slim.before'); - ob_start(); - $this->applyHook('slim.before.router'); - $dispatched = false; - $matchedRoutes = $this->router->getMatchedRoutes($this->request->getMethod(), $this->request->getResourceUri()); - foreach ($matchedRoutes as $route) { - try { - $this->applyHook('slim.before.dispatch'); - $dispatched = $route->dispatch(); - $this->applyHook('slim.after.dispatch'); - if ($dispatched) { - break; - } - } catch (\Slim\Exception\Pass $e) { - continue; - } - } - if (!$dispatched) { - $this->notFound(); - } - $this->applyHook('slim.after.router'); - $this->stop(); - } catch (\Slim\Exception\Stop $e) { - $this->response()->write(ob_get_clean()); - } catch (\Exception $e) { - if ($this->config('debug')) { - ob_end_clean(); - throw $e; - } else { - try { - $this->response()->write(ob_get_clean()); - $this->error($e); - } catch (\Slim\Exception\Stop $e) { - // Do nothing - } - } - } - } - - /******************************************************************************** - * Error Handling and Debugging - *******************************************************************************/ - - /** - * Convert errors into ErrorException objects - * - * This method catches PHP errors and converts them into \ErrorException objects; - * these \ErrorException objects are then thrown and caught by Slim's - * built-in or custom error handlers. - * - * @param int $errno The numeric type of the Error - * @param string $errstr The error message - * @param string $errfile The absolute path to the affected file - * @param int $errline The line number of the error in the affected file - * @return bool - * @throws \ErrorException - */ - public static function handleErrors($errno, $errstr = '', $errfile = '', $errline = '') - { - if (!($errno & error_reporting())) { - return; - } - - throw new \ErrorException($errstr, $errno, 0, $errfile, $errline); - } - - /** - * Generate diagnostic template markup - * - * This method accepts a title and body content to generate an HTML document layout. - * - * @param string $title The title of the HTML template - * @param string $body The body content of the HTML template - * @return string - */ - protected static function generateTemplateMarkup($title, $body) - { - return sprintf("<html><head><title>%s</title><style>body{margin:0;padding:30px;font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;}h1{margin:0;font-size:48px;font-weight:normal;line-height:48px;}strong{display:inline-block;width:65px;}</style></head><body><h1>%s</h1>%s</body></html>", $title, $title, $body); - } - - /** - * Default Not Found handler - */ - protected function defaultNotFound() - { - echo static::generateTemplateMarkup('404 Page Not Found', '<p>The page you are looking for could not be found. Check the address bar to ensure your URL is spelled correctly. If all else fails, you can visit our home page at the link below.</p><a href="' . $this->request->getRootUri() . '/">Visit the Home Page</a>'); - } - - /** - * Default Error handler - */ - protected function defaultError($e) - { - $this->getLog()->error($e); - echo self::generateTemplateMarkup('Error', '<p>A website error has occurred. The website administrator has been notified of the issue. Sorry for the temporary inconvenience.</p>'); - } -} diff --git a/vendor/slim/slim/Slim/View.php b/vendor/slim/slim/Slim/View.php deleted file mode 100644 index 229f424..0000000 --- a/vendor/slim/slim/Slim/View.php +++ /dev/null @@ -1,282 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * @package Slim - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -namespace Slim; - -/** - * View - * - * The view is responsible for rendering a template. The view - * should subclass \Slim\View and implement this interface: - * - * public render(string $template); - * - * This method should render the specified template and return - * the resultant string. - * - * @package Slim - * @author Josh Lockhart - * @since 1.0.0 - */ -class View -{ - /** - * Data available to the view templates - * @var \Slim\Helper\Set - */ - protected $data; - - /** - * Path to templates base directory (without trailing slash) - * @var string - */ - protected $templatesDirectory; - - /** - * Constructor - */ - public function __construct() - { - $this->data = new \Slim\Helper\Set(); - } - - /******************************************************************************** - * Data methods - *******************************************************************************/ - - /** - * Does view data have value with key? - * @param string $key - * @return boolean - */ - public function has($key) - { - return $this->data->has($key); - } - - /** - * Return view data value with key - * @param string $key - * @return mixed - */ - public function get($key) - { - return $this->data->get($key); - } - - /** - * Set view data value with key - * @param string $key - * @param mixed $value - */ - public function set($key, $value) - { - $this->data->set($key, $value); - } - - /** - * Set view data value as Closure with key - * @param string $key - * @param mixed $value - */ - public function keep($key, \Closure $value) - { - $this->data->keep($key, $value); - } - - /** - * Return view data - * @return array - */ - public function all() - { - return $this->data->all(); - } - - /** - * Replace view data - * @param array $data - */ - public function replace(array $data) - { - $this->data->replace($data); - } - - /** - * Clear view data - */ - public function clear() - { - $this->data->clear(); - } - - /******************************************************************************** - * Legacy data methods - *******************************************************************************/ - - /** - * DEPRECATION WARNING! This method will be removed in the next major point release - * - * Get data from view - */ - public function getData($key = null) - { - if (!is_null($key)) { - return isset($this->data[$key]) ? $this->data[$key] : null; - } - - return $this->data->all(); - } - - /** - * DEPRECATION WARNING! This method will be removed in the next major point release - * - * Set data for view - */ - public function setData() - { - $args = func_get_args(); - if (count($args) === 1 && is_array($args[0])) { - $this->data->replace($args[0]); - } elseif (count($args) === 2) { - // Ensure original behavior is maintained. DO NOT invoke stored Closures. - if (is_object($args[1]) && method_exists($args[1], '__invoke')) { - $this->data->set($args[0], $this->data->protect($args[1])); - } else { - $this->data->set($args[0], $args[1]); - } - } else { - throw new \InvalidArgumentException('Cannot set View data with provided arguments. Usage: `View::setData( $key, $value );` or `View::setData([ key => value, ... ]);`'); - } - } - - /** - * DEPRECATION WARNING! This method will be removed in the next major point release - * - * Append data to view - * @param array $data - */ - public function appendData($data) - { - if (!is_array($data)) { - throw new \InvalidArgumentException('Cannot append view data. Expected array argument.'); - } - $this->data->replace($data); - } - - /******************************************************************************** - * Resolve template paths - *******************************************************************************/ - - /** - * Set the base directory that contains view templates - * @param string $directory - * @throws \InvalidArgumentException If directory is not a directory - */ - public function setTemplatesDirectory($directory) - { - $this->templatesDirectory = rtrim($directory, DIRECTORY_SEPARATOR); - } - - /** - * Get templates base directory - * @return string - */ - public function getTemplatesDirectory() - { - return $this->templatesDirectory; - } - - /** - * Get fully qualified path to template file using templates base directory - * @param string $file The template file pathname relative to templates base directory - * @return string - */ - public function getTemplatePathname($file) - { - return $this->templatesDirectory . DIRECTORY_SEPARATOR . ltrim($file, DIRECTORY_SEPARATOR); - } - - /******************************************************************************** - * Rendering - *******************************************************************************/ - - /** - * Display template - * - * This method echoes the rendered template to the current output buffer - * - * @param string $template Pathname of template file relative to templates directory - * @param array $data Any additonal data to be passed to the template. - */ - public function display($template, $data = null) - { - echo $this->fetch($template, $data); - } - - /** - * Return the contents of a rendered template file - * - * @param string $template The template pathname, relative to the template base directory - * @param array $data Any additonal data to be passed to the template. - * @return string The rendered template - */ - public function fetch($template, $data = null) - { - return $this->render($template, $data); - } - - /** - * Render a template file - * - * NOTE: This method should be overridden by custom view subclasses - * - * @param string $template The template pathname, relative to the template base directory - * @param array $data Any additonal data to be passed to the template. - * @return string The rendered template - * @throws \RuntimeException If resolved template pathname is not a valid file - */ - protected function render($template, $data = null) - { - $templatePathname = $this->getTemplatePathname($template); - if (!is_file($templatePathname)) { - throw new \RuntimeException("View cannot render `$template` because the template does not exist"); - } - - $data = array_merge($this->data->all(), (array) $data); - extract($data); - ob_start(); - require $templatePathname; - - return ob_get_clean(); - } -} diff --git a/vendor/slim/slim/composer.json b/vendor/slim/slim/composer.json deleted file mode 100644 index 7769cad..0000000 --- a/vendor/slim/slim/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "slim/slim", - "type": "library", - "description": "Slim Framework, a PHP micro framework", - "keywords": ["microframework","rest","router"], - "homepage": "http://github.com/codeguy/Slim", - "license": "MIT", - "authors": [ - { - "name": "Josh Lockhart", - "email": "info@joshlockhart.com", - "homepage": "http://www.joshlockhart.com/" - } - ], - "require": { - "php": ">=5.3.0" - }, - "suggest": { - "ext-mcrypt": "Required for HTTP cookie encryption", - "phpseclib/mcrypt_compat": "Polyfil for mcrypt extension" - }, - "autoload": { - "psr-0": { "Slim": "." } - } -} diff --git a/vendor/slim/slim/index.php b/vendor/slim/slim/index.php deleted file mode 100644 index 355a8f5..0000000 --- a/vendor/slim/slim/index.php +++ /dev/null @@ -1,169 +0,0 @@ -<?php -/** - * Step 1: Require the Slim Framework - * - * If you are not using Composer, you need to require the - * Slim Framework and register its PSR-0 autoloader. - * - * If you are using Composer, you can skip this step. - */ -require 'Slim/Slim.php'; - -\Slim\Slim::registerAutoloader(); - -/** - * Step 2: Instantiate a Slim application - * - * This example instantiates a Slim application using - * its default settings. However, you will usually configure - * your Slim application now by passing an associative array - * of setting names and values into the application constructor. - */ -$app = new \Slim\Slim(); - -/** - * Step 3: Define the Slim application routes - * - * Here we define several Slim application routes that respond - * to appropriate HTTP request methods. In this example, the second - * argument for `Slim::get`, `Slim::post`, `Slim::put`, `Slim::patch`, and `Slim::delete` - * is an anonymous function. - */ - -// GET route -$app->get( - '/', - function () { - $template = <<<EOT -<!DOCTYPE html> - <html> - <head> - <meta charset="utf-8"/> - <title>Slim Framework for PHP 5</title> - <style> - html,body,div,span,object,iframe, - h1,h2,h3,h4,h5,h6,p,blockquote,pre, - abbr,address,cite,code, - del,dfn,em,img,ins,kbd,q,samp, - small,strong,sub,sup,var, - b,i, - dl,dt,dd,ol,ul,li, - fieldset,form,label,legend, - table,caption,tbody,tfoot,thead,tr,th,td, - article,aside,canvas,details,figcaption,figure, - footer,header,hgroup,menu,nav,section,summary, - time,mark,audio,video{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;} - body{line-height:1;} - article,aside,details,figcaption,figure, - footer,header,hgroup,menu,nav,section{display:block;} - nav ul{list-style:none;} - blockquote,q{quotes:none;} - blockquote:before,blockquote:after, - q:before,q:after{content:'';content:none;} - a{margin:0;padding:0;font-size:100%;vertical-align:baseline;background:transparent;} - ins{background-color:#ff9;color:#000;text-decoration:none;} - mark{background-color:#ff9;color:#000;font-style:italic;font-weight:bold;} - del{text-decoration:line-through;} - abbr[title],dfn[title]{border-bottom:1px dotted;cursor:help;} - table{border-collapse:collapse;border-spacing:0;} - hr{display:block;height:1px;border:0;border-top:1px solid #cccccc;margin:1em 0;padding:0;} - input,select{vertical-align:middle;} - html{ background: #EDEDED; height: 100%; } - body{background:#FFF;margin:0 auto;min-height:100%;padding:0 30px;width:440px;color:#666;font:14px/23px Arial,Verdana,sans-serif;} - h1,h2,h3,p,ul,ol,form,section{margin:0 0 20px 0;} - h1{color:#333;font-size:20px;} - h2,h3{color:#333;font-size:14px;} - h3{margin:0;font-size:12px;font-weight:bold;} - ul,ol{list-style-position:inside;color:#999;} - ul{list-style-type:square;} - code,kbd{background:#EEE;border:1px solid #DDD;border:1px solid #DDD;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;padding:0 4px;color:#666;font-size:12px;} - pre{background:#EEE;border:1px solid #DDD;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;padding:5px 10px;color:#666;font-size:12px;} - pre code{background:transparent;border:none;padding:0;} - a{color:#70a23e;} - header{padding: 30px 0;text-align:center;} - </style> - </head> - <body> - <header> - <a href="http://www.slimframework.com"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHIAAAA6CAYAAABs1g18AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABRhJREFUeNrsXY+VsjAMR98twAo6Ao4gI+gIOIKOgCPICDoCjCAjXFdgha+5C3dcv/QfFB5i8h5PD21Bfk3yS9L2VpGnlGW5kS9wJMTHNRxpmjYRy6SycgRvL18OeMQOTYQ8HvIoJKiiz43hgHkq1zvK/h6e/TyJQXeV/VyWBOSHA4C5RvtMAiCc4ZB9FPjgRI8+YuKcrySO515a1hoAY3nc4G2AH52BZsn+MjaAEwIJICKAIR889HljMCcyrR0QE4v/q/BVBQva7Q1tAczG18+x+PvIswHEAslLbfGrMZKiXEOMAMy6LwlisQCJLPFMfKdBtli5dIihRyH7A627Iaiq5sJ1ThP9xoIgSdWSNVIHYmrTQgOgRyRNqm/M5PnrFFopr3F6B41cd8whRUSufUBU5EL4U93AYRnIWimCIiSI1wAaAZpJ9bPnxx8eyI3Gt4QybwWa6T/BvbQECUMQFkhd3jSkPFgrxwcynuBaNT/u6eJIlbGOBWSNIUDFEIwPZFAtBfYrfeIOSRSXuUYCsprCXwUIZWYnmEhJFMIocMDWjn206c2EsGLCJd42aWSyBNMnHxLEq7niMrY2qyDbQUbqrrTbwUPtxN1ZZCitQV4ZSd6DyoxhmRD6OFjuRUS/KdLGRHYowJZaqYgjt9Lchmi3QYA/cXBsHK6VfWNR5jgA1DLhwfFe4HqfODBpINEECCLO47LT/+HSvSd/OCOgQ8qE0DbHQUBqpC4BkKMPYPkFY4iAJXhGAYr1qmaqQDbECCg5A2NMchzR567aA4xcRKclI405Bmt46vYD7/Gcjqfk6GP/kh1wovIDSHDfiAs/8bOCQ4cf4qMt7eH5Cucr3S0aWGFfjdLHD8EhCFvXQlSqRrY5UV2O9cfZtk77jUFMXeqzCEZqSK4ICkSin2tE12/3rbVcE41OBjBjBPSdJ1N5lfYQpIuhr8axnyIy5KvXmkYnw8VbcwtTNj7fDNCmT2kPQXA+bxpEXkB21HlnSQq0gD67jnfh5KavVJa/XQYEFSaagWwbgjNA+ywstLpEWTKgc5gwVpsyO1bTII+tA6B7BPS+0PiznuM9gPKsPVXbFdADMtwbJxSmkXWfRh6AZhyyzBjIHoDmnCGaMZAKjd5hyNJYCBGDOVcg28AXQ5atAVDO3c4dSALQnYblfa3M4kc/cyA7gMIUBQCTyl4kugIpy8yA7ACqK8Uwk30lIFGOEV3rPDAELwQkr/9YjkaCPDQhCcsrAYlF1v8W8jAEYeQDY7qn6tNGWudfq+YUEr6uq6FZzBpJMUfWFDatLHMCciw2mRC+k81qCCA1DzK4aUVfrJpxnloZWCPVnOgYy8L3GvKjE96HpweQoy7iwVQclVutLOEKJxA8gaRCjSzgNI2zhh3bQhzBCQQPIHGaHaUd96GJbZz3Smmjy16u6j3FuKyNxcBarxqWWfYFE0tVVO1Rl3t1Mb05V00MQCJ71YHpNaMcsjWAfkQvPPkaNC7LqTG7JAhGXTKYf+VDeXAX9IvURoAwtTFHvyYIxtnd5tPkywrPafcwbeSuGVwFau3b76NO7SHQrvqhfFE8kM0Wvpv8gVYiYBlxL+fW/34bgP6bIC7JR7YPDubcHCPzIp4+cum7U6NlhZgK7lua3KGLeFwE2m+HblDYWSHG2SAfINuwBBfxbJEIuWZbBH4fAExD7cvaGVyXyH0dhiAYc92z3ZDfUVv+jgb8HrHy7WVO/8BFcy9vuTz+nwADAGnOR39Yg/QkAAAAAElFTkSuQmCC" alt="Slim"/></a> - </header> - <h1>Welcome to Slim!</h1> - <p> - Congratulations! Your Slim application is running. If this is - your first time using Slim, start with this <a href="http://docs.slimframework.com/#Hello-World" target="_blank">"Hello World" Tutorial</a>. - </p> - <section> - <h2>Get Started</h2> - <ol> - <li>The application code is in <code>index.php</code></li> - <li>Read the <a href="http://docs.slimframework.com/" target="_blank">online documentation</a></li> - <li>Follow <a href="http://www.twitter.com/slimphp" target="_blank">@slimphp</a> on Twitter</li> - </ol> - </section> - <section> - <h2>Slim Framework Community</h2> - - <h3>Support Forum and Knowledge Base</h3> - <p> - Visit the <a href="http://help.slimframework.com" target="_blank">Slim support forum and knowledge base</a> - to read announcements, chat with fellow Slim users, ask questions, help others, or show off your cool - Slim Framework apps. - </p> - - <h3>Twitter</h3> - <p> - Follow <a href="http://www.twitter.com/slimphp" target="_blank">@slimphp</a> on Twitter to receive the very latest news - and updates about the framework. - </p> - </section> - <section style="padding-bottom: 20px"> - <h2>Slim Framework Extras</h2> - <p> - Custom View classes for Smarty, Twig, Mustache, and other template - frameworks are available online in a separate repository. - </p> - <p><a href="https://github.com/codeguy/Slim-Extras" target="_blank">Browse the Extras Repository</a></p> - </section> - </body> - </html> -EOT; - echo $template; - } -); - -// POST route -$app->post( - '/post', - function () { - echo 'This is a POST route'; - } -); - -// PUT route -$app->put( - '/put', - function () { - echo 'This is a PUT route'; - } -); - -// PATCH route -$app->patch('/patch', function () { - echo 'This is a PATCH route'; -}); - -// DELETE route -$app->delete( - '/delete', - function () { - echo 'This is a DELETE route'; - } -); - -/** - * Step 4: Run the Slim application - * - * This method should be called last. This executes the Slim application - * and returns the HTTP response to the HTTP client. - */ -$app->run(); diff --git a/vendor/slim/slim/phpunit.xml.dist b/vendor/slim/slim/phpunit.xml.dist deleted file mode 100644 index c4da172..0000000 --- a/vendor/slim/slim/phpunit.xml.dist +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<phpunit backupGlobals="false" - backupStaticAttributes="false" - colors="true" - convertErrorsToExceptions="true" - convertNoticesToExceptions="true" - convertWarningsToExceptions="true" - processIsolation="false" - stopOnFailure="false" - syntaxCheck="false" - bootstrap="tests/bootstrap.php" -> - <testsuites> - <testsuite name="Slim Test Suite"> - <directory>./tests/</directory> - </testsuite> - </testsuites> - - <filter> - <whitelist> - <directory>./Slim/</directory> - </whitelist> - </filter> -</phpunit> diff --git a/vendor/slim/slim/tests/EnvironmentTest.php b/vendor/slim/slim/tests/EnvironmentTest.php deleted file mode 100644 index a81cb4d..0000000 --- a/vendor/slim/slim/tests/EnvironmentTest.php +++ /dev/null @@ -1,376 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -class EnvironmentTest extends PHPUnit_Framework_TestCase -{ - /** - * Default server settings assume the Slim app is installed - * in a subdirectory `foo/` directly beneath the public document - * root directory; URL rewrite is disabled; requested app - * resource is GET `/bar/xyz` with three query params. - * - * These only provide a common baseline for the following - * tests; tests are free to override these values. - */ - public function setUp() - { - $_SERVER['DOCUMENT_ROOT'] = '/var/www'; - $_SERVER['SCRIPT_FILENAME'] = '/var/www/foo/index.php'; - $_SERVER['SERVER_NAME'] = 'slim'; - $_SERVER['SERVER_PORT'] = '80'; - $_SERVER['SCRIPT_NAME'] = '/foo/index.php'; - $_SERVER['REQUEST_URI'] = '/foo/index.php/bar/xyz'; - $_SERVER['PATH_INFO'] = '/bar/xyz'; - $_SERVER['REQUEST_METHOD'] = 'GET'; - $_SERVER['QUERY_STRING'] = 'one=1&two=2&three=3'; - $_SERVER['HTTPS'] = ''; - $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; - unset($_SERVER['CONTENT_TYPE'], $_SERVER['CONTENT_LENGTH']); - } - - /** - * Test mock environment - * - * This should return the custom values where specified - * and the default values otherwise. - */ - public function testMockEnvironment() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'PUT' - )); - $env2 = \Slim\Environment::getInstance(); - $this->assertSame($env, $env2); - $this->assertInstanceOf('\Slim\Environment', $env); - $this->assertEquals('PUT', $env['REQUEST_METHOD']); - $this->assertEquals(80, $env['SERVER_PORT']); - $this->assertNull($env['foo']); - } - - /** - * Test sets HTTP method - */ - public function testSetsHttpMethod() - { - $env = \Slim\Environment::getInstance(true); - $this->assertEquals('GET', $env['REQUEST_METHOD']); - } - - /** - * Test parses script name and path info - * - * Pre-conditions: - * URL Rewrite is disabled; - * App installed in subdirectory; - */ - public function testParsesPathsWithoutUrlRewriteInSubdirectory() - { - $env = \Slim\Environment::getInstance(true); - $this->assertEquals('/bar/xyz', $env['PATH_INFO']); - $this->assertEquals('/foo/index.php', $env['SCRIPT_NAME']); - } - - /** - * Test parses script name and path info - * - * Pre-conditions: - * URL Rewrite is disabled; - * App installed in root directory; - */ - public function testParsesPathsWithoutUrlRewriteInRootDirectory() - { - $_SERVER['SCRIPT_FILENAME'] = '/var/www/index.php'; - $_SERVER['REQUEST_URI'] = '/index.php/bar/xyz'; - $_SERVER['SCRIPT_NAME'] = '/index.php'; - $env = \Slim\Environment::getInstance(true); - $this->assertEquals('/bar/xyz', $env['PATH_INFO']); - $this->assertEquals('/index.php', $env['SCRIPT_NAME']); - } - - /** - * Test parses script name and path info - * - * Pre-conditions: - * URL Rewrite disabled; - * App installed in root directory; - * Requested resource is "/"; - */ - public function testParsesPathsWithoutUrlRewriteInRootDirectoryForAppRootUri() - { - $_SERVER['SCRIPT_FILENAME'] = '/var/www/index.php'; - $_SERVER['REQUEST_URI'] = '/index.php'; - $_SERVER['SCRIPT_NAME'] = '/index.php'; - unset($_SERVER['PATH_INFO']); - $env = \Slim\Environment::getInstance(true); - $this->assertEquals('/', $env['PATH_INFO']); - $this->assertEquals('/index.php', $env['SCRIPT_NAME']); - } - - /** - * Test parses script name and path info - * - * Pre-conditions: - * URL Rewrite enabled; - * App installed in subdirectory; - */ - public function testParsesPathsWithUrlRewriteInSubdirectory() - { - $_SERVER['SCRIPT_NAME'] = '/foo/index.php'; - $_SERVER['REQUEST_URI'] = '/foo/bar/xyz'; - unset($_SERVER['PATH_INFO']); - $env = \Slim\Environment::getInstance(true); - $this->assertEquals('/bar/xyz', $env['PATH_INFO']); - $this->assertEquals('/foo', $env['SCRIPT_NAME']); - } - - /** - * Test parses script name and path info - * - * Pre-conditions: - * URL Rewrite enabled; - * App installed in root directory; - */ - public function testParsesPathsWithUrlRewriteInRootDirectory() - { - $_SERVER['SCRIPT_FILENAME'] = '/var/www/index.php'; - $_SERVER['SCRIPT_NAME'] = '/index.php'; - $_SERVER['REQUEST_URI'] = '/bar/xyz'; - unset($_SERVER['PATH_INFO']); - $env = \Slim\Environment::getInstance(true); - $this->assertEquals('/bar/xyz', $env['PATH_INFO']); - $this->assertEquals('', $env['SCRIPT_NAME']); - } - - /** - * Test parses script name and path info - * - * Pre-conditions: - * URL Rewrite enabled; - * App installed in root directory; - * Requested resource is "/" - */ - public function testParsesPathsWithUrlRewriteInRootDirectoryForAppRootUri() - { - $_SERVER['SCRIPT_FILENAME'] = '/var/www/index.php'; - $_SERVER['REQUEST_URI'] = '/'; - $_SERVER['SCRIPT_NAME'] = '/index.php'; - unset($_SERVER['PATH_INFO']); - $env = \Slim\Environment::getInstance(true); - $this->assertEquals('/', $env['PATH_INFO']); - $this->assertEquals('', $env['SCRIPT_NAME']); - } - - /** - * Test parses query string - * - * Pre-conditions: - * $_SERVER['QUERY_STRING'] exists and is not empty; - */ - public function testParsesQueryString() - { - $env = \Slim\Environment::getInstance(true); - $this->assertEquals('one=1&two=2&three=3', $env['QUERY_STRING']); - } - - /** - * Test removes query string from PATH_INFO when using URL Rewrite - * - * Pre-conditions: - * $_SERVER['QUERY_STRING'] exists and is not empty; - * URL Rewrite enabled; - */ - public function testRemovesQueryStringFromPathInfo() - { - $_SERVER['SCRIPT_NAME'] = '/foo/index.php'; - $_SERVER['REQUEST_URI'] = '/foo/bar/xyz?one=1&two=2&three=3'; - unset($_SERVER['PATH_INFO']); - $env = \Slim\Environment::getInstance(true); - $this->assertEquals('/bar/xyz', $env['PATH_INFO']); - } - - /** - * Test environment's PATH_INFO retains URL encoded characters (e.g. #) - * - * In earlier version, \Slim\Environment would use PATH_INFO instead - * of REQUEST_URI to determine the root URI and resource URI. - * Unfortunately, the server would URL decode the PATH_INFO string - * before it was handed to PHP. This prevented certain URL-encoded - * characters like the octothorpe from being delivered correctly to - * the Slim application environment. This test ensures the - * REQUEST_URI is used instead and parsed as expected. - */ - public function testPathInfoRetainsUrlEncodedCharacters() - { - $_SERVER['SCRIPT_FILENAME'] = '/var/www/index.php'; - $_SERVER['SCRIPT_NAME'] = '/index.php'; - $_SERVER['REQUEST_URI'] = '/foo/%23bar'; //<-- URL-encoded "#bar" - $env = \Slim\Environment::getInstance(true); - $this->assertEquals('/foo/%23bar', $env['PATH_INFO']); - } - - /** - * Test parses query string - * - * Pre-conditions: - * $_SERVER['QUERY_STRING'] does not exist; - */ - public function testParsesQueryStringThatDoesNotExist() - { - unset($_SERVER['QUERY_STRING']); - $env = \Slim\Environment::getInstance(true); - $this->assertEquals('', $env['QUERY_STRING']); - } - - /** - * Test SERVER_NAME is not empty - */ - public function testServerNameIsNotEmpty() - { - $env = \Slim\Environment::getInstance(true); - $this->assertFalse(empty($env['SERVER_NAME'])); - } - - /** - * Test SERVER_PORT is not empty - */ - public function testServerPortIsNotEmpty() - { - $env = \Slim\Environment::getInstance(true); - $this->assertFalse(empty($env['SERVER_PORT'])); - } - - /** - * Test unsets HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH - * - * Pre-conditions: - * HTTP_CONTENT_TYPE is sent with HTTP request; - * HTTP_CONTENT_LENGTH is sent with HTTP request; - */ - public function testUnsetsContentTypeAndContentLength() - { - $_SERVER['HTTP_CONTENT_LENGTH'] = 150; - $env = \Slim\Environment::getInstance(true); - $this->assertFalse(isset($env['HTTP_CONTENT_LENGTH'])); - } - - /** - * Test sets special request headers if not empty - * - * Pre-conditions: - * CONTENT_TYPE, CONTENT_LENGTH, X_REQUESTED_WITH are sent in client HTTP request; - * CONTENT_TYPE, CONTENT_LENGTH, X_REQUESTED_WITH are not empty; - */ - public function testSetsSpecialHeaders() - { - $_SERVER['CONTENT_TYPE'] = 'text/csv'; - $_SERVER['CONTENT_LENGTH'] = '100'; - $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XmlHttpRequest'; - $env = \Slim\Environment::getInstance(true); - $this->assertEquals('text/csv', $env['CONTENT_TYPE']); - $this->assertEquals('100', $env['CONTENT_LENGTH']); - $this->assertEquals('XmlHttpRequest', $env['HTTP_X_REQUESTED_WITH']); - } - - /** - * Tests X-HTTP-Method-Override is allowed through unmolested. - * - * Pre-conditions: - * X_HTTP_METHOD_OVERRIDE is sent in client HTTP request; - * X_HTTP_METHOD_OVERRIDE is not empty; - */ - public function testSetsHttpMethodOverrideHeader() { - $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] = 'DELETE'; - $env = \Slim\Environment::getInstance(true); - $this->assertEquals('DELETE', $env['HTTP_X_HTTP_METHOD_OVERRIDE']); - } - - /** - * Test detects HTTPS - * - * Pre-conditions: - * $_SERVER['HTTPS'] is set to a non-empty value; - */ - public function testHttps() - { - $_SERVER['HTTPS'] = 1; - $env = \Slim\Environment::getInstance(true); - $this->assertEquals('https', $env['slim.url_scheme']); - } - - /** - * Test detects not HTTPS - * - * Pre-conditions: - * $_SERVER['HTTPS'] is set to an empty value; - */ - public function testNotHttps() - { - $_SERVER['HTTPS'] = ''; - $env = \Slim\Environment::getInstance(true); - $this->assertEquals('http', $env['slim.url_scheme']); - } - - /** - * Test detects not HTTPS on IIS - * - * Pre-conditions: - * $_SERVER['HTTPS'] is set to "off"; - */ - public function testNotHttpsIIS() - { - $_SERVER['HTTPS'] = 'off'; - $env = \Slim\Environment::getInstance(true); - $this->assertEquals('http', $env['slim.url_scheme']); - } - - /** - * Test input is an empty string (and not false) - * - * Pre-conditions: - * Input at php://input may only be read once; subsequent attempts - * will return `false`; in which case, use an empty string. - */ - public function testInputIsEmptyString() - { - $env = \Slim\Environment::getInstance(true); - $this->assertEquals('', $env['slim.input']); - } - - /** - * Test valid resource handle to php://stdErr - */ - public function testErrorResource() - { - $env = \Slim\Environment::getInstance(true); - $this->assertTrue(is_resource($env['slim.errors'])); - } -} diff --git a/vendor/slim/slim/tests/Foo.php b/vendor/slim/slim/tests/Foo.php deleted file mode 100644 index d772d02..0000000 --- a/vendor/slim/slim/tests/Foo.php +++ /dev/null @@ -1,7 +0,0 @@ -<?php -class Foo -{ - public function __construct() - { - } -} diff --git a/vendor/slim/slim/tests/Helper/SetTest.php b/vendor/slim/slim/tests/Helper/SetTest.php deleted file mode 100644 index 80ad661..0000000 --- a/vendor/slim/slim/tests/Helper/SetTest.php +++ /dev/null @@ -1,241 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -class SetTest extends PHPUnit_Framework_TestCase -{ - protected $bag; - protected $property; - - public function setUp() - { - $this->bag = new \Slim\Helper\Set(); - $this->property = new \ReflectionProperty($this->bag, 'data'); - $this->property->setAccessible(true); - } - - public function testSet() - { - $this->bag->set('foo', 'bar'); - $this->assertArrayHasKey('foo', $this->property->getValue($this->bag)); - $bag = $this->property->getValue($this->bag); - $this->assertEquals('bar', $bag['foo']); - } - - public function testGet() - { - $this->property->setValue($this->bag, array('foo' => 'bar')); - $this->assertEquals('bar', $this->bag->get('foo')); - } - - public function testGetNotExists() - { - $this->property->setValue($this->bag, array('foo' => 'bar')); - $this->assertEquals('default', $this->bag->get('abc', 'default')); - } - - public function testAdd() - { - $this->bag->replace(array( - 'abc' => '123', - 'foo' => 'bar' - )); - $this->assertArrayHasKey('abc', $this->property->getValue($this->bag)); - $this->assertArrayHasKey('foo', $this->property->getValue($this->bag)); - $bag = $this->property->getValue($this->bag); - $this->assertEquals('123', $bag['abc']); - $this->assertEquals('bar', $bag['foo']); - } - - public function testAll() - { - $data = array( - 'abc' => '123', - 'foo' => 'bar' - ); - $this->property->setValue($this->bag, $data); - $this->assertEquals($data, $this->bag->all()); - } - - public function testKeys() - { - $data = array( - 'abc' => '123', - 'foo' => 'bar' - ); - $this->property->setValue($this->bag, $data); - $this->assertEquals(array('abc', 'foo'), $this->bag->keys()); - } - - public function testRemove() - { - $data = array( - 'abc' => '123', - 'foo' => 'bar' - ); - $this->property->setValue($this->bag, $data); - $this->bag->remove('foo'); - $this->assertEquals(array('abc' => '123'), $this->property->getValue($this->bag)); - } - - public function testClear() - { - $data = array( - 'abc' => '123', - 'foo' => 'bar' - ); - $this->property->setValue($this->bag, $data); - $this->bag->clear(); - $this->assertEquals(array(), $this->property->getValue($this->bag)); - } - - public function testArrayAccessGet() - { - $data = array( - 'abc' => '123', - 'foo' => 'bar' - ); - $this->property->setValue($this->bag, $data); - $this->assertEquals('bar', $this->bag['foo']); - } - - public function testArrayAccessSet() - { - $data = array( - 'abc' => '123', - 'foo' => 'bar' - ); - $this->property->setValue($this->bag, $data); - $this->bag['foo'] = 'changed'; - $bag = $this->property->getValue($this->bag); - $this->assertEquals('changed', $bag['foo']); - } - - public function testArrayAccessExists() - { - $data = array( - 'abc' => '123', - 'foo' => 'bar' - ); - $this->property->setValue($this->bag, $data); - $this->assertTrue(isset($this->bag['foo'])); - $this->assertFalse(isset($this->bag['bar'])); - } - - public function testArrayAccessUnset() - { - $data = array( - 'abc' => '123', - 'foo' => 'bar' - ); - $this->property->setValue($this->bag, $data); - unset($this->bag['foo']); - $this->assertEquals(array('abc' => '123'), $this->property->getValue($this->bag)); - } - - public function testCount() - { - $data = array( - 'abc' => '123', - 'foo' => 'bar' - ); - $this->property->setValue($this->bag, $data); - $this->assertEquals(2, count($this->bag)); - } - - public function testGetIterator() - { - $data = array( - 'abc' => '123', - 'foo' => 'bar' - ); - $this->property->setValue($this->bag, $data); - $this->assertInstanceOf('\ArrayIterator', $this->bag->getIterator()); - } - - public function testPropertyOverloadGet() - { - $data = array( - 'abc' => '123', - 'foo' => 'bar' - ); - $this->property->setValue($this->bag, $data); - - $this->assertEquals('123', $this->bag->abc); - $this->assertEquals('bar', $this->bag->foo); - } - - public function testPropertyOverloadSet() - { - $this->bag->foo = 'bar'; - $this->assertArrayHasKey('foo', $this->property->getValue($this->bag)); - $this->assertEquals('bar', $this->bag->foo); - } - - public function testPropertyOverloadingIsset() - { - $data = array( - 'abc' => '123', - 'foo' => 'bar' - ); - $this->property->setValue($this->bag, $data); - - $this->assertTrue(isset($this->bag->abc)); - $this->assertTrue(isset($this->bag->foo)); - $this->assertFalse(isset($this->bag->foobar)); - } - - public function testPropertyOverloadingUnset() - { - $data = array( - 'abc' => '123', - 'foo' => 'bar' - ); - $this->property->setValue($this->bag, $data); - - $this->assertTrue(isset($this->bag->abc)); - unset($this->bag->abc); - $this->assertFalse(isset($this->bag->abc)); - $this->assertArrayNotHasKey('abc', $this->property->getValue($this->bag)); - $this->assertArrayHasKey('foo', $this->property->getValue($this->bag)); - } - - public function testProtect() - { - $callable = function () { - return 'foo'; - }; - $result = $this->bag->protect($callable); - - $this->assertInstanceOf('\Closure', $result); - $this->assertSame($callable, $result()); - } -} diff --git a/vendor/slim/slim/tests/Http/CookiesTest.php b/vendor/slim/slim/tests/Http/CookiesTest.php deleted file mode 100644 index c73e2a9..0000000 --- a/vendor/slim/slim/tests/Http/CookiesTest.php +++ /dev/null @@ -1,92 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -class CookiesTest extends PHPUnit_Framework_TestCase -{ - public function testSetWithStringValue() - { - $c = new \Slim\Http\Cookies(); - $c->set('foo', 'bar'); - $this->assertAttributeEquals( - array( - 'foo' => array( - 'value' => 'bar', - 'expires' => null, - 'domain' => null, - 'path' => null, - 'secure' => false, - 'httponly' => false - ) - ), - 'data', - $c - ); - } - - public function testSetWithArrayValue() - { - $now = time(); - $c = new \Slim\Http\Cookies(); - $c->set('foo', array( - 'value' => 'bar', - 'expires' => $now + 86400, - 'domain' => '.example.com', - 'path' => '/', - 'secure' => true, - 'httponly' => true - )); - $this->assertAttributeEquals( - array( - 'foo' => array( - 'value' => 'bar', - 'expires' => $now + 86400, - 'domain' => '.example.com', - 'path' => '/', - 'secure' => true, - 'httponly' => true - ) - ), - 'data', - $c - ); - } - - public function testRemove() - { - $c = new \Slim\Http\Cookies(); - $c->remove('foo'); - $prop = new \ReflectionProperty($c, 'data'); - $prop->setAccessible(true); - $cValue = $prop->getValue($c); - $this->assertEquals('', $cValue['foo']['value']); - $this->assertLessThan(time(), $cValue['foo']['expires']); - } -} diff --git a/vendor/slim/slim/tests/Http/HeadersTest.php b/vendor/slim/slim/tests/Http/HeadersTest.php deleted file mode 100644 index 1c76b23..0000000 --- a/vendor/slim/slim/tests/Http/HeadersTest.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -class HeadersTest extends PHPUnit_Framework_TestCase -{ - public function testNormalizesKey() - { - $h = new \Slim\Http\Headers(); - $h->set('Http_Content_Type', 'text/html'); - $prop = new \ReflectionProperty($h, 'data'); - $prop->setAccessible(true); - $this->assertArrayHasKey('Content-Type', $prop->getValue($h)); - } - - public function testExtractHeaders() - { - $test = array( - 'HTTP_HOST' => 'foo.com', - 'SERVER_NAME' => 'foo', - 'CONTENT_TYPE' => 'text/html', - 'X_FORWARDED_FOR' => '127.0.0.1' - ); - $results = \Slim\Http\Headers::extract($test); - $this->assertEquals(array( - 'HTTP_HOST' => 'foo.com', - 'CONTENT_TYPE' => 'text/html', - 'X_FORWARDED_FOR' => '127.0.0.1' - ), $results); - } -} diff --git a/vendor/slim/slim/tests/Http/RequestTest.php b/vendor/slim/slim/tests/Http/RequestTest.php deleted file mode 100644 index 0b4a1ce..0000000 --- a/vendor/slim/slim/tests/Http/RequestTest.php +++ /dev/null @@ -1,977 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -class RequestTest extends PHPUnit_Framework_TestCase -{ - /** - * Test sets HTTP method - */ - public function testGetMethod() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'GET' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('GET', $req->getMethod()); - } - - /** - * Test HTTP GET method detection - */ - public function testIsGet() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'GET' - )); - $req = new \Slim\Http\Request($env); - $this->assertTrue($req->isGet()); - } - - /** - * Test HTTP POST method detection - */ - public function testIsPost() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'POST', - )); - $req = new \Slim\Http\Request($env); - $this->assertTrue($req->isPost()); - } - - /** - * Test HTTP PUT method detection - */ - public function testIsPut() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'PUT', - )); - $req = new \Slim\Http\Request($env); - $this->assertTrue($req->isPut()); - } - - /** - * Test HTTP DELETE method detection - */ - public function testIsDelete() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'DELETE', - )); - $req = new \Slim\Http\Request($env); - $this->assertTrue($req->isDelete()); - } - - /** - * Test HTTP OPTIONS method detection - */ - public function testIsOptions() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'OPTIONS', - )); - $req = new \Slim\Http\Request($env); - $this->assertTrue($req->isOptions()); - } - - /** - * Test HTTP HEAD method detection - */ - public function testIsHead() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'HEAD', - )); - $req = new \Slim\Http\Request($env); - $this->assertTrue($req->isHead()); - } - - /** - * Test HTTP PATCH method detection - */ - public function testIsPatch() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'PATCH', - )); - $req = new \Slim\Http\Request($env); - $this->assertTrue($req->isPatch()); - } - - /** - * Test AJAX method detection w/ header - */ - public function testIsAjaxWithHeader() - { - $env = \Slim\Environment::mock(array( - 'X_REQUESTED_WITH' => 'XMLHttpRequest' - )); - $req = new \Slim\Http\Request($env); - $this->assertTrue($req->isAjax()); - $this->assertTrue($req->isXhr()); - } - - /** - * Test AJAX method detection w/ query parameter - */ - public function testIsAjaxWithQueryParameter() - { - $env = \Slim\Environment::mock(array( - 'QUERY_STRING' => 'isajax=1', - )); - $req = new \Slim\Http\Request($env); - $this->assertTrue($req->isAjax()); - $this->assertTrue($req->isXhr()); - } - - /** - * Test AJAX method detection without header or query parameter - */ - public function testIsAjaxWithoutHeaderOrQueryParameter() - { - $env = \Slim\Environment::mock(); - $req = new \Slim\Http\Request($env); - $this->assertFalse($req->isAjax()); - $this->assertFalse($req->isXhr()); - } - - /** - * Test AJAX method detection with misspelled header - */ - public function testIsAjaxWithMisspelledHeader() - { - $env = \Slim\Environment::mock(array( - 'X_REQUESTED_WITH' => 'foo' - )); - $req = new \Slim\Http\Request($env); - $this->assertFalse($req->isAjax()); - $this->assertFalse($req->isXhr()); - } - - /** - * Test params from query string - */ - public function testParamsFromQueryString() - { - $env = \Slim\Environment::mock(array( - 'QUERY_STRING' => 'one=1&two=2&three=3' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals(3, count($req->params())); - $this->assertEquals('1', $req->params('one')); - $this->assertNull($req->params('foo')); - $this->assertEquals(1, $req->params('foo', 1)); - } - - /** - * Test params from request body - */ - public function testParamsFromRequestBody() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'POST', - 'QUERY_STRING' => 'one=1&two=2&three=3', - 'slim.input' => 'foo=bar&abc=123', - 'CONTENT_TYPE' => 'application/x-www-form-urlencoded', - 'CONTENT_LENGTH' => 15 - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals(5, count($req->params())); //Union of GET and POST - $this->assertEquals('bar', $req->params('foo')); - } - - /** - * Test fetch GET params - */ - public function testGet() - { - $env = \Slim\Environment::mock(array( - 'QUERY_STRING' => 'one=1&two=2&three=3' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals(3, count($req->get())); - $this->assertEquals('1', $req->get('one')); - $this->assertNull($req->get('foo')); - $this->assertFalse($req->get('foo', false)); - } - - /** - * Test fetch GET params without multibyte - */ - public function testGetWithoutMultibyte() - { - $env = \Slim\Environment::mock(array( - 'QUERY_STRING' => 'one=1&two=2&three=3', - 'slim.tests.ignore_multibyte' => true - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals(3, count($req->get())); - $this->assertEquals('1', $req->get('one')); - $this->assertNull($req->get('foo')); - $this->assertFalse($req->get('foo', false)); - } - - /** - * Test fetch POST params - */ - public function testPost() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'POST', - 'slim.input' => 'foo=bar&abc=123', - 'CONTENT_TYPE' => 'application/x-www-form-urlencoded', - 'CONTENT_LENGTH' => 15 - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals(2, count($req->post())); - $this->assertEquals('bar', $req->post('foo')); - $this->assertNull($req->post('xyz')); - $this->assertFalse($req->post('xyz', false)); - } - - /** - * Test fetch POST params without multibyte - */ - public function testPostWithoutMultibyte() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'POST', - 'slim.input' => 'foo=bar&abc=123', - 'CONTENT_TYPE' => 'application/x-www-form-urlencoded', - 'CONTENT_LENGTH' => 15, - 'slim.tests.ignore_multibyte' => true - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals(2, count($req->post())); - $this->assertEquals('bar', $req->post('foo')); - $this->assertNull($req->post('xyz')); - $this->assertFalse($req->post('xyz', false)); - } - - /** - * Test fetch POST without slim.input - */ - public function testPostWithoutInput() - { - $this->setExpectedException('RuntimeException'); - $env = \Slim\Environment::mock(); - unset($env['slim.input']); - $req = new \Slim\Http\Request($env); - $req->post('foo'); - } - - /** - * Test fetch POST params even if multipart/form-data request - */ - public function testPostWithMultipartRequest() - { - $_POST = array('foo' => 'bar'); //<-- Set by PHP - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'POST', - 'slim.input' => '', //<-- "php://input" is empty for multipart/form-data requests - 'CONTENT_TYPE' => 'multipart/form-data', - 'CONTENT_LENGTH' => 0 - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals(1, count($req->post())); - $this->assertEquals('bar', $req->post('foo')); - $this->assertNull($req->post('xyz')); - } - - /** - * Test fetch PUT params - */ - public function testPut() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'PUT', - 'slim.input' => 'foo=bar&abc=123', - 'CONTENT_TYPE' => 'application/x-www-form-urlencoded', - 'CONTENT_LENGTH' => 15 - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals(2, count($req->put())); - $this->assertEquals('bar', $req->put('foo')); - $this->assertEquals('bar', $req->params('foo')); - $this->assertNull($req->put('xyz')); - $this->assertFalse($req->put('xyz', false)); - } - - /** - * Test fetch PATCH params - */ - public function testPatch() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'PATCH', - 'slim.input' => 'foo=bar&abc=123', - 'CONTENT_TYPE' => 'application/x-www-form-urlencoded', - 'CONTENT_LENGTH' => 15 - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals(2, count($req->patch())); - $this->assertEquals('bar', $req->patch('foo')); - $this->assertEquals('bar', $req->params('foo')); - $this->assertNull($req->patch('xyz')); - $this->assertFalse($req->patch('xyz', false)); - } - - /** - * Test fetch DELETE params - */ - public function testDelete() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'DELETE', - 'slim.input' => 'foo=bar&abc=123', - 'CONTENT_TYPE' => 'application/x-www-form-urlencoded', - 'CONTENT_LENGTH' => 15 - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals(2, count($req->delete())); - $this->assertEquals('bar', $req->delete('foo')); - $this->assertEquals('bar', $req->params('foo')); - $this->assertNull($req->delete('xyz')); - $this->assertFalse($req->delete('xyz', false)); - } - - /** - * Test fetch COOKIE params - */ - public function testCookies() - { - $env = \Slim\Environment::mock(array( - 'HTTP_COOKIE' => 'foo=bar; abc=123' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals(2, count($req->cookies())); - $this->assertEquals('bar', $req->cookies('foo')); - $this->assertNull($req->cookies('xyz')); - } - - /** - * Test is form data - */ - public function testIsFormDataContentFormUrlencoded() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'PUT', - 'slim.input' => '', - 'CONTENT_TYPE' => 'application/x-www-form-urlencoded' - )); - $req = new \Slim\Http\Request($env); - $this->assertTrue($req->isFormData()); - } - - /** - * Test is form data - */ - public function testIsFormDataPostContentUnknown() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'POST', - 'slim.input' => '', - )); - $req = new \Slim\Http\Request($env); - $this->assertTrue($req->isFormData()); - } - - /** - * Test is form data - */ - public function testIsFormDataPostContentUnknownWithMethodOverride() - { - $env = \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'PUT', - )); - $env['slim.method_override.original_method'] = 'POST'; - $req = new \Slim\Http\Request($env); - $this->assertTrue($req->isPut()); - $this->assertTrue($req->isFormData()); - } - - /** - * Test is not form data - */ - public function testIsNotFormData() - { - $env = \Slim\Environment::mock(array( - 'slim.input' => '', - 'CONTENT_TYPE' => 'application/json' - )); - $req = new \Slim\Http\Request($env); - $this->assertFalse($req->isFormData()); - } - - /** - * Test headers - */ - public function testHeaders() - { - $env = \Slim\Environment::mock(array( - 'HTTP_ACCEPT_ENCODING' => 'gzip' - )); - $req = new \Slim\Http\Request($env); - $headers = $req->headers(); - $this->assertInstanceOf('\Slim\Http\Headers', $headers); - $this->assertEquals('gzip', $req->headers('HTTP_ACCEPT_ENCODING')); - $this->assertEquals('gzip', $req->headers('HTTP-ACCEPT-ENCODING')); - $this->assertEquals('gzip', $req->headers('http_accept_encoding')); - $this->assertEquals('gzip', $req->headers('http-accept-encoding')); - $this->assertEquals('gzip', $req->headers('ACCEPT_ENCODING')); - $this->assertEquals('gzip', $req->headers('ACCEPT-ENCODING')); - $this->assertEquals('gzip', $req->headers('accept_encoding')); - $this->assertEquals('gzip', $req->headers('accept-encoding')); - $this->assertNull($req->headers('foo')); - } - - /** - * Test accurately removes HTTP_ prefix from input header name - */ - public function testHeaderRemovesHttpPrefix() - { - $env = \Slim\Environment::mock(array( - 'X_HTTP_METHOD_OVERRIDE' => 'PUT', - 'CONTENT_TYPE' => 'application/json' - )); - //fwrite(fopen('php://stdout', 'w'), print_r($env, true)); - $req = new \Slim\Http\Request($env); - $this->assertEquals('PUT', $req->headers('X_HTTP_METHOD_OVERRIDE')); - $this->assertNull($req->headers('X_METHOD_OVERRIDE')); //<-- Ensures `HTTP_` is not removed if not prefix - $this->assertEquals('application/json', $req->headers('HTTP_CONTENT_TYPE')); //<-- Ensures `HTTP_` is removed if prefix - } - - /** - * Test get body - */ - public function testGetBodyWhenExists() - { - $env = \Slim\Environment::mock(array( - 'slim.input' => 'foo=bar&abc=123', - 'CONTENT_TYPE' => 'application/x-www-form-urlencoded', - 'CONTENT_LENGTH' => 15 - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('foo=bar&abc=123', $req->getBody()); - } - - /** - * Test get body - */ - public function testGetBodyWhenNotExists() - { - $env = \Slim\Environment::mock(); - $req = new \Slim\Http\Request($env); - $this->assertEquals('', $req->getBody()); - } - - /** - * Test get content type - */ - public function testGetContentTypeWhenExists() - { - $env = \Slim\Environment::mock(array( - 'slim.input' => '', - 'CONTENT_TYPE' => 'application/json; charset=ISO-8859-4' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('application/json; charset=ISO-8859-4', $req->getContentType()); - } - - /** - * Test get content type for built-in PHP server - */ - public function testGetContentTypeForBuiltInServer() - { - $env = \Slim\Environment::mock(array( - 'slim.input' => '', - 'HTTP_CONTENT_TYPE' => 'application/json; charset=ISO-8859-4' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('application/json; charset=ISO-8859-4', $req->getContentType()); - } - - /** - * Test get content type - */ - public function testGetContentTypeWhenNotExists() - { - $env = \Slim\Environment::mock(); - $req = new \Slim\Http\Request($env); - $this->assertNull($req->getContentType()); - } - - /** - * Test get content type with built-in server - */ - public function testGetContentTypeWithBuiltInServer() - { - $env = \Slim\Environment::mock(array( - 'slim.input' => '', - 'HTTP_CONTENT_TYPE' => 'application/json; charset=ISO-8859-4' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('application/json; charset=ISO-8859-4', $req->getContentType()); - } - - /** - * Test get media type - */ - public function testGetMediaTypeWhenExists() - { - $env = \Slim\Environment::mock(array( - 'CONTENT_TYPE' => 'application/json;charset=utf-8' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('application/json', $req->getMediaType()); - } - - /** - * Test get media type - */ - public function testGetMediaTypeWhenNotExists() - { - $env = \Slim\Environment::mock(); - $req = new \Slim\Http\Request($env); - $this->assertNull($req->getMediaType()); - } - - /** - * Test get media type - */ - public function testGetMediaTypeWhenNoParamsExist() - { - $env = \Slim\Environment::mock(array( - 'slim.input' => '', - 'CONTENT_TYPE' => 'application/json' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('application/json', $req->getMediaType()); - } - - /** - * Test get media type params - */ - public function testGetMediaTypeParams() - { - $env = \Slim\Environment::mock(array( - 'CONTENT_TYPE' => 'application/json; charset=ISO-8859-4' - )); - $req = new \Slim\Http\Request($env); - $params = $req->getMediaTypeParams(); - $this->assertEquals(1, count($params)); - $this->assertArrayHasKey('charset', $params); - $this->assertEquals('ISO-8859-4', $params['charset']); - } - - /** - * Test get media type params - */ - public function testGetMediaTypeParamsWhenNotExists() - { - $env = \Slim\Environment::mock(); - $req = new \Slim\Http\Request($env); - $params = $req->getMediaTypeParams(); - $this->assertTrue(is_array($params)); - $this->assertEquals(0, count($params)); - } - - /** - * Test get content charset - */ - public function testGetContentCharset() - { - $env = \Slim\Environment::mock(array( - 'slim.input' => '', - 'CONTENT_TYPE' => 'application/json; charset=ISO-8859-4' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('ISO-8859-4', $req->getContentCharset()); - } - - /** - * Test get content charset - */ - public function testGetContentCharsetWhenNotExists() - { - $env = \Slim\Environment::mock(array( - 'slim.input' => '', - 'CONTENT_TYPE' => 'application/json' - )); - $req = new \Slim\Http\Request($env); - $this->assertNull($req->getContentCharset()); - } - - /** - * Test get content length - */ - public function testGetContentLength() - { - $env = \Slim\Environment::mock(array( - 'slim.input' => 'foo=bar&abc=123', - 'CONTENT_TYPE' => 'application/x-www-form-urlencoded', - 'CONTENT_LENGTH' => 15 - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals(15, $req->getContentLength()); - } - - /** - * Test get content length - */ - public function testGetContentLengthWhenNotExists() - { - $env = \Slim\Environment::mock(array( - 'slim.input' => '', - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals(0, $req->getContentLength()); - } - - /** - * Test get host - */ - public function testGetHost() - { - $env = \Slim\Environment::mock(array( - 'SERVER_NAME' => 'slim', - 'HTTP_HOST' => 'slimframework.com' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('slimframework.com', $req->getHost()); //Uses HTTP_HOST if available - } - - /** - * Test get host if HTTP_HOST is an IPv6 address. - */ - public function testGetIPv6Host() - { - $env = \Slim\Environment::mock(array( - 'SERVER_NAME' => 'slim', - 'HTTP_HOST' => '[2001:db8::1]' - )); - - $req = new \Slim\Http\Request($env); - $this->assertEquals('[2001:db8::1]', $req->getHost()); //Uses HTTP_HOST if available - } - - /** - * Test get host if HTTP_HOST is an IPv6 address with appended port. - */ - public function testGetIPv6HostWithoutPortIfPortAppended() - { - $env = \Slim\Environment::mock(array( - 'SERVER_NAME' => 'slim', - 'HTTP_HOST' => '[2001:db8::1]:80' - )); - - $req = new \Slim\Http\Request($env); - $this->assertEquals('[2001:db8::1]', $req->getHost()); //Uses HTTP_HOST if available - } - - /** - * Test get host when it has a port number - */ - public function testGetHostAndStripPort() - { - $env = \Slim\Environment::mock(array( - 'SERVER_NAME' => 'slim', - 'HTTP_HOST' => 'slimframework.com:80' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('slimframework.com', $req->getHost()); //Uses HTTP_HOST if available - } - - /** - * Test get host - */ - public function testGetHostWhenNotExists() - { - $env = \Slim\Environment::mock(array( - 'SERVER_NAME' => 'slim', - 'HTTP_HOST' => 'slimframework.com' - )); - unset($env['HTTP_HOST']); - $req = new \Slim\Http\Request($env); - $this->assertEquals('slim', $req->getHost()); //Uses SERVER_NAME as backup - } - - /** - * Test get host with port - */ - public function testGetHostWithPort() - { - $env = \Slim\Environment::mock(array( - 'HTTP_HOST' => 'slimframework.com', - 'SERVER_NAME' => 'slim', - 'SERVER_PORT' => 80, - 'slim.url_scheme' => 'http' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('slimframework.com:80', $req->getHostWithPort()); - } - - /** - * Test get host with port doesn't duplicate port numbers - */ - public function testGetHostDoesntDuplicatePort() - { - $env = \Slim\Environment::mock(array( - 'HTTP_HOST' => 'slimframework.com:80', - 'SERVER_NAME' => 'slim', - 'SERVER_PORT' => 80, - 'slim.url_scheme' => 'http' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('slimframework.com:80', $req->getHostWithPort()); - } - - /** - * Test get port - */ - public function testGetPort() - { - $env = \Slim\Environment::mock(array( - 'SERVER_PORT' => 80 - )); - $req = new \Slim\Http\Request($env); - $this->assertTrue(is_integer($req->getPort())); - $this->assertEquals(80, $req->getPort()); - } - - /** - * Test get scheme - */ - public function testGetSchemeIfHttp() - { - $env = \Slim\Environment::mock(array( - 'slim.url_scheme' => 'http' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('http', $req->getScheme()); - } - - /** - * Test get scheme - */ - public function testGetSchemeIfHttps() - { - $env = \Slim\Environment::mock(array( - 'slim.url_scheme' => 'https', - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('https', $req->getScheme()); - } - - /** - * Test get [script name, root uri, path, path info, resource uri] in subdirectory without htaccess - */ - public function testAppPathsInSubdirectoryWithoutHtaccess() - { - $env = \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo/index.php', //<-- Physical - 'PATH_INFO' => '/bar/xyz', //<-- Virtual - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('/foo/index.php', $req->getScriptName()); - $this->assertEquals('/foo/index.php', $req->getRootUri()); - $this->assertEquals('/foo/index.php/bar/xyz', $req->getPath()); - $this->assertEquals('/bar/xyz', $req->getPathInfo()); - $this->assertEquals('/bar/xyz', $req->getResourceUri()); - } - - /** - * Test get [script name, root uri, path, path info, resource uri] in subdirectory with htaccess - */ - public function testAppPathsInSubdirectoryWithHtaccess() - { - $env = \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar/xyz', //<-- Virtual - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('/foo', $req->getScriptName()); - $this->assertEquals('/foo', $req->getRootUri()); - $this->assertEquals('/foo/bar/xyz', $req->getPath()); - $this->assertEquals('/bar/xyz', $req->getPathInfo()); - $this->assertEquals('/bar/xyz', $req->getResourceUri()); - } - - /** - * Test get [script name, root uri, path, path info, resource uri] in root directory without htaccess - */ - public function testAppPathsInRootDirectoryWithoutHtaccess() - { - $env = \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/index.php', //<-- Physical - 'PATH_INFO' => '/bar/xyz', //<-- Virtual - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('/index.php', $req->getScriptName()); - $this->assertEquals('/index.php', $req->getRootUri()); - $this->assertEquals('/index.php/bar/xyz', $req->getPath()); - $this->assertEquals('/bar/xyz', $req->getPathInfo()); - $this->assertEquals('/bar/xyz', $req->getResourceUri()); - } - - /** - * Test get [script name, root uri, path, path info, resource uri] in root directory with htaccess - */ - public function testAppPathsInRootDirectoryWithHtaccess() - { - $env = \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '', //<-- Physical - 'PATH_INFO' => '/bar/xyz', //<-- Virtual - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('', $req->getScriptName()); - $this->assertEquals('', $req->getRootUri()); - $this->assertEquals('/bar/xyz', $req->getPath()); - $this->assertEquals('/bar/xyz', $req->getPathInfo()); - $this->assertEquals('/bar/xyz', $req->getResourceUri()); - } - - /** - * Test get URL - */ - public function testGetUrl() - { - $env = \Slim\Environment::mock(array( - 'HTTP_HOST' => 'slimframework.com', - 'SERVER_NAME' => 'slim', - 'SERVER_PORT' => 80, - 'slim.url_scheme' => 'http' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('http://slimframework.com', $req->getUrl()); - } - - /** - * Test get URL - */ - public function testGetUrlWithCustomPort() - { - $env = \Slim\Environment::mock(array( - 'HTTP_HOST' => 'slimframework.com', - 'SERVER_NAME' => 'slim', - 'SERVER_PORT' => 8080, - 'slim.url_scheme' => 'http' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('http://slimframework.com:8080', $req->getUrl()); - } - - /** - * Test get URL - */ - public function testGetUrlWithHttps() - { - $env = \Slim\Environment::mock(array( - 'HTTP_HOST' => 'slimframework.com', - 'SERVER_NAME' => 'slim', - 'SERVER_PORT' => 443, - 'slim.url_scheme' => 'https' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('https://slimframework.com', $req->getUrl()); - } - - /** - * Test get IP - * @dataProvider dataTestIp - */ - public function testGetIp(array $server, $expected) - { - $env = \Slim\Environment::mock($server); - $req = new \Slim\Http\Request($env); - $this->assertEquals($expected, $req->getIp()); - } - - public function dataTestIp() - { - return array( - array(array('REMOTE_ADDR' => '127.0.0.1'), '127.0.0.1'), - array(array('REMOTE_ADDR' => '127.0.0.1', 'CLIENT_IP' => '127.0.0.2'), '127.0.0.2'), - array(array('REMOTE_ADDR' => '127.0.0.1', 'CLIENT_IP' => '127.0.0.2', 'X_FORWARDED_FOR' => '127.0.0.3'), '127.0.0.3'), - array(array('REMOTE_ADDR' => '127.0.0.1', 'CLIENT_IP' => '127.0.0.2', 'HTTP_X_FORWARDED_FOR' => '127.0.0.4'), '127.0.0.4'), - array(array('REMOTE_ADDR' => '127.0.0.1', 'CLIENT_IP' => '127.0.0.2', 'X_FORWARDED_FOR' => '127.0.0.3', 'HTTP_X_FORWARDED_FOR' => '127.0.0.4'), '127.0.0.3'), - ); - } - - /** - * Test get referer - */ - public function testGetReferrer() - { - $env = \Slim\Environment::mock(array( - 'HTTP_REFERER' => 'http://foo.com' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('http://foo.com', $req->getReferrer()); - $this->assertEquals('http://foo.com', $req->getReferer()); - } - - /** - * Test get referer - */ - public function testGetReferrerWhenNotExists() - { - $env = \Slim\Environment::mock(); - $req = new \Slim\Http\Request($env); - $this->assertNull($req->getReferrer()); - $this->assertNull($req->getReferer()); - } - - /** - * Test get user agent string - */ - public function testGetUserAgent() - { - $env = \Slim\Environment::mock(array( - 'HTTP_USER_AGENT' => 'user-agent-string' - )); - $req = new \Slim\Http\Request($env); - $this->assertEquals('user-agent-string', $req->getUserAgent()); - } - - /** - * Test get user agent string when not set - */ - public function testGetUserAgentWhenNotExists() - { - $env = \Slim\Environment::mock(); - unset($env['HTTP_USER_AGENT']); - $req = new \Slim\Http\Request($env); - $this->assertNull($req->getUserAgent()); - } -} diff --git a/vendor/slim/slim/tests/Http/ResponseTest.php b/vendor/slim/slim/tests/Http/ResponseTest.php deleted file mode 100644 index 7989f3a..0000000 --- a/vendor/slim/slim/tests/Http/ResponseTest.php +++ /dev/null @@ -1,271 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -class ResponseTest extends PHPUnit_Framework_TestCase -{ - public function testConstructWithoutArgs() - { - $res = new \Slim\Http\Response(); - - $this->assertAttributeEquals(200, 'status', $res); - $this->assertAttributeEquals('', 'body', $res); - } - - public function testConstructWithArgs() - { - $res = new \Slim\Http\Response('Foo', 201); - - $this->assertAttributeEquals(201, 'status', $res); - $this->assertAttributeEquals('Foo', 'body', $res); - } - - public function testGetStatus() - { - $res = new \Slim\Http\Response(); - - $this->assertEquals(200, $res->getStatus()); - } - - public function testSetStatus() - { - $res = new \Slim\Http\Response(); - $res->setStatus(301); - - $this->assertAttributeEquals(301, 'status', $res); - } - - /** - * DEPRECATION WARNING! - */ - public function testStatusGetOld() - { - $res = new \Slim\Http\Response('', 201); - $this->assertEquals(201, $res->status()); - } - - /** - * DEPRECATION WARNING! - */ - public function testStatusSetOld() - { - $res = new \Slim\Http\Response(); - $prop = new \ReflectionProperty($res, 'status'); - $prop->setAccessible(true); - $res->status(301); - - $this->assertEquals(301, $prop->getValue($res)); - } - - public function testGetBody() - { - $res = new \Slim\Http\Response(); - $property = new \ReflectionProperty($res, 'body'); - $property->setAccessible(true); - $property->setValue($res, 'foo'); - - $this->assertEquals('foo', $res->getBody()); - } - - public function testSetBody() - { - $res = new \Slim\Http\Response('bar'); - $res->setBody('foo'); // <-- Should replace body - - $this->assertAttributeEquals('foo', 'body', $res); - } - - public function testWrite() - { - $res = new \Slim\Http\Response(); - $property = new \ReflectionProperty($res, 'body'); - $property->setAccessible(true); - $property->setValue($res, 'foo'); - $res->write('bar'); // <-- Should append to body - - $this->assertAttributeEquals('foobar', 'body', $res); - } - - public function testLength() - { - $res = new \Slim\Http\Response('foo'); // <-- Sets body and length - - $this->assertEquals(3, $res->getLength()); - } - - public function testFinalize() - { - $res = new \Slim\Http\Response(); - $resFinal = $res->finalize(); - - $this->assertTrue(is_array($resFinal)); - $this->assertEquals(3, count($resFinal)); - $this->assertEquals(200, $resFinal[0]); - $this->assertInstanceOf('\Slim\Http\Headers', $resFinal[1]); - $this->assertEquals('', $resFinal[2]); - } - - public function testFinalizeWithEmptyBody() - { - $res = new \Slim\Http\Response('Foo', 304); - $resFinal = $res->finalize(); - - $this->assertEquals('', $resFinal[2]); - } - - public function testRedirect() - { - $res = new \Slim\Http\Response(); - $res->redirect('/foo'); - - $pStatus = new \ReflectionProperty($res, 'status'); - $pStatus->setAccessible(true); - - $this->assertEquals(302, $pStatus->getValue($res)); - $this->assertEquals('/foo', $res->headers['Location']); - } - - public function testIsEmpty() - { - $r1 = new \Slim\Http\Response(); - $r2 = new \Slim\Http\Response(); - $r1->setStatus(404); - $r2->setStatus(201); - $this->assertFalse($r1->isEmpty()); - $this->assertTrue($r2->isEmpty()); - } - - public function testIsClientError() - { - $r1 = new \Slim\Http\Response(); - $r2 = new \Slim\Http\Response(); - $r1->setStatus(404); - $r2->setStatus(500); - $this->assertTrue($r1->isClientError()); - $this->assertFalse($r2->isClientError()); - } - - public function testIsForbidden() - { - $r1 = new \Slim\Http\Response(); - $r2 = new \Slim\Http\Response(); - $r1->setStatus(403); - $r2->setStatus(500); - $this->assertTrue($r1->isForbidden()); - $this->assertFalse($r2->isForbidden()); - } - - public function testIsInformational() - { - $r1 = new \Slim\Http\Response(); - $r2 = new \Slim\Http\Response(); - $r1->setStatus(100); - $r2->setStatus(200); - $this->assertTrue($r1->isInformational()); - $this->assertFalse($r2->isInformational()); - } - - public function testIsNotFound() - { - $r1 = new \Slim\Http\Response(); - $r2 = new \Slim\Http\Response(); - $r1->setStatus(404); - $r2->setStatus(200); - $this->assertTrue($r1->isNotFound()); - $this->assertFalse($r2->isNotFound()); - } - - public function testIsOk() - { - $r1 = new \Slim\Http\Response(); - $r2 = new \Slim\Http\Response(); - $r1->setStatus(200); - $r2->setStatus(201); - $this->assertTrue($r1->isOk()); - $this->assertFalse($r2->isOk()); - } - - public function testIsSuccessful() - { - $r1 = new \Slim\Http\Response(); - $r2 = new \Slim\Http\Response(); - $r3 = new \Slim\Http\Response(); - $r1->setStatus(200); - $r2->setStatus(201); - $r3->setStatus(302); - $this->assertTrue($r1->isSuccessful()); - $this->assertTrue($r2->isSuccessful()); - $this->assertFalse($r3->isSuccessful()); - } - - public function testIsRedirect() - { - $r1 = new \Slim\Http\Response(); - $r2 = new \Slim\Http\Response(); - $r1->setStatus(307); - $r2->setStatus(304); - $this->assertTrue($r1->isRedirect()); - $this->assertFalse($r2->isRedirect()); - } - - public function testIsRedirection() - { - $r1 = new \Slim\Http\Response(); - $r2 = new \Slim\Http\Response(); - $r3 = new \Slim\Http\Response(); - $r1->setStatus(307); - $r2->setStatus(304); - $r3->setStatus(200); - $this->assertTrue($r1->isRedirection()); - $this->assertTrue($r2->isRedirection()); - $this->assertFalse($r3->isRedirection()); - } - - public function testIsServerError() - { - $r1 = new \Slim\Http\Response(); - $r2 = new \Slim\Http\Response(); - $r1->setStatus(500); - $r2->setStatus(400); - $this->assertTrue($r1->isServerError()); - $this->assertFalse($r2->isServerError()); - } - - public function testMessageForCode() - { - $this->assertEquals('200 OK', \Slim\Http\Response::getMessageForCode(200)); - } - - public function testMessageForCodeWithInvalidCode() - { - $this->assertNull(\Slim\Http\Response::getMessageForCode(600)); - } -} diff --git a/vendor/slim/slim/tests/Http/UtilTest.php b/vendor/slim/slim/tests/Http/UtilTest.php deleted file mode 100644 index cdd00e1..0000000 --- a/vendor/slim/slim/tests/Http/UtilTest.php +++ /dev/null @@ -1,493 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -class SlimHttpUtilTest extends PHPUnit_Framework_TestCase -{ - /** - * Test strip slashes when magic quotes disabled - */ - public function testStripSlashesWithoutMagicQuotes() - { - $data = "This should have \"quotes\" in it"; - $stripped = \Slim\Http\Util::stripSlashesIfMagicQuotes($data, false); - $this->assertEquals($data, $stripped); - } - - /** - * Test strip slashes from array when magic quotes disabled - */ - public function testStripSlashesFromArrayWithoutMagicQuotes() - { - $data = array("This should have \"quotes\" in it", "And this \"too\" has quotes"); - $stripped = \Slim\Http\Util::stripSlashesIfMagicQuotes($data, false); - $this->assertEquals($data, $stripped); - } - - /** - * Test strip slashes when magic quotes enabled - */ - public function testStripSlashesWithMagicQuotes() - { - $data = "This should have \"quotes\" in it"; - $stripped = \Slim\Http\Util::stripSlashesIfMagicQuotes($data, true); - $this->assertEquals('This should have "quotes" in it', $stripped); - } - - /** - * Test strip slashes from array when magic quotes enabled - */ - public function testStripSlashesFromArrayWithMagicQuotes() - { - $data = array("This should have \"quotes\" in it", "And this \"too\" has quotes"); - $stripped = \Slim\Http\Util::stripSlashesIfMagicQuotes($data, true); - $this->assertEquals($data = array('This should have "quotes" in it', 'And this "too" has quotes'), $stripped); - } - - /** - * Test encrypt and decrypt with valid data - */ - public function testEncryptAndDecryptWithValidData() - { - if (!function_exists('mcrypt_list_algorithms')) { - $this->markTestSkipped(('mcrypt not available.')); - } - if (version_compare(PHP_VERSION, '7.1', '>=')) { - // mcrypt is deprecated - error_reporting(E_ALL ^ E_DEPRECATED); - } - - $data = 'foo'; - $key = 'secret'; - $iv = md5('initializationVector'); - $encrypted = \Slim\Http\Util::encrypt($data, $key, $iv); - $decrypted = \Slim\Http\Util::decrypt($encrypted, $key, $iv); - $this->assertEquals($data, $decrypted); - $this->assertTrue($data !== $encrypted); - } - - /** - * Test encrypt when data is empty string - */ - public function testEncryptWhenDataIsEmptyString() - { - $data = ''; - $key = 'secret'; - $iv = md5('initializationVector'); - $encrypted = \Slim\Http\Util::encrypt($data, $key, $iv); - $this->assertEquals('', $encrypted); - } - - /** - * Test decrypt when data is empty string - */ - public function testDecryptWhenDataIsEmptyString() - { - $data = ''; - $key = 'secret'; - $iv = md5('initializationVector'); - $decrypted = \Slim\Http\Util::decrypt($data, $key, $iv); - $this->assertEquals('', $decrypted); - } - - /** - * Test encrypt when IV and key sizes are too long - */ - public function testEncryptAndDecryptWhenKeyAndIvAreTooLong() - { - if (!function_exists('mcrypt_list_algorithms')) { - $this->markTestSkipped(('mcrypt not available.')); - } - if (version_compare(PHP_VERSION, '7.1', '>=')) { - // mcrypt is deprecated - error_reporting(E_ALL ^ E_DEPRECATED); - } - - $data = 'foo'; - $key = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'; - $iv = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'; - $encrypted = \Slim\Http\Util::encrypt($data, $key, $iv); - $decrypted = \Slim\Http\Util::decrypt($encrypted, $key, $iv); - $this->assertEquals($data, $decrypted); - $this->assertTrue($data !== $encrypted); - } - - public function testEncodeAndDecodeSecureCookieWithValidData() - { - if (!function_exists('mcrypt_list_algorithms')) { - $this->markTestSkipped(('mcrypt not available.')); - } - if (version_compare(PHP_VERSION, '7.1', '>=')) { - // mcrypt is deprecated - error_reporting(E_ALL ^ E_DEPRECATED); - } - - //Prepare cookie value - $value = 'foo'; - $expires = time() + 86400; - $secret = 'password'; - $algorithm = MCRYPT_RIJNDAEL_256; - $mode = MCRYPT_MODE_CBC; - $encodedValue = \Slim\Http\Util::encodeSecureCookie($value, $expires, $secret, $algorithm, $mode); - $decodedValue = \Slim\Http\Util::decodeSecureCookie($encodedValue, $secret, $algorithm, $mode); - - //Test secure cookie value - $parts = explode('|', $encodedValue); - $this->assertEquals(3, count($parts)); - $this->assertEquals($expires, $parts[0]); - $this->assertEquals($value, $decodedValue); - } - - /** - * Test encode/decode secure cookie with old expiration - * - * In this test, the expiration date is purposefully set to a time before now. - * When decoding the encoded cookie value, FALSE is returned since the cookie - * will have expired before it is decoded. - */ - public function testEncodeAndDecodeSecureCookieWithOldExpiration() - { - if (!function_exists('mcrypt_list_algorithms')) { - $this->markTestSkipped(('mcrypt not available.')); - } - if (version_compare(PHP_VERSION, '7.1', '>=')) { - // mcrypt is deprecated - error_reporting(E_ALL ^ E_DEPRECATED); - } - - $value = 'foo'; - $expires = time() - 100; - $secret = 'password'; - $algorithm = MCRYPT_RIJNDAEL_256; - $mode = MCRYPT_MODE_CBC; - $encodedValue = \Slim\Http\Util::encodeSecureCookie($value, $expires, $secret, $algorithm, $mode); - $decodedValue = \Slim\Http\Util::decodeSecureCookie($encodedValue, $secret, $algorithm, $mode); - $this->assertFalse($decodedValue); - } - - /** - * Test encode/decode secure cookie with tampered data - * - * In this test, the encoded data is purposefully changed to simulate someone - * tampering with the client-side cookie data. When decoding the encoded cookie value, - * FALSE is returned since the verification key will not match. - */ - public function testEncodeAndDecodeSecureCookieWithTamperedData() - { - if (!function_exists('mcrypt_list_algorithms')) { - $this->markTestSkipped(('mcrypt not available.')); - } - if (version_compare(PHP_VERSION, '7.1', '>=')) { - // mcrypt is deprecated - error_reporting(E_ALL ^ E_DEPRECATED); - } - - $value = 'foo'; - $expires = time() + 86400; - $secret = 'password'; - $algorithm = MCRYPT_RIJNDAEL_256; - $mode = MCRYPT_MODE_CBC; - $encodedValue = \Slim\Http\Util::encodeSecureCookie($value, $expires, $secret, $algorithm, $mode); - $encodedValueParts = explode('|', $encodedValue); - $encodedValueParts[1] = $encodedValueParts[1] . 'changed'; - $encodedValue = implode('|', $encodedValueParts); - $decodedValue = \Slim\Http\Util::decodeSecureCookie($encodedValue, $secret, $algorithm, $mode); - $this->assertFalse($decodedValue); - } - - public function testSetCookieHeaderWithNameAndValue() - { - $name = 'foo'; - $value = 'bar'; - $header = array(); - \Slim\Http\Util::setCookieHeader($header, $name, $value); - $this->assertEquals('foo=bar', $header['Set-Cookie']); - } - - public function testSetCookieHeaderWithNameAndValueWhenCookieAlreadySet() - { - $name = 'foo'; - $value = 'bar'; - $header = array('Set-Cookie' => 'one=two'); - \Slim\Http\Util::setCookieHeader($header, $name, $value); - $this->assertEquals("one=two\nfoo=bar", $header['Set-Cookie']); - } - - public function testSetCookieHeaderWithNameAndValueAndDomain() - { - $name = 'foo'; - $value = 'bar'; - $domain = 'foo.com'; - $header = array(); - \Slim\Http\Util::setCookieHeader($header, $name, array( - 'value' => $value, - 'domain' => $domain - )); - $this->assertEquals('foo=bar; domain=foo.com', $header['Set-Cookie']); - } - - public function testSetCookieHeaderWithNameAndValueAndDomainAndPath() - { - $name = 'foo'; - $value = 'bar'; - $domain = 'foo.com'; - $path = '/foo'; - $header = array(); - \Slim\Http\Util::setCookieHeader($header, $name, array( - 'value' => $value, - 'domain' => $domain, - 'path' => $path - )); - $this->assertEquals('foo=bar; domain=foo.com; path=/foo', $header['Set-Cookie']); - } - - public function testSetCookieHeaderWithNameAndValueAndDomainAndPathAndExpiresAsString() - { - $name = 'foo'; - $value = 'bar'; - $domain = 'foo.com'; - $path = '/foo'; - $expires = '2 days'; - $expiresFormat = gmdate('D, d-M-Y H:i:s e', strtotime($expires)); - $header = array(); - \Slim\Http\Util::setCookieHeader($header, $name, array( - 'value' => $value, - 'domain' => $domain, - 'path' => '/foo', - 'expires' => $expires - )); - $this->assertEquals('foo=bar; domain=foo.com; path=/foo; expires=' . $expiresFormat, $header['Set-Cookie']); - } - - public function testSetCookieHeaderWithNameAndValueAndDomainAndPathAndExpiresAsInteger() - { - $name = 'foo'; - $value = 'bar'; - $domain = 'foo.com'; - $path = '/foo'; - $expires = strtotime('2 days'); - $expiresFormat = gmdate('D, d-M-Y H:i:s e', $expires); - $header = array(); - \Slim\Http\Util::setCookieHeader($header, $name, array( - 'value' => $value, - 'domain' => $domain, - 'path' => '/foo', - 'expires' => $expires - )); - $this->assertEquals('foo=bar; domain=foo.com; path=/foo; expires=' . $expiresFormat, $header['Set-Cookie']); - } - - public function testSetCookieHeaderWithNameAndValueAndDomainAndPathAndExpiresAsZero() - { - $name = 'foo'; - $value = 'bar'; - $domain = 'foo.com'; - $path = '/foo'; - $expires = 0; - $header = array(); - \Slim\Http\Util::setCookieHeader($header, $name, array( - 'value' => $value, - 'domain' => $domain, - 'path' => '/foo', - 'expires' => $expires - )); - $this->assertEquals('foo=bar; domain=foo.com; path=/foo', $header['Set-Cookie']); - } - - public function testSetCookieHeaderWithNameAndValueAndDomainAndPathAndExpiresAndSecure() - { - $name = 'foo'; - $value = 'bar'; - $domain = 'foo.com'; - $path = '/foo'; - $expires = strtotime('2 days'); - $expiresFormat = gmdate('D, d-M-Y H:i:s e', $expires); - $secure = true; - $header = array(); - \Slim\Http\Util::setCookieHeader($header, $name, array( - 'value' => $value, - 'domain' => $domain, - 'path' => '/foo', - 'expires' => $expires, - 'secure' => $secure - )); - $this->assertEquals('foo=bar; domain=foo.com; path=/foo; expires=' . $expiresFormat . '; secure', $header['Set-Cookie']); - } - - public function testSetCookieHeaderWithNameAndValueAndDomainAndPathAndExpiresAndSecureAndHttpOnly() - { - $name = 'foo'; - $value = 'bar'; - $domain = 'foo.com'; - $path = '/foo'; - $expires = strtotime('2 days'); - $expiresFormat = gmdate('D, d-M-Y H:i:s e', $expires); - $secure = true; - $httpOnly = true; - $header = array(); - \Slim\Http\Util::setCookieHeader($header, $name, array( - 'value' => $value, - 'domain' => $domain, - 'path' => '/foo', - 'expires' => $expires, - 'secure' => $secure, - 'httponly' => $httpOnly - )); - $this->assertEquals('foo=bar; domain=foo.com; path=/foo; expires=' . $expiresFormat . '; secure; HttpOnly', $header['Set-Cookie']); - } - - /** - * Test serializeCookies and decrypt with string expires - * - * In this test a cookie with a string typed value for 'expires' is set, - * which should be parsed by `strtotime` to a timestamp when it's added to - * the headers; this timestamp should then be correctly parsed, and the - * value correctly decrypted, by `decodeSecureCookie`. - */ - public function testSerializeCookiesAndDecryptWithStringExpires() - { - if (!function_exists('mcrypt_list_algorithms')) { - $this->markTestSkipped(('mcrypt not available.')); - } - if (version_compare(PHP_VERSION, '7.1', '>=')) { - // mcrypt is deprecated - error_reporting(E_ALL ^ E_DEPRECATED); - } - - $value = 'bar'; - - $headers = new \Slim\Http\Headers(); - - $settings = array( - 'cookies.encrypt' => true, - 'cookies.secret_key' => 'secret', - 'cookies.cipher' => MCRYPT_RIJNDAEL_256, - 'cookies.cipher_mode' => MCRYPT_MODE_CBC - ); - - $cookies = new \Slim\Http\Cookies(); - $cookies->set('foo', array( - 'value' => $value, - 'expires' => '1 hour' - )); - - \Slim\Http\Util::serializeCookies($headers, $cookies, $settings); - - $encrypted = $headers->get('Set-Cookie'); - $encrypted = strstr($encrypted, ';', true); - $encrypted = urldecode(substr(strstr($encrypted, '='), 1)); - - $decrypted = \Slim\Http\Util::decodeSecureCookie( - $encrypted, - $settings['cookies.secret_key'], - $settings['cookies.cipher'], - $settings['cookies.cipher_mode'] - ); - - $this->assertEquals($value, $decrypted); - $this->assertTrue($value !== $encrypted); - } - - public function testDeleteCookieHeaderWithSurvivingCookie() - { - $header = array('Set-Cookie' => "foo=bar\none=two"); - \Slim\Http\Util::deleteCookieHeader($header, 'foo'); - $this->assertEquals(1, preg_match("@^one=two\nfoo=; expires=@", $header['Set-Cookie'])); - } - - public function testDeleteCookieHeaderWithoutSurvivingCookie() - { - $header = array('Set-Cookie' => "foo=bar"); - \Slim\Http\Util::deleteCookieHeader($header, 'foo'); - $this->assertEquals(1, preg_match("@foo=; expires=@", $header['Set-Cookie'])); - } - - public function testDeleteCookieHeaderWithMatchingDomain() - { - $header = array('Set-Cookie' => "foo=bar; domain=foo.com"); - \Slim\Http\Util::deleteCookieHeader($header, 'foo', array( - 'domain' => 'foo.com' - )); - $this->assertEquals(1, preg_match("@foo=; domain=foo.com; expires=@", $header['Set-Cookie'])); - } - - public function testDeleteCookieHeaderWithoutMatchingDomain() - { - $header = array('Set-Cookie' => "foo=bar; domain=foo.com"); - \Slim\Http\Util::deleteCookieHeader($header, 'foo', array( - 'domain' => 'bar.com' - )); - $this->assertEquals(1, preg_match("@foo=bar; domain=foo\.com\nfoo=; domain=bar\.com@", $header['Set-Cookie'])); - } - - /** - * Test parses Cookie: HTTP header - */ - public function testParsesCookieHeader() - { - $header = 'foo=bar; one=two; colors=blue'; - $result = \Slim\Http\Util::parseCookieHeader($header); - $this->assertEquals(3, count($result)); - $this->assertEquals('bar', $result['foo']); - $this->assertEquals('two', $result['one']); - $this->assertEquals('blue', $result['colors']); - } - - /** - * Test parses Cookie: HTTP header with `=` in the cookie value - */ - public function testParsesCookieHeaderWithEqualSignInValue() - { - $header = 'foo=bar; one=two=; colors=blue'; - $result = \Slim\Http\Util::parseCookieHeader($header); - $this->assertEquals(3, count($result)); - $this->assertEquals('bar', $result['foo']); - $this->assertEquals('two=', $result['one']); - $this->assertEquals('blue', $result['colors']); - } - - public function testParsesCookieHeaderWithCommaSeparator() - { - $header = 'foo=bar, one=two, colors=blue'; - $result = \Slim\Http\Util::parseCookieHeader($header); - $this->assertEquals(3, count($result)); - $this->assertEquals('bar', $result['foo']); - $this->assertEquals('two', $result['one']); - $this->assertEquals('blue', $result['colors']); - } - - public function testPrefersLeftmostCookieWhenManyCookiesWithSameName() - { - $header = 'foo=bar; foo=beer'; - $result = \Slim\Http\Util::parseCookieHeader($header); - $this->assertEquals('bar', $result['foo']); - } -} diff --git a/vendor/slim/slim/tests/LogTest.php b/vendor/slim/slim/tests/LogTest.php deleted file mode 100644 index 9419855..0000000 --- a/vendor/slim/slim/tests/LogTest.php +++ /dev/null @@ -1,208 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -class MyWriter -{ - public function write( $object, $level ) - { - echo (string) $object; - - return true; - } -} - -class LogTest extends PHPUnit_Framework_TestCase -{ - public function testEnabled() - { - $log = new \Slim\Log(new MyWriter()); - $this->assertTrue($log->isEnabled()); //<-- Default case - $log->setEnabled(true); - $this->assertTrue($log->isEnabled()); - $log->setEnabled(false); - $this->assertFalse($log->isEnabled()); - } - - public function testGetLevel() - { - $log = new \Slim\Log(new MyWriter()); - $this->assertEquals(\Slim\Log::DEBUG, $log->getLevel()); - } - - public function testSetLevel() - { - $log = new \Slim\Log(new MyWriter()); - $log->setLevel(\Slim\Log::WARN); - $this->assertEquals(\Slim\Log::WARN, $log->getLevel()); - } - - public function testSetInvalidLevel() - { - $this->setExpectedException('InvalidArgumentException'); - $log = new \Slim\Log(new MyWriter()); - $log->setLevel(\Slim\Log::DEBUG + 1); - } - - public function testLogDebug() - { - $this->expectOutputString('Debug'); - $log = new \Slim\Log(new MyWriter()); - $result = $log->debug('Debug'); - $this->assertTrue($result); - } - - public function testLogDebugExcludedByLevel() - { - $log = new \Slim\Log(new MyWriter()); - $log->setLevel(\Slim\Log::INFO); - $this->assertFalse($log->debug('Debug')); - } - - public function testLogInfo() - { - $this->expectOutputString('Info'); - $log = new \Slim\Log(new MyWriter()); - $result = $log->info('Info'); - $this->assertTrue($result); - } - - public function testLogInfoExcludedByLevel() - { - $log = new \Slim\Log(new MyWriter()); - $log->setLevel(\Slim\Log::NOTICE); - $this->assertFalse($log->info('Info')); - } - - public function testLogNotice() - { - $this->expectOutputString('Notice'); - $log = new \Slim\Log(new MyWriter()); - $result = $log->notice('Notice'); - $this->assertTrue($result); - } - - public function testLogNoticeExcludedByLevel() - { - $log = new \Slim\Log(new MyWriter()); - $log->setLevel(\Slim\Log::WARN); - $this->assertFalse($log->info('Info')); - } - - public function testLogWarn() - { - $this->expectOutputString('Warn'); - $log = new \Slim\Log(new MyWriter()); - $result = $log->warning('Warn'); - $this->assertTrue($result); - } - - public function testLogWarnExcludedByLevel() - { - $log = new \Slim\Log(new MyWriter()); - $log->setLevel(\Slim\Log::ERROR); - $this->assertFalse($log->warning('Warn')); - } - - public function testLogError() - { - $this->expectOutputString('Error'); - $log = new \Slim\Log(new MyWriter()); - $result = $log->error('Error'); - $this->assertTrue($result); - } - - public function testLogErrorExcludedByLevel() - { - $log = new \Slim\Log(new MyWriter()); - $log->setLevel(\Slim\Log::CRITICAL); - $this->assertFalse($log->error('Error')); - } - - public function testLogCritical() - { - $this->expectOutputString('Critical'); - $log = new \Slim\Log(new MyWriter()); - $result = $log->critical('Critical'); - $this->assertTrue($result); - } - - public function testLogCriticalExcludedByLevel() - { - $log = new \Slim\Log(new MyWriter()); - $log->setLevel(\Slim\Log::ALERT); - $this->assertFalse($log->critical('Critical')); - } - - public function testLogAlert() - { - $this->expectOutputString('Alert'); - $log = new \Slim\Log(new MyWriter()); - $result = $log->alert('Alert'); - $this->assertTrue($result); - } - - public function testLogAlertExcludedByLevel() - { - $log = new \Slim\Log(new MyWriter()); - $log->setLevel(\Slim\Log::EMERGENCY); - $this->assertFalse($log->alert('Alert')); - } - - public function testLogEmergency() - { - $this->expectOutputString('Emergency'); - $log = new \Slim\Log(new MyWriter()); - $result = $log->emergency('Emergency'); - $this->assertTrue($result); - } - - public function testInterpolateMessage() - { - $this->expectOutputString('Hello Slim !'); - $log = new \Slim\Log(new MyWriter()); - $result = $log->debug( - 'Hello {framework} !', - array('framework' => "Slim") - ); - $this->assertTrue($result); - } - - public function testGetAndSetWriter() - { - $writer1 = new MyWriter(); - $writer2 = new MyWriter(); - $log = new \Slim\Log($writer1); - $this->assertSame($writer1, $log->getWriter()); - $log->setWriter($writer2); - $this->assertSame($writer2, $log->getWriter()); - } -} diff --git a/vendor/slim/slim/tests/LogWriterTest.php b/vendor/slim/slim/tests/LogWriterTest.php deleted file mode 100644 index 9b37145..0000000 --- a/vendor/slim/slim/tests/LogWriterTest.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -class LogWriterTest extends PHPUnit_Framework_TestCase -{ - public function testInstantiation() - { - $this->expectOutputString('Hello!' . PHP_EOL); - $handle = fopen('php://output', 'w'); - $fw = new \Slim\LogWriter($handle); - $this->assertTrue($fw->write('Hello!') > 0); //<-- Returns number of bytes written if successful - } - - public function testInstantiationWithNonResource() - { - $this->setExpectedException('InvalidArgumentException'); - $fw = new \Slim\LogWriter(@fopen('/foo/bar.txt', 'w')); - } -} diff --git a/vendor/slim/slim/tests/Middleware/ContentTypesTest.php b/vendor/slim/slim/tests/Middleware/ContentTypesTest.php deleted file mode 100644 index 8bee114..0000000 --- a/vendor/slim/slim/tests/Middleware/ContentTypesTest.php +++ /dev/null @@ -1,162 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -class ContentTypesTest extends PHPUnit_Framework_TestCase -{ - public function setUp() - { - ob_start(); - } - - public function tearDown() - { - ob_end_clean(); - } - - /** - * Test parses JSON - */ - public function testParsesJson() - { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'POST', - 'CONTENT_TYPE' => 'application/json', - 'CONENT_LENGTH' => 13, - 'slim.input' => '{"foo":"bar"}' - )); - $s = new \Slim\Slim(); - $s->add(new \Slim\Middleware\ContentTypes()); - $s->run(); - $body = $s->request()->getBody(); - $this->assertTrue(is_array($body)); - $this->assertEquals('bar', $body['foo']); - } - - /** - * Test ignores JSON with errors - */ - public function testParsesJsonWithError() - { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'POST', - 'CONTENT_TYPE' => 'application/json', - 'CONENT_LENGTH' => 12, - 'slim.input' => '{"foo":"bar"' //<-- This should be incorrect! - )); - $s = new \Slim\Slim(); - $s->add(new \Slim\Middleware\ContentTypes()); - $s->run(); - $body = $s->request()->getBody(); - $this->assertTrue(is_string($body)); - $this->assertEquals('{"foo":"bar"', $body); - } - - /** - * Test parses XML - */ - public function testParsesXml() - { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'POST', - 'CONTENT_TYPE' => 'application/xml', - 'CONENT_LENGTH' => 68, - 'slim.input' => '<books><book><id>1</id><author>Clive Cussler</author></book></books>' - )); - $s = new \Slim\Slim(); - $s->add(new \Slim\Middleware\ContentTypes()); - $s->run(); - $body = $s->request()->getBody(); - $this->assertInstanceOf('SimpleXMLElement', $body); - $this->assertEquals('Clive Cussler', (string) $body->book->author); - } - - /** - * Test ignores XML with errors - */ - public function testParsesXmlWithError() - { - libxml_use_internal_errors(true); - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'POST', - 'CONTENT_TYPE' => 'application/xml', - 'CONTENT_LENGTH' => 68, - 'slim.input' => '<books><book><id>1</id><author>Clive Cussler</book></books>' //<-- This should be incorrect! - )); - $s = new \Slim\Slim(); - $s->add(new \Slim\Middleware\ContentTypes()); - $s->run(); - $body = $s->request()->getBody(); - $this->assertTrue(is_string($body)); - $this->assertEquals('<books><book><id>1</id><author>Clive Cussler</book></books>', $body); - } - - /** - * Test parses CSV - */ - public function testParsesCsv() - { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'POST', - 'CONTENT_TYPE' => 'text/csv', - 'CONTENT_LENGTH' => 44, - 'slim.input' => "John,Doe,000-111-2222\nJane,Doe,111-222-3333" - )); - $s = new \Slim\Slim(); - $s->add(new \Slim\Middleware\ContentTypes()); - $s->run(); - $body = $s->request()->getBody(); - $this->assertTrue(is_array($body)); - $this->assertEquals(2, count($body)); - $this->assertEquals('000-111-2222', $body[0][2]); - $this->assertEquals('Doe', $body[1][1]); - } - - /** - * Test parses request body based on media-type only, disregarding - * any extra content-type header parameters - */ - public function testParsesRequestBodyWithMediaType() - { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'POST', - 'CONTENT_TYPE' => 'application/json; charset=ISO-8859-4', - 'CONTENT_LENGTH' => 13, - 'slim.input' => '{"foo":"bar"}' - )); - $s = new \Slim\Slim(); - $s->add(new \Slim\Middleware\ContentTypes()); - $s->run(); - $body = $s->request()->getBody(); - $this->assertTrue(is_array($body)); - $this->assertEquals('bar', $body['foo']); - } -} diff --git a/vendor/slim/slim/tests/Middleware/FlashTest.php b/vendor/slim/slim/tests/Middleware/FlashTest.php deleted file mode 100644 index e283341..0000000 --- a/vendor/slim/slim/tests/Middleware/FlashTest.php +++ /dev/null @@ -1,141 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -class SlimFlashTest extends PHPUnit_Framework_TestCase -{ - /** - * Setup - */ - public function setUp() - { - $_SESSION = array(); - } - - /** - * Test set flash message for next request - */ - public function testSetFlashForNextRequest() - { - $f = new \Slim\Middleware\Flash(); - $f->set('foo', 'bar'); - $f->save(); - $this->assertEquals('bar', $_SESSION['slim.flash']['foo']); - } - - /** - * Test set flash message for current request - */ - public function testSetFlashForCurrentRequest() - { - $f = new \Slim\Middleware\Flash(); - $f->now('foo', 'bar'); - $this->assertEquals('bar', $f['foo']); - } - - /** - * Test loads flash from previous request - */ - public function testLoadsFlashFromPreviousRequest() - { - $_SESSION['slim.flash'] = array('info' => 'foo'); - $f = new \Slim\Middleware\Flash(); - $f->loadMessages(); - $this->assertEquals('foo', $f['info']); - } - - /** - * Test keep flash message for next request - */ - public function testKeepFlashFromPreviousRequest() - { - $_SESSION['slim.flash'] = array('info' => 'foo'); - $f = new \Slim\Middleware\Flash(); - $f->loadMessages(); - $f->keep(); - $f->save(); - $this->assertEquals('foo', $_SESSION['slim.flash']['info']); - } - - /** - * Test flash messages from previous request do not persist to next request - */ - public function testFlashMessagesFromPreviousRequestDoNotPersist() - { - $_SESSION['slim.flash'] = array('info' => 'foo'); - $f = new \Slim\Middleware\Flash(); - $f->save(); - $this->assertEmpty($_SESSION['slim.flash']); - } - - /** - * Test set Flash using array access - */ - public function testFlashArrayAccess() - { - $_SESSION['slim.flash'] = array('info' => 'foo'); - $f = new \Slim\Middleware\Flash(); - $f['info'] = 'bar'; - $f->save(); - $this->assertTrue(isset($f['info'])); - $this->assertEquals('bar', $f['info']); - unset($f['info']); - $this->assertFalse(isset($f['info'])); - } - - /** - * Test iteration - */ - public function testIteration() - { - $_SESSION['slim.flash'] = array('info' => 'foo', 'error' => 'bar'); - $f = new \Slim\Middleware\Flash(); - $f->loadMessages(); - $output = ''; - foreach ($f as $key => $value) { - $output .= $key . $value; - } - $this->assertEquals('infofooerrorbar', $output); - } - - /** - * Test countable - */ - public function testCountable() - { - $_SESSION['slim.flash'] = array('info' => 'foo', 'error' => 'bar'); - $f = new \Slim\MiddleWare\Flash(); - $f->loadMessages(); - $this->assertEquals(2, count($f)); - } - - -} diff --git a/vendor/slim/slim/tests/Middleware/MethodOverrideTest.php b/vendor/slim/slim/tests/Middleware/MethodOverrideTest.php deleted file mode 100644 index 5bdae11..0000000 --- a/vendor/slim/slim/tests/Middleware/MethodOverrideTest.php +++ /dev/null @@ -1,149 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * We use a mock application, instead of a Slim application. - * so that we may easily test the Method Override middleware - * in isolation. - */ -class CustomAppMethod -{ - protected $environment; - - public function __construct() - { - $this->environment = \Slim\Environment::getInstance(); - } - - public function &environment() { - return $this->environment; - } - - public function call() - { - //Do nothing - } -} - -class MethodOverrideTest extends PHPUnit_Framework_TestCase -{ - /** - * Test overrides method as POST - */ - public function testOverrideMethodAsPost() - { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'POST', - 'CONTENT_TYPE' => 'application/x-www-form-urlencoded', - 'CONTENT_LENGTH' => 11, - 'slim.input' => '_METHOD=PUT' - )); - $app = new CustomAppMethod(); - $mw = new \Slim\Middleware\MethodOverride(); - $mw->setApplication($app); - $mw->setNextMiddleware($app); - $mw->call(); - $env =& $app->environment(); - $this->assertEquals('PUT', $env['REQUEST_METHOD']); - $this->assertTrue(isset($env['slim.method_override.original_method'])); - $this->assertEquals('POST', $env['slim.method_override.original_method']); - } - - /** - * Test does not override method if not POST - */ - public function testDoesNotOverrideMethodIfNotPost() - { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'GET', - 'slim.input' => '' - )); - $app = new CustomAppMethod(); - $mw = new \Slim\Middleware\MethodOverride(); - $mw->setApplication($app); - $mw->setNextMiddleware($app); - $mw->call(); - $env =& $app->environment(); - $this->assertEquals('GET', $env['REQUEST_METHOD']); - $this->assertFalse(isset($env['slim.method_override.original_method'])); - } - - /** - * Test does not override method if no method override parameter - */ - public function testDoesNotOverrideMethodAsPostWithoutParameter() - { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'POST', - 'REMOTE_ADDR' => '127.0.0.1', - 'SCRIPT_NAME' => '/foo/index.php', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - 'QUERY_STRING' => 'foo=bar', - 'SERVER_NAME' => 'slim', - 'SERVER_PORT' => 80, - 'slim.url_scheme' => 'http', - 'slim.input' => '', - 'slim.errors' => fopen('php://stderr', 'w') - )); - $app = new CustomAppMethod(); - $mw = new \Slim\Middleware\MethodOverride(); - $mw->setApplication($app); - $mw->setNextMiddleware($app); - $mw->call(); - $env =& $app->environment(); - $this->assertEquals('POST', $env['REQUEST_METHOD']); - $this->assertFalse(isset($env['slim.method_override.original_method'])); - } - - /** - * Test overrides method with X-Http-Method-Override header - */ - public function testOverrideMethodAsHeader() - { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'POST', - 'CONTENT_TYPE' => 'application/json', - 'CONTENT_LENGTH' => 0, - 'slim.input' => '', - 'HTTP_X_HTTP_METHOD_OVERRIDE' => 'DELETE' - )); - $app = new CustomAppMethod(); - $mw = new \Slim\Middleware\MethodOverride(); - $mw->setApplication($app); - $mw->setNextMiddleware($app); - $mw->call(); - $env =& $app->environment(); - $this->assertEquals('DELETE', $env['REQUEST_METHOD']); - $this->assertTrue(isset($env['slim.method_override.original_method'])); - $this->assertEquals('POST', $env['slim.method_override.original_method']); - } -} diff --git a/vendor/slim/slim/tests/Middleware/PrettyExceptionsTest.php b/vendor/slim/slim/tests/Middleware/PrettyExceptionsTest.php deleted file mode 100644 index a2e48f5..0000000 --- a/vendor/slim/slim/tests/Middleware/PrettyExceptionsTest.php +++ /dev/null @@ -1,153 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -class PrettyExceptionsTest extends PHPUnit_Framework_TestCase -{ - /** - * Test middleware returns successful response unchanged - */ - public function testReturnsUnchangedSuccessResponse() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/index.php', - 'PATH_INFO' => '/foo' - )); - $app = new \Slim\Slim(); - $app->get('/foo', function () { - echo "Success"; - }); - $mw = new \Slim\Middleware\PrettyExceptions(); - $mw->setApplication($app); - $mw->setNextMiddleware($app); - $mw->call(); - $this->assertEquals(200, $app->response()->status()); - $this->assertEquals('Success', $app->response()->body()); - } - - /** - * Test middleware returns diagnostic screen for error response - */ - public function testReturnsDiagnosticsForErrorResponse() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/index.php', - 'PATH_INFO' => '/foo' - )); - $app = new \Slim\Slim(array( - 'log.enabled' => false - )); - $app->get('/foo', function () { - throw new \Exception('Test Message', 100); - }); - $mw = new \Slim\Middleware\PrettyExceptions(); - $mw->setApplication($app); - $mw->setNextMiddleware($app); - $mw->call(); - $this->assertEquals(1, preg_match('@Slim Application Error@', $app->response()->body())); - $this->assertEquals(500, $app->response()->status()); - } - - /** - * Test middleware overrides response content type to html - */ - public function testResponseContentTypeIsOverriddenToHtml() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/index.php', - 'PATH_INFO' => '/foo' - )); - $app = new \Slim\Slim(array( - 'log.enabled' => false - )); - $app->get('/foo', function () use ($app) { - $app->contentType('application/json;charset=utf-8'); //<-- set content type to something else - throw new \Exception('Test Message', 100); - }); - $mw = new \Slim\Middleware\PrettyExceptions(); - $mw->setApplication($app); - $mw->setNextMiddleware($app); - $mw->call(); - $response = $app->response(); - $this->assertEquals('text/html', $response['Content-Type']); - } - - /** - * Test exception type is in response body - */ - public function testExceptionTypeIsInResponseBody() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/index.php', - 'PATH_INFO' => '/foo' - )); - $app = new \Slim\Slim(array( - 'log.enabled' => false - )); - $app->get('/foo', function () use ($app) { - throw new \LogicException('Test Message', 100); - }); - $mw = new \Slim\Middleware\PrettyExceptions(); - $mw->setApplication($app); - $mw->setNextMiddleware($app); - $mw->call(); - - $this->assertContains('LogicException', $app->response()->body()); - } - - /** - * Test with custom log - */ - public function testWithCustomLogWriter() - { - $this->setExpectedException('\LogicException'); - - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/index.php', - 'PATH_INFO' => '/foo' - )); - $app = new \Slim\Slim(array( - 'log.enabled' => false - )); - $app->container->singleton('log', function () use ($app) { - return new \Slim\Log(new \Slim\LogWriter('php://temp')); - }); - $app->get('/foo', function () use ($app) { - throw new \LogicException('Test Message', 100); - }); - $mw = new \Slim\Middleware\PrettyExceptions(); - $mw->setApplication($app); - $mw->setNextMiddleware($app); - $mw->call(); - - $this->assertContains('LogicException', $app->response()->body()); - } -} diff --git a/vendor/slim/slim/tests/Middleware/SessionCookieTest.php b/vendor/slim/slim/tests/Middleware/SessionCookieTest.php deleted file mode 100644 index 2673a18..0000000 --- a/vendor/slim/slim/tests/Middleware/SessionCookieTest.php +++ /dev/null @@ -1,463 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -class SessionCookieTest extends PHPUnit_Framework_TestCase -{ - public function setUp() - { - $_SESSION = array(); - } - - /** - * Test session cookie is set and constructed correctly - * - * We test for two things: - * - * 1) That the HTTP cookie exists with the correct name; - * 2) That the HTTP cookie's value is the expected value; - */ - public function testSessionCookieIsCreated() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/index.php', - 'PATH_INFO' => '/foo' - )); - $app = new \Slim\Slim(); - $app->get('/foo', function () { - $_SESSION['foo'] = 'bar'; - echo "Success"; - }); - $mw = new \Slim\Middleware\SessionCookie(array('expires' => '10 years')); - $mw->setApplication($app); - $mw->setNextMiddleware($app); - $mw->call(); - list($status, $header, $body) = $app->response()->finalize(); - $this->assertTrue($app->response->cookies->has('slim_session')); - $cookie = $app->response->cookies->get('slim_session'); - $this->assertEquals('{"foo":"bar"}', $cookie['value']); - } - - /** - * Test $_SESSION is populated from an encrypted HTTP cookie - * - * The encrypted cookie contains the serialized array ['foo' => 'bar']. The - * global secret, cipher, and cipher mode are assumed to be the default - * values. - */ - // public function testSessionIsPopulatedFromEncryptedCookie() - // { - // \Slim\Environment::mock(array( - // 'SCRIPT_NAME' => '/index.php', - // 'PATH_INFO' => '/foo', - // 'HTTP_COOKIE' => 'slim_session=1644004961%7CLKkYPwqKIMvBK7MWl6D%2BxeuhLuMaW4quN%2F512ZAaVIY%3D%7Ce0f007fa852c7101e8224bb529e26be4d0dfbd63', - // )); - // $app = new \Slim\Slim(); - // // The cookie value in the test is encrypted, so cookies.encrypt must - // // be set to true - // $app->config('cookies.encrypt', true); - // $app->get('/foo', function () { - // echo "Success"; - // }); - // $mw = new \Slim\Middleware\SessionCookie(array('expires' => '10 years')); - // $mw->setApplication($app); - // $mw->setNextMiddleware($app); - // $mw->call(); - // $this->assertEquals(array('foo' => 'bar'), $_SESSION); - // } - - /** - * Test $_SESSION is populated from an unencrypted HTTP cookie - * - * The unencrypted cookie contains the serialized array ['foo' => 'bar']. - * The global cookies.encrypt setting is set to false - */ - public function testSessionIsPopulatedFromUnencryptedCookie() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/index.php', - 'PATH_INFO' => '/foo', - 'HTTP_COOKIE' => 'slim_session={"foo":"bar"}', - )); - $app = new \Slim\Slim(); - // The cookie value in the test is unencrypted, so cookies.encrypt must - // be set to false - $app->config('cookies.encrypt', false); - $app->get('/foo', function () { - echo "Success"; - }); - $mw = new \Slim\Middleware\SessionCookie(array('expires' => '10 years')); - $mw->setApplication($app); - $mw->setNextMiddleware($app); - $mw->call(); - $this->assertEquals(array('foo' => 'bar'), $_SESSION); - } - - /** - * Test $_SESSION is populated from an unencrypted HTTP cookie - * - * The unencrypted cookie contains the serialized array ['foo' => 'bar']. - * The global cookies.encrypt setting is set to false - */ - public function testSessionIsPopulatedFromMalformedCookieData() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/index.php', - 'PATH_INFO' => '/foo', - 'HTTP_COOKIE' => 'slim_session={"foo":"bar"sdkhguy5y}', - )); - $app = new \Slim\Slim(); - // The cookie value in the test is unencrypted, so cookies.encrypt must - // be set to false - $app->config('cookies.encrypt', false); - $app->get('/foo', function () { - echo "Success"; - }); - $mw = new \Slim\Middleware\SessionCookie(array('expires' => '10 years')); - $mw->setApplication($app); - $mw->setNextMiddleware($app); - $mw->call(); - $this->assertEquals(array(), $_SESSION); - } - - /** - * Test $_SESSION is populated as empty array if no HTTP cookie - */ - public function testSessionIsPopulatedAsEmptyIfNoCookie() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/index.php', - 'PATH_INFO' => '/foo' - )); - $app = new \Slim\Slim(); - $app->get('/foo', function () { - echo "Success"; - }); - $mw = new \Slim\Middleware\SessionCookie(array('expires' => '10 years')); - $mw->setApplication($app); - $mw->setNextMiddleware($app); - $mw->call(); - $this->assertEquals(array(), $_SESSION); - } - - public function testSerializingTooLongValueWritesLogAndDoesntCreateCookie() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/index.php', - 'PATH_INFO' => '/foo' - )); - - $logWriter = $this->getMockBuilder('Slim\LogWriter') - ->disableOriginalConstructor() - ->getMock(); - - $logWriter->expects($this->once()) - ->method('write') - ->with('WARNING! Slim\Middleware\SessionCookie data size is larger than 4KB. Content save failed.', \Slim\Log::ERROR); - - $app = new \Slim\Slim(array( - 'log.writer' => $logWriter - )); - - $tooLongValue = $this->getTooLongValue(); - - $app->get('/foo', function () use ($tooLongValue) { - $_SESSION['test'] = $tooLongValue; - echo "Success"; - }); - - $mw = new \Slim\Middleware\SessionCookie(array('expires' => '10 years')); - $mw->setApplication($app); - $mw->setNextMiddleware($app); - $mw->call(); - list($status, $header, $body) = $app->response()->finalize(); - $this->assertFalse($app->response->cookies->has('slim_session')); - } - - /** - * Generated by http://www.random.org/strings/ - */ - protected function getTooLongValue() - { - return <<<EOF -8Y7WpaR3Fiyv0wF0QhKn -hwgh0SYA5cNOh85lSY3E -POUv7tHdFAKK0rmJnNUT -dxVjXuDUlStKTiC6B2rE -BMnchGCK2IIC83agjZ8t -K5U9tmPok3z7n7qFJPp4 -YfMPI07qRBgZnYW3vvrj -mY1082KeqiegFNwGiUSs -HYE16N7PChio33DZWjsD -urQLFxD1I0FsxPO7rora -Nmas8nhLl1SiwnlL8eZX -y2xe18BWfXcNHDGkfaih -zXT7MxHXmnq0s4lowjcc -5n8lrXmjYtIdHxl2QcMb -emFTXQpPX9bw8WjulQCB -Peq12lgmurt988RZiquy -lQ5Dw86wMIcIm3uULhr7 -T8Obj45ubR8poc1l5sIs -EG6kvcDIHVeQjUdrJuiw -sBLmZnLll23QGK8hMFO1 -Pii0BXpzL9wpUt3hQnfe -prkTuA8zuxU8vMOu5uSi -Zynrx9BniMwYGPTOJVSd -ygUsr1GQ1KGJu6ukLvgo -7zrkBV0QM9jNqqvkzZwm -ZnoKRJI1SbaSCqsAduCt -q5RPtNVpHmtizY3QwiJs -8tjGt9MG37zgKx8KhfYE -ByoILEa2ceHjdrP6yd1G -UMHeFx2kOCx2DVeVJIkt -aiFdKMTE9rIbpObSp1fy -Aei9bjwcWwHT2S22rYnj -QHG7FEHSPdkw8acO393N -Ip4rgim3NKanJXpfdthy -yMh4EnoYBBoqSScfW4g5 -bVrXYt8JkyCuR5Og0JBN -npKpr7obY4ZYVOnIF9Pe -soEmhC8uCw73bXzMy4ui -2oi4eFSXOoNDXZiAkz3c -zshSls22jy5QBvEJDDtY -C50qtymWnisOM1TIochg -OOnMEtkUHJw21kuw6m91 -aqxRK1thCfPGBGytOmzG -kyqvZE1oEzCONj7q4I3p -rvbnRzZhXv21UXRJnR51 -QJyXbtzDGpSljtSt4Fxi -SGiklrhWQCdRrnXuBExW -mQFykwpVF07NRPet9LdT -zOaOhwMfCeYQr2xqkKq7 -Ru2dsZdhHzhBDvV5nv1q -qB7kVD0YDKB6RJyPcpX9 -MxvPmISfMJMFiAFD82Qf -0idAAQxmd6fK9TkJPihp -wp2mvp3yAHWKmdsgLcss -OUqFt0BJoM7Iz4jJpF2d -hiWTsF1jrgEhV07TInLp -u7htseWgTDRY9UYp9wy6 -vnF0vsaFikqpjGkLy5oH -ncvaoRPa5MDBNvXZoiG9 -gCMvsGG8eLW3u8UWvRrk -bKgFBuy4zLhBF4RBuTVt -Dz1QmbyQPqmmfjchF6u3 -myRkxQtSnHQZr0kUqSJS -Ati7CBQq6LOPSVlAek5a -7EOVTREQ52qOjKAibvAr -etvEUy3CbsDiaeSPGlJH -XyFey6LugF2UZfHDFjgV -ByBaUrDz0yuvLOvECQuS -5CoA6FBz8D71FwwebEYl -5xQyEV5h7lNAsgbjBY6o -N92xlCGjyNGWp1Y9HoNL -mMhirp7mufNYVqIy8jBl -nYSK8Rk6KybpAPspHXPd -oemmqqxjF9g4ZjNk2pyL -dqetI1RYqszZPZeH7WNW -B1x1GSPdGXnefeNmxFxr -vFTVOHqgOgZR0xHHUl8P -RwFio0Cd8ZkaRIpcs7jh -Ps0tGJgPyo1gRdm9wtlB -j4hmInyIpAz1MjHYAQc1 -YIjnSirWsrItgqidgS3W -LNT7DriU7wPyN6zV9G6d -YFD19x1DDBwz57DegTsy -rz72EblrUsP6wtN69GRo -irhM6N9eNu8Bq9Qo5Tlc -Cpb3Zl3FDttiW63KXQpL -4ZQ7VGbfVjwBwhcGoOe7 -RgXxZ9OU0HJFQRpjvJDW -lk3PpNhcHT4vVkgF9Q3V -URiazjSe8G4zHrBBMaxM -Gh7Xp4hqf9GTnIYyMe5E -palqUjJhSGm7EZAR1b4i -HN8qrHznKAyhlywYBw3N -nV9Kla5KFWaRG4r3cCT1 -qHT7nPIbVjxNYdujh5WK -CKg7BfQjwZtHk2oM1cyO -RBPMpZxNpM3ZhiXNz5D2 -xZJM9ETPwABBqHirjTXA -faI4irlrshHra2hg6mHE -N0OLyZjmKpyzHRlAcC44 -oEMe1Mq85Kynyla7S3Lo -Us9auTpKq33jAI51MUvC -Vbu2qKSsmCrXu1WMDFfL -WCCzzLqz2kfMy3IV0ngc -ya4k4AoSjb2nd43VGRvt -1FrWocIRfoyFj3igs8lF -dQlTXv3jttgGmHVJtuJK -zCHcfzABc5pNch7cEW4B -r8jB0mL9ESrMHhvqGxbf -qLUYdNrXNJNujy43WNLt -GaQ6adUTFHErjRYFj7ws -btv28UZlttBqlVAEpu7G -1Se9HT2tp45a5iwbAHpA -tXaOwMjaI3S1uxngaVVL -saFZXdx4kExE3Y3SEMTA -my9rhAEFcw4N1uBqa2Ts -IRupwTKFoRIpPSBwnPPw -qpxq4VIrOdESR4UZiOcw -1n12beyYTUN0zNzV0nRf -dkgrmnaeWbrxA2QQaHDq -o1f6VCap62NxJI2Wd0F7 -eyYYL6mY0XUmuCdV2v9e -SPBqa552akcetnRViZD9 -cqLrX89ouNlDcjC7hmYk -3vAcrwlseFDYDYzrCXXx -tkyJUeJjORVXoFKaoEmi -o1JoqBFpSPyRT6RwFTXC -IMW657539XCcn0Tvx3iJ -rW9ZUNBSHNHjR0wfbr1R -x7Ez1Br1T9VG4wEetwfY -Xj9s0ipdQDEeYG3eCkBG -xQCp4J0a7BEqEEVPJvYY -S46aXD70Ur3BiokRfeJK -kEQcqPCP9kmWxXboESOB -VjADYs7ZwJUvWNAk0Msc -5cSrhWsbizSwo31NsPKj -PHKG7ui9gU0F5fXKXtWz -8FxjchkHJ3jQQSWKfkSu -pN8e9d71IVYA1vLyQGqV -Hh3QE3o9tmNsJMEBoRK8 -QBLTFWWfkGSOI3Vp3y6c -5gwll5qdcgnaF4tDvdRd -NDYpacWX4hnFsrO73OOo -GaenbdbDOUp0iClZKlTU -79UJvctLD86KC2mwxSqc -jbwmzM4oZZ7zuYo769YY -B7Ssx6qbITbIqaJJboMK -7tLwsE3FhBphBJBKP4Bk -aumHnttxOXpiX3b5ivlk -gsvWRKCd1KLYkucRdW1j -j0TSXNoMGXlIK9X6YjX1 -4zvHH7QEPlgK4AaRWw6r -eXSVfE2X2nbn1wzA3bdw -exrWkKQ8v87kzzxpzdF7 -wL9B42yeyA6SgfnZ0SnW -hyO53wkaJNQnK2rzndcA -8jSesmehxaHL39QUdlEo -oAQMANsGVewC4cYhdjpk -tBVMFz1LMIg8nj5acoKx -4IxsrP4UrdaHa2QlFZ38 -OMg0erS6Mg2nVY9PBLGu -WLybJJlrNJ3ZKgftRyOb -s392j4FVZuxnLc8Euq2g -2AB9ceeOXHrw6dJeqImY -q8Gqy9rzsKyp9vEg13h3 -UhWoiMQuE8i38vd5HZuO -CjLfC9MtQY7wou4YGl1f -bQGFeV3I1YVsyh1zjdYX -E4yS7PXLT2pTvq9aTuPc -41Vm8F6tc6mnYCc0gfCY -nmKOUzThbGpqnSkJzmr5 -E5izT37qIM1PJ1IotRnw -X0rD7K2rUN47XeLXW3x2 -3taWQ4GMNGQgjuD7MPwX -u7AyGdUWFG25ZaeZSyrt -mLPs4NU5ayAgrj9L089E -5mWnKfJ8OoAbhjb9XpY5 -cBv75uTcpezbnWe5C7YC -DWikoIaaJQebFW2tddw2 -qMyIzbkUJxyTheONxBjJ -WyWqJmTW5uniw9ofX84U -JaFGtu4y24UGSmPrIjVj -SDFz3iRvf2FG65m8brV9 -0mpT6dWL4p59cdTs0n1c -jw7rIgu3VFnkuOp8mZR3 -F1PPQYZfZkqbyiu7Tvl6 -tXT8EPpH39oB9Qe3SI6C -DwL6cklHbnOyEOO5jNOo -vEORF3tEYRngOowzuOEY -6XY27pGEG9L9MvwvHinw -rEMyl7S9eFk554yHvCa3 -pLToqRXBWIPK51roFlKs -AXfdbVdGkGqwlKn68k01 -ecFbbnvrpmcLF2gL3GbC -aWJf90PECBF0qqZ1jVC3 -WjMuah0gZjryj7zsZKMB -1J9koTowUYguyp4MBGmp -rnjhybC8RQSEvmYpqkGR -Qdj2QlGYXN1H8A1315QJ -amycQeWwXnrdI3duyqTa -H2YwgIStIGQlWNigfiIZ -btR0CdDnkwGt0hlCtQF0 -O37vtIvVgCKVbcXbBexH -xhkbsShz4onN4CeGf7Ox -1vJfx422pUnxtjG5Laag -3IV5ib20qSYZW3Wr2LiH -zmvoTLblxTX3EpYPlHxC -U0Ceix4L3dMomXzn7OAC -JyzkRGfIi8j4EnKfoWPG -gMUXWXZZgJzLBfZ4y9FV -7ClYOAd9EoWspOWQ1MmO -1CIKB3Ei846C1rmXS8Zc -ARLDXFpaHp1VlbEMF8fk -KrQa28U3gbHs9B5oGhxS -WHc9LmQiINcUglo8cKPs -3WMYJ8TAtvlMswUPOd6t -s81Cy4B2oLrc4E5XSa5p -QA6pDUiKipuWFXZ4BMUF -E03CQbBiZ27GpJekftsF -pqGkJifdjVLuuIu0xBej -V27rk0vIwp1Q8p4DvJ1F -TPhvHNooyU6Rrmcx8GIK -81nRsYYsvVo3LCmuOnX5 -uY6xGTes3UOMXkXwEfGj -T5LfaSyWP5y4L7vvLBjS -dHO7dVB1bmIA40fEgk3i -KHJxU6C0rUVtPtIR1slm -YdhTz1mwWi2z2GDzzRJB -TIzFqPkKrgCgkiv2RzCg -Z0qY4Wjpfug51zXzU51H -nWm3mJnVLAKv9RNkdThl -xk28IMKOGOPdQuXjGDB6 -eEG3ndIRXnmmLilygHop -jE6u88nWi30Yos79canx -b0VuROFF04rZuOTo5Fue -yt4fSpHN7v4uZ7uNPMA9 -0sENIYeLlIbBWhqTjXCp -m7qMMX3acdRtTTVNp7Qt -s8XKOJmCQr7YGk47jGMn -6o1kxMmoUgWCW8rEtnWA -kxXj1hKRFBJmX8ErM6Zp -FZBIPSbNt5hmXoC1M92l -UxeirI2PCJnQcAJVmNVJ -FaJ9L5K0u1J9JKGl2Aew -bHGX5QLvkGXSFY5OCezp -5cnbOjU1j8Fuvtuuk9d0 -7Oz2IIi69WB5J14n9iWQ -XgCpDLURX3urpiYDFf3P -7xeWOS4yTMUQ0EbLkZOU -AzKM3Dp7nGr9SYPI4xmi -EOF; - } -} diff --git a/vendor/slim/slim/tests/MiddlewareTest.php b/vendor/slim/slim/tests/MiddlewareTest.php deleted file mode 100644 index 08ea135..0000000 --- a/vendor/slim/slim/tests/MiddlewareTest.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -class MyMiddleware extends \Slim\Middleware -{ - public function call() {} -} - -class MiddlewareTest extends PHPUnit_Framework_TestCase -{ - public function testSetApplication() - { - $app = new stdClass(); - $mw = new MyMiddleware(); - $mw->setApplication($app); - - $this->assertAttributeSame($app, 'app', $mw); - } - - public function testGetApplication() - { - $app = new stdClass(); - $mw = new MyMiddleware(); - $property = new \ReflectionProperty($mw, 'app'); - $property->setAccessible(true); - $property->setValue($mw, $app); - - $this->assertSame($app, $mw->getApplication()); - } - - public function testSetNextMiddleware() - { - $mw1 = new MyMiddleware(); - $mw2 = new MyMiddleware(); - $mw1->setNextMiddleware($mw2); - - $this->assertAttributeSame($mw2, 'next', $mw1); - } - - public function testGetNextMiddleware() - { - $mw1 = new MyMiddleware(); - $mw2 = new MyMiddleware(); - $property = new \ReflectionProperty($mw1, 'next'); - $property->setAccessible(true); - $property->setValue($mw1, $mw2); - - $this->assertSame($mw2, $mw1->getNextMiddleware()); - } -} diff --git a/vendor/slim/slim/tests/README b/vendor/slim/slim/tests/README deleted file mode 100644 index 7bc611c..0000000 --- a/vendor/slim/slim/tests/README +++ /dev/null @@ -1,18 +0,0 @@ -Slim Framework Unit Tests - -Follow the directions below to run the Slim Framework unit tests. You'll need the latest version of PHPUnit. To save development time, these unit tests require PHP >= 5.3. However, the Slim Framework itself requires only PHP >= 5.2. - -1. Install the latest version of PHPUnit -Visit http://www.phpunit.de/ for installation instructions. - -2. Run PHPUnit -From the filesystem directory that contains the `tests` directory, you may run all unit tests or specific unit tests. Here are several examples. The '$>' in the examples below is your command prompt. - -To run all tests: -$> phpunit tests - -To run all HTTP-related tests: -$> phpunit tests/Http - -To run only the HTTP Request tests: -$> phpunit tests/Http/RequestTest \ No newline at end of file diff --git a/vendor/slim/slim/tests/RouteTest.php b/vendor/slim/slim/tests/RouteTest.php deleted file mode 100644 index e45bfda..0000000 --- a/vendor/slim/slim/tests/RouteTest.php +++ /dev/null @@ -1,617 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -class LazyInitializeTestClass { - public static $initialized = false; - - public function __construct() { - self::$initialized = true; - } - - public function foo() { - } -} - -class FooTestClass { - public static $foo_invoked = false; - public static $foo_invoked_args = array(); - - public function foo() { - self::$foo_invoked = true; - self::$foo_invoked_args = func_get_args(); - } -} - -class RouteTest extends PHPUnit_Framework_TestCase -{ - public function testGetPattern() - { - $route = new \Slim\Route('/foo', function () {}); - - $this->assertEquals('/foo', $route->getPattern()); - } - - public function testGetName() - { - $route = new \Slim\Route('/foo', function () {}); - - $property = new \ReflectionProperty($route, 'name'); - $property->setAccessible(true); - $property->setValue($route, 'foo'); - - $this->assertEquals('foo', $route->getName()); - } - - public function testSetName() - { - $route = new \Slim\Route('/foo', function () {}); - $route->name('foo'); // <-- Alias for `setName()` - - $this->assertAttributeEquals('foo', 'name', $route); - } - - public function testGetCallable() - { - $callable = function () { - echo 'Foo'; - }; - $route = new \Slim\Route('/foo', $callable); - - $this->assertSame($callable, $route->getCallable()); - } - - public function testGetCallableAsClass() - { - FooTestClass::$foo_invoked = false; - FooTestClass::$foo_invoked_args = array(); - $route = new \Slim\Route('/foo', '\FooTestClass:foo'); - $route->setParams(array('bar' => '1234')); - - $this->assertFalse(FooTestClass::$foo_invoked); - $this->assertTrue($route->dispatch()); - $this->assertTrue(FooTestClass::$foo_invoked); - $this->assertEquals(array('1234'), FooTestClass::$foo_invoked_args); - } - - public function testGetCallableAsClassLazyInitialize() - { - LazyInitializeTestClass::$initialized = false; - - $route = new \Slim\Route('/foo', '\LazyInitializeTestClass:foo'); - $this->assertFalse(LazyInitializeTestClass::$initialized); - - $route->dispatch(); - $this->assertTrue(LazyInitializeTestClass::$initialized); - } - - public function testGetCallableAsStaticMethod() - { - $route = new \Slim\Route('/bar', '\Slim\Slim::getInstance'); - - $callable = $route->getCallable(); - $this->assertEquals('\Slim\Slim::getInstance', $callable); - } - - public function example_càllâble_wïth_wéird_chars() - { - return 'test'; - } - - public function testGetCallableWithOddCharsAsClass() - { - $route = new \Slim\Route('/foo', '\RouteTest:example_càllâble_wïth_wéird_chars'); - $callable = $route->getCallable(); - - $this->assertEquals('test', $callable()); - } - - public function testSetCallable() - { - $callable = function () { - echo 'Foo'; - }; - $route = new \Slim\Route('/foo', $callable); // <-- Called inside __construct() - - $this->assertAttributeSame($callable, 'callable', $route); - } - - public function testSetCallableWithInvalidArgument() - { - $this->setExpectedException('\InvalidArgumentException'); - $route = new \Slim\Route('/foo', 'doesNotExist'); // <-- Called inside __construct() - } - - public function testGetParams() - { - $route = new \Slim\Route('/hello/:first/:last', function () {}); - $route->matches('/hello/mr/anderson'); // <-- Parses params from argument - - $this->assertEquals(array( - 'first' => 'mr', - 'last' => 'anderson' - ), $route->getParams()); - } - - public function testSetParams() - { - $route = new \Slim\Route('/hello/:first/:last', function () {}); - $route->matches('/hello/mr/anderson'); // <-- Parses params from argument - $route->setParams(array( - 'first' => 'agent', - 'last' => 'smith' - )); - - $this->assertAttributeEquals(array( - 'first' => 'agent', - 'last' => 'smith' - ), 'params', $route); - } - - public function testGetParam() - { - $route = new \Slim\Route('/hello/:first/:last', function () {}); - - $property = new \ReflectionProperty($route, 'params'); - $property->setAccessible(true); - $property->setValue($route, array( - 'first' => 'foo', - 'last' => 'bar' - )); - - $this->assertEquals('foo', $route->getParam('first')); - } - - public function testGetParamThatDoesNotExist() - { - $this->setExpectedException('InvalidArgumentException'); - - $route = new \Slim\Route('/hello/:first/:last', function () {}); - - $property = new \ReflectionProperty($route, 'params'); - $property->setAccessible(true); - $property->setValue($route, array( - 'first' => 'foo', - 'last' => 'bar' - )); - - $route->getParam('middle'); - } - - public function testSetParam() - { - $route = new \Slim\Route('/hello/:first/:last', function () {}); - $route->matches('/hello/mr/anderson'); // <-- Parses params from argument - $route->setParam('last', 'smith'); - - $this->assertAttributeEquals(array( - 'first' => 'mr', - 'last' => 'smith' - ), 'params', $route); - } - - public function testSetParamThatDoesNotExist() - { - $this->setExpectedException('InvalidArgumentException'); - - $route = new \Slim\Route('/hello/:first/:last', function () {}); - $route->matches('/hello/mr/anderson'); // <-- Parses params from argument - $route->setParam('middle', 'smith'); // <-- Should trigger InvalidArgumentException - } - - public function testMatches() - { - $route = new \Slim\Route('/hello/:name', function () {}); - - $this->assertTrue($route->matches('/hello/josh')); - } - - public function testMatchesIsFalse() - { - $route = new \Slim\Route('/foo', function () {}); - - $this->assertFalse($route->matches('/bar')); - } - - public function testMatchesPatternWithTrailingSlash() - { - $route = new \Slim\Route('/foo/', function () {}); - - $this->assertTrue($route->matches('/foo/')); - $this->assertTrue($route->matches('/foo')); - } - - public function testMatchesPatternWithoutTrailingSlash() - { - $route = new \Slim\Route('/foo', function () {}); - - $this->assertFalse($route->matches('/foo/')); - $this->assertTrue($route->matches('/foo')); - } - - public function testMatchesWithConditions() - { - $route = new \Slim\Route('/hello/:first/and/:second', function () {}); - $route->conditions(array( - 'first' => '[a-zA-Z]{3,}' - )); - - $this->assertTrue($route->matches('/hello/Josh/and/John')); - } - - public function testMatchesWithConditionsIsFalse() - { - $route = new \Slim\Route('/hello/:first/and/:second', function () {}); - $route->conditions(array( - 'first' => '[a-z]{3,}' - )); - - $this->assertFalse($route->matches('/hello/Josh/and/John')); - } - - /* - * Route should match URI with valid path component according to rfc2396 - * - * "Uniform Resource Identifiers (URI): Generic Syntax" http://www.ietf.org/rfc/rfc2396.txt - * - * Excludes "+" which is valid but decodes into a space character - */ - public function testMatchesWithValidRfc2396PathComponent() - { - $symbols = ':@&=$,'; - $route = new \Slim\Route('/rfc2386/:symbols', function () {}); - - $this->assertTrue($route->matches('/rfc2386/' . $symbols)); - } - - /* - * Route should match URI including unreserved punctuation marks from rfc2396 - * - * "Uniform Resource Identifiers (URI): Generic Syntax" http://www.ietf.org/rfc/rfc2396.txt - */ - public function testMatchesWithUnreservedMarks() - { - $marks = "-_.!~*'()"; - $route = new \Slim\Route('/marks/:marks', function () {}); - - $this->assertTrue($route->matches('/marks/' . $marks)); - } - - public function testMatchesOptionalParameters() - { - $pattern = '/archive/:year(/:month(/:day))'; - - $route1 = new \Slim\Route($pattern, function () {}); - $this->assertTrue($route1->matches('/archive/2010')); - $this->assertEquals(array('year' => '2010'), $route1->getParams()); - - $route2 = new \Slim\Route($pattern, function () {}); - $this->assertTrue($route2->matches('/archive/2010/05')); - $this->assertEquals(array('year' => '2010', 'month' => '05'), $route2->getParams()); - - $route3 = new \Slim\Route($pattern, function () {}); - $this->assertTrue($route3->matches('/archive/2010/05/13')); - $this->assertEquals(array('year' => '2010', 'month' => '05', 'day' => '13'), $route3->getParams()); - } - - public function testMatchesIsCaseSensitiveByDefault() - { - $route = new \Slim\Route('/case/sensitive', function () {}); - $this->assertTrue($route->matches('/case/sensitive')); - $this->assertFalse($route->matches('/CaSe/SensItiVe')); - } - - public function testMatchesCanBeCaseInsensitive() - { - $route = new \Slim\Route('/Case/Insensitive', function () {}, false); - $this->assertTrue($route->matches('/Case/Insensitive')); - $this->assertTrue($route->matches('/CaSe/iNSensItiVe')); - } - - public function testGetConditions() - { - $route = new \Slim\Route('/foo', function () {}); - - $property = new \ReflectionProperty($route, 'conditions'); - $property->setAccessible(true); - $property->setValue($route, array('foo' => '\d{3}')); - - $this->assertEquals(array('foo' => '\d{3}'), $route->getConditions()); - } - - public function testSetDefaultConditions() - { - \Slim\Route::setDefaultConditions(array( - 'id' => '\d+' - )); - - $property = new \ReflectionProperty('\Slim\Route', 'defaultConditions'); - $property->setAccessible(true); - - $this->assertEquals(array( - 'id' => '\d+' - ), $property->getValue()); - } - - public function testGetDefaultConditions() - { - $property = new \ReflectionProperty('\Slim\Route', 'defaultConditions'); - $property->setAccessible(true); - $property->setValue(array( - 'id' => '\d+' - )); - - $this->assertEquals(array( - 'id' => '\d+' - ), \Slim\Route::getDefaultConditions()); - } - - public function testDefaultConditionsAssignedToInstance() - { - $staticProperty = new \ReflectionProperty('\Slim\Route', 'defaultConditions'); - $staticProperty->setAccessible(true); - $staticProperty->setValue(array( - 'id' => '\d+' - )); - $route = new \Slim\Route('/foo', function () {}); - - $this->assertAttributeEquals(array( - 'id' => '\d+' - ), 'conditions', $route); - } - - public function testMatchesWildcard() - { - $route = new \Slim\Route('/hello/:path+/world', function () {}); - - $this->assertTrue($route->matches('/hello/foo/bar/world')); - $this->assertAttributeEquals(array( - 'path' => array('foo', 'bar') - ), 'params', $route); - } - - public function testMatchesMultipleWildcards() - { - $route = new \Slim\Route('/hello/:path+/world/:date+', function () {}); - - $this->assertTrue($route->matches('/hello/foo/bar/world/2012/03/10')); - $this->assertAttributeEquals(array( - 'path' => array('foo', 'bar'), - 'date' => array('2012', '03', '10') - ), 'params', $route); - } - - public function testMatchesParamsAndWildcards() - { - $route = new \Slim\Route('/hello/:path+/world/:year/:month/:day/:path2+', function () {}); - - $this->assertTrue($route->matches('/hello/foo/bar/world/2012/03/10/first/second')); - $this->assertAttributeEquals(array( - 'path' => array('foo', 'bar'), - 'year' => '2012', - 'month' => '03', - 'day' => '10', - 'path2' => array('first', 'second') - ), 'params', $route); - } - - public function testMatchesParamsWithOptionalWildcard() - { - $route = new \Slim\Route('/hello(/:foo(/:bar+))', function () {}); - - $this->assertTrue($route->matches('/hello')); - $this->assertTrue($route->matches('/hello/world')); - $this->assertTrue($route->matches('/hello/world/foo')); - $this->assertTrue($route->matches('/hello/world/foo/bar')); - } - - public function testSetMiddleware() - { - $route = new \Slim\Route('/foo', function () {}); - $mw = function () { - echo 'Foo'; - }; - $route->setMiddleware($mw); - - $this->assertAttributeContains($mw, 'middleware', $route); - } - - public function testSetMiddlewareMultipleTimes() - { - $route = new \Slim\Route('/foo', function () {}); - $mw1 = function () { - echo 'Foo'; - }; - $mw2 = function () { - echo 'Bar'; - }; - $route->setMiddleware($mw1); - $route->setMiddleware($mw2); - - $this->assertAttributeContains($mw1, 'middleware', $route); - $this->assertAttributeContains($mw2, 'middleware', $route); - } - - public function testSetMiddlewareWithArray() - { - $route = new \Slim\Route('/foo', function () {}); - $mw1 = function () { - echo 'Foo'; - }; - $mw2 = function () { - echo 'Bar'; - }; - $route->setMiddleware(array($mw1, $mw2)); - - $this->assertAttributeContains($mw1, 'middleware', $route); - $this->assertAttributeContains($mw2, 'middleware', $route); - } - - public function testSetMiddlewareWithInvalidArgument() - { - $this->setExpectedException('InvalidArgumentException'); - - $route = new \Slim\Route('/foo', function () {}); - $route->setMiddleware('doesNotExist'); // <-- Should throw InvalidArgumentException - } - - public function testSetMiddlewareWithArrayWithInvalidArgument() - { - $this->setExpectedException('InvalidArgumentException'); - - $route = new \Slim\Route('/foo', function () {}); - $route->setMiddleware(array('doesNotExist')); - } - - public function testGetMiddleware() - { - $route = new \Slim\Route('/foo', function () {}); - - $property = new \ReflectionProperty($route, 'middleware'); - $property->setAccessible(true); - $property->setValue($route, array('foo' => 'bar')); - - $this->assertEquals(array('foo' => 'bar'), $route->getMiddleware()); - } - - public function testSetHttpMethods() - { - $route = new \Slim\Route('/foo', function () {}); - $route->setHttpMethods('GET', 'POST'); - - $this->assertAttributeEquals(array('GET', 'POST'), 'methods', $route); - } - - public function testGetHttpMethods() - { - $route = new \Slim\Route('/foo', function () {}); - - $property = new \ReflectionProperty($route, 'methods'); - $property->setAccessible(true); - $property->setValue($route, array('GET', 'POST')); - - $this->assertEquals(array('GET', 'POST'), $route->getHttpMethods()); - } - - public function testAppendHttpMethods() - { - $route = new \Slim\Route('/foo', function () {}); - - $property = new \ReflectionProperty($route, 'methods'); - $property->setAccessible(true); - $property->setValue($route, array('GET', 'POST')); - - $route->appendHttpMethods('PUT'); - - $this->assertAttributeEquals(array('GET', 'POST', 'PUT'), 'methods', $route); - } - - public function testAppendArrayOfHttpMethods() - { - $arrayOfMethods = array('GET','POST','PUT'); - $route = new \Slim\Route('/foo', function () {}); - $route->appendHttpMethods($arrayOfMethods); - - $this->assertAttributeEquals($arrayOfMethods,'methods',$route); - } - - public function testAppendHttpMethodsWithVia() - { - $route = new \Slim\Route('/foo', function () {}); - $route->via('PUT'); - - $this->assertAttributeContains('PUT', 'methods', $route); - } - - public function testAppendArrayOfHttpMethodsWithVia() - { - $arrayOfMethods = array('GET','POST','PUT'); - $route = new \Slim\Route('/foo', function () {}); - $route->via($arrayOfMethods); - - $this->assertAttributeEquals($arrayOfMethods,'methods',$route); - } - - public function testSupportsHttpMethod() - { - $route = new \Slim\Route('/foo', function () {}); - - $property = new \ReflectionProperty($route, 'methods'); - $property->setAccessible(true); - $property->setValue($route, array('POST')); - - $this->assertTrue($route->supportsHttpMethod('POST')); - $this->assertFalse($route->supportsHttpMethod('PUT')); - } - - /** - * Test dispatch with params - */ - public function testDispatch() - { - $this->expectOutputString('Hello josh'); - $route = new \Slim\Route('/hello/:name', function ($name) { echo "Hello $name"; }); - $route->matches('/hello/josh'); //<-- Extracts params from resource URI - $route->dispatch(); - } - - /** - * Test dispatch with middleware - */ - public function testDispatchWithMiddleware() - { - $this->expectOutputString('First! Second! Hello josh'); - $route = new \Slim\Route('/hello/:name', function ($name) { echo "Hello $name"; }); - $route->setMiddleware(function () { - echo "First! "; - }); - $route->setMiddleware(function () { - echo "Second! "; - }); - $route->matches('/hello/josh'); //<-- Extracts params from resource URI - $route->dispatch(); - } - - /** - * Test middleware with arguments - */ - public function testRouteMiddlwareArguments() - { - $this->expectOutputString('foobar'); - $route = new \Slim\Route('/foo', function () { echo "bar"; }); - $route->setName('foo'); - $route->setMiddleware(function ($route) { - echo $route->getName(); - }); - $route->matches('/foo'); //<-- Extracts params from resource URI - $route->dispatch(); - } -} diff --git a/vendor/slim/slim/tests/RouterTest.php b/vendor/slim/slim/tests/RouterTest.php deleted file mode 100644 index 145f0d7..0000000 --- a/vendor/slim/slim/tests/RouterTest.php +++ /dev/null @@ -1,250 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -class RouterTest extends PHPUnit_Framework_TestCase -{ - /** - * Constructor should initialize routes as empty array - */ - public function testConstruct() - { - $router = new \Slim\Router(); - - $this->assertAttributeEquals(array(), 'routes', $router); - } - - /** - * Map should set and return instance of \Slim\Route - */ - public function testMap() - { - $router = new \Slim\Router(); - $route = new \Slim\Route('/foo', function() {}); - $router->map($route); - - $this->assertAttributeContains($route, 'routes', $router); - } - - /** - * Named route should be added and indexed by name - */ - public function testAddNamedRoute() - { - $router = new \Slim\Router(); - $route = new \Slim\Route('/foo', function () {}); - $router->addNamedRoute('foo', $route); - - $property = new \ReflectionProperty($router, 'namedRoutes'); - $property->setAccessible(true); - - $rV = $property->getValue($router); - $this->assertSame($route, $rV['foo']); - } - - /** - * Named route should have unique name - */ - public function testAddNamedRouteWithDuplicateKey() - { - $this->setExpectedException('RuntimeException'); - - $router = new \Slim\Router(); - $route = new \Slim\Route('/foo', function () {}); - $router->addNamedRoute('foo', $route); - $router->addNamedRoute('foo', $route); - } - - /** - * Router should return named route by name, or null if not found - */ - public function testGetNamedRoute() - { - $router = new \Slim\Router(); - $route = new \Slim\Route('/foo', function () {}); - - $property = new \ReflectionProperty($router, 'namedRoutes'); - $property->setAccessible(true); - $property->setValue($router, array('foo' => $route)); - - $this->assertSame($route, $router->getNamedRoute('foo')); - $this->assertNull($router->getNamedRoute('bar')); - } - - /** - * Router should determine named routes and cache results - */ - public function testGetNamedRoutes() - { - $router = new \Slim\Router(); - $route1 = new \Slim\Route('/foo', function () {}); - $route2 = new \Slim\Route('/bar', function () {}); - - // Init router routes to array - $propertyRouterRoutes = new \ReflectionProperty($router, 'routes'); - $propertyRouterRoutes->setAccessible(true); - $propertyRouterRoutes->setValue($router, array($route1, $route2)); - - // Init router named routes to null - $propertyRouterNamedRoutes = new \ReflectionProperty($router, 'namedRoutes'); - $propertyRouterNamedRoutes->setAccessible(true); - $propertyRouterNamedRoutes->setValue($router, null); - - // Init route name - $propertyRouteName = new \ReflectionProperty($route2, 'name'); - $propertyRouteName->setAccessible(true); - $propertyRouteName->setValue($route2, 'bar'); - - $namedRoutes = $router->getNamedRoutes(); - $this->assertCount(1, $namedRoutes); - $this->assertSame($route2, $namedRoutes['bar']); - } - - /** - * Router should detect presence of a named route by name - */ - public function testHasNamedRoute() - { - $router = new \Slim\Router(); - $route = new \Slim\Route('/foo', function () {}); - - $property = new \ReflectionProperty($router, 'namedRoutes'); - $property->setAccessible(true); - $property->setValue($router, array('foo' => $route)); - - $this->assertTrue($router->hasNamedRoute('foo')); - $this->assertFalse($router->hasNamedRoute('bar')); - } - - /** - * Router should return current route if set during iteration - */ - public function testGetCurrentRoute() - { - $router = new \Slim\Router(); - $route = new \Slim\Route('/foo', function () {}); - - $property = new \ReflectionProperty($router, 'currentRoute'); - $property->setAccessible(true); - $property->setValue($router, $route); - - $this->assertSame($route, $router->getCurrentRoute()); - } - - /** - * Router should return first matching route if current route not set yet by iteration - */ - public function testGetCurrentRouteIfMatchedRoutes() - { - $router = new \Slim\Router(); - $route = new \Slim\Route('/foo', function () {}); - - $propertyMatchedRoutes = new \ReflectionProperty($router, 'matchedRoutes'); - $propertyMatchedRoutes->setAccessible(true); - $propertyMatchedRoutes->setValue($router, array($route)); - - $propertyCurrentRoute = new \ReflectionProperty($router, 'currentRoute'); - $propertyCurrentRoute->setAccessible(true); - $propertyCurrentRoute->setValue($router, null); - - $this->assertSame($route, $router->getCurrentRoute()); - } - - /** - * Router should return `null` if current route not set yet and there are no matching routes - */ - public function testGetCurrentRouteIfNoMatchedRoutes() - { - $router = new \Slim\Router(); - - $propertyMatchedRoutes = new \ReflectionProperty($router, 'matchedRoutes'); - $propertyMatchedRoutes->setAccessible(true); - $propertyMatchedRoutes->setValue($router, array()); - - $propertyCurrentRoute = new \ReflectionProperty($router, 'currentRoute'); - $propertyCurrentRoute->setAccessible(true); - $propertyCurrentRoute->setValue($router, null); - - $this->assertNull($router->getCurrentRoute()); - } - - public function testGetMatchedRoutes() - { - $router = new \Slim\Router(); - - $route1 = new \Slim\Route('/foo', function () {}); - $route1 = $route1->via('GET'); - - $route2 = new \Slim\Route('/foo', function () {}); - $route2 = $route2->via('POST'); - - $route3 = new \Slim\Route('/bar', function () {}); - $route3 = $route3->via('PUT'); - - $routes = new \ReflectionProperty($router, 'routes'); - $routes->setAccessible(true); - $routes->setValue($router, array($route1, $route2, $route3)); - - $matchedRoutes = $router->getMatchedRoutes('GET', '/foo'); - $this->assertSame($route1, $matchedRoutes[0]); - } - - // Test url for named route - - public function testUrlFor() - { - $router = new \Slim\Router(); - - $route1 = new \Slim\Route('/hello/:first/:last', function () {}); - $route1 = $route1->via('GET')->name('hello'); - - $route2 = new \Slim\Route('/path/(:foo\.:bar)', function () {}); - $route2 = $route2->via('GET')->name('regexRoute'); - - $routes = new \ReflectionProperty($router, 'namedRoutes'); - $routes->setAccessible(true); - $routes->setValue($router, array( - 'hello' => $route1, - 'regexRoute' => $route2 - )); - - $this->assertEquals('/hello/Josh/Lockhart', $router->urlFor('hello', array('first' => 'Josh', 'last' => 'Lockhart'))); - $this->assertEquals('/path/Hello.Josh', $router->urlFor('regexRoute', array('foo' => 'Hello', 'bar' => 'Josh'))); - } - - public function testUrlForIfNoSuchRoute() - { - $this->setExpectedException('RuntimeException'); - - $router = new \Slim\Router(); - $router->urlFor('foo', array('abc' => '123')); - } -} diff --git a/vendor/slim/slim/tests/SlimTest.php b/vendor/slim/slim/tests/SlimTest.php deleted file mode 100644 index 3aa9273..0000000 --- a/vendor/slim/slim/tests/SlimTest.php +++ /dev/null @@ -1,1657 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@joshlockhart.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -//Mock custom view -class CustomView extends \Slim\View -{ - public function render($template, $data = null) { echo "Custom view"; } -} - -//Echo Logger -class EchoErrorLogger -{ - public function error($object) { echo get_class($object) .':'.$object->getMessage(); } -} - -//Mock extending class -class Derived extends \Slim\Slim -{ - public static function getDefaultSettings() - { - return array_merge( - array("late-static-binding" => true) - , parent::getDefaultSettings()); - } -} - -//Mock middleware -class CustomMiddleware extends \Slim\Middleware -{ - public function call() - { - $env = $this->app->environment(); - $res = $this->app->response(); - $env['slim.test'] = 'Hello'; - $this->next->call(); - $res->header('X-Slim-Test', 'Hello'); - $res->write('Hello'); - } -} - -class SlimTest extends PHPUnit_Framework_TestCase -{ - public function setUp() - { - //Remove environment mode if set - unset($_ENV['SLIM_MODE']); - - //Reset session - $_SESSION = array(); - - //Prepare default environment variables - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - 'QUERY_STRING' => 'one=foo&two=bar', - 'SERVER_NAME' => 'slimframework.com', - )); - } - - /************************************************ - * INSTANTIATION - ************************************************/ - - /** - * Test version constant is string - */ - public function testHasVersionConstant() - { - $this->assertTrue(is_string(\Slim\Slim::VERSION)); - } - - /** - * Test default instance properties - */ - public function testDefaultInstanceProperties() - { - $s = new \Slim\Slim(); - $this->assertInstanceOf('\Slim\Http\Request', $s->request()); - $this->assertInstanceOf('\Slim\Http\Response', $s->response()); - $this->assertInstanceOf('\Slim\Router', $s->router()); - $this->assertInstanceOf('\Slim\View', $s->view()); - $this->assertInstanceOf('\Slim\Log', $s->getLog()); - $this->assertEquals(\Slim\Log::DEBUG, $s->getLog()->getLevel()); - $this->assertTrue($s->getLog()->getEnabled()); - $this->assertInstanceOf('\Slim\Environment', $s->environment()); - } - - /** - * Test get default instance - */ - public function testGetDefaultInstance() - { - $s = new \Slim\Slim(); - $s->setName('default'); //We must do this manually since a default app is already set in prev tests - $this->assertEquals('default', $s->getName()); - $this->assertInstanceOf('\Slim\Slim', \Slim\Slim::getInstance()); - $this->assertSame($s, \Slim\Slim::getInstance()); - } - - /** - * Test get named instance - */ - public function testGetNamedInstance() - { - $s = new \Slim\Slim(); - $s->setName('foo'); - $this->assertSame($s, \Slim\Slim::getInstance('foo')); - } - - /** - * Test Slim autoloader ignores non-Slim classes - * - * Pre-conditions: - * Instantiate a non-Slim class; - * - * Post-conditions: - * Slim autoloader returns without requiring a class file; - */ - public function testSlimAutoloaderIgnoresNonSlimClass() - { - $foo = new Foo(); - } - - /************************************************ - * SETTINGS - ************************************************/ - - /** - * Test get setting that exists - */ - public function testGetSettingThatExists() - { - $s = new \Slim\Slim(); - $this->assertEquals('./templates', $s->config('templates.path')); - } - - /** - * Test get setting that does not exist - */ - public function testGetSettingThatDoesNotExist() - { - $s = new \Slim\Slim(); - $this->assertNull($s->config('foo')); - } - - /** - * Test set setting - */ - public function testSetSetting() - { - $s = new \Slim\Slim(); - $this->assertEquals('./templates', $s->config('templates.path')); - $s->config('templates.path', './tmpl'); - $this->assertEquals('./tmpl', $s->config('templates.path')); - } - - /** - * Test batch set settings - */ - public function testBatchSetSettings() - { - $s = new \Slim\Slim(); - $this->assertEquals('./templates', $s->config('templates.path')); - $this->assertTrue($s->config('debug')); - $s->config(array( - 'templates.path' => './tmpl', - 'debug' => false - )); - $this->assertEquals('./tmpl', $s->config('templates.path')); - $this->assertFalse($s->config('debug')); - } - - /** - * Test set settings recursively - */ - public function testSetSettingsRecursively() - { - $config = array( - 'my_module' => array( - 'paths' => array( - './my_module/path/1', - ), - ) - ); - - $s = new \Slim\Slim($config); - - $override = array( - 'my_module' => array( - 'paths' => array( - './my_module/path/2', - './my_module/path/3', - ), - ) - ); - - // Test recursive batch behaviour - $s->config($override, true); - - $expected = array( - 'paths' => array( - './my_module/path/1', - './my_module/path/2', - './my_module/path/3', - ), - ); - - $this->assertEquals($expected, $s->config('my_module')); - - // Test default batch behaviour - $s = new \Slim\Slim($config); - $s->config($override); - - $this->assertNotEquals($expected, $s->config('my_module')); - } - - /************************************************ - * MODES - ************************************************/ - - /** - * Test default mode - */ - public function testGetDefaultMode() - { - $s = new \Slim\Slim(); - $this->assertEquals('development', $s->getMode()); - } - - /** - * Test custom mode from environment - */ - public function testGetModeFromEnvironment() - { - $_ENV['SLIM_MODE'] = 'production'; - $s = new \Slim\Slim(); - $this->assertEquals('production', $s->getMode()); - } - - /** - * Test custom mode from app settings - */ - public function testGetModeFromSettings() - { - $s = new \Slim\Slim(array( - 'mode' => 'test' - )); - $this->assertEquals('test', $s->getMode()); - } - - /** - * Test mode configuration - */ - public function testModeConfiguration() - { - $flag = 0; - $configureTest = function () use (&$flag) { - $flag = 'test'; - }; - $configureProduction = function () use (&$flag) { - $flag = 'production'; - }; - $s = new \Slim\Slim(array('mode' => 'test')); - $s->configureMode('test', $configureTest); - $s->configureMode('production', $configureProduction); - $this->assertEquals('test', $flag); - } - - /** - * Test mode configuration when mode does not match - */ - public function testModeConfigurationWhenModeDoesNotMatch() - { - $flag = 0; - $configureTest = function () use (&$flag) { - $flag = 'test'; - }; - $s = new \Slim\Slim(array('mode' => 'production')); - $s->configureMode('test', $configureTest); - $this->assertEquals(0, $flag); - } - - /** - * Test mode configuration when not callable - */ - public function testModeConfigurationWhenNotCallable() - { - $flag = 0; - $s = new \Slim\Slim(array('mode' => 'production')); - $s->configureMode('production', 'foo'); - $this->assertEquals(0, $flag); - } - - /** - * Test custom mode from getenv() - */ - public function testGetModeFromGetEnv() - { - putenv('SLIM_MODE=production'); - $s = new \Slim\Slim(); - $this->assertEquals('production', $s->getMode()); - } - - /************************************************ - * ROUTING - ************************************************/ - - /** - * Test GENERIC route - */ - public function testGenericRoute() - { - $s = new \Slim\Slim(); - $callable = function () { echo "foo"; }; - $route = $s->map('/bar', $callable); - $this->assertInstanceOf('\Slim\Route', $route); - $this->assertEmpty($route->getHttpMethods()); - } - - /** - * Test GET routes also get mapped as a HEAD route - */ - public function testGetRouteIsAlsoMappedAsHead() - { - $s = new \Slim\Slim(); - $route = $s->get('/foo', function () {}); - $this->assertTrue($route->supportsHttpMethod(\Slim\Http\Request::METHOD_GET)); - $this->assertTrue($route->supportsHttpMethod(\Slim\Http\Request::METHOD_HEAD)); - } - - /** - * Test GET route - */ - public function testGetRoute() - { - $s = new \Slim\Slim(); - $mw1 = function () { echo "foo"; }; - $mw2 = function () { echo "bar"; }; - $callable = function () { echo "xyz"; }; - $route = $s->get('/bar', $mw1, $mw2, $callable); - $s->call(); - $this->assertEquals('foobarxyz', $s->response()->body()); - $this->assertEquals('/bar', $route->getPattern()); - $this->assertSame($callable, $route->getCallable()); - } - - /** - * Test POST route - */ - public function testPostRoute() - { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'POST', - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - )); - $s = new \Slim\Slim(); - $mw1 = function () { echo "foo"; }; - $mw2 = function () { echo "bar"; }; - $callable = function () { echo "xyz"; }; - $route = $s->post('/bar', $mw1, $mw2, $callable); - $s->call(); - $this->assertEquals('foobarxyz', $s->response()->body()); - $this->assertEquals('/bar', $route->getPattern()); - $this->assertSame($callable, $route->getCallable()); - } - - /** - * Test PUT route - */ - public function testPutRoute() - { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'PUT', - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - )); - $s = new \Slim\Slim(); - $mw1 = function () { echo "foo"; }; - $mw2 = function () { echo "bar"; }; - $callable = function () { echo "xyz"; }; - $route = $s->put('/bar', $mw1, $mw2, $callable); - $s->call(); - $this->assertEquals('foobarxyz', $s->response()->body()); - $this->assertEquals('/bar', $route->getPattern()); - $this->assertSame($callable, $route->getCallable()); - } - - /** - * Test PATCH route - */ - public function testPatchRoute() - { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'PATCH', - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - )); - $s = new \Slim\Slim(); - $mw1 = function () { echo "foo"; }; - $mw2 = function () { echo "bar"; }; - $callable = function () { echo "xyz"; }; - $route = $s->patch('/bar', $mw1, $mw2, $callable); - $s->call(); - $this->assertEquals('foobarxyz', $s->response()->body()); - $this->assertEquals('/bar', $route->getPattern()); - $this->assertSame($callable, $route->getCallable()); - } - - /** - * Test DELETE route - */ - public function testDeleteRoute() - { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'DELETE', - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - )); - $s = new \Slim\Slim(); - $mw1 = function () { echo "foo"; }; - $mw2 = function () { echo "bar"; }; - $callable = function () { echo "xyz"; }; - $route = $s->delete('/bar', $mw1, $mw2, $callable); - $s->call(); - $this->assertEquals('foobarxyz', $s->response()->body()); - $this->assertEquals('/bar', $route->getPattern()); - $this->assertSame($callable, $route->getCallable()); - } - - /** - * Test OPTIONS route - */ - public function testOptionsRoute() - { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'OPTIONS', - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - )); - $s = new \Slim\Slim(); - $mw1 = function () { echo "foo"; }; - $mw2 = function () { echo "bar"; }; - $callable = function () { echo "xyz"; }; - $route = $s->options('/bar', $mw1, $mw2, $callable); - $s->call(); - $this->assertEquals('foobarxyz', $s->response()->body()); - $this->assertEquals('/bar', $route->getPattern()); - $this->assertSame($callable, $route->getCallable()); - } - - /** - * Test route groups - */ - public function testRouteGroups() - { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'GET', - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar/baz', //<-- Virtual' - )); - $s = new \Slim\Slim(); - $mw1 = function () { echo "foo"; }; - $mw2 = function () { echo "bar"; }; - $callable = function () { echo "xyz"; }; - $s->group('/bar', $mw1, function () use ($s, $mw2, $callable) { - $s->get('/baz', $mw2, $callable); - }); - $s->call(); - $this->assertEquals('foobarxyz', $s->response()->body()); - } - - /* - * Test ANY route - */ - public function testAnyRoute() - { - $mw1 = function () { echo "foo"; }; - $mw2 = function () { echo "bar"; }; - $callable = function () { echo "xyz"; }; - $methods = array('GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'); - foreach ($methods as $i => $method) { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => $method, - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - )); - $s = new \Slim\Slim(); - $route = $s->any('/bar', $mw1, $mw2, $callable); - $s->call(); - $this->assertEquals('foobarxyz', $s->response()->body()); - $this->assertEquals('/bar', $route->getPattern()); - $this->assertSame($callable, $route->getCallable()); - } - } - - /** - * Test if route does NOT expect trailing slash and URL has one - */ - public function testRouteWithoutSlashAndUrlWithOne() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar/', //<-- Virtual - )); - $s = new \Slim\Slim(); - $s->get('/bar', function () { echo "xyz"; }); - $s->call(); - $this->assertEquals(404, $s->response()->status()); - } - - /** - * Tests if route will match in case-insensitive manner if configured to do so - */ - public function testRouteMatchesInCaseInsensitiveMannerIfConfigured() - { - \Slim\Environment::mock(array( - 'PATH_INFO' => '/BaR', // Does not match route case - )); - $s = new \Slim\Slim(array('routes.case_sensitive' => false)); - $route = $s->get('/bar', function () { echo "xyz"; }); - $s->call(); - $this->assertEquals(200, $s->response()->status()); - $this->assertEquals('xyz', $s->response()->body()); - $this->assertEquals('/bar', $route->getPattern()); - } - - /** - * Test if route contains URL encoded characters - */ - public function testRouteWithUrlEncodedCharacters() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar/jo%20hn/smi%20th', //<-- Virtual - )); - $s = new \Slim\Slim(); - $s->get('/bar/:one/:two', function ($one, $two) { echo $one . $two; }); - $s->call(); - $this->assertEquals('jo hnsmi th', $s->response()->body()); - } - - /************************************************ - * VIEW - ************************************************/ - - /** - * Test set view with string class name - */ - public function testSetSlimViewFromString() - { - $s = new \Slim\Slim(); - $this->assertInstanceOf('\Slim\View', $s->view()); - $s->view('CustomView'); - $this->assertInstanceOf('CustomView', $s->view()); - } - - /** - * Test set view with object instance - */ - public function testSetSlimViewFromInstance() - { - $s = new \Slim\Slim(); - $this->assertInstanceOf('\Slim\View', $s->view()); - $s->view(new CustomView()); - $this->assertInstanceOf('CustomView', $s->view()); - } - - /** - * Test view data is transferred to newer view - */ - public function testViewDataTransfer() - { - $data = array('foo' => 'bar'); - $s = new \Slim\Slim(); - $s->view()->setData($data); - $s->view('CustomView'); - $this->assertSame($data, $s->view()->getData()); - } - - /************************************************ - * RENDERING - ************************************************/ - - /** - * Test template path is passed to view - */ - public function testViewGetsTemplatesPath() - { - $path = dirname(__FILE__) . '/templates'; - $s = new \Slim\Slim(array('templates.path' => $path)); - $this->assertEquals($s->view->getTemplatesDirectory(), $path); - } - - /** - * Test render with template and data - */ - public function testRenderTemplateWithData() - { - $s = new \Slim\Slim(array('templates.path' => dirname(__FILE__) . '/templates')); - $s->get('/bar', function () use ($s) { - $s->render('test.php', array('foo' => 'bar')); - }); - $s->call(); - list($status, $header, $body) = $s->response()->finalize(); - $this->assertEquals(200, $status); - $this->assertEquals('test output bar', $body); - } - - /** - * Test render with template and data and status - */ - public function testRenderTemplateWithDataAndStatus() - { - $s = new \Slim\Slim(array('templates.path' => dirname(__FILE__) . '/templates')); - $s->get('/bar', function () use ($s) { - $s->render('test.php', array('foo' => 'bar'), 500); - }); - $s->call(); - list($status, $header, $body) = $s->response()->finalize(); - $this->assertEquals(500, $status); - $this->assertEquals('test output bar', $body); - } - - /************************************************ - * LOG - ************************************************/ - - /** - * Test get log - * - * This asserts that a Slim app has a default Log - * upon instantiation. The Log itself is tested - * separately in another file. - */ - public function testGetLog() - { - $s = new \Slim\Slim(); - $this->assertInstanceOf('\Slim\Log', $s->getLog()); - } - - /************************************************ - * HTTP CACHING - ************************************************/ - - /** - * Test Last-Modified match - */ - public function testLastModifiedMatch() - { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'GET', - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - 'HTTP_IF_MODIFIED_SINCE' => 'Sun, 03 Oct 2010 21:00:52 GMT', - )); - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->lastModified(1286139652); - }); - $s->call(); - $this->assertEquals(304, $s->response()->status()); - } - - /** - * Test Last-Modified match - */ - public function testLastModifiedDoesNotMatch() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - 'IF_MODIFIED_SINCE' => 'Sun, 03 Oct 2010 21:00:52 GMT', - )); - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->lastModified(1286139250); - }); - $s->call(); - $this->assertEquals(200, $s->response()->status()); - } - - public function testLastModifiedOnlyAcceptsIntegers() - { - $this->setExpectedException('\InvalidArgumentException'); - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - )); - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->lastModified('Test'); - }); - $s->call(); - } - - /** - * Test Last Modified header format - */ - public function testLastModifiedHeaderFormat() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - )); - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->lastModified(1286139652); - }); - $s->call(); - list($status, $header, $body) = $s->response()->finalize(); - $this->assertTrue(isset($header['Last-Modified'])); - $this->assertEquals('Sun, 03 Oct 2010 21:00:52 GMT', $header['Last-Modified']); - } - - /** - * Test ETag matches - */ - public function testEtagMatches() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - 'HTTP_IF_NONE_MATCH' => '"abc123"', - )); - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->etag('abc123'); - }); - $s->call(); - $this->assertEquals(304, $s->response()->status()); - } - - /** - * Test ETag does not match - */ - public function testEtagDoesNotMatch() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - 'IF_NONE_MATCH' => '"abc1234"', - )); - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->etag('abc123'); - }); - $s->call(); - $this->assertEquals(200, $s->response()->status()); - } - - /** - * Test ETag with invalid type - */ - public function testETagWithInvalidType() - { - $this->setExpectedException('\InvalidArgumentException'); - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - 'IF_NONE_MATCH' => '"abc1234"', - )); - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->etag('123','foo'); - }); - $s->call(); - } - - /** - * Test Expires - */ - public function testExpiresAsString() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - )); - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->expires('5 days'); - }); - $s->call(); - list($status, $header, $body) = $s->response()->finalize(); - $this->assertTrue(isset($header['Expires'])); - - $this->assertEquals( - strtotime('5 days'), - strtotime($header['Expires']), - 1 // delta - ); - } - - /** - * Test Expires - */ - public function testExpiresAsInteger() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - )); - $fiveDaysFromNow = time() + (60 * 60 * 24 * 5); - $expectedDate = gmdate('D, d M Y H:i:s T', $fiveDaysFromNow); - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s, $fiveDaysFromNow) { - $s->expires($fiveDaysFromNow); - }); - $s->call(); - list($status, $header, $body) = $s->response()->finalize(); - $this->assertTrue(isset($header['Expires'])); - $this->assertEquals($header['Expires'], $expectedDate); - } - - /************************************************ - * COOKIES - ************************************************/ - - /** - * Set cookie - * - * This tests that the Slim application instance sets - * a cookie in the HTTP response header. This does NOT - * test the implementation of setting the cookie; that is - * tested in a separate file. - */ - public function testSetCookie() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - )); - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->setCookie('foo', 'bar', '2 days'); - $s->setCookie('foo1', 'bar1', '2 days'); - }); - $s->call(); - $cookie1 = $s->response->cookies->get('foo'); - $cookie2 = $s->response->cookies->get('foo1'); - $this->assertEquals(2, count($s->response->cookies)); - $this->assertEquals('bar', $cookie1['value']); - $this->assertEquals('bar1', $cookie2['value']); - } - - /** - * Test get cookie - * - * This method ensures that the `Cookie:` HTTP request - * header is parsed if present, and made accessible via the - * Request object. - */ - public function testGetCookie() - { - \Slim\Environment::mock(array( - 'REQUEST_METHOD' => 'GET', - 'REMOTE_ADDR' => '127.0.0.1', - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - 'QUERY_STRING' => 'one=foo&two=bar', - 'SERVER_NAME' => 'slimframework.com', - 'SERVER_PORT' => 80, - 'HTTP_COOKIE' => 'foo=bar; foo2=bar2', - 'slim.url_scheme' => 'http', - 'slim.input' => '', - 'slim.errors' => @fopen('php://stderr', 'w') - )); - $s = new \Slim\Slim(); - $this->assertEquals('bar', $s->getCookie('foo')); - $this->assertEquals('bar2', $s->getCookie('foo2')); - } - - /** - * Test get cookie when cookie does not exist - */ - public function testGetCookieThatDoesNotExist() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - )); - $s = new \Slim\Slim(); - $this->assertNull($s->getCookie('foo')); - } - - /** - * Test delete cookie - * - * This method ensures that the `Set-Cookie:` HTTP response - * header is set. The implementation of setting the response - * cookie is tested separately in another file. - */ - public function testDeleteCookie() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/bar', //<-- Virtual - 'COOKIE' => 'foo=bar; foo2=bar2', - )); - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->setCookie('foo', 'bar'); - $s->deleteCookie('foo'); - }); - $s->call(); - $cookie = $s->response->cookies->get('foo'); - $this->assertEquals(1, count($s->response->cookies)); - $this->assertEquals('', $cookie['value']); - $this->assertLessThan(time(), $cookie['expires']); - } - - /************************************************ - * HELPERS - ************************************************/ - - /** - * Test get filesystem path to Slim app root directory - */ - public function testGetRoot() - { - $_SERVER['DOCUMENT_ROOT'] = dirname(__FILE__); //<-- No trailing slash - $s = new \Slim\Slim(); - $this->assertEquals($_SERVER['DOCUMENT_ROOT'] . '/foo/', $s->root()); //<-- Appends physical app path with trailing slash - } - - /** - * Test stop - */ - public function testStop() - { - $this->setExpectedException('\Slim\Exception\Stop'); - $s = new \Slim\Slim(); - $s->stop(); - } - - /** - * Test stop with subsequent output - */ - public function testStopWithSubsequentOutput() - { - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - echo "Foo"; //<-- Should be in response body! - $s->stop(); - echo "Bar"; //<-- Should not be in response body! - }); - $s->call(); - $this->assertEquals('Foo', $s->response()->body()); - } - - /** - * Test stop with output buffer on and pre content - */ - public function testStopOutputWithOutputBufferingOnAndPreContent() - { - $this->expectOutputString('1.2.Foo.3'); //<-- PHP unit uses OB here - echo "1."; - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - echo "Foo"; - $s->stop(); - }); - echo "2."; - $s->run(); //<-- Needs to be run to actually echo body - echo ".3"; - } - - /** - * Test stop does not leave output buffers open - */ - public function testStopDoesNotLeaveOutputBuffersOpen() - { - $level_start = ob_get_level(); - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->stop(); - }); - $s->run(); - $this->assertEquals($level_start, ob_get_level()); - } - - /** - * Test halt - */ - public function testHalt() - { - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - echo "Foo!"; //<-- Should not be in response body! - $s->halt(500, 'Something broke'); - }); - $s->call(); - list($status, $header, $body) = $s->response()->finalize(); - $this->assertEquals(500, $status); - $this->assertEquals('Something broke', $body); - } - - /** - * Test halt with output buffering and pre content - */ - public function testHaltOutputWithOutputBufferingOnAndPreContent() - { - $this->expectOutputString('1.2.Something broke.3'); //<-- PHP unit uses OB here - echo "1."; - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - echo "Foo!"; //<-- Should not be in response body! - $s->halt(500, 'Something broke'); - }); - echo "2."; - $s->run(); - echo ".3"; - } - - /** - * Test halt does not leave output buffers open - */ - public function testHaltDoesNotLeaveOutputBuffersOpen() - { - $level_start = ob_get_level(); - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->halt(500, ''); - }); - $s->run(); - $this->assertEquals($level_start, ob_get_level()); - } - - /** - * Test pass cleans buffer and throws exception - */ - public function testPass() - { - ob_start(); - $s = new \Slim\Slim(); - echo "Foo"; - try { - $s->pass(); - $this->fail('Did not catch Slim_Exception_Pass'); - } catch ( \Slim\Exception\Pass $e ) {} - $output = ob_get_clean(); - $this->assertEquals('', $output); - } - - /** - * Test pass when there is a subsequent fallback route - */ - public function testPassWithSubsequentRoute() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/name/Frank', //<-- Virtual - )); - $s = new \Slim\Slim(); - $s->get('/name/Frank', function () use ($s) { - echo "Fail"; //<-- Should not be in response body! - $s->pass(); - }); - $s->get('/name/:name', function ($name) { - echo $name; //<-- Should be in response body! - }); - $s->call(); - $this->assertEquals('Frank', $s->response()->body()); - } - - /** - * Test pass when there is not a subsequent fallback route - */ - public function testPassWithoutSubsequentRoute() - { - \Slim\Environment::mock(array( - 'SCRIPT_NAME' => '/foo', //<-- Physical - 'PATH_INFO' => '/name/Frank', //<-- Virtual - )); - $s = new \Slim\Slim(); - $s->get('/name/Frank', function () use ($s) { - echo "Fail"; //<-- Should not be in response body! - $s->pass(); - }); - $s->call(); - $this->assertEquals(404, $s->response()->status()); - } - - /** - * Test content type - */ - public function testContentType() - { - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->contentType('application/json'); - }); - $s->call(); - list($status, $header, $body) = $s->response()->finalize(); - $this->assertEquals('application/json', $header['Content-Type']); - } - - /** - * Test status - */ - public function testStatus() - { - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->status(403); - }); - $s->call(); - $this->assertEquals(403, $s->response()->status()); - } - - /** - * Test URL for - */ - public function testSlimUrlFor() - { - $s = new \Slim\Slim(); - $s->get('/hello/:name', function () {})->name('hello'); - $this->assertEquals('/foo/hello/Josh', $s->urlFor('hello', array('name' => 'Josh'))); //<-- Prepends physical path! - } - - /** - * Test redirect sets status and header - */ - public function testRedirect() - { - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - echo "Foo"; //<-- Should not be in response body! - $s->redirect('/somewhere/else', 303); - }); - $s->call(); - list($status, $header, $body) = $s->response()->finalize(); - $this->assertEquals(303, $status); - $this->assertEquals('/somewhere/else', $header['Location']); - $this->assertEquals('', $body); - } - - /************************************************ - * RUNNER - ************************************************/ - - /** - * Test that runner sends headers and body - */ - public function testRun() - { - $this->expectOutputString('Foo'); - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - echo "Foo"; - }); - $s->run(); - } - - /** - * Test runner output with output buffering on and pre content - */ - public function testRunOutputWithOutputBufferingOnAndPreContent() - { - $this->expectOutputString('1.2.Foo.3'); //<-- PHP unit uses OB here - $s = new \Slim\Slim(); - echo "1."; - $s->get('/bar', function () use ($s) { - echo "Foo"; - }); - echo "2."; - $s->run(); - echo ".3"; - } - - /** - * Test that runner does not leave output buffers open - */ - public function testRunDoesNotLeaveAnyOutputBuffersOpen() - { - $level_start = ob_get_level(); - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) {}); - $s->run(); - $this->assertEquals($level_start, ob_get_level()); - } - - /************************************************ - * MIDDLEWARE - ************************************************/ - - /** - * Test add middleware - * - * This asserts that middleware are queued and called - * in sequence. This also asserts that the environment - * variables are passed by reference. - */ - public function testAddMiddleware() - { - $this->expectOutputString('FooHello'); - $s = new \Slim\Slim(); - $s->add(new CustomMiddleware()); //<-- See top of this file for class definition - $s->get('/bar', function () { - echo 'Foo'; - }); - $s->run(); - $this->assertEquals('Hello', $s->response()->header('X-Slim-Test')); - } - - /** - * Test exception when adding circular middleware queues - * - * This asserts that the same middleware can NOT be queued twice (usually by accident). - * Circular middleware stack causes a troublesome to debug PHP Fatal error: - * - * > Fatal error: Maximum function nesting level of '100' reached. aborting! - */ - public function testFailureWhenAddingCircularMiddleware() - { - $this->setExpectedException('\RuntimeException'); - $middleware = new CustomMiddleware; - $s = new \Slim\Slim; - $s->add($middleware); - $s->add(new CustomMiddleware); - $s->add($middleware); - $s->run(); - } - - /************************************************ - * FLASH MESSAGING - ************************************************/ - - public function testSetFlashForNextRequest() - { - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->flash('info', 'bar'); - }); - $this->assertFalse(isset($_SESSION['slim.flash'])); - $s->run(); - $this->assertEquals('bar', $_SESSION['slim.flash']['info']); - } - - public function testSetFlashForCurrentRequest() - { - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->flashNow('info', 'bar'); - }); - $s->run(); - $env = $s->environment(); - $this->assertEquals('bar', $env['slim.flash']['info']); - } - - public function testKeepFlashForNextRequest() - { - $_SESSION['slim.flash'] = array('info' => 'Foo'); - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->flashKeep(); - }); - $s->run(); - $this->assertEquals('Foo', $_SESSION['slim.flash']['info']); - } - - public function testFlashData() - { - $s = new \Slim\Slim(); - $s->get('/bar', function () use ($s) { - $s->flashNow('info', 'bar'); - }); - $s->run(); - $this->assertEquals(array('info' => 'bar'), $s->flashData()); - } - - /************************************************ - * NOT FOUND HANDLING - ************************************************/ - - /** - * Test custom Not Found handler - */ - public function testNotFound() - { - $s = new \Slim\Slim(); - $s->notFound(function () { - echo "Not Found"; - }); - $s->get('/foo', function () {}); - $s->call(); - list($status, $header, $body) = $s->response()->finalize(); - $this->assertEquals(404, $status); - $this->assertEquals('Not Found', $body); - } - - /************************************************ - * ERROR HANDLING - ************************************************/ - - /** - * Test default and custom error handlers - * - * Pre-conditions: - * Invoked app route calls default error handler; - * - * Post-conditions: - * Response status code is 500; - */ - public function testSlimError() - { - $s = new \Slim\Slim(array( - "log.enabled" => false - )); - $s->get('/bar', function () use ($s) { - $s->error(); - }); - $s->call(); - $this->assertEquals(500, $s->response()->status()); - } - - /** - * Test default error handler logs the error when debug is false. - * - * Pre-conditions: - * Invoked app route calls default error handler; - * - * Post-conditions: - * Error log is called - */ - public function testDefaultHandlerLogsTheErrorWhenDebugIsFalse() - { - $s = new \Slim\Slim(array('debug' => false)); - $s->container->singleton('log', function ($c) { - return new EchoErrorLogger(); - }); - $s->get('/bar', function () use ($s) { - throw new \InvalidArgumentException('my specific error message'); - }); - - ob_start(); - $s->run(); - $output = ob_get_clean(); - $this->assertTrue(strpos($output, 'InvalidArgumentException:my specific error message') !== false); - } - - /** - * Test triggered errors are converted to ErrorExceptions - * - * Pre-conditions: - * Custom error handler defined; - * Invoked app route triggers error; - * - * Post-conditions: - * Response status is 500; - * Response body is equal to triggered error message; - * Error handler's argument is ErrorException instance; - */ - public function DISABLEDtestTriggeredErrorsAreConvertedToErrorExceptions() - { - $s = new \Slim\Slim(array( - 'debug' => false - )); - $s->error(function ( $e ) { - if ($e instanceof \ErrorException) { - echo $e->getMessage(); - } - }); - $s->get('/bar', function () { - trigger_error('Foo I say!'); - }); - $s->call(); - list($status, $header, $body) = $s->response()->finalize(); - $this->assertEquals(500, $status); - $this->assertEquals('Foo I say!', $body); - } - - /** - * Test error triggered with multiple applications - * - * Pre-conditions: - * Multiple Slim apps are instantiated; - * Both apps are run; - * One app returns 200 OK; - * One app triggers an error; - * - * Post-conditions: - * One app returns 200 OK with no Exceptions; - * One app returns 500 Error; - * Error triggered does not affect other app; - */ - public function testErrorWithMultipleApps() - { - $s1 = new \Slim\Slim(array( - 'debug' => false, - 'log.enabled' => false - )); - $s2 = new \Slim\Slim(); - $s1->get('/bar', function () use ($s1) { - $s1->error(); - }); - $s2->get('/bar', function () { - echo 'success'; - }); - $s1->call(); - $s2->call(); - $this->assertEquals(500, $s1->response()->status()); - $this->assertEquals(200, $s2->response()->status()); - } - - /** - * Test custom error handler uses existing Response object - */ - public function testErrorHandlerUsesCurrentResponseObject() - { - $s = new \Slim\Slim(array( - 'debug' => false - )); - $s->error(function ( \Exception $e ) use ($s) { - $r = $s->response(); - $r->status(503); - $r->write('Foo'); - $r['X-Powered-By'] = 'Slim'; - echo 'Bar'; - }); - $s->get('/bar', function () { - throw new \Exception('Foo'); - }); - $s->call(); - list($status, $header, $body) = $s->response()->finalize(); - $this->assertEquals(503, $status); - $this->assertEquals('FooBar', $body); - $this->assertEquals('Slim', $header['X-Powered-By']); - } - - /** - * Test custom global error handler - */ - public function testHandleErrors() - { - $defaultErrorReporting = error_reporting(); - - // Test 1 - error_reporting(E_ALL ^ E_NOTICE); // <-- Report all errors EXCEPT notices - try { - \Slim\Slim::handleErrors(E_NOTICE, 'test error', 'Slim.php', 119); - } catch (\ErrorException $e) { - $this->fail('Slim::handleErrors reported a disabled error level.'); - } - - // Test 2 - error_reporting(E_ALL | E_STRICT); // <-- Report all errors, including E_STRICT - try { - \Slim\Slim::handleErrors(E_STRICT, 'test error', 'Slim.php', 119); - $this->fail('Slim::handleErrors didn\'t report a enabled error level'); - } catch (\ErrorException $e) {} - - error_reporting($defaultErrorReporting); - } - - /** - * Slim should keep reference to a callable error callback - */ - public function testErrorHandler() { - $s = new \Slim\Slim(); - $errCallback = function () { echo "404"; }; - $s->error($errCallback); - $this->assertSame($errCallback, PHPUnit_Framework_Assert::readAttribute($s, 'error')); - } - - /** - * Slim should throw a Slim_Exception_Stop if error callback is not callable - */ - public function testErrorHandlerIfNotCallable() { - $this->setExpectedException('\Slim\Exception\Stop'); - $s = new \Slim\Slim(array("log.enabled" => false)); - $errCallback = 'foo'; - $s->error($errCallback); - } - - /** - * Slim should keep reference to a callable NotFound callback - */ - public function testNotFoundHandler() { - $s = new \Slim\Slim(); - $notFoundCallback = function () { echo "404"; }; - $s->notFound($notFoundCallback); - $this->assertSame($notFoundCallback, PHPUnit_Framework_Assert::readAttribute($s, 'notFound')); - } - - /** - * Slim should throw a Slim_Exception_Stop if NotFound callback is not callable - */ - public function testNotFoundHandlerIfNotCallable() { - $this->setExpectedException('\Slim\Exception\Stop'); - $s = new \Slim\Slim(); - $notFoundCallback = 'foo'; - $s->notFound($notFoundCallback); - } - - /************************************************ - * HOOKS - ************************************************/ - - /** - * Test hook listener - * - * Pre-conditions: - * Slim app instantiated; - * Hook name does not exist; - * Listeners are callable objects; - * - * Post-conditions: - * Callables are invoked in expected order; - */ - public function testRegistersAndCallsHooksByPriority() - { - $this->expectOutputString('barfoo'); - $app = new \Slim\Slim(); - $callable1 = function () { echo "foo"; }; - $callable2 = function () { echo "bar"; }; - $app->hook('test.hook.one', $callable1); //default is 10 - $app->hook('test.hook.one', $callable2, 8); - $hooks = $app->getHooks(); - $this->assertEquals(7, count($hooks)); //6 default, 1 custom - $app->applyHook('test.hook.one'); - } - - /** - * Test hook listener if listener is not callable - * - * Pre-conditions: - * Slim app instantiated; - * Hook name does not exist; - * Listener is NOT a callable object; - * - * Post-conditions: - * Hook is created; - * Callable is NOT assigned to hook; - */ - public function testHookInvalidCallable() - { - $app = new \Slim\Slim(); - $callable = 'test'; //NOT callable - $app->hook('test.hook.one', $callable); - $this->assertEquals(array(array()), $app->getHooks('test.hook.one')); - } - - /** - * Test hook invocation if hook does not exist - * - * Pre-conditions: - * Slim app instantiated; - * Hook name does not exist; - * - * Post-conditions: - * Hook is created; - * Hook initialized with empty array; - */ - public function testHookInvocationIfNotExists() - { - $app = new \Slim\Slim(); - $app->applyHook('test.hook.one'); - $this->assertEquals(array(array()), $app->getHooks('test.hook.one')); - } - - /** - * Test clear hooks - * - * Pre-conditions: - * Slim app instantiated; - * Two hooks exist, each with one listener; - * - * Post-conditions: - * Case A: Listeners for 'test.hook.one' are cleared; - * Case B: Listeners for all hooks are cleared; - */ - public function testHookClear() - { - $app = new \Slim\Slim(); - $app->hook('test.hook.one', function () {}); - $app->hook('test.hook.two', function () {}); - $app->clearHooks('test.hook.two'); - $this->assertEquals(array(array()), $app->getHooks('test.hook.two')); - $hookOne = $app->getHooks('test.hook.one'); - $this->assertTrue(count($hookOne[10]) === 1); - $app->clearHooks(); - $this->assertEquals(array(array()), $app->getHooks('test.hook.one')); - } - - /** - * Test hooks accept multiple arguments - * - * Pre-conditions: - * Slim app instantiated; - * Hook name does not exist; - * Listener is a callable object; - * - * Post-conditions: - * Callable invoked with 2 arguments - */ - public function testHooksMultipleArguments() - { - $testArgA = 'argumentA'; - $testArgB = 'argumentB'; - - $this->expectOutputString($testArgA . $testArgB); - - $app = new \Slim\Slim(); - - $app->hook('test.hook.one', function ($argA, $argB) { - echo $argA . $argB; - }); - $app->applyHook('test.hook.one', $testArgA, $testArgB); - } - - /** - * Test late static binding - * - * Pre-conditions: - * Slim app is extended by Derived class and instantiated; - * Derived class overrides the 'getDefaultSettings' function and adds an extra default config value - * Test that the new config value exists - * - * Post-conditions: - * Config value exists and is equal to expected value - */ - public function testDerivedClassCanOverrideStaticFunction() - { - $app = new Derived(); - $this->assertEquals($app->config("late-static-binding"), true); - } -} diff --git a/vendor/slim/slim/tests/ViewTest.php b/vendor/slim/slim/tests/ViewTest.php deleted file mode 100644 index 456ebf7..0000000 --- a/vendor/slim/slim/tests/ViewTest.php +++ /dev/null @@ -1,199 +0,0 @@ -<?php -/** - * Slim - a micro PHP 5 framework - * - * @author Josh Lockhart <info@slimframework.com> - * @copyright 2011-2017 Josh Lockhart - * @link http://www.slimframework.com - * @license http://www.slimframework.com/license - * @version 2.6.3 - * - * MIT LICENSE - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -class ViewTest extends PHPUnit_Framework_TestCase -{ - public function testGetDataAll() - { - $view = new \Slim\View(); - $prop = new \ReflectionProperty($view, 'data'); - $prop->setAccessible(true); - $prop->setValue($view, new \Slim\Helper\Set(array('foo' => 'bar'))); - - $this->assertSame(array('foo' => 'bar'), $view->getData()); - } - - public function testGetDataKeyExists() - { - $view = new \Slim\View(); - $prop = new \ReflectionProperty($view, 'data'); - $prop->setAccessible(true); - $prop->setValue($view, new \Slim\Helper\Set(array('foo' => 'bar'))); - - $this->assertEquals('bar', $view->getData('foo')); - } - - public function testGetDataKeyNotExists() - { - $view = new \Slim\View(); - $prop = new \ReflectionProperty($view, 'data'); - $prop->setAccessible(true); - $prop->setValue($view, new \Slim\Helper\Set(array('foo' => 'bar'))); - - $this->assertNull($view->getData('abc')); - } - - public function testSetDataKeyValue() - { - $view = new \Slim\View(); - $prop = new \ReflectionProperty($view, 'data'); - $prop->setAccessible(true); - $view->setData('foo', 'bar'); - - $this->assertEquals(array('foo' => 'bar'), $prop->getValue($view)->all()); - } - - public function testSetDataKeyValueAsClosure() - { - $view = new \Slim\View(); - $prop = new \ReflectionProperty($view, 'data'); - $prop->setAccessible(true); - - $view->setData('fooClosure', function () { - return 'foo'; - }); - - $value = $prop->getValue($view)->get('fooClosure'); - $this->assertInstanceOf('Closure', $value); - $this->assertEquals('foo', $value()); - } - - public function testSetDataArray() - { - $view = new \Slim\View(); - $prop = new \ReflectionProperty($view, 'data'); - $prop->setAccessible(true); - $view->setData(array('foo' => 'bar')); - - $this->assertEquals(array('foo' => 'bar'), $prop->getValue($view)->all()); - } - - public function testSetDataInvalidArgument() - { - $this->setExpectedException('InvalidArgumentException'); - - $view = new \Slim\View(); - $view->setData('foo'); - } - - public function testAppendData() - { - $view = new \Slim\View(); - $prop = new \ReflectionProperty($view, 'data'); - $prop->setAccessible(true); - $view->appendData(array('foo' => 'bar')); - - $this->assertEquals(array('foo' => 'bar'), $prop->getValue($view)->all()); - } - - public function testLocalData() - { - $view = new \Slim\View(); - $prop1 = new \ReflectionProperty($view, 'data'); - $prop1->setAccessible(true); - $prop1->setValue($view, new \Slim\Helper\Set(array('foo' => 'bar'))); - - $prop2 = new \ReflectionProperty($view, 'templatesDirectory'); - $prop2->setAccessible(true); - $prop2->setValue($view, dirname(__FILE__) . '/templates'); - - $output = $view->fetch('test.php', array('foo' => 'baz')); - $this->assertEquals('test output baz', $output); - } - - public function testAppendDataOverwrite() - { - $view = new \Slim\View(); - $prop = new \ReflectionProperty($view, 'data'); - $prop->setAccessible(true); - $prop->setValue($view, new \Slim\Helper\Set(array('foo' => 'bar'))); - $view->appendData(array('foo' => '123')); - - $this->assertEquals(array('foo' => '123'), $prop->getValue($view)->all()); - } - - public function testAppendDataInvalidArgument() - { - $this->setExpectedException('InvalidArgumentException'); - - $view = new \Slim\View(); - $view->appendData('foo'); - } - - public function testGetTemplatesDirectory() - { - $view = new \Slim\View(); - $property = new \ReflectionProperty($view, 'templatesDirectory'); - $property->setAccessible(true); - $property->setValue($view, 'templates'); - - $this->assertEquals('templates', $view->getTemplatesDirectory()); - } - - public function testSetTemplatesDirectory() - { - $view = new \Slim\View(); - $directory = 'templates' . DIRECTORY_SEPARATOR; - $view->setTemplatesDirectory($directory); // <-- Should strip trailing slash - - $this->assertAttributeEquals('templates', 'templatesDirectory', $view); - } - - public function testDisplay() - { - $this->expectOutputString('test output bar'); - - $view = new \Slim\View(); - $prop1 = new \ReflectionProperty($view, 'data'); - $prop1->setAccessible(true); - $prop1->setValue($view, new \Slim\Helper\Set(array('foo' => 'bar'))); - - $prop2 = new \ReflectionProperty($view, 'templatesDirectory'); - $prop2->setAccessible(true); - $prop2->setValue($view, dirname(__FILE__) . '/templates'); - - $view->display('test.php'); - } - - public function testDisplayTemplateThatDoesNotExist() - { - $this->setExpectedException('\RuntimeException'); - - $view = new \Slim\View(); - - $prop2 = new \ReflectionProperty($view, 'templatesDirectory'); - $prop2->setAccessible(true); - $prop2->setValue($view, dirname(__FILE__) . '/templates'); - - $view->display('foo.php'); - } -} diff --git a/vendor/slim/slim/tests/bootstrap.php b/vendor/slim/slim/tests/bootstrap.php deleted file mode 100644 index c253350..0000000 --- a/vendor/slim/slim/tests/bootstrap.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -set_include_path(dirname(__FILE__) . '/../' . PATH_SEPARATOR . get_include_path()); - -// Set default timezone -date_default_timezone_set('America/New_York'); - -require_once 'Slim/Slim.php'; - -// Register Slim's autoloader -\Slim\Slim::registerAutoloader(); - -//Register non-Slim autoloader -function customAutoLoader( $class ) -{ - $file = rtrim(dirname(__FILE__), '/') . '/' . $class . '.php'; - if ( file_exists($file) ) { - require $file; - } else { - return; - } -} -spl_autoload_register('customAutoLoader'); diff --git a/vendor/slim/slim/tests/templates/test.php b/vendor/slim/slim/tests/templates/test.php deleted file mode 100644 index b4c7754..0000000 --- a/vendor/slim/slim/tests/templates/test.php +++ /dev/null @@ -1 +0,0 @@ -test output <?php echo $foo; ?> diff --git a/vendor/symfony/polyfill-mbstring/LICENSE b/vendor/symfony/polyfill-mbstring/LICENSE deleted file mode 100644 index 4cd8bdd..0000000 --- a/vendor/symfony/polyfill-mbstring/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2019 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php deleted file mode 100644 index 15503bc..0000000 --- a/vendor/symfony/polyfill-mbstring/Mbstring.php +++ /dev/null @@ -1,847 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Mbstring; - -/** - * Partial mbstring implementation in PHP, iconv based, UTF-8 centric. - * - * Implemented: - * - mb_chr - Returns a specific character from its Unicode code point - * - mb_convert_encoding - Convert character encoding - * - mb_convert_variables - Convert character code in variable(s) - * - mb_decode_mimeheader - Decode string in MIME header field - * - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED - * - mb_decode_numericentity - Decode HTML numeric string reference to character - * - mb_encode_numericentity - Encode character to HTML numeric string reference - * - mb_convert_case - Perform case folding on a string - * - mb_detect_encoding - Detect character encoding - * - mb_get_info - Get internal settings of mbstring - * - mb_http_input - Detect HTTP input character encoding - * - mb_http_output - Set/Get HTTP output character encoding - * - mb_internal_encoding - Set/Get internal character encoding - * - mb_list_encodings - Returns an array of all supported encodings - * - mb_ord - Returns the Unicode code point of a character - * - mb_output_handler - Callback function converts character encoding in output buffer - * - mb_scrub - Replaces ill-formed byte sequences with substitute characters - * - mb_strlen - Get string length - * - mb_strpos - Find position of first occurrence of string in a string - * - mb_strrpos - Find position of last occurrence of a string in a string - * - mb_str_split - Convert a string to an array - * - mb_strtolower - Make a string lowercase - * - mb_strtoupper - Make a string uppercase - * - mb_substitute_character - Set/Get substitution character - * - mb_substr - Get part of string - * - mb_stripos - Finds position of first occurrence of a string within another, case insensitive - * - mb_stristr - Finds first occurrence of a string within another, case insensitive - * - mb_strrchr - Finds the last occurrence of a character in a string within another - * - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive - * - mb_strripos - Finds position of last occurrence of a string within another, case insensitive - * - mb_strstr - Finds first occurrence of a string within another - * - mb_strwidth - Return width of string - * - mb_substr_count - Count the number of substring occurrences - * - * Not implemented: - * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) - * - mb_ereg_* - Regular expression with multibyte support - * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable - * - mb_preferred_mime_name - Get MIME charset string - * - mb_regex_encoding - Returns current encoding for multibyte regex as string - * - mb_regex_set_options - Set/Get the default options for mbregex functions - * - mb_send_mail - Send encoded mail - * - mb_split - Split multibyte string using regular expression - * - mb_strcut - Get part of string - * - mb_strimwidth - Get truncated string with specified width - * - * @author Nicolas Grekas <p@tchwork.com> - * - * @internal - */ -final class Mbstring -{ - const MB_CASE_FOLD = PHP_INT_MAX; - - private static $encodingList = array('ASCII', 'UTF-8'); - 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", 'ι'), - ); - - 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); - } - - $toEncoding = self::getEncoding($toEncoding); - - if ('BASE64' === $fromEncoding) { - $s = base64_decode($s); - $fromEncoding = $toEncoding; - } - - if ('BASE64' === $toEncoding) { - return base64_encode($s); - } - - if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) { - if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) { - $fromEncoding = 'Windows-1252'; - } - if ('UTF-8' !== $fromEncoding) { - $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s); - } - - return preg_replace_callback('/[\x80-\xFF]+/', array(__CLASS__, 'html_encoding_callback'), $s); - } - - if ('HTML-ENTITIES' === $fromEncoding) { - $s = html_entity_decode($s, ENT_COMPAT, 'UTF-8'); - $fromEncoding = 'UTF-8'; - } - - 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) - { - $vars = array(&$a, &$b, &$c, &$d, &$e, &$f); - - $ok = true; - array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { - if (false === $v = Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { - $ok = false; - } - }); - - return $ok ? $fromEncoding : false; - } - - 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) - { - 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; - } - - if (!\is_array($convmap) || !$convmap) { - 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); - - return ''; // Instead of null (cf. mb_encode_numericentity). - } - - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - $cnt = floor(\count($convmap) / 4) * 4; - - for ($i = 0; $i < $cnt; $i += 4) { - // collector_decode_htmlnumericentity ignores $convmap[$i + 3] - $convmap[$i] += $convmap[$i + 2]; - $convmap[$i + 1] += $convmap[$i + 2]; - } - - $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]; - for ($i = 0; $i < $cnt; $i += 4) { - if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { - return Mbstring::mb_chr($c - $convmap[$i + 2]); - } - } - - return $m[0]; - }, $s); - - if (null === $encoding) { - return $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; - } - - if (!\is_array($convmap) || !$convmap) { - 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 !== $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; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4); - - $cnt = floor(\count($convmap) / 4) * 4; - $i = 0; - $len = \strlen($s); - $result = ''; - - while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - $c = self::mb_ord($uchr); - - 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.';'; - continue 2; - } - } - $result .= $uchr; - } - - if (null === $encoding) { - return $result; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $result); - } - - public static function mb_convert_case($s, $mode, $encoding = null) - { - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - if (MB_CASE_TITLE == $mode) { - static $titleRegexp = null; - if (null === $titleRegexp) { - $titleRegexp = self::getData('titleCaseRegexp'); - } - $s = preg_replace_callback($titleRegexp, array(__CLASS__, 'title_case'), $s); - } else { - if (MB_CASE_UPPER == $mode) { - static $upper = null; - if (null === $upper) { - $upper = self::getData('upperCase'); - } - $map = $upper; - } else { - if (self::MB_CASE_FOLD === $mode) { - $s = str_replace(self::$caseFold[0], self::$caseFold[1], $s); - } - - static $lower = null; - if (null === $lower) { - $lower = self::getData('lowerCase'); - } - $map = $lower; - } - - static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4); - - $i = 0; - $len = \strlen($s); - - while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - - if (isset($map[$uchr])) { - $uchr = $map[$uchr]; - $nlen = \strlen($uchr); - - if ($nlen == $ulen) { - $nlen = $i; - do { - $s[--$nlen] = $uchr[--$ulen]; - } while ($ulen); - } else { - $s = substr_replace($s, $uchr, $i - $ulen, $ulen); - $len += $nlen - $ulen; - $i += $nlen - $ulen; - } - } - } - } - - if (null === $encoding) { - return $s; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $s); - } - - 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, ' ')) { - self::$internalEncoding = $encoding; - - return true; - } - - return false; - } - - public static function mb_language($lang = null) - { - if (null === $lang) { - return self::$language; - } - - switch ($lang = strtolower($lang)) { - case 'uni': - case 'neutral': - self::$language = $lang; - - return true; - } - - return false; - } - - public static function mb_list_encodings() - { - return array('UTF-8'); - } - - public static function mb_encoding_aliases($encoding) - { - switch (strtoupper($encoding)) { - case 'UTF8': - case 'UTF-8': - return array('utf8'); - } - - 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); - } - - public static function mb_detect_encoding($str, $encodingList = null, $strict = false) - { - if (null === $encodingList) { - $encodingList = self::$encodingList; - } else { - if (!\is_array($encodingList)) { - $encodingList = array_map('trim', explode(',', $encodingList)); - } - $encodingList = array_map('strtoupper', $encodingList); - } - - foreach ($encodingList as $enc) { - switch ($enc) { - case 'ASCII': - if (!preg_match('/[\x80-\xFF]/', $str)) { - return $enc; - } - break; - - case 'UTF8': - case 'UTF-8': - if (preg_match('//u', $str)) { - return 'UTF-8'; - } - break; - - default: - if (0 === strncmp($enc, 'ISO-8859-', 9)) { - return $enc; - } - } - } - - return false; - } - - public static function mb_detect_order($encodingList = null) - { - if (null === $encodingList) { - return self::$encodingList; - } - - if (!\is_array($encodingList)) { - $encodingList = array_map('trim', explode(',', $encodingList)); - } - $encodingList = array_map('strtoupper', $encodingList); - - foreach ($encodingList as $enc) { - switch ($enc) { - default: - if (strncmp($enc, 'ISO-8859-', 9)) { - return false; - } - // no break - case 'ASCII': - case 'UTF8': - case 'UTF-8': - } - } - - self::$encodingList = $encodingList; - - return true; - } - - public static function mb_strlen($s, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return \strlen($s); - } - - return @iconv_strlen($s, $encoding); - } - - 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; - if ('' === $needle) { - trigger_error(__METHOD__.': Empty delimiter', E_USER_WARNING); - - return false; - } - - return iconv_strpos($haystack, $needle, $offset, $encoding); - } - - 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) { - $offset = 0; - } elseif ($offset = (int) $offset) { - if ($offset < 0) { - if (0 > $offset += self::mb_strlen($needle)) { - $haystack = self::mb_substr($haystack, 0, $offset, $encoding); - } - $offset = 0; - } else { - $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding); - } - } - - $pos = iconv_strrpos($haystack, $needle, $encoding); - - return false !== $pos ? $offset + $pos : false; - } - - public static function mb_str_split($string, $split_length = 1, $encoding = null) - { - if (null !== $string && !\is_scalar($string) && !(\is_object($string) && \method_exists($string, '__toString'))) { - trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', E_USER_WARNING); - - return null; - } - - if (1 > $split_length = (int) $split_length) { - trigger_error('The length of each segment must be greater than zero', E_USER_WARNING); - - return false; - } - - if (null === $encoding) { - $encoding = mb_internal_encoding(); - } - - if ('UTF-8' === $encoding = self::getEncoding($encoding)) { - $rx = '/('; - while (65535 < $split_length) { - $rx .= '.{65535}'; - $split_length -= 65535; - } - $rx .= '.{'.$split_length.'})/us'; - - return preg_split($rx, $string, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); - } - - $result = array(); - $length = mb_strlen($string, $encoding); - - for ($i = 0; $i < $length; $i += $split_length) { - $result[] = mb_substr($string, $i, $split_length, $encoding); - } - - return $result; - } - - 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) - { - return self::mb_convert_case($s, MB_CASE_UPPER, $encoding); - } - - public static function mb_substitute_character($c = null) - { - if (0 === strcasecmp($c, 'none')) { - return true; - } - - return null !== $c ? false : 'none'; - } - - public static function mb_substr($s, $start, $length = null, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return (string) substr($s, $start, null === $length ? 2147483647 : $length); - } - - if ($start < 0) { - $start = iconv_strlen($s, $encoding) + $start; - if ($start < 0) { - $start = 0; - } - } - - if (null === $length) { - $length = 2147483647; - } elseif ($length < 0) { - $length = iconv_strlen($s, $encoding) + $length - $start; - if ($length < 0) { - return ''; - } - } - - return (string) iconv_substr($s, $start, $length, $encoding); - } - - 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) - { - $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) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strrchr($haystack, $needle, $part); - } - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = iconv_strrpos($haystack, $needle, $encoding); - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - 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) - { - $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) - { - $pos = strpos($haystack, $needle); - if (false === $pos) { - return false; - } - if ($part) { - return substr($haystack, 0, $pos); - } - - return substr($haystack, $pos); - } - - public static function mb_get_info($type = 'all') - { - $info = array( - 'internal_encoding' => self::$internalEncoding, - 'http_output' => 'pass', - 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', - 'func_overload' => 0, - 'func_overload_list' => 'no overload', - 'mail_charset' => 'UTF-8', - 'mail_header_encoding' => 'BASE64', - 'mail_body_encoding' => 'BASE64', - 'illegal_chars' => 0, - 'encoding_translation' => 'Off', - 'language' => self::$language, - 'detect_order' => self::$encodingList, - 'substitute_character' => 'none', - 'strict_detection' => 'Off', - ); - - if ('all' === $type) { - return $info; - } - if (isset($info[$type])) { - return $info[$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_strwidth($s, $encoding = null) - { - $encoding = self::getEncoding($encoding); - - if ('UTF-8' !== $encoding) { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); - - return ($wide << 1) + iconv_strlen($s, 'UTF-8'); - } - - public static function mb_substr_count($haystack, $needle, $encoding = null) - { - return substr_count($haystack, $needle); - } - - public static function mb_output_handler($contents, $status) - { - return $contents; - } - - 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 { - $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)) { - $s = mb_convert_encoding($s, $encoding, 'UTF-8'); - } - - return $s; - } - - public static function mb_ord($s, $encoding = null) - { - if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { - $s = mb_convert_encoding($s, 'UTF-8', $encoding); - } - - if (1 === \strlen($s)) { - return \ord($s); - } - - $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; - if (0xF0 <= $code) { - return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; - } - if (0xE0 <= $code) { - return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; - } - if (0xC0 <= $code) { - return (($code - 0xC0) << 6) + $s[2] - 0x80; - } - - return $code; - } - - 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); - } - - private static function html_encoding_callback(array $m) - { - $i = 1; - $entities = ''; - $m = unpack('C*', htmlentities($m[0], ENT_COMPAT, 'UTF-8')); - - while (isset($m[$i])) { - if (0x80 > $m[$i]) { - $entities .= \chr($m[$i++]); - continue; - } - if (0xF0 <= $m[$i]) { - $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } elseif (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.';'; - } - - return $entities; - } - - private static function title_case(array $s) - { - return self::mb_convert_case($s[1], MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], MB_CASE_LOWER, 'UTF-8'); - } - - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { - return require $file; - } - - return false; - } - - private static function getEncoding($encoding) - { - if (null === $encoding) { - return self::$internalEncoding; - } - - if ('UTF-8' === $encoding) { - return 'UTF-8'; - } - - $encoding = strtoupper($encoding); - - if ('8BIT' === $encoding || 'BINARY' === $encoding) { - return 'CP850'; - } - - if ('UTF8' === $encoding) { - return 'UTF-8'; - } - - return $encoding; - } -} diff --git a/vendor/symfony/polyfill-mbstring/README.md b/vendor/symfony/polyfill-mbstring/README.md deleted file mode 100644 index 342e828..0000000 --- a/vendor/symfony/polyfill-mbstring/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Symfony Polyfill / Mbstring -=========================== - -This component provides a partial, native PHP implementation for the -[Mbstring](http://php.net/mbstring) extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php deleted file mode 100644 index e6fbfa6..0000000 --- a/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +++ /dev/null @@ -1,1096 +0,0 @@ -<?php - -return 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', - '𐐀' => '𐐨', - '𐐁' => '𐐩', - '𐐂' => '𐐪', - '𐐃' => '𐐫', - '𐐄' => '𐐬', - '𐐅' => '𐐭', - '𐐆' => '𐐮', - '𐐇' => '𐐯', - '𐐈' => '𐐰', - '𐐉' => '𐐱', - '𐐊' => '𐐲', - '𐐋' => '𐐳', - '𐐌' => '𐐴', - '𐐍' => '𐐵', - '𐐎' => '𐐶', - '𐐏' => '𐐷', - '𐐐' => '𐐸', - '𐐑' => '𐐹', - '𐐒' => '𐐺', - '𐐓' => '𐐻', - '𐐔' => '𐐼', - '𐐕' => '𐐽', - '𐐖' => '𐐾', - '𐐗' => '𐐿', - '𐐘' => '𐑀', - '𐐙' => '𐑁', - '𐐚' => '𐑂', - '𐐛' => '𐑃', - '𐐜' => '𐑄', - '𐐝' => '𐑅', - '𐐞' => '𐑆', - '𐐟' => '𐑇', - '𐐠' => '𐑈', - '𐐡' => '𐑉', - '𐐢' => '𐑊', - '𐐣' => '𐑋', - '𐐤' => '𐑌', - '𐐥' => '𐑍', - '𐐦' => '𐑎', - '𐐧' => '𐑏', - '𑢠' => '𑣀', - '𑢡' => '𑣁', - '𑢢' => '𑣂', - '𑢣' => '𑣃', - '𑢤' => '𑣄', - '𑢥' => '𑣅', - '𑢦' => '𑣆', - '𑢧' => '𑣇', - '𑢨' => '𑣈', - '𑢩' => '𑣉', - '𑢪' => '𑣊', - '𑢫' => '𑣋', - '𑢬' => '𑣌', - '𑢭' => '𑣍', - '𑢮' => '𑣎', - '𑢯' => '𑣏', - '𑢰' => '𑣐', - '𑢱' => '𑣑', - '𑢲' => '𑣒', - '𑢳' => '𑣓', - '𑢴' => '𑣔', - '𑢵' => '𑣕', - '𑢶' => '𑣖', - '𑢷' => '𑣗', - '𑢸' => '𑣘', - '𑢹' => '𑣙', - '𑢺' => '𑣚', - '𑢻' => '𑣛', - '𑢼' => '𑣜', - '𑢽' => '𑣝', - '𑢾' => '𑣞', - '𑢿' => '𑣟', -); diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php deleted file mode 100644 index 2a8f6e7..0000000 --- a/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +++ /dev/null @@ -1,5 +0,0 @@ -<?php - -// from Case_Ignorable in https://unicode.org/Public/UNIDATA/DerivedCoreProperties.txt - -return '/(?<![\x{0027}\x{002E}\x{003A}\x{005E}\x{0060}\x{00A8}\x{00AD}\x{00AF}\x{00B4}\x{00B7}\x{00B8}\x{02B0}-\x{02C1}\x{02C2}-\x{02C5}\x{02C6}-\x{02D1}\x{02D2}-\x{02DF}\x{02E0}-\x{02E4}\x{02E5}-\x{02EB}\x{02EC}\x{02ED}\x{02EE}\x{02EF}-\x{02FF}\x{0300}-\x{036F}\x{0374}\x{0375}\x{037A}\x{0384}-\x{0385}\x{0387}\x{0483}-\x{0487}\x{0488}-\x{0489}\x{0559}\x{0591}-\x{05BD}\x{05BF}\x{05C1}-\x{05C2}\x{05C4}-\x{05C5}\x{05C7}\x{05F4}\x{0600}-\x{0605}\x{0610}-\x{061A}\x{061C}\x{0640}\x{064B}-\x{065F}\x{0670}\x{06D6}-\x{06DC}\x{06DD}\x{06DF}-\x{06E4}\x{06E5}-\x{06E6}\x{06E7}-\x{06E8}\x{06EA}-\x{06ED}\x{070F}\x{0711}\x{0730}-\x{074A}\x{07A6}-\x{07B0}\x{07EB}-\x{07F3}\x{07F4}-\x{07F5}\x{07FA}\x{07FD}\x{0816}-\x{0819}\x{081A}\x{081B}-\x{0823}\x{0824}\x{0825}-\x{0827}\x{0828}\x{0829}-\x{082D}\x{0859}-\x{085B}\x{08D3}-\x{08E1}\x{08E2}\x{08E3}-\x{0902}\x{093A}\x{093C}\x{0941}-\x{0948}\x{094D}\x{0951}-\x{0957}\x{0962}-\x{0963}\x{0971}\x{0981}\x{09BC}\x{09C1}-\x{09C4}\x{09CD}\x{09E2}-\x{09E3}\x{09FE}\x{0A01}-\x{0A02}\x{0A3C}\x{0A41}-\x{0A42}\x{0A47}-\x{0A48}\x{0A4B}-\x{0A4D}\x{0A51}\x{0A70}-\x{0A71}\x{0A75}\x{0A81}-\x{0A82}\x{0ABC}\x{0AC1}-\x{0AC5}\x{0AC7}-\x{0AC8}\x{0ACD}\x{0AE2}-\x{0AE3}\x{0AFA}-\x{0AFF}\x{0B01}\x{0B3C}\x{0B3F}\x{0B41}-\x{0B44}\x{0B4D}\x{0B56}\x{0B62}-\x{0B63}\x{0B82}\x{0BC0}\x{0BCD}\x{0C00}\x{0C04}\x{0C3E}-\x{0C40}\x{0C46}-\x{0C48}\x{0C4A}-\x{0C4D}\x{0C55}-\x{0C56}\x{0C62}-\x{0C63}\x{0C81}\x{0CBC}\x{0CBF}\x{0CC6}\x{0CCC}-\x{0CCD}\x{0CE2}-\x{0CE3}\x{0D00}-\x{0D01}\x{0D3B}-\x{0D3C}\x{0D41}-\x{0D44}\x{0D4D}\x{0D62}-\x{0D63}\x{0DCA}\x{0DD2}-\x{0DD4}\x{0DD6}\x{0E31}\x{0E34}-\x{0E3A}\x{0E46}\x{0E47}-\x{0E4E}\x{0EB1}\x{0EB4}-\x{0EB9}\x{0EBB}-\x{0EBC}\x{0EC6}\x{0EC8}-\x{0ECD}\x{0F18}-\x{0F19}\x{0F35}\x{0F37}\x{0F39}\x{0F71}-\x{0F7E}\x{0F80}-\x{0F84}\x{0F86}-\x{0F87}\x{0F8D}-\x{0F97}\x{0F99}-\x{0FBC}\x{0FC6}\x{102D}-\x{1030}\x{1032}-\x{1037}\x{1039}-\x{103A}\x{103D}-\x{103E}\x{1058}-\x{1059}\x{105E}-\x{1060}\x{1071}-\x{1074}\x{1082}\x{1085}-\x{1086}\x{108D}\x{109D}\x{10FC}\x{135D}-\x{135F}\x{1712}-\x{1714}\x{1732}-\x{1734}\x{1752}-\x{1753}\x{1772}-\x{1773}\x{17B4}-\x{17B5}\x{17B7}-\x{17BD}\x{17C6}\x{17C9}-\x{17D3}\x{17D7}\x{17DD}\x{180B}-\x{180D}\x{180E}\x{1843}\x{1885}-\x{1886}\x{18A9}\x{1920}-\x{1922}\x{1927}-\x{1928}\x{1932}\x{1939}-\x{193B}\x{1A17}-\x{1A18}\x{1A1B}\x{1A56}\x{1A58}-\x{1A5E}\x{1A60}\x{1A62}\x{1A65}-\x{1A6C}\x{1A73}-\x{1A7C}\x{1A7F}\x{1AA7}\x{1AB0}-\x{1ABD}\x{1ABE}\x{1B00}-\x{1B03}\x{1B34}\x{1B36}-\x{1B3A}\x{1B3C}\x{1B42}\x{1B6B}-\x{1B73}\x{1B80}-\x{1B81}\x{1BA2}-\x{1BA5}\x{1BA8}-\x{1BA9}\x{1BAB}-\x{1BAD}\x{1BE6}\x{1BE8}-\x{1BE9}\x{1BED}\x{1BEF}-\x{1BF1}\x{1C2C}-\x{1C33}\x{1C36}-\x{1C37}\x{1C78}-\x{1C7D}\x{1CD0}-\x{1CD2}\x{1CD4}-\x{1CE0}\x{1CE2}-\x{1CE8}\x{1CED}\x{1CF4}\x{1CF8}-\x{1CF9}\x{1D2C}-\x{1D6A}\x{1D78}\x{1D9B}-\x{1DBF}\x{1DC0}-\x{1DF9}\x{1DFB}-\x{1DFF}\x{1FBD}\x{1FBF}-\x{1FC1}\x{1FCD}-\x{1FCF}\x{1FDD}-\x{1FDF}\x{1FED}-\x{1FEF}\x{1FFD}-\x{1FFE}\x{200B}-\x{200F}\x{2018}\x{2019}\x{2024}\x{2027}\x{202A}-\x{202E}\x{2060}-\x{2064}\x{2066}-\x{206F}\x{2071}\x{207F}\x{2090}-\x{209C}\x{20D0}-\x{20DC}\x{20DD}-\x{20E0}\x{20E1}\x{20E2}-\x{20E4}\x{20E5}-\x{20F0}\x{2C7C}-\x{2C7D}\x{2CEF}-\x{2CF1}\x{2D6F}\x{2D7F}\x{2DE0}-\x{2DFF}\x{2E2F}\x{3005}\x{302A}-\x{302D}\x{3031}-\x{3035}\x{303B}\x{3099}-\x{309A}\x{309B}-\x{309C}\x{309D}-\x{309E}\x{30FC}-\x{30FE}\x{A015}\x{A4F8}-\x{A4FD}\x{A60C}\x{A66F}\x{A670}-\x{A672}\x{A674}-\x{A67D}\x{A67F}\x{A69C}-\x{A69D}\x{A69E}-\x{A69F}\x{A6F0}-\x{A6F1}\x{A700}-\x{A716}\x{A717}-\x{A71F}\x{A720}-\x{A721}\x{A770}\x{A788}\x{A789}-\x{A78A}\x{A7F8}-\x{A7F9}\x{A802}\x{A806}\x{A80B}\x{A825}-\x{A826}\x{A8C4}-\x{A8C5}\x{A8E0}-\x{A8F1}\x{A8FF}\x{A926}-\x{A92D}\x{A947}-\x{A951}\x{A980}-\x{A982}\x{A9B3}\x{A9B6}-\x{A9B9}\x{A9BC}\x{A9CF}\x{A9E5}\x{A9E6}\x{AA29}-\x{AA2E}\x{AA31}-\x{AA32}\x{AA35}-\x{AA36}\x{AA43}\x{AA4C}\x{AA70}\x{AA7C}\x{AAB0}\x{AAB2}-\x{AAB4}\x{AAB7}-\x{AAB8}\x{AABE}-\x{AABF}\x{AAC1}\x{AADD}\x{AAEC}-\x{AAED}\x{AAF3}-\x{AAF4}\x{AAF6}\x{AB5B}\x{AB5C}-\x{AB5F}\x{ABE5}\x{ABE8}\x{ABED}\x{FB1E}\x{FBB2}-\x{FBC1}\x{FE00}-\x{FE0F}\x{FE13}\x{FE20}-\x{FE2F}\x{FE52}\x{FE55}\x{FEFF}\x{FF07}\x{FF0E}\x{FF1A}\x{FF3E}\x{FF40}\x{FF70}\x{FF9E}-\x{FF9F}\x{FFE3}\x{FFF9}-\x{FFFB}\x{101FD}\x{102E0}\x{10376}-\x{1037A}\x{10A01}-\x{10A03}\x{10A05}-\x{10A06}\x{10A0C}-\x{10A0F}\x{10A38}-\x{10A3A}\x{10A3F}\x{10AE5}-\x{10AE6}\x{10D24}-\x{10D27}\x{10F46}-\x{10F50}\x{11001}\x{11038}-\x{11046}\x{1107F}-\x{11081}\x{110B3}-\x{110B6}\x{110B9}-\x{110BA}\x{110BD}\x{110CD}\x{11100}-\x{11102}\x{11127}-\x{1112B}\x{1112D}-\x{11134}\x{11173}\x{11180}-\x{11181}\x{111B6}-\x{111BE}\x{111C9}-\x{111CC}\x{1122F}-\x{11231}\x{11234}\x{11236}-\x{11237}\x{1123E}\x{112DF}\x{112E3}-\x{112EA}\x{11300}-\x{11301}\x{1133B}-\x{1133C}\x{11340}\x{11366}-\x{1136C}\x{11370}-\x{11374}\x{11438}-\x{1143F}\x{11442}-\x{11444}\x{11446}\x{1145E}\x{114B3}-\x{114B8}\x{114BA}\x{114BF}-\x{114C0}\x{114C2}-\x{114C3}\x{115B2}-\x{115B5}\x{115BC}-\x{115BD}\x{115BF}-\x{115C0}\x{115DC}-\x{115DD}\x{11633}-\x{1163A}\x{1163D}\x{1163F}-\x{11640}\x{116AB}\x{116AD}\x{116B0}-\x{116B5}\x{116B7}\x{1171D}-\x{1171F}\x{11722}-\x{11725}\x{11727}-\x{1172B}\x{1182F}-\x{11837}\x{11839}-\x{1183A}\x{11A01}-\x{11A0A}\x{11A33}-\x{11A38}\x{11A3B}-\x{11A3E}\x{11A47}\x{11A51}-\x{11A56}\x{11A59}-\x{11A5B}\x{11A8A}-\x{11A96}\x{11A98}-\x{11A99}\x{11C30}-\x{11C36}\x{11C38}-\x{11C3D}\x{11C3F}\x{11C92}-\x{11CA7}\x{11CAA}-\x{11CB0}\x{11CB2}-\x{11CB3}\x{11CB5}-\x{11CB6}\x{11D31}-\x{11D36}\x{11D3A}\x{11D3C}-\x{11D3D}\x{11D3F}-\x{11D45}\x{11D47}\x{11D90}-\x{11D91}\x{11D95}\x{11D97}\x{11EF3}-\x{11EF4}\x{16AF0}-\x{16AF4}\x{16B30}-\x{16B36}\x{16B40}-\x{16B43}\x{16F8F}-\x{16F92}\x{16F93}-\x{16F9F}\x{16FE0}-\x{16FE1}\x{1BC9D}-\x{1BC9E}\x{1BCA0}-\x{1BCA3}\x{1D167}-\x{1D169}\x{1D173}-\x{1D17A}\x{1D17B}-\x{1D182}\x{1D185}-\x{1D18B}\x{1D1AA}-\x{1D1AD}\x{1D242}-\x{1D244}\x{1DA00}-\x{1DA36}\x{1DA3B}-\x{1DA6C}\x{1DA75}\x{1DA84}\x{1DA9B}-\x{1DA9F}\x{1DAA1}-\x{1DAAF}\x{1E000}-\x{1E006}\x{1E008}-\x{1E018}\x{1E01B}-\x{1E021}\x{1E023}-\x{1E024}\x{1E026}-\x{1E02A}\x{1E8D0}-\x{1E8D6}\x{1E944}-\x{1E94A}\x{1F3FB}-\x{1F3FF}\x{E0001}\x{E0020}-\x{E007F}\x{E0100}-\x{E01EF}])(\pL)(\pL*+)/u'; diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php deleted file mode 100644 index b8103b2..0000000 --- a/vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php +++ /dev/null @@ -1,1104 +0,0 @@ -<?php - -return 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', - '𐐨' => '𐐀', - '𐐩' => '𐐁', - '𐐪' => '𐐂', - '𐐫' => '𐐃', - '𐐬' => '𐐄', - '𐐭' => '𐐅', - '𐐮' => '𐐆', - '𐐯' => '𐐇', - '𐐰' => '𐐈', - '𐐱' => '𐐉', - '𐐲' => '𐐊', - '𐐳' => '𐐋', - '𐐴' => '𐐌', - '𐐵' => '𐐍', - '𐐶' => '𐐎', - '𐐷' => '𐐏', - '𐐸' => '𐐐', - '𐐹' => '𐐑', - '𐐺' => '𐐒', - '𐐻' => '𐐓', - '𐐼' => '𐐔', - '𐐽' => '𐐕', - '𐐾' => '𐐖', - '𐐿' => '𐐗', - '𐑀' => '𐐘', - '𐑁' => '𐐙', - '𐑂' => '𐐚', - '𐑃' => '𐐛', - '𐑄' => '𐐜', - '𐑅' => '𐐝', - '𐑆' => '𐐞', - '𐑇' => '𐐟', - '𐑈' => '𐐠', - '𐑉' => '𐐡', - '𐑊' => '𐐢', - '𐑋' => '𐐣', - '𐑌' => '𐐤', - '𐑍' => '𐐥', - '𐑎' => '𐐦', - '𐑏' => '𐐧', - '𑣀' => '𑢠', - '𑣁' => '𑢡', - '𑣂' => '𑢢', - '𑣃' => '𑢣', - '𑣄' => '𑢤', - '𑣅' => '𑢥', - '𑣆' => '𑢦', - '𑣇' => '𑢧', - '𑣈' => '𑢨', - '𑣉' => '𑢩', - '𑣊' => '𑢪', - '𑣋' => '𑢫', - '𑣌' => '𑢬', - '𑣍' => '𑢭', - '𑣎' => '𑢮', - '𑣏' => '𑢯', - '𑣐' => '𑢰', - '𑣑' => '𑢱', - '𑣒' => '𑢲', - '𑣓' => '𑢳', - '𑣔' => '𑢴', - '𑣕' => '𑢵', - '𑣖' => '𑢶', - '𑣗' => '𑢷', - '𑣘' => '𑢸', - '𑣙' => '𑢹', - '𑣚' => '𑢺', - '𑣛' => '𑢻', - '𑣜' => '𑢼', - '𑣝' => '𑢽', - '𑣞' => '𑢾', - '𑣟' => '𑢿', -); diff --git a/vendor/symfony/polyfill-mbstring/bootstrap.php b/vendor/symfony/polyfill-mbstring/bootstrap.php deleted file mode 100644 index 204a41b..0000000 --- a/vendor/symfony/polyfill-mbstring/bootstrap.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Mbstring as p; - -if (!function_exists('mb_strlen')) { - define('MB_CASE_UPPER', 0); - 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); } -} -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); } -} - -if (!function_exists('mb_str_split')) { - function mb_str_split($string, $split_length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $split_length, $encoding); } -} diff --git a/vendor/symfony/polyfill-mbstring/composer.json b/vendor/symfony/polyfill-mbstring/composer.json deleted file mode 100644 index 1a8bec5..0000000 --- a/vendor/symfony/polyfill-mbstring/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "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" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "1.14-dev" - } - } -} diff --git a/vendor/symfony/translation/CHANGELOG.md b/vendor/symfony/translation/CHANGELOG.md deleted file mode 100644 index 9784532..0000000 --- a/vendor/symfony/translation/CHANGELOG.md +++ /dev/null @@ -1,133 +0,0 @@ -CHANGELOG -========= - -4.4.0 ------ - - * deprecated support for using `null` as the locale in `Translator` - * deprecated accepting STDIN implicitly when using the `lint:xliff` command, use `lint:xliff -` (append a dash) instead to make it explicit. - * Marked the `TranslationDataCollector` class as `@final`. - -4.3.0 ------ - - * Improved Xliff 1.2 loader to load the original file's metadata - * Added `TranslatorPathsPass` - -4.2.0 ------ - - * Started using ICU parent locales as fallback locales. - * allow using the ICU message format using domains with the "+intl-icu" suffix - * deprecated `Translator::transChoice()` in favor of using `Translator::trans()` with a `%count%` parameter - * deprecated `TranslatorInterface` in favor of `Symfony\Contracts\Translation\TranslatorInterface` - * deprecated `MessageSelector`, `Interval` and `PluralizationRules`; use `IdentityTranslator` instead - * Added `IntlFormatter` and `IntlFormatterInterface` - * added support for multiple files and directories in `XliffLintCommand` - * Marked `Translator::getFallbackLocales()` and `TranslationDataCollector::getFallbackLocales()` as internal - -4.1.0 ------ - - * The `FileDumper::setBackup()` method is deprecated. - * The `TranslationWriter::disableBackup()` method is deprecated. - * The `XliffFileDumper` will write "name" on the "unit" node when dumping XLIFF 2.0. - -4.0.0 ------ - - * removed the backup feature of the `FileDumper` class - * removed `TranslationWriter::writeTranslations()` method - * removed support for passing `MessageSelector` instances to the constructor of the `Translator` class - -3.4.0 ------ - - * Added `TranslationDumperPass` - * Added `TranslationExtractorPass` - * Added `TranslatorPass` - * Added `TranslationReader` and `TranslationReaderInterface` - * Added `<notes>` section to the Xliff 2.0 dumper. - * Improved Xliff 2.0 loader to load `<notes>` section. - * Added `TranslationWriterInterface` - * Deprecated `TranslationWriter::writeTranslations` in favor of `TranslationWriter::write` - * added support for adding custom message formatter and decoupling the default one. - * Added `PhpExtractor` - * Added `PhpStringTokenParser` - -3.2.0 ------ - - * Added support for escaping `|` in plural translations with double pipe. - -3.1.0 ------ - - * Deprecated the backup feature of the file dumper classes. - -3.0.0 ------ - - * removed `FileDumper::format()` method. - * Changed the visibility of the locale property in `Translator` from protected to private. - -2.8.0 ------ - - * deprecated FileDumper::format(), overwrite FileDumper::formatCatalogue() instead. - * deprecated Translator::getMessages(), rely on TranslatorBagInterface::getCatalogue() instead. - * added `FileDumper::formatCatalogue` which allows format the catalogue without dumping it into file. - * added option `json_encoding` to JsonFileDumper - * added options `as_tree`, `inline` to YamlFileDumper - * added support for XLIFF 2.0. - * added support for XLIFF target and tool attributes. - * added message parameters to DataCollectorTranslator. - * [DEPRECATION] The `DiffOperation` class has been deprecated and - will be removed in Symfony 3.0, since its operation has nothing to do with 'diff', - so the class name is misleading. The `TargetOperation` class should be used for - this use-case instead. - -2.7.0 ------ - - * added DataCollectorTranslator for collecting the translated messages. - -2.6.0 ------ - - * added possibility to cache catalogues - * added TranslatorBagInterface - * added LoggingTranslator - * added Translator::getMessages() for retrieving the message catalogue as an array - -2.5.0 ------ - - * added relative file path template to the file dumpers - * added optional backup to the file dumpers - * changed IcuResFileDumper to extend FileDumper - -2.3.0 ------ - - * added classes to make operations on catalogues (like making a diff or a merge on 2 catalogues) - * added Translator::getFallbackLocales() - * deprecated Translator::setFallbackLocale() in favor of the new Translator::setFallbackLocales() method - -2.2.0 ------ - - * QtTranslationsLoader class renamed to QtFileLoader. QtTranslationsLoader is deprecated and will be removed in 2.3. - * [BC BREAK] uniformized the exception thrown by the load() method when an error occurs. The load() method now - throws Symfony\Component\Translation\Exception\NotFoundResourceException when a resource cannot be found - and Symfony\Component\Translation\Exception\InvalidResourceException when a resource is invalid. - * changed the exception class thrown by some load() methods from \RuntimeException to \InvalidArgumentException - (IcuDatFileLoader, IcuResFileLoader and QtFileLoader) - -2.1.0 ------ - - * added support for more than one fallback locale - * added support for extracting translation messages from templates (Twig and PHP) - * added dumpers for translation catalogs - * added support for QT, gettext, and ResourceBundles diff --git a/vendor/symfony/translation/Catalogue/AbstractOperation.php b/vendor/symfony/translation/Catalogue/AbstractOperation.php deleted file mode 100644 index 919bab8..0000000 --- a/vendor/symfony/translation/Catalogue/AbstractOperation.php +++ /dev/null @@ -1,157 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Catalogue; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\Exception\LogicException; -use Symfony\Component\Translation\MessageCatalogue; -use Symfony\Component\Translation\MessageCatalogueInterface; - -/** - * Base catalogues binary operation class. - * - * A catalogue binary operation performs operation on - * source (the left argument) and target (the right argument) catalogues. - * - * @author Jean-François Simon <contact@jfsimon.fr> - */ -abstract class AbstractOperation implements OperationInterface -{ - protected $source; - protected $target; - protected $result; - - /** - * @var array|null The domains affected by this operation - */ - private $domains; - - /** - * This array stores 'all', 'new' and 'obsolete' messages for all valid domains. - * - * The data structure of this array is as follows: - * - * [ - * 'domain 1' => [ - * 'all' => [...], - * 'new' => [...], - * 'obsolete' => [...] - * ], - * 'domain 2' => [ - * 'all' => [...], - * 'new' => [...], - * 'obsolete' => [...] - * ], - * ... - * ] - * - * @var array The array that stores 'all', 'new' and 'obsolete' messages - */ - protected $messages; - - /** - * @throws LogicException - */ - public function __construct(MessageCatalogueInterface $source, MessageCatalogueInterface $target) - { - if ($source->getLocale() !== $target->getLocale()) { - throw new LogicException('Operated catalogues must belong to the same locale.'); - } - - $this->source = $source; - $this->target = $target; - $this->result = new MessageCatalogue($source->getLocale()); - $this->messages = []; - } - - /** - * {@inheritdoc} - */ - public function getDomains() - { - if (null === $this->domains) { - $this->domains = array_values(array_unique(array_merge($this->source->getDomains(), $this->target->getDomains()))); - } - - return $this->domains; - } - - /** - * {@inheritdoc} - */ - public function getMessages($domain) - { - if (!\in_array($domain, $this->getDomains())) { - throw new InvalidArgumentException(sprintf('Invalid domain: %s.', $domain)); - } - - if (!isset($this->messages[$domain]['all'])) { - $this->processDomain($domain); - } - - return $this->messages[$domain]['all']; - } - - /** - * {@inheritdoc} - */ - public function getNewMessages($domain) - { - if (!\in_array($domain, $this->getDomains())) { - throw new InvalidArgumentException(sprintf('Invalid domain: %s.', $domain)); - } - - if (!isset($this->messages[$domain]['new'])) { - $this->processDomain($domain); - } - - return $this->messages[$domain]['new']; - } - - /** - * {@inheritdoc} - */ - public function getObsoleteMessages($domain) - { - if (!\in_array($domain, $this->getDomains())) { - throw new InvalidArgumentException(sprintf('Invalid domain: %s.', $domain)); - } - - if (!isset($this->messages[$domain]['obsolete'])) { - $this->processDomain($domain); - } - - return $this->messages[$domain]['obsolete']; - } - - /** - * {@inheritdoc} - */ - public function getResult() - { - foreach ($this->getDomains() as $domain) { - if (!isset($this->messages[$domain])) { - $this->processDomain($domain); - } - } - - return $this->result; - } - - /** - * Performs operation on source and target catalogues for the given domain and - * stores the results. - * - * @param string $domain The domain which the operation will be performed for - */ - abstract protected function processDomain($domain); -} diff --git a/vendor/symfony/translation/Catalogue/MergeOperation.php b/vendor/symfony/translation/Catalogue/MergeOperation.php deleted file mode 100644 index d2f4abd..0000000 --- a/vendor/symfony/translation/Catalogue/MergeOperation.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Catalogue; - -use Symfony\Component\Translation\MessageCatalogueInterface; - -/** - * Merge operation between two catalogues as follows: - * all = source ∪ target = {x: x ∈ source ∨ x ∈ target} - * new = all ∖ source = {x: x ∈ target ∧ x ∉ source} - * obsolete = source ∖ all = {x: x ∈ source ∧ x ∉ source ∧ x ∉ target} = ∅ - * Basically, the result contains messages from both catalogues. - * - * @author Jean-François Simon <contact@jfsimon.fr> - */ -class MergeOperation extends AbstractOperation -{ - /** - * {@inheritdoc} - */ - protected function processDomain($domain) - { - $this->messages[$domain] = [ - 'all' => [], - 'new' => [], - 'obsolete' => [], - ]; - $intlDomain = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX; - - foreach ($this->source->all($domain) as $id => $message) { - $this->messages[$domain]['all'][$id] = $message; - $this->result->add([$id => $message], $this->source->defines($id, $intlDomain) ? $intlDomain : $domain); - if (null !== $keyMetadata = $this->source->getMetadata($id, $domain)) { - $this->result->setMetadata($id, $keyMetadata, $domain); - } - } - - foreach ($this->target->all($domain) as $id => $message) { - if (!$this->source->has($id, $domain)) { - $this->messages[$domain]['all'][$id] = $message; - $this->messages[$domain]['new'][$id] = $message; - $this->result->add([$id => $message], $this->target->defines($id, $intlDomain) ? $intlDomain : $domain); - if (null !== $keyMetadata = $this->target->getMetadata($id, $domain)) { - $this->result->setMetadata($id, $keyMetadata, $domain); - } - } - } - } -} diff --git a/vendor/symfony/translation/Catalogue/OperationInterface.php b/vendor/symfony/translation/Catalogue/OperationInterface.php deleted file mode 100644 index 87d888e..0000000 --- a/vendor/symfony/translation/Catalogue/OperationInterface.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Catalogue; - -use Symfony\Component\Translation\MessageCatalogueInterface; - -/** - * Represents an operation on catalogue(s). - * - * An instance of this interface performs an operation on one or more catalogues and - * stores intermediate and final results of the operation. - * - * The first catalogue in its argument(s) is called the 'source catalogue' or 'source' and - * the following results are stored: - * - * Messages: also called 'all', are valid messages for the given domain after the operation is performed. - * - * New Messages: also called 'new' (new = all ∖ source = {x: x ∈ all ∧ x ∉ source}). - * - * Obsolete Messages: also called 'obsolete' (obsolete = source ∖ all = {x: x ∈ source ∧ x ∉ all}). - * - * Result: also called 'result', is the resulting catalogue for the given domain that holds the same messages as 'all'. - * - * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> - */ -interface OperationInterface -{ - /** - * Returns domains affected by operation. - * - * @return array - */ - public function getDomains(); - - /** - * Returns all valid messages ('all') after operation. - * - * @param string $domain - * - * @return array - */ - public function getMessages($domain); - - /** - * Returns new messages ('new') after operation. - * - * @param string $domain - * - * @return array - */ - public function getNewMessages($domain); - - /** - * Returns obsolete messages ('obsolete') after operation. - * - * @param string $domain - * - * @return array - */ - public function getObsoleteMessages($domain); - - /** - * Returns resulting catalogue ('result'). - * - * @return MessageCatalogueInterface - */ - public function getResult(); -} diff --git a/vendor/symfony/translation/Catalogue/TargetOperation.php b/vendor/symfony/translation/Catalogue/TargetOperation.php deleted file mode 100644 index 22aa9a3..0000000 --- a/vendor/symfony/translation/Catalogue/TargetOperation.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Catalogue; - -use Symfony\Component\Translation\MessageCatalogueInterface; - -/** - * Target operation between two catalogues: - * intersection = source ∩ target = {x: x ∈ source ∧ x ∈ target} - * all = intersection ∪ (target ∖ intersection) = target - * new = all ∖ source = {x: x ∈ target ∧ x ∉ source} - * obsolete = source ∖ all = source ∖ target = {x: x ∈ source ∧ x ∉ target} - * Basically, the result contains messages from the target catalogue. - * - * @author Michael Lee <michael.lee@zerustech.com> - */ -class TargetOperation extends AbstractOperation -{ - /** - * {@inheritdoc} - */ - protected function processDomain($domain) - { - $this->messages[$domain] = [ - 'all' => [], - 'new' => [], - 'obsolete' => [], - ]; - $intlDomain = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX; - - // For 'all' messages, the code can't be simplified as ``$this->messages[$domain]['all'] = $target->all($domain);``, - // because doing so will drop messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback} - // - // For 'new' messages, the code can't be simplified as ``array_diff_assoc($this->target->all($domain), $this->source->all($domain));`` - // because doing so will not exclude messages like {x: x ∈ target ∧ x ∉ source.all ∧ x ∈ source.fallback} - // - // For 'obsolete' messages, the code can't be simplified as ``array_diff_assoc($this->source->all($domain), $this->target->all($domain))`` - // because doing so will not exclude messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback} - - foreach ($this->source->all($domain) as $id => $message) { - if ($this->target->has($id, $domain)) { - $this->messages[$domain]['all'][$id] = $message; - $this->result->add([$id => $message], $this->target->defines($id, $intlDomain) ? $intlDomain : $domain); - if (null !== $keyMetadata = $this->source->getMetadata($id, $domain)) { - $this->result->setMetadata($id, $keyMetadata, $domain); - } - } else { - $this->messages[$domain]['obsolete'][$id] = $message; - } - } - - foreach ($this->target->all($domain) as $id => $message) { - if (!$this->source->has($id, $domain)) { - $this->messages[$domain]['all'][$id] = $message; - $this->messages[$domain]['new'][$id] = $message; - $this->result->add([$id => $message], $this->target->defines($id, $intlDomain) ? $intlDomain : $domain); - if (null !== $keyMetadata = $this->target->getMetadata($id, $domain)) { - $this->result->setMetadata($id, $keyMetadata, $domain); - } - } - } - } -} diff --git a/vendor/symfony/translation/Command/XliffLintCommand.php b/vendor/symfony/translation/Command/XliffLintCommand.php deleted file mode 100644 index 3f8fe73..0000000 --- a/vendor/symfony/translation/Command/XliffLintCommand.php +++ /dev/null @@ -1,273 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Command; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\Util\XliffUtils; - -/** - * Validates XLIFF files syntax and outputs encountered errors. - * - * @author Grégoire Pineau <lyrixx@lyrixx.info> - * @author Robin Chalas <robin.chalas@gmail.com> - * @author Javier Eguiluz <javier.eguiluz@gmail.com> - */ -class XliffLintCommand extends Command -{ - protected static $defaultName = 'lint:xliff'; - - private $format; - private $displayCorrectFiles; - private $directoryIteratorProvider; - private $isReadableProvider; - private $requireStrictFileNames; - - public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null, bool $requireStrictFileNames = true) - { - parent::__construct($name); - - $this->directoryIteratorProvider = $directoryIteratorProvider; - $this->isReadableProvider = $isReadableProvider; - $this->requireStrictFileNames = $requireStrictFileNames; - } - - /** - * {@inheritdoc} - */ - protected function configure() - { - $this - ->setDescription('Lints a XLIFF file and outputs encountered errors') - ->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN') - ->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'txt') - ->setHelp(<<<EOF -The <info>%command.name%</info> command lints a XLIFF file and outputs to STDOUT -the first encountered syntax error. - -You can validates XLIFF contents passed from STDIN: - - <info>cat filename | php %command.full_name% -</info> - -You can also validate the syntax of a file: - - <info>php %command.full_name% filename</info> - -Or of a whole directory: - - <info>php %command.full_name% dirname</info> - <info>php %command.full_name% dirname --format=json</info> - -EOF - ) - ; - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $io = new SymfonyStyle($input, $output); - $filenames = (array) $input->getArgument('filename'); - $this->format = $input->getOption('format'); - $this->displayCorrectFiles = $output->isVerbose(); - - if (['-'] === $filenames) { - return $this->display($io, [$this->validate(file_get_contents('php://stdin'))]); - } - - // @deprecated to be removed in 5.0 - if (!$filenames) { - if (0 !== ftell(STDIN)) { - throw new RuntimeException('Please provide a filename or pipe file content to STDIN.'); - } - - @trigger_error('Piping content from STDIN to the "lint:xliff" command without passing the dash symbol "-" as argument is deprecated since Symfony 4.4.', E_USER_DEPRECATED); - - return $this->display($io, [$this->validate(file_get_contents('php://stdin'))]); - } - - $filesInfo = []; - foreach ($filenames as $filename) { - if (!$this->isReadable($filename)) { - throw new RuntimeException(sprintf('File or directory "%s" is not readable.', $filename)); - } - - foreach ($this->getFiles($filename) as $file) { - $filesInfo[] = $this->validate(file_get_contents($file), $file); - } - } - - return $this->display($io, $filesInfo); - } - - private function validate(string $content, string $file = null): array - { - $errors = []; - - // Avoid: Warning DOMDocument::loadXML(): Empty string supplied as input - if ('' === trim($content)) { - return ['file' => $file, 'valid' => true]; - } - - $internal = libxml_use_internal_errors(true); - - $document = new \DOMDocument(); - $document->loadXML($content); - - if (null !== $targetLanguage = $this->getTargetLanguageFromFile($document)) { - $normalizedLocale = preg_quote(str_replace('-', '_', $targetLanguage), '/'); - // strict file names require translation files to be named '____.locale.xlf' - // otherwise, both '____.locale.xlf' and 'locale.____.xlf' are allowed - // also, the regexp matching must be case-insensitive, as defined for 'target-language' values - // http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#target-language - $expectedFilenamePattern = $this->requireStrictFileNames ? sprintf('/^.*\.(?i:%s)\.(?:xlf|xliff)/', $normalizedLocale) : sprintf('/^(?:.*\.(?i:%s)|(?i:%s)\..*)\.(?:xlf|xliff)/', $normalizedLocale, $normalizedLocale); - - if (0 === preg_match($expectedFilenamePattern, basename($file))) { - $errors[] = [ - 'line' => -1, - 'column' => -1, - 'message' => sprintf('There is a mismatch between the language included in the file name ("%s") and the "%s" value used in the "target-language" attribute of the file.', basename($file), $targetLanguage), - ]; - } - } - - foreach (XliffUtils::validateSchema($document) as $xmlError) { - $errors[] = [ - 'line' => $xmlError['line'], - 'column' => $xmlError['column'], - 'message' => $xmlError['message'], - ]; - } - - libxml_clear_errors(); - libxml_use_internal_errors($internal); - - return ['file' => $file, 'valid' => 0 === \count($errors), 'messages' => $errors]; - } - - private function display(SymfonyStyle $io, array $files) - { - switch ($this->format) { - case 'txt': - return $this->displayTxt($io, $files); - case 'json': - return $this->displayJson($io, $files); - default: - throw new InvalidArgumentException(sprintf('The format "%s" is not supported.', $this->format)); - } - } - - private function displayTxt(SymfonyStyle $io, array $filesInfo) - { - $countFiles = \count($filesInfo); - $erroredFiles = 0; - - foreach ($filesInfo as $info) { - if ($info['valid'] && $this->displayCorrectFiles) { - $io->comment('<info>OK</info>'.($info['file'] ? sprintf(' in %s', $info['file']) : '')); - } elseif (!$info['valid']) { - ++$erroredFiles; - $io->text('<error> ERROR </error>'.($info['file'] ? sprintf(' in %s', $info['file']) : '')); - $io->listing(array_map(function ($error) { - // general document errors have a '-1' line number - return -1 === $error['line'] ? $error['message'] : sprintf('Line %d, Column %d: %s', $error['line'], $error['column'], $error['message']); - }, $info['messages'])); - } - } - - if (0 === $erroredFiles) { - $io->success(sprintf('All %d XLIFF files contain valid syntax.', $countFiles)); - } else { - $io->warning(sprintf('%d XLIFF files have valid syntax and %d contain errors.', $countFiles - $erroredFiles, $erroredFiles)); - } - - return min($erroredFiles, 1); - } - - private function displayJson(SymfonyStyle $io, array $filesInfo) - { - $errors = 0; - - array_walk($filesInfo, function (&$v) use (&$errors) { - $v['file'] = (string) $v['file']; - if (!$v['valid']) { - ++$errors; - } - }); - - $io->writeln(json_encode($filesInfo, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); - - return min($errors, 1); - } - - private function getFiles(string $fileOrDirectory) - { - if (is_file($fileOrDirectory)) { - yield new \SplFileInfo($fileOrDirectory); - - return; - } - - foreach ($this->getDirectoryIterator($fileOrDirectory) as $file) { - if (!\in_array($file->getExtension(), ['xlf', 'xliff'])) { - continue; - } - - yield $file; - } - } - - private function getDirectoryIterator(string $directory) - { - $default = function ($directory) { - return new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), - \RecursiveIteratorIterator::LEAVES_ONLY - ); - }; - - if (null !== $this->directoryIteratorProvider) { - return ($this->directoryIteratorProvider)($directory, $default); - } - - return $default($directory); - } - - private function isReadable(string $fileOrDirectory) - { - $default = function ($fileOrDirectory) { - return is_readable($fileOrDirectory); - }; - - if (null !== $this->isReadableProvider) { - return ($this->isReadableProvider)($fileOrDirectory, $default); - } - - return $default($fileOrDirectory); - } - - private function getTargetLanguageFromFile(\DOMDocument $xliffContents): ?string - { - foreach ($xliffContents->getElementsByTagName('file')[0]->attributes ?? [] as $attribute) { - if ('target-language' === $attribute->nodeName) { - return $attribute->nodeValue; - } - } - - return null; - } -} diff --git a/vendor/symfony/translation/DataCollector/TranslationDataCollector.php b/vendor/symfony/translation/DataCollector/TranslationDataCollector.php deleted file mode 100644 index 9b6da11..0000000 --- a/vendor/symfony/translation/DataCollector/TranslationDataCollector.php +++ /dev/null @@ -1,174 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\DataCollector; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\HttpKernel\DataCollector\DataCollector; -use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface; -use Symfony\Component\Translation\DataCollectorTranslator; -use Symfony\Component\VarDumper\Cloner\Data; - -/** - * @author Abdellatif Ait boudad <a.aitboudad@gmail.com> - * - * @final since Symfony 4.4 - */ -class TranslationDataCollector extends DataCollector implements LateDataCollectorInterface -{ - private $translator; - - public function __construct(DataCollectorTranslator $translator) - { - $this->translator = $translator; - } - - /** - * {@inheritdoc} - */ - public function lateCollect() - { - $messages = $this->sanitizeCollectedMessages($this->translator->getCollectedMessages()); - - $this->data += $this->computeCount($messages); - $this->data['messages'] = $messages; - - $this->data = $this->cloneVar($this->data); - } - - /** - * {@inheritdoc} - * - * @param \Throwable|null $exception - */ - public function collect(Request $request, Response $response/*, \Throwable $exception = null*/) - { - $this->data['locale'] = $this->translator->getLocale(); - $this->data['fallback_locales'] = $this->translator->getFallbackLocales(); - } - - /** - * {@inheritdoc} - */ - public function reset() - { - $this->data = []; - } - - /** - * @return array|Data - */ - public function getMessages() - { - return isset($this->data['messages']) ? $this->data['messages'] : []; - } - - /** - * @return int - */ - public function getCountMissings() - { - return isset($this->data[DataCollectorTranslator::MESSAGE_MISSING]) ? $this->data[DataCollectorTranslator::MESSAGE_MISSING] : 0; - } - - /** - * @return int - */ - public function getCountFallbacks() - { - return isset($this->data[DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK]) ? $this->data[DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK] : 0; - } - - /** - * @return int - */ - public function getCountDefines() - { - return isset($this->data[DataCollectorTranslator::MESSAGE_DEFINED]) ? $this->data[DataCollectorTranslator::MESSAGE_DEFINED] : 0; - } - - public function getLocale() - { - return !empty($this->data['locale']) ? $this->data['locale'] : null; - } - - /** - * @internal since Symfony 4.2 - */ - public function getFallbackLocales() - { - return (isset($this->data['fallback_locales']) && \count($this->data['fallback_locales']) > 0) ? $this->data['fallback_locales'] : []; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'translation'; - } - - private function sanitizeCollectedMessages(array $messages) - { - $result = []; - foreach ($messages as $key => $message) { - $messageId = $message['locale'].$message['domain'].$message['id']; - - if (!isset($result[$messageId])) { - $message['count'] = 1; - $message['parameters'] = !empty($message['parameters']) ? [$message['parameters']] : []; - $messages[$key]['translation'] = $this->sanitizeString($message['translation']); - $result[$messageId] = $message; - } else { - if (!empty($message['parameters'])) { - $result[$messageId]['parameters'][] = $message['parameters']; - } - - ++$result[$messageId]['count']; - } - - unset($messages[$key]); - } - - return $result; - } - - private function computeCount(array $messages) - { - $count = [ - DataCollectorTranslator::MESSAGE_DEFINED => 0, - DataCollectorTranslator::MESSAGE_MISSING => 0, - DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK => 0, - ]; - - foreach ($messages as $message) { - ++$count[$message['state']]; - } - - return $count; - } - - private function sanitizeString(string $string, int $length = 80) - { - $string = trim(preg_replace('/\s+/', ' ', $string)); - - if (false !== $encoding = mb_detect_encoding($string, null, true)) { - if (mb_strlen($string, $encoding) > $length) { - return mb_substr($string, 0, $length - 3, $encoding).'...'; - } - } elseif (\strlen($string) > $length) { - return substr($string, 0, $length - 3).'...'; - } - - return $string; - } -} diff --git a/vendor/symfony/translation/DataCollectorTranslator.php b/vendor/symfony/translation/DataCollectorTranslator.php deleted file mode 100644 index 1c672b7..0000000 --- a/vendor/symfony/translation/DataCollectorTranslator.php +++ /dev/null @@ -1,182 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -use Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface; -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface; -use Symfony\Contracts\Translation\LocaleAwareInterface; -use Symfony\Contracts\Translation\TranslatorInterface; - -/** - * @author Abdellatif Ait boudad <a.aitboudad@gmail.com> - */ -class DataCollectorTranslator implements LegacyTranslatorInterface, TranslatorInterface, TranslatorBagInterface, WarmableInterface -{ - const MESSAGE_DEFINED = 0; - const MESSAGE_MISSING = 1; - const MESSAGE_EQUALS_FALLBACK = 2; - - /** - * @var TranslatorInterface|TranslatorBagInterface - */ - private $translator; - - private $messages = []; - - /** - * @param TranslatorInterface $translator The translator must implement TranslatorBagInterface - */ - public function __construct($translator) - { - if (!$translator instanceof LegacyTranslatorInterface && !$translator instanceof TranslatorInterface) { - throw new \TypeError(sprintf('Argument 1 passed to %s() must be an instance of %s, %s given.', __METHOD__, TranslatorInterface::class, \is_object($translator) ? \get_class($translator) : \gettype($translator))); - } - if (!$translator instanceof TranslatorBagInterface || !$translator instanceof LocaleAwareInterface) { - throw new InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface, TranslatorBagInterface and LocaleAwareInterface.', \get_class($translator))); - } - - $this->translator = $translator; - } - - /** - * {@inheritdoc} - */ - public function trans($id, array $parameters = [], $domain = null, $locale = null) - { - $trans = $this->translator->trans($id, $parameters, $domain, $locale); - $this->collectMessage($locale, $domain, $id, $trans, $parameters); - - return $trans; - } - - /** - * {@inheritdoc} - * - * @deprecated since Symfony 4.2, use the trans() method instead with a %count% parameter - */ - public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null) - { - if ($this->translator instanceof TranslatorInterface) { - $trans = $this->translator->trans($id, ['%count%' => $number] + $parameters, $domain, $locale); - } else { - $trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale); - } - - $this->collectMessage($locale, $domain, $id, $trans, ['%count%' => $number] + $parameters); - - return $trans; - } - - /** - * {@inheritdoc} - */ - public function setLocale($locale) - { - $this->translator->setLocale($locale); - } - - /** - * {@inheritdoc} - */ - public function getLocale() - { - return $this->translator->getLocale(); - } - - /** - * {@inheritdoc} - */ - public function getCatalogue($locale = null) - { - return $this->translator->getCatalogue($locale); - } - - /** - * {@inheritdoc} - */ - public function warmUp($cacheDir) - { - if ($this->translator instanceof WarmableInterface) { - $this->translator->warmUp($cacheDir); - } - } - - /** - * Gets the fallback locales. - * - * @return array The fallback locales - */ - public function getFallbackLocales() - { - if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) { - return $this->translator->getFallbackLocales(); - } - - return []; - } - - /** - * Passes through all unknown calls onto the translator object. - */ - public function __call($method, $args) - { - return $this->translator->{$method}(...$args); - } - - /** - * @return array - */ - public function getCollectedMessages() - { - return $this->messages; - } - - private function collectMessage(?string $locale, ?string $domain, ?string $id, string $translation, ?array $parameters = []) - { - if (null === $domain) { - $domain = 'messages'; - } - - $id = (string) $id; - $catalogue = $this->translator->getCatalogue($locale); - $locale = $catalogue->getLocale(); - $fallbackLocale = null; - if ($catalogue->defines($id, $domain)) { - $state = self::MESSAGE_DEFINED; - } elseif ($catalogue->has($id, $domain)) { - $state = self::MESSAGE_EQUALS_FALLBACK; - - $fallbackCatalogue = $catalogue->getFallbackCatalogue(); - while ($fallbackCatalogue) { - if ($fallbackCatalogue->defines($id, $domain)) { - $fallbackLocale = $fallbackCatalogue->getLocale(); - break; - } - $fallbackCatalogue = $fallbackCatalogue->getFallbackCatalogue(); - } - } else { - $state = self::MESSAGE_MISSING; - } - - $this->messages[] = [ - 'locale' => $locale, - 'fallbackLocale' => $fallbackLocale, - 'domain' => $domain, - 'id' => $id, - 'translation' => $translation, - 'parameters' => $parameters, - 'state' => $state, - 'transChoiceNumber' => isset($parameters['%count%']) && is_numeric($parameters['%count%']) ? $parameters['%count%'] : null, - ]; - } -} diff --git a/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php b/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php deleted file mode 100644 index 930f36d..0000000 --- a/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * Adds tagged translation.formatter services to translation writer. - */ -class TranslationDumperPass implements CompilerPassInterface -{ - private $writerServiceId; - private $dumperTag; - - public function __construct(string $writerServiceId = 'translation.writer', string $dumperTag = 'translation.dumper') - { - $this->writerServiceId = $writerServiceId; - $this->dumperTag = $dumperTag; - } - - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition($this->writerServiceId)) { - return; - } - - $definition = $container->getDefinition($this->writerServiceId); - - foreach ($container->findTaggedServiceIds($this->dumperTag, true) as $id => $attributes) { - $definition->addMethodCall('addDumper', [$attributes[0]['alias'], new Reference($id)]); - } - } -} diff --git a/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php b/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php deleted file mode 100644 index d08b2ba..0000000 --- a/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\RuntimeException; -use Symfony\Component\DependencyInjection\Reference; - -/** - * Adds tagged translation.extractor services to translation extractor. - */ -class TranslationExtractorPass implements CompilerPassInterface -{ - private $extractorServiceId; - private $extractorTag; - - public function __construct(string $extractorServiceId = 'translation.extractor', string $extractorTag = 'translation.extractor') - { - $this->extractorServiceId = $extractorServiceId; - $this->extractorTag = $extractorTag; - } - - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition($this->extractorServiceId)) { - return; - } - - $definition = $container->getDefinition($this->extractorServiceId); - - foreach ($container->findTaggedServiceIds($this->extractorTag, true) as $id => $attributes) { - if (!isset($attributes[0]['alias'])) { - throw new RuntimeException(sprintf('The alias for the tag "translation.extractor" of service "%s" must be set.', $id)); - } - - $definition->addMethodCall('addExtractor', [$attributes[0]['alias'], new Reference($id)]); - } - } -} diff --git a/vendor/symfony/translation/DependencyInjection/TranslatorPass.php b/vendor/symfony/translation/DependencyInjection/TranslatorPass.php deleted file mode 100644 index ed4a840..0000000 --- a/vendor/symfony/translation/DependencyInjection/TranslatorPass.php +++ /dev/null @@ -1,89 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\DependencyInjection; - -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -class TranslatorPass implements CompilerPassInterface -{ - private $translatorServiceId; - private $readerServiceId; - private $loaderTag; - private $debugCommandServiceId; - private $updateCommandServiceId; - - public function __construct(string $translatorServiceId = 'translator.default', string $readerServiceId = 'translation.reader', string $loaderTag = 'translation.loader', string $debugCommandServiceId = 'console.command.translation_debug', string $updateCommandServiceId = 'console.command.translation_update') - { - $this->translatorServiceId = $translatorServiceId; - $this->readerServiceId = $readerServiceId; - $this->loaderTag = $loaderTag; - $this->debugCommandServiceId = $debugCommandServiceId; - $this->updateCommandServiceId = $updateCommandServiceId; - } - - public function process(ContainerBuilder $container) - { - if (!$container->hasDefinition($this->translatorServiceId)) { - return; - } - - $loaders = []; - $loaderRefs = []; - foreach ($container->findTaggedServiceIds($this->loaderTag, true) as $id => $attributes) { - $loaderRefs[$id] = new Reference($id); - $loaders[$id][] = $attributes[0]['alias']; - if (isset($attributes[0]['legacy-alias'])) { - $loaders[$id][] = $attributes[0]['legacy-alias']; - } - } - - if ($container->hasDefinition($this->readerServiceId)) { - $definition = $container->getDefinition($this->readerServiceId); - foreach ($loaders as $id => $formats) { - foreach ($formats as $format) { - $definition->addMethodCall('addLoader', [$format, $loaderRefs[$id]]); - } - } - } - - $container - ->findDefinition($this->translatorServiceId) - ->replaceArgument(0, ServiceLocatorTagPass::register($container, $loaderRefs)) - ->replaceArgument(3, $loaders) - ; - - if (!$container->hasParameter('twig.default_path')) { - return; - } - - $paths = array_keys($container->getDefinition('twig.template_iterator')->getArgument(2)); - if ($container->hasDefinition($this->debugCommandServiceId)) { - $definition = $container->getDefinition($this->debugCommandServiceId); - $definition->replaceArgument(4, $container->getParameter('twig.default_path')); - - if (\count($definition->getArguments()) > 6) { - $definition->replaceArgument(6, $paths); - } - } - if ($container->hasDefinition($this->updateCommandServiceId)) { - $definition = $container->getDefinition($this->updateCommandServiceId); - $definition->replaceArgument(5, $container->getParameter('twig.default_path')); - - if (\count($definition->getArguments()) > 7) { - $definition->replaceArgument(7, $paths); - } - } - } -} diff --git a/vendor/symfony/translation/Dumper/CsvFileDumper.php b/vendor/symfony/translation/Dumper/CsvFileDumper.php deleted file mode 100644 index bfa8db6..0000000 --- a/vendor/symfony/translation/Dumper/CsvFileDumper.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * CsvFileDumper generates a csv formatted string representation of a message catalogue. - * - * @author Stealth35 - */ -class CsvFileDumper extends FileDumper -{ - private $delimiter = ';'; - private $enclosure = '"'; - - /** - * {@inheritdoc} - */ - public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = []) - { - $handle = fopen('php://memory', 'r+b'); - - foreach ($messages->all($domain) as $source => $target) { - fputcsv($handle, [$source, $target], $this->delimiter, $this->enclosure); - } - - rewind($handle); - $output = stream_get_contents($handle); - fclose($handle); - - return $output; - } - - /** - * Sets the delimiter and escape character for CSV. - * - * @param string $delimiter Delimiter character - * @param string $enclosure Enclosure character - */ - public function setCsvControl($delimiter = ';', $enclosure = '"') - { - $this->delimiter = $delimiter; - $this->enclosure = $enclosure; - } - - /** - * {@inheritdoc} - */ - protected function getExtension() - { - return 'csv'; - } -} diff --git a/vendor/symfony/translation/Dumper/DumperInterface.php b/vendor/symfony/translation/Dumper/DumperInterface.php deleted file mode 100644 index 445b701..0000000 --- a/vendor/symfony/translation/Dumper/DumperInterface.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * DumperInterface is the interface implemented by all translation dumpers. - * There is no common option. - * - * @author Michel Salib <michelsalib@hotmail.com> - */ -interface DumperInterface -{ - /** - * Dumps the message catalogue. - * - * @param array $options Options that are used by the dumper - */ - public function dump(MessageCatalogue $messages, $options = []); -} diff --git a/vendor/symfony/translation/Dumper/FileDumper.php b/vendor/symfony/translation/Dumper/FileDumper.php deleted file mode 100644 index 2009c53..0000000 --- a/vendor/symfony/translation/Dumper/FileDumper.php +++ /dev/null @@ -1,130 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\Exception\RuntimeException; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * FileDumper is an implementation of DumperInterface that dump a message catalogue to file(s). - * - * Options: - * - path (mandatory): the directory where the files should be saved - * - * @author Michel Salib <michelsalib@hotmail.com> - */ -abstract class FileDumper implements DumperInterface -{ - /** - * A template for the relative paths to files. - * - * @var string - */ - protected $relativePathTemplate = '%domain%.%locale%.%extension%'; - - /** - * Sets the template for the relative paths to files. - * - * @param string $relativePathTemplate A template for the relative paths to files - */ - public function setRelativePathTemplate($relativePathTemplate) - { - $this->relativePathTemplate = $relativePathTemplate; - } - - /** - * Sets backup flag. - * - * @param bool $backup - * - * @deprecated since Symfony 4.1 - */ - public function setBackup($backup) - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED); - - if (false !== $backup) { - throw new \LogicException('The backup feature is no longer supported.'); - } - } - - /** - * {@inheritdoc} - */ - public function dump(MessageCatalogue $messages, $options = []) - { - if (!\array_key_exists('path', $options)) { - throw new InvalidArgumentException('The file dumper needs a path option.'); - } - - // save a file for each domain - foreach ($messages->getDomains() as $domain) { - $fullpath = $options['path'].'/'.$this->getRelativePath($domain, $messages->getLocale()); - if (!file_exists($fullpath)) { - $directory = \dirname($fullpath); - if (!file_exists($directory) && !@mkdir($directory, 0777, true)) { - throw new RuntimeException(sprintf('Unable to create directory "%s".', $directory)); - } - } - - $intlDomain = $domain.MessageCatalogue::INTL_DOMAIN_SUFFIX; - $intlMessages = $messages->all($intlDomain); - - if ($intlMessages) { - $intlPath = $options['path'].'/'.$this->getRelativePath($intlDomain, $messages->getLocale()); - file_put_contents($intlPath, $this->formatCatalogue($messages, $intlDomain, $options)); - - $messages->replace([], $intlDomain); - - try { - if ($messages->all($domain)) { - file_put_contents($fullpath, $this->formatCatalogue($messages, $domain, $options)); - } - continue; - } finally { - $messages->replace($intlMessages, $intlDomain); - } - } - - file_put_contents($fullpath, $this->formatCatalogue($messages, $domain, $options)); - } - } - - /** - * Transforms a domain of a message catalogue to its string representation. - * - * @param string $domain - * - * @return string representation - */ - abstract public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = []); - - /** - * Gets the file extension of the dumper. - * - * @return string file extension - */ - abstract protected function getExtension(); - - /** - * Gets the relative file path using the template. - */ - private function getRelativePath(string $domain, string $locale): string - { - return strtr($this->relativePathTemplate, [ - '%domain%' => $domain, - '%locale%' => $locale, - '%extension%' => $this->getExtension(), - ]); - } -} diff --git a/vendor/symfony/translation/Dumper/IcuResFileDumper.php b/vendor/symfony/translation/Dumper/IcuResFileDumper.php deleted file mode 100644 index 829e0d0..0000000 --- a/vendor/symfony/translation/Dumper/IcuResFileDumper.php +++ /dev/null @@ -1,104 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * IcuResDumper generates an ICU ResourceBundle formatted string representation of a message catalogue. - * - * @author Stealth35 - */ -class IcuResFileDumper extends FileDumper -{ - /** - * {@inheritdoc} - */ - protected $relativePathTemplate = '%domain%/%locale%.%extension%'; - - /** - * {@inheritdoc} - */ - public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = []) - { - $data = $indexes = $resources = ''; - - foreach ($messages->all($domain) as $source => $target) { - $indexes .= pack('v', \strlen($data) + 28); - $data .= $source."\0"; - } - - $data .= $this->writePadding($data); - - $keyTop = $this->getPosition($data); - - foreach ($messages->all($domain) as $source => $target) { - $resources .= pack('V', $this->getPosition($data)); - - $data .= pack('V', \strlen($target)) - .mb_convert_encoding($target."\0", 'UTF-16LE', 'UTF-8') - .$this->writePadding($data) - ; - } - - $resOffset = $this->getPosition($data); - - $data .= pack('v', \count($messages->all($domain))) - .$indexes - .$this->writePadding($data) - .$resources - ; - - $bundleTop = $this->getPosition($data); - - $root = pack('V7', - $resOffset + (2 << 28), // Resource Offset + Resource Type - 6, // Index length - $keyTop, // Index keys top - $bundleTop, // Index resources top - $bundleTop, // Index bundle top - \count($messages->all($domain)), // Index max table length - 0 // Index attributes - ); - - $header = pack('vC2v4C12@32', - 32, // Header size - 0xDA, 0x27, // Magic number 1 and 2 - 20, 0, 0, 2, // Rest of the header, ..., Size of a char - 0x52, 0x65, 0x73, 0x42, // Data format identifier - 1, 2, 0, 0, // Data version - 1, 4, 0, 0 // Unicode version - ); - - return $header.$root.$data; - } - - private function writePadding(string $data): ?string - { - $padding = \strlen($data) % 4; - - return $padding ? str_repeat("\xAA", 4 - $padding) : null; - } - - private function getPosition(string $data) - { - return (\strlen($data) + 28) / 4; - } - - /** - * {@inheritdoc} - */ - protected function getExtension() - { - return 'res'; - } -} diff --git a/vendor/symfony/translation/Dumper/IniFileDumper.php b/vendor/symfony/translation/Dumper/IniFileDumper.php deleted file mode 100644 index 45ff961..0000000 --- a/vendor/symfony/translation/Dumper/IniFileDumper.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * IniFileDumper generates an ini formatted string representation of a message catalogue. - * - * @author Stealth35 - */ -class IniFileDumper extends FileDumper -{ - /** - * {@inheritdoc} - */ - public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = []) - { - $output = ''; - - foreach ($messages->all($domain) as $source => $target) { - $escapeTarget = str_replace('"', '\"', $target); - $output .= $source.'="'.$escapeTarget."\"\n"; - } - - return $output; - } - - /** - * {@inheritdoc} - */ - protected function getExtension() - { - return 'ini'; - } -} diff --git a/vendor/symfony/translation/Dumper/JsonFileDumper.php b/vendor/symfony/translation/Dumper/JsonFileDumper.php deleted file mode 100644 index 2af8231..0000000 --- a/vendor/symfony/translation/Dumper/JsonFileDumper.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * JsonFileDumper generates an json formatted string representation of a message catalogue. - * - * @author singles - */ -class JsonFileDumper extends FileDumper -{ - /** - * {@inheritdoc} - */ - public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = []) - { - $flags = $options['json_encoding'] ?? JSON_PRETTY_PRINT; - - return json_encode($messages->all($domain), $flags); - } - - /** - * {@inheritdoc} - */ - protected function getExtension() - { - return 'json'; - } -} diff --git a/vendor/symfony/translation/Dumper/MoFileDumper.php b/vendor/symfony/translation/Dumper/MoFileDumper.php deleted file mode 100644 index 5a96dac..0000000 --- a/vendor/symfony/translation/Dumper/MoFileDumper.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\Loader\MoFileLoader; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * MoFileDumper generates a gettext formatted string representation of a message catalogue. - * - * @author Stealth35 - */ -class MoFileDumper extends FileDumper -{ - /** - * {@inheritdoc} - */ - public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = []) - { - $sources = $targets = $sourceOffsets = $targetOffsets = ''; - $offsets = []; - $size = 0; - - foreach ($messages->all($domain) as $source => $target) { - $offsets[] = array_map('strlen', [$sources, $source, $targets, $target]); - $sources .= "\0".$source; - $targets .= "\0".$target; - ++$size; - } - - $header = [ - 'magicNumber' => MoFileLoader::MO_LITTLE_ENDIAN_MAGIC, - 'formatRevision' => 0, - 'count' => $size, - 'offsetId' => MoFileLoader::MO_HEADER_SIZE, - 'offsetTranslated' => MoFileLoader::MO_HEADER_SIZE + (8 * $size), - 'sizeHashes' => 0, - 'offsetHashes' => MoFileLoader::MO_HEADER_SIZE + (16 * $size), - ]; - - $sourcesSize = \strlen($sources); - $sourcesStart = $header['offsetHashes'] + 1; - - foreach ($offsets as $offset) { - $sourceOffsets .= $this->writeLong($offset[1]) - .$this->writeLong($offset[0] + $sourcesStart); - $targetOffsets .= $this->writeLong($offset[3]) - .$this->writeLong($offset[2] + $sourcesStart + $sourcesSize); - } - - $output = implode('', array_map([$this, 'writeLong'], $header)) - .$sourceOffsets - .$targetOffsets - .$sources - .$targets - ; - - return $output; - } - - /** - * {@inheritdoc} - */ - protected function getExtension() - { - return 'mo'; - } - - private function writeLong($str): string - { - return pack('V*', $str); - } -} diff --git a/vendor/symfony/translation/Dumper/PhpFileDumper.php b/vendor/symfony/translation/Dumper/PhpFileDumper.php deleted file mode 100644 index e77afc2..0000000 --- a/vendor/symfony/translation/Dumper/PhpFileDumper.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * PhpFileDumper generates PHP files from a message catalogue. - * - * @author Michel Salib <michelsalib@hotmail.com> - */ -class PhpFileDumper extends FileDumper -{ - /** - * {@inheritdoc} - */ - public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = []) - { - return "<?php\n\nreturn ".var_export($messages->all($domain), true).";\n"; - } - - /** - * {@inheritdoc} - */ - protected function getExtension() - { - return 'php'; - } -} diff --git a/vendor/symfony/translation/Dumper/PoFileDumper.php b/vendor/symfony/translation/Dumper/PoFileDumper.php deleted file mode 100644 index 2cc9e88..0000000 --- a/vendor/symfony/translation/Dumper/PoFileDumper.php +++ /dev/null @@ -1,137 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * PoFileDumper generates a gettext formatted string representation of a message catalogue. - * - * @author Stealth35 - */ -class PoFileDumper extends FileDumper -{ - /** - * {@inheritdoc} - */ - public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = []) - { - $output = 'msgid ""'."\n"; - $output .= 'msgstr ""'."\n"; - $output .= '"Content-Type: text/plain; charset=UTF-8\n"'."\n"; - $output .= '"Content-Transfer-Encoding: 8bit\n"'."\n"; - $output .= '"Language: '.$messages->getLocale().'\n"'."\n"; - $output .= "\n"; - - $newLine = false; - foreach ($messages->all($domain) as $source => $target) { - if ($newLine) { - $output .= "\n"; - } else { - $newLine = true; - } - $metadata = $messages->getMetadata($source, $domain); - - if (isset($metadata['comments'])) { - $output .= $this->formatComments($metadata['comments']); - } - if (isset($metadata['flags'])) { - $output .= $this->formatComments(implode(',', (array) $metadata['flags']), ','); - } - if (isset($metadata['sources'])) { - $output .= $this->formatComments(implode(' ', (array) $metadata['sources']), ':'); - } - - $sourceRules = $this->getStandardRules($source); - $targetRules = $this->getStandardRules($target); - if (2 == \count($sourceRules) && $targetRules !== []) { - $output .= sprintf('msgid "%s"'."\n", $this->escape($sourceRules[0])); - $output .= sprintf('msgid_plural "%s"'."\n", $this->escape($sourceRules[1])); - foreach ($targetRules as $i => $targetRule) { - $output .= sprintf('msgstr[%d] "%s"'."\n", $i, $this->escape($targetRule)); - } - } else { - $output .= sprintf('msgid "%s"'."\n", $this->escape($source)); - $output .= sprintf('msgstr "%s"'."\n", $this->escape($target)); - } - } - - return $output; - } - - private function getStandardRules(string $id) - { - // Partly copied from TranslatorTrait::trans. - $parts = []; - if (preg_match('/^\|++$/', $id)) { - $parts = explode('|', $id); - } elseif (preg_match_all('/(?:\|\||[^\|])++/', $id, $matches)) { - $parts = $matches[0]; - } - - $intervalRegexp = <<<'EOF' -/^(?P<interval> - ({\s* - (\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*) - \s*}) - - | - - (?P<left_delimiter>[\[\]]) - \s* - (?P<left>-Inf|\-?\d+(\.\d+)?) - \s*,\s* - (?P<right>\+?Inf|\-?\d+(\.\d+)?) - \s* - (?P<right_delimiter>[\[\]]) -)\s*(?P<message>.*?)$/xs -EOF; - - $standardRules = []; - foreach ($parts as $part) { - $part = trim(str_replace('||', '|', $part)); - - if (preg_match($intervalRegexp, $part)) { - // Explicit rule is not a standard rule. - return []; - } else { - $standardRules[] = $part; - } - } - - return $standardRules; - } - - /** - * {@inheritdoc} - */ - protected function getExtension() - { - return 'po'; - } - - private function escape(string $str): string - { - return addcslashes($str, "\0..\37\42\134"); - } - - private function formatComments($comments, string $prefix = ''): ?string - { - $output = null; - - foreach ((array) $comments as $comment) { - $output .= sprintf('#%s %s'."\n", $prefix, $comment); - } - - return $output; - } -} diff --git a/vendor/symfony/translation/Dumper/QtFileDumper.php b/vendor/symfony/translation/Dumper/QtFileDumper.php deleted file mode 100644 index 79a64b2..0000000 --- a/vendor/symfony/translation/Dumper/QtFileDumper.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * QtFileDumper generates ts files from a message catalogue. - * - * @author Benjamin Eberlei <kontakt@beberlei.de> - */ -class QtFileDumper extends FileDumper -{ - /** - * {@inheritdoc} - */ - public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = []) - { - $dom = new \DOMDocument('1.0', 'utf-8'); - $dom->formatOutput = true; - $ts = $dom->appendChild($dom->createElement('TS')); - $context = $ts->appendChild($dom->createElement('context')); - $context->appendChild($dom->createElement('name', $domain)); - - foreach ($messages->all($domain) as $source => $target) { - $message = $context->appendChild($dom->createElement('message')); - $metadata = $messages->getMetadata($source, $domain); - if (isset($metadata['sources'])) { - foreach ((array) $metadata['sources'] as $location) { - $loc = explode(':', $location, 2); - $location = $message->appendChild($dom->createElement('location')); - $location->setAttribute('filename', $loc[0]); - if (isset($loc[1])) { - $location->setAttribute('line', $loc[1]); - } - } - } - $message->appendChild($dom->createElement('source', $source)); - $message->appendChild($dom->createElement('translation', $target)); - } - - return $dom->saveXML(); - } - - /** - * {@inheritdoc} - */ - protected function getExtension() - { - return 'ts'; - } -} diff --git a/vendor/symfony/translation/Dumper/XliffFileDumper.php b/vendor/symfony/translation/Dumper/XliffFileDumper.php deleted file mode 100644 index dd9d788..0000000 --- a/vendor/symfony/translation/Dumper/XliffFileDumper.php +++ /dev/null @@ -1,203 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * XliffFileDumper generates xliff files from a message catalogue. - * - * @author Michel Salib <michelsalib@hotmail.com> - */ -class XliffFileDumper extends FileDumper -{ - /** - * {@inheritdoc} - */ - public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = []) - { - $xliffVersion = '1.2'; - if (\array_key_exists('xliff_version', $options)) { - $xliffVersion = $options['xliff_version']; - } - - if (\array_key_exists('default_locale', $options)) { - $defaultLocale = $options['default_locale']; - } else { - $defaultLocale = \Locale::getDefault(); - } - - if ('1.2' === $xliffVersion) { - return $this->dumpXliff1($defaultLocale, $messages, $domain, $options); - } - if ('2.0' === $xliffVersion) { - return $this->dumpXliff2($defaultLocale, $messages, $domain); - } - - throw new InvalidArgumentException(sprintf('No support implemented for dumping XLIFF version "%s".', $xliffVersion)); - } - - /** - * {@inheritdoc} - */ - protected function getExtension() - { - return 'xlf'; - } - - private function dumpXliff1(string $defaultLocale, MessageCatalogue $messages, ?string $domain, array $options = []) - { - $toolInfo = ['tool-id' => 'symfony', 'tool-name' => 'Symfony']; - if (\array_key_exists('tool_info', $options)) { - $toolInfo = array_merge($toolInfo, $options['tool_info']); - } - - $dom = new \DOMDocument('1.0', 'utf-8'); - $dom->formatOutput = true; - - $xliff = $dom->appendChild($dom->createElement('xliff')); - $xliff->setAttribute('version', '1.2'); - $xliff->setAttribute('xmlns', 'urn:oasis:names:tc:xliff:document:1.2'); - - $xliffFile = $xliff->appendChild($dom->createElement('file')); - $xliffFile->setAttribute('source-language', str_replace('_', '-', $defaultLocale)); - $xliffFile->setAttribute('target-language', str_replace('_', '-', $messages->getLocale())); - $xliffFile->setAttribute('datatype', 'plaintext'); - $xliffFile->setAttribute('original', 'file.ext'); - - $xliffHead = $xliffFile->appendChild($dom->createElement('header')); - $xliffTool = $xliffHead->appendChild($dom->createElement('tool')); - foreach ($toolInfo as $id => $value) { - $xliffTool->setAttribute($id, $value); - } - - $xliffBody = $xliffFile->appendChild($dom->createElement('body')); - foreach ($messages->all($domain) as $source => $target) { - $translation = $dom->createElement('trans-unit'); - - $translation->setAttribute('id', strtr(substr(base64_encode(hash('sha256', $source, true)), 0, 7), '/+', '._')); - $translation->setAttribute('resname', $source); - - $s = $translation->appendChild($dom->createElement('source')); - $s->appendChild($dom->createTextNode($source)); - - // Does the target contain characters requiring a CDATA section? - $text = 1 === preg_match('/[&<>]/', $target) ? $dom->createCDATASection($target) : $dom->createTextNode($target); - - $targetElement = $dom->createElement('target'); - $metadata = $messages->getMetadata($source, $domain); - if ($this->hasMetadataArrayInfo('target-attributes', $metadata)) { - foreach ($metadata['target-attributes'] as $name => $value) { - $targetElement->setAttribute($name, $value); - } - } - $t = $translation->appendChild($targetElement); - $t->appendChild($text); - - if ($this->hasMetadataArrayInfo('notes', $metadata)) { - foreach ($metadata['notes'] as $note) { - if (!isset($note['content'])) { - continue; - } - - $n = $translation->appendChild($dom->createElement('note')); - $n->appendChild($dom->createTextNode($note['content'])); - - if (isset($note['priority'])) { - $n->setAttribute('priority', $note['priority']); - } - - if (isset($note['from'])) { - $n->setAttribute('from', $note['from']); - } - } - } - - $xliffBody->appendChild($translation); - } - - return $dom->saveXML(); - } - - private function dumpXliff2(string $defaultLocale, MessageCatalogue $messages, ?string $domain) - { - $dom = new \DOMDocument('1.0', 'utf-8'); - $dom->formatOutput = true; - - $xliff = $dom->appendChild($dom->createElement('xliff')); - $xliff->setAttribute('xmlns', 'urn:oasis:names:tc:xliff:document:2.0'); - $xliff->setAttribute('version', '2.0'); - $xliff->setAttribute('srcLang', str_replace('_', '-', $defaultLocale)); - $xliff->setAttribute('trgLang', str_replace('_', '-', $messages->getLocale())); - - $xliffFile = $xliff->appendChild($dom->createElement('file')); - if (MessageCatalogue::INTL_DOMAIN_SUFFIX === substr($domain, -($suffixLength = \strlen(MessageCatalogue::INTL_DOMAIN_SUFFIX)))) { - $xliffFile->setAttribute('id', substr($domain, 0, -$suffixLength).'.'.$messages->getLocale()); - } else { - $xliffFile->setAttribute('id', $domain.'.'.$messages->getLocale()); - } - - foreach ($messages->all($domain) as $source => $target) { - $translation = $dom->createElement('unit'); - $translation->setAttribute('id', strtr(substr(base64_encode(hash('sha256', $source, true)), 0, 7), '/+', '._')); - $name = $source; - if (\strlen($source) > 80) { - $name = substr(md5($source), -7); - } - $translation->setAttribute('name', $name); - $metadata = $messages->getMetadata($source, $domain); - - // Add notes section - if ($this->hasMetadataArrayInfo('notes', $metadata)) { - $notesElement = $dom->createElement('notes'); - foreach ($metadata['notes'] as $note) { - $n = $dom->createElement('note'); - $n->appendChild($dom->createTextNode(isset($note['content']) ? $note['content'] : '')); - unset($note['content']); - - foreach ($note as $name => $value) { - $n->setAttribute($name, $value); - } - $notesElement->appendChild($n); - } - $translation->appendChild($notesElement); - } - - $segment = $translation->appendChild($dom->createElement('segment')); - - $s = $segment->appendChild($dom->createElement('source')); - $s->appendChild($dom->createTextNode($source)); - - // Does the target contain characters requiring a CDATA section? - $text = 1 === preg_match('/[&<>]/', $target) ? $dom->createCDATASection($target) : $dom->createTextNode($target); - - $targetElement = $dom->createElement('target'); - if ($this->hasMetadataArrayInfo('target-attributes', $metadata)) { - foreach ($metadata['target-attributes'] as $name => $value) { - $targetElement->setAttribute($name, $value); - } - } - $t = $segment->appendChild($targetElement); - $t->appendChild($text); - - $xliffFile->appendChild($translation); - } - - return $dom->saveXML(); - } - - private function hasMetadataArrayInfo(string $key, array $metadata = null): bool - { - return null !== $metadata && \array_key_exists($key, $metadata) && ($metadata[$key] instanceof \Traversable || \is_array($metadata[$key])); - } -} diff --git a/vendor/symfony/translation/Dumper/YamlFileDumper.php b/vendor/symfony/translation/Dumper/YamlFileDumper.php deleted file mode 100644 index d6e4af8..0000000 --- a/vendor/symfony/translation/Dumper/YamlFileDumper.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Dumper; - -use Symfony\Component\Translation\Exception\LogicException; -use Symfony\Component\Translation\MessageCatalogue; -use Symfony\Component\Translation\Util\ArrayConverter; -use Symfony\Component\Yaml\Yaml; - -/** - * YamlFileDumper generates yaml files from a message catalogue. - * - * @author Michel Salib <michelsalib@hotmail.com> - */ -class YamlFileDumper extends FileDumper -{ - private $extension; - - public function __construct(string $extension = 'yml') - { - $this->extension = $extension; - } - - /** - * {@inheritdoc} - */ - public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = []) - { - if (!class_exists('Symfony\Component\Yaml\Yaml')) { - throw new LogicException('Dumping translations in the YAML format requires the Symfony Yaml component.'); - } - - $data = $messages->all($domain); - - if (isset($options['as_tree']) && $options['as_tree']) { - $data = ArrayConverter::expandToTree($data); - } - - if (isset($options['inline']) && ($inline = (int) $options['inline']) > 0) { - return Yaml::dump($data, $inline); - } - - return Yaml::dump($data); - } - - /** - * {@inheritdoc} - */ - protected function getExtension() - { - return $this->extension; - } -} diff --git a/vendor/symfony/translation/Exception/ExceptionInterface.php b/vendor/symfony/translation/Exception/ExceptionInterface.php deleted file mode 100644 index 8f9c54e..0000000 --- a/vendor/symfony/translation/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Exception; - -/** - * Exception interface for all exceptions thrown by the component. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/vendor/symfony/translation/Exception/InvalidArgumentException.php b/vendor/symfony/translation/Exception/InvalidArgumentException.php deleted file mode 100644 index 90d0669..0000000 --- a/vendor/symfony/translation/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Exception; - -/** - * Base InvalidArgumentException for the Translation component. - * - * @author Abdellatif Ait boudad <a.aitboudad@gmail.com> - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/translation/Exception/InvalidResourceException.php b/vendor/symfony/translation/Exception/InvalidResourceException.php deleted file mode 100644 index cf07943..0000000 --- a/vendor/symfony/translation/Exception/InvalidResourceException.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Exception; - -/** - * Thrown when a resource cannot be loaded. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class InvalidResourceException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/translation/Exception/LogicException.php b/vendor/symfony/translation/Exception/LogicException.php deleted file mode 100644 index 9019c7e..0000000 --- a/vendor/symfony/translation/Exception/LogicException.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Exception; - -/** - * Base LogicException for Translation component. - * - * @author Abdellatif Ait boudad <a.aitboudad@gmail.com> - */ -class LogicException extends \LogicException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/translation/Exception/NotFoundResourceException.php b/vendor/symfony/translation/Exception/NotFoundResourceException.php deleted file mode 100644 index cff73ae..0000000 --- a/vendor/symfony/translation/Exception/NotFoundResourceException.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Exception; - -/** - * Thrown when a resource does not exist. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class NotFoundResourceException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/translation/Exception/RuntimeException.php b/vendor/symfony/translation/Exception/RuntimeException.php deleted file mode 100644 index dcd7940..0000000 --- a/vendor/symfony/translation/Exception/RuntimeException.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Exception; - -/** - * Base RuntimeException for the Translation component. - * - * @author Abdellatif Ait boudad <a.aitboudad@gmail.com> - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/translation/Extractor/AbstractFileExtractor.php b/vendor/symfony/translation/Extractor/AbstractFileExtractor.php deleted file mode 100644 index 618df73..0000000 --- a/vendor/symfony/translation/Extractor/AbstractFileExtractor.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Extractor; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; - -/** - * Base class used by classes that extract translation messages from files. - * - * @author Marcos D. Sánchez <marcosdsanchez@gmail.com> - */ -abstract class AbstractFileExtractor -{ - /** - * @param string|iterable $resource Files, a file or a directory - * - * @return iterable - */ - protected function extractFiles($resource) - { - if (is_iterable($resource)) { - $files = []; - foreach ($resource as $file) { - if ($this->canBeExtracted($file)) { - $files[] = $this->toSplFileInfo($file); - } - } - } elseif (is_file($resource)) { - $files = $this->canBeExtracted($resource) ? [$this->toSplFileInfo($resource)] : []; - } else { - $files = $this->extractFromDirectory($resource); - } - - return $files; - } - - private function toSplFileInfo(string $file): \SplFileInfo - { - return new \SplFileInfo($file); - } - - /** - * @param string $file - * - * @return bool - * - * @throws InvalidArgumentException - */ - protected function isFile($file) - { - if (!is_file($file)) { - throw new InvalidArgumentException(sprintf('The "%s" file does not exist.', $file)); - } - - return true; - } - - /** - * @param string $file - * - * @return bool - */ - abstract protected function canBeExtracted($file); - - /** - * @param string|array $resource Files, a file or a directory - * - * @return iterable files to be extracted - */ - abstract protected function extractFromDirectory($resource); -} diff --git a/vendor/symfony/translation/Extractor/ChainExtractor.php b/vendor/symfony/translation/Extractor/ChainExtractor.php deleted file mode 100644 index 2683f5d..0000000 --- a/vendor/symfony/translation/Extractor/ChainExtractor.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Extractor; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * ChainExtractor extracts translation messages from template files. - * - * @author Michel Salib <michelsalib@hotmail.com> - */ -class ChainExtractor implements ExtractorInterface -{ - /** - * The extractors. - * - * @var ExtractorInterface[] - */ - private $extractors = []; - - /** - * Adds a loader to the translation extractor. - * - * @param string $format The format of the loader - */ - public function addExtractor($format, ExtractorInterface $extractor) - { - $this->extractors[$format] = $extractor; - } - - /** - * {@inheritdoc} - */ - public function setPrefix($prefix) - { - foreach ($this->extractors as $extractor) { - $extractor->setPrefix($prefix); - } - } - - /** - * {@inheritdoc} - */ - public function extract($directory, MessageCatalogue $catalogue) - { - foreach ($this->extractors as $extractor) { - $extractor->extract($directory, $catalogue); - } - } -} diff --git a/vendor/symfony/translation/Extractor/ExtractorInterface.php b/vendor/symfony/translation/Extractor/ExtractorInterface.php deleted file mode 100644 index 91de201..0000000 --- a/vendor/symfony/translation/Extractor/ExtractorInterface.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Extractor; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * Extracts translation messages from a directory or files to the catalogue. - * New found messages are injected to the catalogue using the prefix. - * - * @author Michel Salib <michelsalib@hotmail.com> - */ -interface ExtractorInterface -{ - /** - * Extracts translation messages from files, a file or a directory to the catalogue. - * - * @param string|array $resource Files, a file or a directory - */ - public function extract($resource, MessageCatalogue $catalogue); - - /** - * Sets the prefix that should be used for new found messages. - * - * @param string $prefix The prefix - */ - public function setPrefix($prefix); -} diff --git a/vendor/symfony/translation/Extractor/PhpExtractor.php b/vendor/symfony/translation/Extractor/PhpExtractor.php deleted file mode 100644 index 5237bf6..0000000 --- a/vendor/symfony/translation/Extractor/PhpExtractor.php +++ /dev/null @@ -1,275 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Extractor; - -use Symfony\Component\Finder\Finder; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * PhpExtractor extracts translation messages from a PHP template. - * - * @author Michel Salib <michelsalib@hotmail.com> - */ -class PhpExtractor extends AbstractFileExtractor implements ExtractorInterface -{ - const MESSAGE_TOKEN = 300; - const METHOD_ARGUMENTS_TOKEN = 1000; - const DOMAIN_TOKEN = 1001; - - /** - * Prefix for new found message. - * - * @var string - */ - private $prefix = ''; - - /** - * The sequence that captures translation messages. - * - * @var array - */ - protected $sequences = [ - [ - '->', - 'trans', - '(', - self::MESSAGE_TOKEN, - ',', - self::METHOD_ARGUMENTS_TOKEN, - ',', - self::DOMAIN_TOKEN, - ], - [ - '->', - 'transChoice', - '(', - self::MESSAGE_TOKEN, - ',', - self::METHOD_ARGUMENTS_TOKEN, - ',', - self::METHOD_ARGUMENTS_TOKEN, - ',', - self::DOMAIN_TOKEN, - ], - [ - '->', - 'trans', - '(', - self::MESSAGE_TOKEN, - ], - [ - '->', - 'transChoice', - '(', - self::MESSAGE_TOKEN, - ], - ]; - - /** - * {@inheritdoc} - */ - public function extract($resource, MessageCatalogue $catalog) - { - $files = $this->extractFiles($resource); - foreach ($files as $file) { - $this->parseTokens(token_get_all(file_get_contents($file)), $catalog, $file); - - gc_mem_caches(); - } - } - - /** - * {@inheritdoc} - */ - public function setPrefix($prefix) - { - $this->prefix = $prefix; - } - - /** - * Normalizes a token. - * - * @param mixed $token - * - * @return string|null - */ - protected function normalizeToken($token) - { - if (isset($token[1]) && 'b"' !== $token) { - return $token[1]; - } - - return $token; - } - - /** - * Seeks to a non-whitespace token. - */ - private function seekToNextRelevantToken(\Iterator $tokenIterator) - { - for (; $tokenIterator->valid(); $tokenIterator->next()) { - $t = $tokenIterator->current(); - if (T_WHITESPACE !== $t[0]) { - break; - } - } - } - - private function skipMethodArgument(\Iterator $tokenIterator) - { - $openBraces = 0; - - for (; $tokenIterator->valid(); $tokenIterator->next()) { - $t = $tokenIterator->current(); - - if ('[' === $t[0] || '(' === $t[0]) { - ++$openBraces; - } - - if (']' === $t[0] || ')' === $t[0]) { - --$openBraces; - } - - if ((0 === $openBraces && ',' === $t[0]) || (-1 === $openBraces && ')' === $t[0])) { - break; - } - } - } - - /** - * Extracts the message from the iterator while the tokens - * match allowed message tokens. - */ - private function getValue(\Iterator $tokenIterator) - { - $message = ''; - $docToken = ''; - $docPart = ''; - - for (; $tokenIterator->valid(); $tokenIterator->next()) { - $t = $tokenIterator->current(); - if ('.' === $t) { - // Concatenate with next token - continue; - } - if (!isset($t[1])) { - break; - } - - switch ($t[0]) { - case T_START_HEREDOC: - $docToken = $t[1]; - break; - case T_ENCAPSED_AND_WHITESPACE: - case T_CONSTANT_ENCAPSED_STRING: - if ('' === $docToken) { - $message .= PhpStringTokenParser::parse($t[1]); - } else { - $docPart = $t[1]; - } - break; - case T_END_HEREDOC: - $message .= PhpStringTokenParser::parseDocString($docToken, $docPart); - $docToken = ''; - $docPart = ''; - break; - case T_WHITESPACE: - break; - default: - break 2; - } - } - - return $message; - } - - /** - * Extracts trans message from PHP tokens. - * - * @param array $tokens - * @param string $filename - */ - protected function parseTokens($tokens, MessageCatalogue $catalog/*, string $filename*/) - { - if (\func_num_args() < 3 && __CLASS__ !== static::class && __CLASS__ !== (new \ReflectionMethod($this, __FUNCTION__))->getDeclaringClass()->getName() && !$this instanceof \PHPUnit\Framework\MockObject\MockObject && !$this instanceof \Prophecy\Prophecy\ProphecySubjectInterface) { - @trigger_error(sprintf('The "%s()" method will have a new "string $filename" argument in version 5.0, not defining it is deprecated since Symfony 4.3.', __METHOD__), E_USER_DEPRECATED); - } - $filename = 2 < \func_num_args() ? func_get_arg(2) : ''; - - $tokenIterator = new \ArrayIterator($tokens); - - for ($key = 0; $key < $tokenIterator->count(); ++$key) { - foreach ($this->sequences as $sequence) { - $message = ''; - $domain = 'messages'; - $tokenIterator->seek($key); - - foreach ($sequence as $sequenceKey => $item) { - $this->seekToNextRelevantToken($tokenIterator); - - if ($this->normalizeToken($tokenIterator->current()) === $item) { - $tokenIterator->next(); - continue; - } elseif (self::MESSAGE_TOKEN === $item) { - $message = $this->getValue($tokenIterator); - - if (\count($sequence) === ($sequenceKey + 1)) { - break; - } - } elseif (self::METHOD_ARGUMENTS_TOKEN === $item) { - $this->skipMethodArgument($tokenIterator); - } elseif (self::DOMAIN_TOKEN === $item) { - $domainToken = $this->getValue($tokenIterator); - if ('' !== $domainToken) { - $domain = $domainToken; - } - - break; - } else { - break; - } - } - - if ($message) { - $catalog->set($message, $this->prefix.$message, $domain); - $metadata = $catalog->getMetadata($message, $domain) ?? []; - $normalizedFilename = preg_replace('{[\\\\/]+}', '/', $filename); - $metadata['sources'][] = $normalizedFilename.':'.$tokens[$key][2]; - $catalog->setMetadata($message, $metadata, $domain); - break; - } - } - } - } - - /** - * @param string $file - * - * @return bool - * - * @throws \InvalidArgumentException - */ - protected function canBeExtracted($file) - { - return $this->isFile($file) && 'php' === pathinfo($file, PATHINFO_EXTENSION); - } - - /** - * {@inheritdoc} - */ - protected function extractFromDirectory($directory) - { - $finder = new Finder(); - - return $finder->files()->name('*.php')->in($directory); - } -} diff --git a/vendor/symfony/translation/Extractor/PhpStringTokenParser.php b/vendor/symfony/translation/Extractor/PhpStringTokenParser.php deleted file mode 100644 index 4531e91..0000000 --- a/vendor/symfony/translation/Extractor/PhpStringTokenParser.php +++ /dev/null @@ -1,142 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Extractor; - -/* - * The following is derived from code at http://github.com/nikic/PHP-Parser - * - * Copyright (c) 2011 by Nikita Popov - * - * Some rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * - * * The names of the contributors may not be used to endorse or - * promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -class PhpStringTokenParser -{ - protected static $replacements = [ - '\\' => '\\', - '$' => '$', - 'n' => "\n", - 'r' => "\r", - 't' => "\t", - 'f' => "\f", - 'v' => "\v", - 'e' => "\x1B", - ]; - - /** - * Parses a string token. - * - * @param string $str String token content - * - * @return string The parsed string - */ - public static function parse($str) - { - $bLength = 0; - if ('b' === $str[0]) { - $bLength = 1; - } - - if ('\'' === $str[$bLength]) { - return str_replace( - ['\\\\', '\\\''], - ['\\', '\''], - substr($str, $bLength + 1, -1) - ); - } else { - return self::parseEscapeSequences(substr($str, $bLength + 1, -1), '"'); - } - } - - /** - * Parses escape sequences in strings (all string types apart from single quoted). - * - * @param string $str String without quotes - * @param string|null $quote Quote type - * - * @return string String with escape sequences parsed - */ - public static function parseEscapeSequences($str, $quote) - { - if (null !== $quote) { - $str = str_replace('\\'.$quote, $quote, $str); - } - - return preg_replace_callback( - '~\\\\([\\\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3})~', - [__CLASS__, 'parseCallback'], - $str - ); - } - - private static function parseCallback(array $matches): string - { - $str = $matches[1]; - - if (isset(self::$replacements[$str])) { - return self::$replacements[$str]; - } elseif ('x' === $str[0] || 'X' === $str[0]) { - return \chr(hexdec($str)); - } else { - return \chr(octdec($str)); - } - } - - /** - * Parses a constant doc string. - * - * @param string $startToken Doc string start token content (<<<SMTHG) - * @param string $str String token content - * - * @return string Parsed string - */ - public static function parseDocString($startToken, $str) - { - // strip last newline (thanks tokenizer for sticking it into the string!) - $str = preg_replace('~(\r\n|\n|\r)$~', '', $str); - - // nowdoc string - if (false !== strpos($startToken, '\'')) { - return $str; - } - - return self::parseEscapeSequences($str, null); - } -} diff --git a/vendor/symfony/translation/Formatter/ChoiceMessageFormatterInterface.php b/vendor/symfony/translation/Formatter/ChoiceMessageFormatterInterface.php deleted file mode 100644 index 621dbb2..0000000 --- a/vendor/symfony/translation/Formatter/ChoiceMessageFormatterInterface.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Formatter; - -/** - * @author Abdellatif Ait boudad <a.aitboudad@gmail.com> - * - * @deprecated since Symfony 4.2, use MessageFormatterInterface::format() with a %count% parameter instead - */ -interface ChoiceMessageFormatterInterface -{ - /** - * Formats a localized message pattern with given arguments. - * - * @param string $message The message (may also be an object that can be cast to string) - * @param int $number The number to use to find the indice of the message - * @param string $locale The message locale - * @param array $parameters An array of parameters for the message - * - * @return string - */ - public function choiceFormat($message, $number, $locale, array $parameters = []); -} diff --git a/vendor/symfony/translation/Formatter/MessageFormatter.php b/vendor/symfony/translation/Formatter/MessageFormatter.php deleted file mode 100644 index 030d7a5..0000000 --- a/vendor/symfony/translation/Formatter/MessageFormatter.php +++ /dev/null @@ -1,79 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Formatter; - -use Symfony\Component\Translation\IdentityTranslator; -use Symfony\Component\Translation\MessageSelector; -use Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface; -use Symfony\Contracts\Translation\TranslatorInterface; - -/** - * @author Abdellatif Ait boudad <a.aitboudad@gmail.com> - */ -class MessageFormatter implements MessageFormatterInterface, IntlFormatterInterface, ChoiceMessageFormatterInterface -{ - private $translator; - private $intlFormatter; - - /** - * @param TranslatorInterface|null $translator An identity translator to use as selector for pluralization - */ - public function __construct($translator = null, IntlFormatterInterface $intlFormatter = null) - { - if ($translator instanceof MessageSelector) { - $translator = new IdentityTranslator($translator); - } elseif (null !== $translator && !$translator instanceof TranslatorInterface && !$translator instanceof LegacyTranslatorInterface) { - throw new \TypeError(sprintf('Argument 1 passed to %s() must be an instance of %s, %s given.', __METHOD__, TranslatorInterface::class, \is_object($translator) ? \get_class($translator) : \gettype($translator))); - } - - $this->translator = $translator ?? new IdentityTranslator(); - $this->intlFormatter = $intlFormatter ?? new IntlFormatter(); - } - - /** - * {@inheritdoc} - */ - public function format($message, $locale, array $parameters = []) - { - if ($this->translator instanceof TranslatorInterface) { - return $this->translator->trans($message, $parameters, null, $locale); - } - - return strtr($message, $parameters); - } - - /** - * {@inheritdoc} - */ - public function formatIntl(string $message, string $locale, array $parameters = []): string - { - return $this->intlFormatter->formatIntl($message, $locale, $parameters); - } - - /** - * {@inheritdoc} - * - * @deprecated since Symfony 4.2, use format() with a %count% parameter instead - */ - public function choiceFormat($message, $number, $locale, array $parameters = []) - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the format() one instead with a %%count%% parameter.', __METHOD__), E_USER_DEPRECATED); - - $parameters = ['%count%' => $number] + $parameters; - - if ($this->translator instanceof TranslatorInterface) { - return $this->format($message, $locale, $parameters); - } - - return $this->format($this->translator->transChoice($message, $number, [], null, $locale), $locale, $parameters); - } -} diff --git a/vendor/symfony/translation/Formatter/MessageFormatterInterface.php b/vendor/symfony/translation/Formatter/MessageFormatterInterface.php deleted file mode 100644 index 370c055..0000000 --- a/vendor/symfony/translation/Formatter/MessageFormatterInterface.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Formatter; - -/** - * @author Guilherme Blanco <guilhermeblanco@hotmail.com> - * @author Abdellatif Ait boudad <a.aitboudad@gmail.com> - */ -interface MessageFormatterInterface -{ - /** - * Formats a localized message pattern with given arguments. - * - * @param string $message The message (may also be an object that can be cast to string) - * @param string $locale The message locale - * @param array $parameters An array of parameters for the message - * - * @return string - */ - public function format($message, $locale, array $parameters = []); -} diff --git a/vendor/symfony/translation/IdentityTranslator.php b/vendor/symfony/translation/IdentityTranslator.php deleted file mode 100644 index 87b40bf..0000000 --- a/vendor/symfony/translation/IdentityTranslator.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -use Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface; -use Symfony\Contracts\Translation\TranslatorInterface; -use Symfony\Contracts\Translation\TranslatorTrait; - -/** - * IdentityTranslator does not translate anything. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class IdentityTranslator implements LegacyTranslatorInterface, TranslatorInterface -{ - use TranslatorTrait { - trans as private doTrans; - setLocale as private doSetLocale; - } - - private $selector; - - public function __construct(MessageSelector $selector = null) - { - $this->selector = $selector; - - if (__CLASS__ !== static::class) { - @trigger_error(sprintf('Calling "%s()" is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED); - } - } - - /** - * {@inheritdoc} - */ - public function trans($id, array $parameters = [], $domain = null, $locale = null) - { - return $this->doTrans($id, $parameters, $domain, $locale); - } - - /** - * {@inheritdoc} - */ - public function setLocale($locale) - { - $this->doSetLocale($locale); - } - - /** - * {@inheritdoc} - * - * @deprecated since Symfony 4.2, use the trans() method instead with a %count% parameter - */ - public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null) - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the trans() one instead with a "%%count%%" parameter.', __METHOD__), E_USER_DEPRECATED); - - if ($this->selector) { - return strtr($this->selector->choose((string) $id, $number, $locale ?: $this->getLocale()), $parameters); - } - - return $this->trans($id, ['%count%' => $number] + $parameters, $domain, $locale); - } - - private function getPluralizationRule(int $number, string $locale): int - { - return PluralizationRules::get($number, $locale, false); - } -} diff --git a/vendor/symfony/translation/Interval.php b/vendor/symfony/translation/Interval.php deleted file mode 100644 index 1adc43f..0000000 --- a/vendor/symfony/translation/Interval.php +++ /dev/null @@ -1,112 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.2, use IdentityTranslator instead.', Interval::class), E_USER_DEPRECATED); - -use Symfony\Component\Translation\Exception\InvalidArgumentException; - -/** - * Tests if a given number belongs to a given math interval. - * - * An interval can represent a finite set of numbers: - * - * {1,2,3,4} - * - * An interval can represent numbers between two numbers: - * - * [1, +Inf] - * ]-1,2[ - * - * The left delimiter can be [ (inclusive) or ] (exclusive). - * The right delimiter can be [ (exclusive) or ] (inclusive). - * Beside numbers, you can use -Inf and +Inf for the infinite. - * - * @author Fabien Potencier <fabien@symfony.com> - * - * @see http://en.wikipedia.org/wiki/Interval_%28mathematics%29#The_ISO_notation - * @deprecated since Symfony 4.2, use IdentityTranslator instead - */ -class Interval -{ - /** - * Tests if the given number is in the math interval. - * - * @param int $number A number - * @param string $interval An interval - * - * @return bool - * - * @throws InvalidArgumentException - */ - public static function test($number, $interval) - { - $interval = trim($interval); - - if (!preg_match('/^'.self::getIntervalRegexp().'$/x', $interval, $matches)) { - throw new InvalidArgumentException(sprintf('"%s" is not a valid interval.', $interval)); - } - - if ($matches[1]) { - foreach (explode(',', $matches[2]) as $n) { - if ($number == $n) { - return true; - } - } - } else { - $leftNumber = self::convertNumber($matches['left']); - $rightNumber = self::convertNumber($matches['right']); - - return - ('[' === $matches['left_delimiter'] ? $number >= $leftNumber : $number > $leftNumber) - && (']' === $matches['right_delimiter'] ? $number <= $rightNumber : $number < $rightNumber) - ; - } - - return false; - } - - /** - * Returns a Regexp that matches valid intervals. - * - * @return string A Regexp (without the delimiters) - */ - public static function getIntervalRegexp() - { - return <<<EOF - ({\s* - (\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*) - \s*}) - - | - - (?P<left_delimiter>[\[\]]) - \s* - (?P<left>-Inf|\-?\d+(\.\d+)?) - \s*,\s* - (?P<right>\+?Inf|\-?\d+(\.\d+)?) - \s* - (?P<right_delimiter>[\[\]]) -EOF; - } - - private static function convertNumber(string $number): float - { - if ('-Inf' === $number) { - return log(0); - } elseif ('+Inf' === $number || 'Inf' === $number) { - return -log(0); - } - - return (float) $number; - } -} diff --git a/vendor/symfony/translation/LICENSE b/vendor/symfony/translation/LICENSE deleted file mode 100644 index 9e936ec..0000000 --- a/vendor/symfony/translation/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-2020 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/translation/Loader/ArrayLoader.php b/vendor/symfony/translation/Loader/ArrayLoader.php deleted file mode 100644 index 2e9a428..0000000 --- a/vendor/symfony/translation/Loader/ArrayLoader.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * ArrayLoader loads translations from a PHP array. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class ArrayLoader implements LoaderInterface -{ - /** - * {@inheritdoc} - */ - public function load($resource, $locale, $domain = 'messages') - { - $resource = $this->flatten($resource); - $catalogue = new MessageCatalogue($locale); - $catalogue->add($resource, $domain); - - return $catalogue; - } - - /** - * Flattens an nested array of translations. - * - * The scheme used is: - * 'key' => ['key2' => ['key3' => 'value']] - * Becomes: - * 'key.key2.key3' => 'value' - */ - private function flatten(array $messages): array - { - $result = []; - foreach ($messages as $key => $value) { - if (\is_array($value)) { - foreach ($this->flatten($value) as $k => $v) { - $result[$key.'.'.$k] = $v; - } - } else { - $result[$key] = $value; - } - } - - return $result; - } -} diff --git a/vendor/symfony/translation/Loader/CsvFileLoader.php b/vendor/symfony/translation/Loader/CsvFileLoader.php deleted file mode 100644 index db17bd5..0000000 --- a/vendor/symfony/translation/Loader/CsvFileLoader.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Translation\Exception\NotFoundResourceException; - -/** - * CsvFileLoader loads translations from CSV files. - * - * @author Saša Stamenković <umpirsky@gmail.com> - */ -class CsvFileLoader extends FileLoader -{ - private $delimiter = ';'; - private $enclosure = '"'; - private $escape = '\\'; - - /** - * {@inheritdoc} - */ - protected function loadResource($resource) - { - $messages = []; - - try { - $file = new \SplFileObject($resource, 'rb'); - } catch (\RuntimeException $e) { - throw new NotFoundResourceException(sprintf('Error opening file "%s".', $resource), 0, $e); - } - - $file->setFlags(\SplFileObject::READ_CSV | \SplFileObject::SKIP_EMPTY); - $file->setCsvControl($this->delimiter, $this->enclosure, $this->escape); - - foreach ($file as $data) { - if (false === $data) { - continue; - } - - if ('#' !== substr($data[0], 0, 1) && isset($data[1]) && 2 === \count($data)) { - $messages[$data[0]] = $data[1]; - } - } - - return $messages; - } - - /** - * Sets the delimiter, enclosure, and escape character for CSV. - * - * @param string $delimiter Delimiter character - * @param string $enclosure Enclosure character - * @param string $escape Escape character - */ - public function setCsvControl($delimiter = ';', $enclosure = '"', $escape = '\\') - { - $this->delimiter = $delimiter; - $this->enclosure = $enclosure; - $this->escape = $escape; - } -} diff --git a/vendor/symfony/translation/Loader/FileLoader.php b/vendor/symfony/translation/Loader/FileLoader.php deleted file mode 100644 index 7ec54a3..0000000 --- a/vendor/symfony/translation/Loader/FileLoader.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Translation\Exception\InvalidResourceException; -use Symfony\Component\Translation\Exception\NotFoundResourceException; - -/** - * @author Abdellatif Ait boudad <a.aitboudad@gmail.com> - */ -abstract class FileLoader extends ArrayLoader -{ - /** - * {@inheritdoc} - */ - public function load($resource, $locale, $domain = 'messages') - { - if (!stream_is_local($resource)) { - throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); - } - - if (!file_exists($resource)) { - throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); - } - - $messages = $this->loadResource($resource); - - // empty resource - if (null === $messages) { - $messages = []; - } - - // not an array - if (!\is_array($messages)) { - throw new InvalidResourceException(sprintf('Unable to load file "%s".', $resource)); - } - - $catalogue = parent::load($messages, $locale, $domain); - - if (class_exists('Symfony\Component\Config\Resource\FileResource')) { - $catalogue->addResource(new FileResource($resource)); - } - - return $catalogue; - } - - /** - * @param string $resource - * - * @return array - * - * @throws InvalidResourceException if stream content has an invalid format - */ - abstract protected function loadResource($resource); -} diff --git a/vendor/symfony/translation/Loader/IcuDatFileLoader.php b/vendor/symfony/translation/Loader/IcuDatFileLoader.php deleted file mode 100644 index 7bbf4c2..0000000 --- a/vendor/symfony/translation/Loader/IcuDatFileLoader.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Translation\Exception\InvalidResourceException; -use Symfony\Component\Translation\Exception\NotFoundResourceException; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * IcuResFileLoader loads translations from a resource bundle. - * - * @author stealth35 - */ -class IcuDatFileLoader extends IcuResFileLoader -{ - /** - * {@inheritdoc} - */ - public function load($resource, $locale, $domain = 'messages') - { - if (!stream_is_local($resource.'.dat')) { - throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); - } - - if (!file_exists($resource.'.dat')) { - throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); - } - - try { - $rb = new \ResourceBundle($locale, $resource); - } catch (\Exception $e) { - $rb = null; - } - - if (!$rb) { - throw new InvalidResourceException(sprintf('Cannot load resource "%s"', $resource)); - } elseif (intl_is_failure($rb->getErrorCode())) { - throw new InvalidResourceException($rb->getErrorMessage(), $rb->getErrorCode()); - } - - $messages = $this->flatten($rb); - $catalogue = new MessageCatalogue($locale); - $catalogue->add($messages, $domain); - - if (class_exists('Symfony\Component\Config\Resource\FileResource')) { - $catalogue->addResource(new FileResource($resource.'.dat')); - } - - return $catalogue; - } -} diff --git a/vendor/symfony/translation/Loader/IcuResFileLoader.php b/vendor/symfony/translation/Loader/IcuResFileLoader.php deleted file mode 100644 index 005f260..0000000 --- a/vendor/symfony/translation/Loader/IcuResFileLoader.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Config\Resource\DirectoryResource; -use Symfony\Component\Translation\Exception\InvalidResourceException; -use Symfony\Component\Translation\Exception\NotFoundResourceException; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * IcuResFileLoader loads translations from a resource bundle. - * - * @author stealth35 - */ -class IcuResFileLoader implements LoaderInterface -{ - /** - * {@inheritdoc} - */ - public function load($resource, $locale, $domain = 'messages') - { - if (!stream_is_local($resource)) { - throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); - } - - if (!is_dir($resource)) { - throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); - } - - try { - $rb = new \ResourceBundle($locale, $resource); - } catch (\Exception $e) { - $rb = null; - } - - if (!$rb) { - throw new InvalidResourceException(sprintf('Cannot load resource "%s"', $resource)); - } elseif (intl_is_failure($rb->getErrorCode())) { - throw new InvalidResourceException($rb->getErrorMessage(), $rb->getErrorCode()); - } - - $messages = $this->flatten($rb); - $catalogue = new MessageCatalogue($locale); - $catalogue->add($messages, $domain); - - if (class_exists('Symfony\Component\Config\Resource\DirectoryResource')) { - $catalogue->addResource(new DirectoryResource($resource)); - } - - return $catalogue; - } - - /** - * Flattens an ResourceBundle. - * - * The scheme used is: - * key { key2 { key3 { "value" } } } - * Becomes: - * 'key.key2.key3' => 'value' - * - * This function takes an array by reference and will modify it - * - * @param \ResourceBundle $rb The ResourceBundle that will be flattened - * @param array $messages Used internally for recursive calls - * @param string $path Current path being parsed, used internally for recursive calls - * - * @return array the flattened ResourceBundle - */ - protected function flatten(\ResourceBundle $rb, array &$messages = [], $path = null) - { - foreach ($rb as $key => $value) { - $nodePath = $path ? $path.'.'.$key : $key; - if ($value instanceof \ResourceBundle) { - $this->flatten($value, $messages, $nodePath); - } else { - $messages[$nodePath] = $value; - } - } - - return $messages; - } -} diff --git a/vendor/symfony/translation/Loader/IniFileLoader.php b/vendor/symfony/translation/Loader/IniFileLoader.php deleted file mode 100644 index 11d9b27..0000000 --- a/vendor/symfony/translation/Loader/IniFileLoader.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -/** - * IniFileLoader loads translations from an ini file. - * - * @author stealth35 - */ -class IniFileLoader extends FileLoader -{ - /** - * {@inheritdoc} - */ - protected function loadResource($resource) - { - return parse_ini_file($resource, true); - } -} diff --git a/vendor/symfony/translation/Loader/JsonFileLoader.php b/vendor/symfony/translation/Loader/JsonFileLoader.php deleted file mode 100644 index e3e7c75..0000000 --- a/vendor/symfony/translation/Loader/JsonFileLoader.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Translation\Exception\InvalidResourceException; - -/** - * JsonFileLoader loads translations from an json file. - * - * @author singles - */ -class JsonFileLoader extends FileLoader -{ - /** - * {@inheritdoc} - */ - protected function loadResource($resource) - { - $messages = []; - if ($data = file_get_contents($resource)) { - $messages = json_decode($data, true); - - if (0 < $errorCode = json_last_error()) { - throw new InvalidResourceException(sprintf('Error parsing JSON - %s', $this->getJSONErrorMessage($errorCode))); - } - } - - return $messages; - } - - /** - * Translates JSON_ERROR_* constant into meaningful message. - */ - private function getJSONErrorMessage(int $errorCode): string - { - switch ($errorCode) { - case JSON_ERROR_DEPTH: - return 'Maximum stack depth exceeded'; - case JSON_ERROR_STATE_MISMATCH: - return 'Underflow or the modes mismatch'; - case JSON_ERROR_CTRL_CHAR: - return 'Unexpected control character found'; - case JSON_ERROR_SYNTAX: - return 'Syntax error, malformed JSON'; - case JSON_ERROR_UTF8: - return 'Malformed UTF-8 characters, possibly incorrectly encoded'; - default: - return 'Unknown error'; - } - } -} diff --git a/vendor/symfony/translation/Loader/LoaderInterface.php b/vendor/symfony/translation/Loader/LoaderInterface.php deleted file mode 100644 index 1785402..0000000 --- a/vendor/symfony/translation/Loader/LoaderInterface.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Translation\Exception\InvalidResourceException; -use Symfony\Component\Translation\Exception\NotFoundResourceException; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * LoaderInterface is the interface implemented by all translation loaders. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -interface LoaderInterface -{ - /** - * Loads a locale. - * - * @param mixed $resource A resource - * @param string $locale A locale - * @param string $domain The domain - * - * @return MessageCatalogue A MessageCatalogue instance - * - * @throws NotFoundResourceException when the resource cannot be found - * @throws InvalidResourceException when the resource cannot be loaded - */ - public function load($resource, $locale, $domain = 'messages'); -} diff --git a/vendor/symfony/translation/Loader/MoFileLoader.php b/vendor/symfony/translation/Loader/MoFileLoader.php deleted file mode 100644 index d344c6e..0000000 --- a/vendor/symfony/translation/Loader/MoFileLoader.php +++ /dev/null @@ -1,140 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Translation\Exception\InvalidResourceException; - -/** - * @copyright Copyright (c) 2010, Union of RAD http://union-of-rad.org (http://lithify.me/) - */ -class MoFileLoader extends FileLoader -{ - /** - * Magic used for validating the format of a MO file as well as - * detecting if the machine used to create that file was little endian. - */ - const MO_LITTLE_ENDIAN_MAGIC = 0x950412de; - - /** - * Magic used for validating the format of a MO file as well as - * detecting if the machine used to create that file was big endian. - */ - const MO_BIG_ENDIAN_MAGIC = 0xde120495; - - /** - * The size of the header of a MO file in bytes. - */ - const MO_HEADER_SIZE = 28; - - /** - * Parses machine object (MO) format, independent of the machine's endian it - * was created on. Both 32bit and 64bit systems are supported. - * - * {@inheritdoc} - */ - protected function loadResource($resource) - { - $stream = fopen($resource, 'r'); - - $stat = fstat($stream); - - if ($stat['size'] < self::MO_HEADER_SIZE) { - throw new InvalidResourceException('MO stream content has an invalid format.'); - } - $magic = unpack('V1', fread($stream, 4)); - $magic = hexdec(substr(dechex(current($magic)), -8)); - - if (self::MO_LITTLE_ENDIAN_MAGIC == $magic) { - $isBigEndian = false; - } elseif (self::MO_BIG_ENDIAN_MAGIC == $magic) { - $isBigEndian = true; - } else { - throw new InvalidResourceException('MO stream content has an invalid format.'); - } - - // formatRevision - $this->readLong($stream, $isBigEndian); - $count = $this->readLong($stream, $isBigEndian); - $offsetId = $this->readLong($stream, $isBigEndian); - $offsetTranslated = $this->readLong($stream, $isBigEndian); - // sizeHashes - $this->readLong($stream, $isBigEndian); - // offsetHashes - $this->readLong($stream, $isBigEndian); - - $messages = []; - - for ($i = 0; $i < $count; ++$i) { - $pluralId = null; - $translated = null; - - fseek($stream, $offsetId + $i * 8); - - $length = $this->readLong($stream, $isBigEndian); - $offset = $this->readLong($stream, $isBigEndian); - - if ($length < 1) { - continue; - } - - fseek($stream, $offset); - $singularId = fread($stream, $length); - - if (false !== strpos($singularId, "\000")) { - list($singularId, $pluralId) = explode("\000", $singularId); - } - - fseek($stream, $offsetTranslated + $i * 8); - $length = $this->readLong($stream, $isBigEndian); - $offset = $this->readLong($stream, $isBigEndian); - - if ($length < 1) { - continue; - } - - fseek($stream, $offset); - $translated = fread($stream, $length); - - if (false !== strpos($translated, "\000")) { - $translated = explode("\000", $translated); - } - - $ids = ['singular' => $singularId, 'plural' => $pluralId]; - $item = compact('ids', 'translated'); - - if (!empty($item['ids']['singular'])) { - $id = $item['ids']['singular']; - if (isset($item['ids']['plural'])) { - $id .= '|'.$item['ids']['plural']; - } - $messages[$id] = stripcslashes(implode('|', (array) $item['translated'])); - } - } - - fclose($stream); - - return array_filter($messages); - } - - /** - * Reads an unsigned long from stream respecting endianness. - * - * @param resource $stream - */ - private function readLong($stream, bool $isBigEndian): int - { - $result = unpack($isBigEndian ? 'N1' : 'V1', fread($stream, 4)); - $result = current($result); - - return (int) substr($result, -8); - } -} diff --git a/vendor/symfony/translation/Loader/PhpFileLoader.php b/vendor/symfony/translation/Loader/PhpFileLoader.php deleted file mode 100644 index 0991c3d..0000000 --- a/vendor/symfony/translation/Loader/PhpFileLoader.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -/** - * PhpFileLoader loads translations from PHP files returning an array of translations. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class PhpFileLoader extends FileLoader -{ - private static $cache = []; - - /** - * {@inheritdoc} - */ - protected function loadResource($resource) - { - if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(ini_get('opcache.enable_cli'), FILTER_VALIDATE_BOOLEAN))) { - self::$cache = null; - } - - if (null === self::$cache) { - return require $resource; - } - - if (isset(self::$cache[$resource])) { - return self::$cache[$resource]; - } - - return self::$cache[$resource] = require $resource; - } -} diff --git a/vendor/symfony/translation/Loader/PoFileLoader.php b/vendor/symfony/translation/Loader/PoFileLoader.php deleted file mode 100644 index 5e460fb..0000000 --- a/vendor/symfony/translation/Loader/PoFileLoader.php +++ /dev/null @@ -1,149 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -/** - * @copyright Copyright (c) 2010, Union of RAD https://github.com/UnionOfRAD/lithium - * @copyright Copyright (c) 2012, Clemens Tolboom - */ -class PoFileLoader extends FileLoader -{ - /** - * Parses portable object (PO) format. - * - * From https://www.gnu.org/software/gettext/manual/gettext.html#PO-Files - * we should be able to parse files having: - * - * white-space - * # translator-comments - * #. extracted-comments - * #: reference... - * #, flag... - * #| msgid previous-untranslated-string - * msgid untranslated-string - * msgstr translated-string - * - * extra or different lines are: - * - * #| msgctxt previous-context - * #| msgid previous-untranslated-string - * msgctxt context - * - * #| msgid previous-untranslated-string-singular - * #| msgid_plural previous-untranslated-string-plural - * msgid untranslated-string-singular - * msgid_plural untranslated-string-plural - * msgstr[0] translated-string-case-0 - * ... - * msgstr[N] translated-string-case-n - * - * The definition states: - * - white-space and comments are optional. - * - msgid "" that an empty singleline defines a header. - * - * This parser sacrifices some features of the reference implementation the - * differences to that implementation are as follows. - * - No support for comments spanning multiple lines. - * - Translator and extracted comments are treated as being the same type. - * - Message IDs are allowed to have other encodings as just US-ASCII. - * - * Items with an empty id are ignored. - * - * {@inheritdoc} - */ - protected function loadResource($resource) - { - $stream = fopen($resource, 'r'); - - $defaults = [ - 'ids' => [], - 'translated' => null, - ]; - - $messages = []; - $item = $defaults; - $flags = []; - - while ($line = fgets($stream)) { - $line = trim($line); - - if ('' === $line) { - // Whitespace indicated current item is done - if (!\in_array('fuzzy', $flags)) { - $this->addMessage($messages, $item); - } - $item = $defaults; - $flags = []; - } elseif ('#,' === substr($line, 0, 2)) { - $flags = array_map('trim', explode(',', substr($line, 2))); - } elseif ('msgid "' === substr($line, 0, 7)) { - // We start a new msg so save previous - // TODO: this fails when comments or contexts are added - $this->addMessage($messages, $item); - $item = $defaults; - $item['ids']['singular'] = substr($line, 7, -1); - } elseif ('msgstr "' === substr($line, 0, 8)) { - $item['translated'] = substr($line, 8, -1); - } elseif ('"' === $line[0]) { - $continues = isset($item['translated']) ? 'translated' : 'ids'; - - if (\is_array($item[$continues])) { - end($item[$continues]); - $item[$continues][key($item[$continues])] .= substr($line, 1, -1); - } else { - $item[$continues] .= substr($line, 1, -1); - } - } elseif ('msgid_plural "' === substr($line, 0, 14)) { - $item['ids']['plural'] = substr($line, 14, -1); - } elseif ('msgstr[' === substr($line, 0, 7)) { - $size = strpos($line, ']'); - $item['translated'][(int) substr($line, 7, 1)] = substr($line, $size + 3, -1); - } - } - // save last item - if (!\in_array('fuzzy', $flags)) { - $this->addMessage($messages, $item); - } - fclose($stream); - - return $messages; - } - - /** - * Save a translation item to the messages. - * - * A .po file could contain by error missing plural indexes. We need to - * fix these before saving them. - */ - private function addMessage(array &$messages, array $item) - { - if (!empty($item['ids']['singular'])) { - $id = stripcslashes($item['ids']['singular']); - if (isset($item['ids']['plural'])) { - $id .= '|'.stripcslashes($item['ids']['plural']); - } - - $translated = (array) $item['translated']; - // PO are by definition indexed so sort by index. - ksort($translated); - // Make sure every index is filled. - end($translated); - $count = key($translated); - // Fill missing spots with '-'. - $empties = array_fill(0, $count + 1, '-'); - $translated += $empties; - ksort($translated); - - $messages[$id] = stripcslashes(implode('|', $translated)); - } - } -} diff --git a/vendor/symfony/translation/Loader/QtFileLoader.php b/vendor/symfony/translation/Loader/QtFileLoader.php deleted file mode 100644 index 2d4a4c0..0000000 --- a/vendor/symfony/translation/Loader/QtFileLoader.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Config\Util\XmlUtils; -use Symfony\Component\Translation\Exception\InvalidResourceException; -use Symfony\Component\Translation\Exception\NotFoundResourceException; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * QtFileLoader loads translations from QT Translations XML files. - * - * @author Benjamin Eberlei <kontakt@beberlei.de> - */ -class QtFileLoader implements LoaderInterface -{ - /** - * {@inheritdoc} - */ - public function load($resource, $locale, $domain = 'messages') - { - if (!stream_is_local($resource)) { - throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); - } - - if (!file_exists($resource)) { - throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); - } - - try { - $dom = XmlUtils::loadFile($resource); - } catch (\InvalidArgumentException $e) { - throw new InvalidResourceException(sprintf('Unable to load "%s".', $resource), $e->getCode(), $e); - } - - $internalErrors = libxml_use_internal_errors(true); - libxml_clear_errors(); - - $xpath = new \DOMXPath($dom); - $nodes = $xpath->evaluate('//TS/context/name[text()="'.$domain.'"]'); - - $catalogue = new MessageCatalogue($locale); - if (1 == $nodes->length) { - $translations = $nodes->item(0)->nextSibling->parentNode->parentNode->getElementsByTagName('message'); - foreach ($translations as $translation) { - $translationValue = (string) $translation->getElementsByTagName('translation')->item(0)->nodeValue; - - if (!empty($translationValue)) { - $catalogue->set( - (string) $translation->getElementsByTagName('source')->item(0)->nodeValue, - $translationValue, - $domain - ); - } - $translation = $translation->nextSibling; - } - - if (class_exists('Symfony\Component\Config\Resource\FileResource')) { - $catalogue->addResource(new FileResource($resource)); - } - } - - libxml_use_internal_errors($internalErrors); - - return $catalogue; - } -} diff --git a/vendor/symfony/translation/Loader/XliffFileLoader.php b/vendor/symfony/translation/Loader/XliffFileLoader.php deleted file mode 100644 index 15a6ee5..0000000 --- a/vendor/symfony/translation/Loader/XliffFileLoader.php +++ /dev/null @@ -1,208 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Config\Resource\FileResource; -use Symfony\Component\Config\Util\XmlUtils; -use Symfony\Component\Translation\Exception\InvalidResourceException; -use Symfony\Component\Translation\Exception\NotFoundResourceException; -use Symfony\Component\Translation\MessageCatalogue; -use Symfony\Component\Translation\Util\XliffUtils; - -/** - * XliffFileLoader loads translations from XLIFF files. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class XliffFileLoader implements LoaderInterface -{ - /** - * {@inheritdoc} - */ - public function load($resource, $locale, $domain = 'messages') - { - if (!stream_is_local($resource)) { - throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); - } - - if (!file_exists($resource)) { - throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); - } - - $catalogue = new MessageCatalogue($locale); - $this->extract($resource, $catalogue, $domain); - - if (class_exists('Symfony\Component\Config\Resource\FileResource')) { - $catalogue->addResource(new FileResource($resource)); - } - - return $catalogue; - } - - private function extract($resource, MessageCatalogue $catalogue, string $domain) - { - try { - $dom = XmlUtils::loadFile($resource); - } catch (\InvalidArgumentException $e) { - throw new InvalidResourceException(sprintf('Unable to load "%s": %s', $resource, $e->getMessage()), $e->getCode(), $e); - } - - $xliffVersion = XliffUtils::getVersionNumber($dom); - if ($errors = XliffUtils::validateSchema($dom)) { - throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: %s', $resource, XliffUtils::getErrorsAsString($errors))); - } - - if ('1.2' === $xliffVersion) { - $this->extractXliff1($dom, $catalogue, $domain); - } - - if ('2.0' === $xliffVersion) { - $this->extractXliff2($dom, $catalogue, $domain); - } - } - - /** - * Extract messages and metadata from DOMDocument into a MessageCatalogue. - */ - private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain) - { - $xml = simplexml_import_dom($dom); - $encoding = strtoupper($dom->encoding); - - $namespace = 'urn:oasis:names:tc:xliff:document:1.2'; - $xml->registerXPathNamespace('xliff', $namespace); - - foreach ($xml->xpath('//xliff:file') as $file) { - $fileAttributes = $file->attributes(); - - $file->registerXPathNamespace('xliff', $namespace); - - foreach ($file->xpath('.//xliff:trans-unit') as $translation) { - $attributes = $translation->attributes(); - - if (!(isset($attributes['resname']) || isset($translation->source))) { - continue; - } - - $source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source; - // If the xlf file has another encoding specified, try to convert it because - // simple_xml will always return utf-8 encoded values - $target = $this->utf8ToCharset((string) ($translation->target ?? $translation->source), $encoding); - - $catalogue->set((string) $source, $target, $domain); - - $metadata = [ - 'source' => (string) $translation->source, - 'file' => [ - 'original' => (string) $fileAttributes['original'], - ], - ]; - if ($notes = $this->parseNotesMetadata($translation->note, $encoding)) { - $metadata['notes'] = $notes; - } - - if (isset($translation->target) && $translation->target->attributes()) { - $metadata['target-attributes'] = []; - foreach ($translation->target->attributes() as $key => $value) { - $metadata['target-attributes'][$key] = (string) $value; - } - } - - if (isset($attributes['id'])) { - $metadata['id'] = (string) $attributes['id']; - } - - $catalogue->setMetadata((string) $source, $metadata, $domain); - } - } - } - - private function extractXliff2(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain) - { - $xml = simplexml_import_dom($dom); - $encoding = strtoupper($dom->encoding); - - $xml->registerXPathNamespace('xliff', 'urn:oasis:names:tc:xliff:document:2.0'); - - foreach ($xml->xpath('//xliff:unit') as $unit) { - foreach ($unit->segment as $segment) { - $source = $segment->source; - - // If the xlf file has another encoding specified, try to convert it because - // simple_xml will always return utf-8 encoded values - $target = $this->utf8ToCharset((string) (isset($segment->target) ? $segment->target : $source), $encoding); - - $catalogue->set((string) $source, $target, $domain); - - $metadata = []; - if (isset($segment->target) && $segment->target->attributes()) { - $metadata['target-attributes'] = []; - foreach ($segment->target->attributes() as $key => $value) { - $metadata['target-attributes'][$key] = (string) $value; - } - } - - if (isset($unit->notes)) { - $metadata['notes'] = []; - foreach ($unit->notes->note as $noteNode) { - $note = []; - foreach ($noteNode->attributes() as $key => $value) { - $note[$key] = (string) $value; - } - $note['content'] = (string) $noteNode; - $metadata['notes'][] = $note; - } - } - - $catalogue->setMetadata((string) $source, $metadata, $domain); - } - } - } - - /** - * Convert a UTF8 string to the specified encoding. - */ - private function utf8ToCharset(string $content, string $encoding = null): string - { - if ('UTF-8' !== $encoding && !empty($encoding)) { - return mb_convert_encoding($content, $encoding, 'UTF-8'); - } - - return $content; - } - - private function parseNotesMetadata(\SimpleXMLElement $noteElement = null, string $encoding = null): array - { - $notes = []; - - if (null === $noteElement) { - return $notes; - } - - /** @var \SimpleXMLElement $xmlNote */ - foreach ($noteElement as $xmlNote) { - $noteAttributes = $xmlNote->attributes(); - $note = ['content' => $this->utf8ToCharset((string) $xmlNote, $encoding)]; - if (isset($noteAttributes['priority'])) { - $note['priority'] = (int) $noteAttributes['priority']; - } - - if (isset($noteAttributes['from'])) { - $note['from'] = (string) $noteAttributes['from']; - } - - $notes[] = $note; - } - - return $notes; - } -} diff --git a/vendor/symfony/translation/Loader/YamlFileLoader.php b/vendor/symfony/translation/Loader/YamlFileLoader.php deleted file mode 100644 index 438d7d7..0000000 --- a/vendor/symfony/translation/Loader/YamlFileLoader.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Loader; - -use Symfony\Component\Translation\Exception\InvalidResourceException; -use Symfony\Component\Translation\Exception\LogicException; -use Symfony\Component\Yaml\Exception\ParseException; -use Symfony\Component\Yaml\Parser as YamlParser; -use Symfony\Component\Yaml\Yaml; - -/** - * YamlFileLoader loads translations from Yaml files. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -class YamlFileLoader extends FileLoader -{ - private $yamlParser; - - /** - * {@inheritdoc} - */ - protected function loadResource($resource) - { - if (null === $this->yamlParser) { - if (!class_exists('Symfony\Component\Yaml\Parser')) { - throw new LogicException('Loading translations from the YAML format requires the Symfony Yaml component.'); - } - - $this->yamlParser = new YamlParser(); - } - - try { - $messages = $this->yamlParser->parseFile($resource, Yaml::PARSE_CONSTANT); - } catch (ParseException $e) { - throw new InvalidResourceException(sprintf('Error parsing YAML, invalid file "%s"', $resource), 0, $e); - } - - if (null !== $messages && !\is_array($messages)) { - throw new InvalidResourceException(sprintf('Unable to load file "%s".', $resource)); - } - - return $messages ?: []; - } -} diff --git a/vendor/symfony/translation/LoggingTranslator.php b/vendor/symfony/translation/LoggingTranslator.php deleted file mode 100644 index 812136f..0000000 --- a/vendor/symfony/translation/LoggingTranslator.php +++ /dev/null @@ -1,152 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -use Psr\Log\LoggerInterface; -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface; -use Symfony\Contracts\Translation\LocaleAwareInterface; -use Symfony\Contracts\Translation\TranslatorInterface; - -/** - * @author Abdellatif Ait boudad <a.aitboudad@gmail.com> - */ -class LoggingTranslator implements TranslatorInterface, LegacyTranslatorInterface, TranslatorBagInterface -{ - /** - * @var TranslatorInterface|TranslatorBagInterface - */ - private $translator; - - private $logger; - - /** - * @param TranslatorInterface $translator The translator must implement TranslatorBagInterface - */ - public function __construct($translator, LoggerInterface $logger) - { - if (!$translator instanceof LegacyTranslatorInterface && !$translator instanceof TranslatorInterface) { - throw new \TypeError(sprintf('Argument 1 passed to %s() must be an instance of %s, %s given.', __METHOD__, TranslatorInterface::class, \is_object($translator) ? \get_class($translator) : \gettype($translator))); - } - if (!$translator instanceof TranslatorBagInterface || !$translator instanceof LocaleAwareInterface) { - throw new InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface, TranslatorBagInterface and LocaleAwareInterface.', \get_class($translator))); - } - - $this->translator = $translator; - $this->logger = $logger; - } - - /** - * {@inheritdoc} - */ - public function trans($id, array $parameters = [], $domain = null, $locale = null) - { - $trans = $this->translator->trans($id, $parameters, $domain, $locale); - $this->log($id, $domain, $locale); - - return $trans; - } - - /** - * {@inheritdoc} - * - * @deprecated since Symfony 4.2, use the trans() method instead with a %count% parameter - */ - public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null) - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the trans() one instead with a "%%count%%" parameter.', __METHOD__), E_USER_DEPRECATED); - - if ($this->translator instanceof TranslatorInterface) { - $trans = $this->translator->trans($id, ['%count%' => $number] + $parameters, $domain, $locale); - } else { - $trans = $this->translator->transChoice($id, $number, $parameters, $domain, $locale); - } - - $this->log($id, $domain, $locale); - - return $trans; - } - - /** - * {@inheritdoc} - */ - public function setLocale($locale) - { - $prev = $this->translator->getLocale(); - $this->translator->setLocale($locale); - if ($prev === $locale) { - return; - } - - $this->logger->debug(sprintf('The locale of the translator has changed from "%s" to "%s".', $prev, $locale)); - } - - /** - * {@inheritdoc} - */ - public function getLocale() - { - return $this->translator->getLocale(); - } - - /** - * {@inheritdoc} - */ - public function getCatalogue($locale = null) - { - return $this->translator->getCatalogue($locale); - } - - /** - * Gets the fallback locales. - * - * @return array The fallback locales - */ - public function getFallbackLocales() - { - if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) { - return $this->translator->getFallbackLocales(); - } - - return []; - } - - /** - * Passes through all unknown calls onto the translator object. - */ - public function __call($method, $args) - { - return $this->translator->{$method}(...$args); - } - - /** - * Logs for missing translations. - */ - private function log(?string $id, ?string $domain, ?string $locale) - { - if (null === $domain) { - $domain = 'messages'; - } - - $id = (string) $id; - $catalogue = $this->translator->getCatalogue($locale); - if ($catalogue->defines($id, $domain)) { - return; - } - - if ($catalogue->has($id, $domain)) { - $this->logger->debug('Translation use fallback catalogue.', ['id' => $id, 'domain' => $domain, 'locale' => $catalogue->getLocale()]); - } else { - $this->logger->warning('Translation not found.', ['id' => $id, 'domain' => $domain, 'locale' => $catalogue->getLocale()]); - } - } -} diff --git a/vendor/symfony/translation/MessageCatalogue.php b/vendor/symfony/translation/MessageCatalogue.php deleted file mode 100644 index cde056a..0000000 --- a/vendor/symfony/translation/MessageCatalogue.php +++ /dev/null @@ -1,317 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -use Symfony\Component\Config\Resource\ResourceInterface; -use Symfony\Component\Translation\Exception\LogicException; - -/** - * @author Fabien Potencier <fabien@symfony.com> - */ -class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterface -{ - private $messages = []; - private $metadata = []; - private $resources = []; - private $locale; - private $fallbackCatalogue; - private $parent; - - /** - * @param string $locale The locale - * @param array $messages An array of messages classified by domain - */ - public function __construct(?string $locale, array $messages = []) - { - if (null === $locale) { - @trigger_error(sprintf('Passing "null" to the first argument of the "%s" method has been deprecated since Symfony 4.4 and will throw an error in 5.0.', __METHOD__), E_USER_DEPRECATED); - } - - $this->locale = $locale; - $this->messages = $messages; - } - - /** - * {@inheritdoc} - */ - public function getLocale() - { - return $this->locale; - } - - /** - * {@inheritdoc} - */ - public function getDomains() - { - $domains = []; - $suffixLength = \strlen(self::INTL_DOMAIN_SUFFIX); - - foreach ($this->messages as $domain => $messages) { - if (\strlen($domain) > $suffixLength && false !== $i = strpos($domain, self::INTL_DOMAIN_SUFFIX, -$suffixLength)) { - $domain = substr($domain, 0, $i); - } - $domains[$domain] = $domain; - } - - return array_values($domains); - } - - /** - * {@inheritdoc} - */ - public function all($domain = null) - { - if (null !== $domain) { - return ($this->messages[$domain.self::INTL_DOMAIN_SUFFIX] ?? []) + ($this->messages[$domain] ?? []); - } - - $allMessages = []; - $suffixLength = \strlen(self::INTL_DOMAIN_SUFFIX); - - foreach ($this->messages as $domain => $messages) { - if (\strlen($domain) > $suffixLength && false !== $i = strpos($domain, self::INTL_DOMAIN_SUFFIX, -$suffixLength)) { - $domain = substr($domain, 0, $i); - $allMessages[$domain] = $messages + ($allMessages[$domain] ?? []); - } else { - $allMessages[$domain] = ($allMessages[$domain] ?? []) + $messages; - } - } - - return $allMessages; - } - - /** - * {@inheritdoc} - */ - public function set($id, $translation, $domain = 'messages') - { - $this->add([$id => $translation], $domain); - } - - /** - * {@inheritdoc} - */ - public function has($id, $domain = 'messages') - { - if (isset($this->messages[$domain][$id]) || isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id])) { - return true; - } - - if (null !== $this->fallbackCatalogue) { - return $this->fallbackCatalogue->has($id, $domain); - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function defines($id, $domain = 'messages') - { - return isset($this->messages[$domain][$id]) || isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id]); - } - - /** - * {@inheritdoc} - */ - public function get($id, $domain = 'messages') - { - if (isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id])) { - return $this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id]; - } - - if (isset($this->messages[$domain][$id])) { - return $this->messages[$domain][$id]; - } - - if (null !== $this->fallbackCatalogue) { - return $this->fallbackCatalogue->get($id, $domain); - } - - return $id; - } - - /** - * {@inheritdoc} - */ - public function replace($messages, $domain = 'messages') - { - unset($this->messages[$domain], $this->messages[$domain.self::INTL_DOMAIN_SUFFIX]); - - $this->add($messages, $domain); - } - - /** - * {@inheritdoc} - */ - public function add($messages, $domain = 'messages') - { - if (!isset($this->messages[$domain])) { - $this->messages[$domain] = []; - } - $intlDomain = $domain; - $suffixLength = \strlen(self::INTL_DOMAIN_SUFFIX); - if (\strlen($domain) > $suffixLength && false !== strpos($domain, self::INTL_DOMAIN_SUFFIX, -$suffixLength)) { - $intlDomain .= self::INTL_DOMAIN_SUFFIX; - } - foreach ($messages as $id => $message) { - if (isset($this->messages[$intlDomain]) && \array_key_exists($id, $this->messages[$intlDomain])) { - $this->messages[$intlDomain][$id] = $message; - } else { - $this->messages[$domain][$id] = $message; - } - } - } - - /** - * {@inheritdoc} - */ - public function addCatalogue(MessageCatalogueInterface $catalogue) - { - if ($catalogue->getLocale() !== $this->locale) { - throw new LogicException(sprintf('Cannot add a catalogue for locale "%s" as the current locale for this catalogue is "%s"', $catalogue->getLocale(), $this->locale)); - } - - foreach ($catalogue->all() as $domain => $messages) { - if ($intlMessages = $catalogue->all($domain.self::INTL_DOMAIN_SUFFIX)) { - $this->add($intlMessages, $domain.self::INTL_DOMAIN_SUFFIX); - $messages = array_diff_key($messages, $intlMessages); - } - $this->add($messages, $domain); - } - - foreach ($catalogue->getResources() as $resource) { - $this->addResource($resource); - } - - if ($catalogue instanceof MetadataAwareInterface) { - $metadata = $catalogue->getMetadata('', ''); - $this->addMetadata($metadata); - } - } - - /** - * {@inheritdoc} - */ - public function addFallbackCatalogue(MessageCatalogueInterface $catalogue) - { - // detect circular references - $c = $catalogue; - while ($c = $c->getFallbackCatalogue()) { - if ($c->getLocale() === $this->getLocale()) { - throw new LogicException(sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale())); - } - } - - $c = $this; - do { - if ($c->getLocale() === $catalogue->getLocale()) { - throw new LogicException(sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale())); - } - - foreach ($catalogue->getResources() as $resource) { - $c->addResource($resource); - } - } while ($c = $c->parent); - - $catalogue->parent = $this; - $this->fallbackCatalogue = $catalogue; - - foreach ($catalogue->getResources() as $resource) { - $this->addResource($resource); - } - } - - /** - * {@inheritdoc} - */ - public function getFallbackCatalogue() - { - return $this->fallbackCatalogue; - } - - /** - * {@inheritdoc} - */ - public function getResources() - { - return array_values($this->resources); - } - - /** - * {@inheritdoc} - */ - public function addResource(ResourceInterface $resource) - { - $this->resources[$resource->__toString()] = $resource; - } - - /** - * {@inheritdoc} - */ - public function getMetadata($key = '', $domain = 'messages') - { - if ('' == $domain) { - return $this->metadata; - } - - if (isset($this->metadata[$domain])) { - if ('' == $key) { - return $this->metadata[$domain]; - } - - if (isset($this->metadata[$domain][$key])) { - return $this->metadata[$domain][$key]; - } - } - - return null; - } - - /** - * {@inheritdoc} - */ - public function setMetadata($key, $value, $domain = 'messages') - { - $this->metadata[$domain][$key] = $value; - } - - /** - * {@inheritdoc} - */ - public function deleteMetadata($key = '', $domain = 'messages') - { - if ('' == $domain) { - $this->metadata = []; - } elseif ('' == $key) { - unset($this->metadata[$domain]); - } else { - unset($this->metadata[$domain][$key]); - } - } - - /** - * Adds current values with the new values. - * - * @param array $values Values to add - */ - private function addMetadata(array $values) - { - foreach ($values as $domain => $keys) { - foreach ($keys as $key => $value) { - $this->setMetadata($key, $value, $domain); - } - } - } -} diff --git a/vendor/symfony/translation/MessageCatalogueInterface.php b/vendor/symfony/translation/MessageCatalogueInterface.php deleted file mode 100644 index f3d3f5e..0000000 --- a/vendor/symfony/translation/MessageCatalogueInterface.php +++ /dev/null @@ -1,138 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -use Symfony\Component\Config\Resource\ResourceInterface; - -/** - * MessageCatalogueInterface. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -interface MessageCatalogueInterface -{ - const INTL_DOMAIN_SUFFIX = '+intl-icu'; - - /** - * Gets the catalogue locale. - * - * @return string The locale - */ - public function getLocale(); - - /** - * Gets the domains. - * - * @return array An array of domains - */ - public function getDomains(); - - /** - * Gets the messages within a given domain. - * - * If $domain is null, it returns all messages. - * - * @param string $domain The domain name - * - * @return array An array of messages - */ - public function all($domain = null); - - /** - * Sets a message translation. - * - * @param string $id The message id - * @param string $translation The messages translation - * @param string $domain The domain name - */ - public function set($id, $translation, $domain = 'messages'); - - /** - * Checks if a message has a translation. - * - * @param string $id The message id - * @param string $domain The domain name - * - * @return bool true if the message has a translation, false otherwise - */ - public function has($id, $domain = 'messages'); - - /** - * Checks if a message has a translation (it does not take into account the fallback mechanism). - * - * @param string $id The message id - * @param string $domain The domain name - * - * @return bool true if the message has a translation, false otherwise - */ - public function defines($id, $domain = 'messages'); - - /** - * Gets a message translation. - * - * @param string $id The message id - * @param string $domain The domain name - * - * @return string The message translation - */ - public function get($id, $domain = 'messages'); - - /** - * Sets translations for a given domain. - * - * @param array $messages An array of translations - * @param string $domain The domain name - */ - public function replace($messages, $domain = 'messages'); - - /** - * Adds translations for a given domain. - * - * @param array $messages An array of translations - * @param string $domain The domain name - */ - public function add($messages, $domain = 'messages'); - - /** - * Merges translations from the given Catalogue into the current one. - * - * The two catalogues must have the same locale. - */ - public function addCatalogue(self $catalogue); - - /** - * Merges translations from the given Catalogue into the current one - * only when the translation does not exist. - * - * This is used to provide default translations when they do not exist for the current locale. - */ - public function addFallbackCatalogue(self $catalogue); - - /** - * Gets the fallback catalogue. - * - * @return self|null A MessageCatalogueInterface instance or null when no fallback has been set - */ - public function getFallbackCatalogue(); - - /** - * Returns an array of resources loaded to build this collection. - * - * @return ResourceInterface[] An array of resources - */ - public function getResources(); - - /** - * Adds a resource for this collection. - */ - public function addResource(ResourceInterface $resource); -} diff --git a/vendor/symfony/translation/MessageSelector.php b/vendor/symfony/translation/MessageSelector.php deleted file mode 100644 index 0f0febb..0000000 --- a/vendor/symfony/translation/MessageSelector.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.2, use IdentityTranslator instead.', MessageSelector::class), E_USER_DEPRECATED); - -use Symfony\Component\Translation\Exception\InvalidArgumentException; - -/** - * MessageSelector. - * - * @author Fabien Potencier <fabien@symfony.com> - * @author Bernhard Schussek <bschussek@gmail.com> - * - * @deprecated since Symfony 4.2, use IdentityTranslator instead. - */ -class MessageSelector -{ - /** - * Given a message with different plural translations separated by a - * pipe (|), this method returns the correct portion of the message based - * on the given number, locale and the pluralization rules in the message - * itself. - * - * The message supports two different types of pluralization rules: - * - * interval: {0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples - * indexed: There is one apple|There are %count% apples - * - * The indexed solution can also contain labels (e.g. one: There is one apple). - * This is purely for making the translations more clear - it does not - * affect the functionality. - * - * The two methods can also be mixed: - * {0} There are no apples|one: There is one apple|more: There are %count% apples - * - * @param string $message The message being translated - * @param int|float $number The number of items represented for the message - * @param string $locale The locale to use for choosing - * - * @return string - * - * @throws InvalidArgumentException - */ - public function choose($message, $number, $locale) - { - $parts = []; - if (preg_match('/^\|++$/', $message)) { - $parts = explode('|', $message); - } elseif (preg_match_all('/(?:\|\||[^\|])++/', $message, $matches)) { - $parts = $matches[0]; - } - - $explicitRules = []; - $standardRules = []; - foreach ($parts as $part) { - $part = trim(str_replace('||', '|', $part)); - - if (preg_match('/^(?P<interval>'.Interval::getIntervalRegexp().')\s*(?P<message>.*?)$/xs', $part, $matches)) { - $explicitRules[$matches['interval']] = $matches['message']; - } elseif (preg_match('/^\w+\:\s*(.*?)$/', $part, $matches)) { - $standardRules[] = $matches[1]; - } else { - $standardRules[] = $part; - } - } - - // try to match an explicit rule, then fallback to the standard ones - foreach ($explicitRules as $interval => $m) { - if (Interval::test($number, $interval)) { - return $m; - } - } - - $position = PluralizationRules::get($number, $locale); - - if (!isset($standardRules[$position])) { - // when there's exactly one rule given, and that rule is a standard - // rule, use this rule - if (1 === \count($parts) && isset($standardRules[0])) { - return $standardRules[0]; - } - - throw new InvalidArgumentException(sprintf('Unable to choose a translation for "%s" with locale "%s" for value "%d". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").', $message, $locale, $number)); - } - - return $standardRules[$position]; - } -} diff --git a/vendor/symfony/translation/MetadataAwareInterface.php b/vendor/symfony/translation/MetadataAwareInterface.php deleted file mode 100644 index e93c6fb..0000000 --- a/vendor/symfony/translation/MetadataAwareInterface.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -/** - * MetadataAwareInterface. - * - * @author Fabien Potencier <fabien@symfony.com> - */ -interface MetadataAwareInterface -{ - /** - * Gets metadata for the given domain and key. - * - * Passing an empty domain will return an array with all metadata indexed by - * domain and then by key. Passing an empty key will return an array with all - * metadata for the given domain. - * - * @param string $key The key - * @param string $domain The domain name - * - * @return mixed The value that was set or an array with the domains/keys or null - */ - public function getMetadata($key = '', $domain = 'messages'); - - /** - * Adds metadata to a message domain. - * - * @param string $key The key - * @param mixed $value The value - * @param string $domain The domain name - */ - public function setMetadata($key, $value, $domain = 'messages'); - - /** - * Deletes metadata for the given key and domain. - * - * Passing an empty domain will delete all metadata. Passing an empty key will - * delete all metadata for the given domain. - * - * @param string $key The key - * @param string $domain The domain name - */ - public function deleteMetadata($key = '', $domain = 'messages'); -} diff --git a/vendor/symfony/translation/PluralizationRules.php b/vendor/symfony/translation/PluralizationRules.php deleted file mode 100644 index 77c2760..0000000 --- a/vendor/symfony/translation/PluralizationRules.php +++ /dev/null @@ -1,218 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -/** - * Returns the plural rules for a given locale. - * - * @author Fabien Potencier <fabien@symfony.com> - * - * @deprecated since Symfony 4.2, use IdentityTranslator instead - */ -class PluralizationRules -{ - private static $rules = []; - - /** - * Returns the plural position to use for the given locale and number. - * - * @param int $number The number - * @param string $locale The locale - * - * @return int The plural position - */ - public static function get($number, $locale/*, bool $triggerDeprecation = true*/) - { - if (3 > \func_num_args() || func_get_arg(2)) { - @trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED); - } - - if ('pt_BR' === $locale) { - // temporary set a locale for brazilian - $locale = 'xbr'; - } - - if (\strlen($locale) > 3) { - $locale = substr($locale, 0, -\strlen(strrchr($locale, '_'))); - } - - if (isset(self::$rules[$locale])) { - $return = self::$rules[$locale]($number); - - if (!\is_int($return) || $return < 0) { - return 0; - } - - return $return; - } - - /* - * The plural rules are derived from code of the Zend Framework (2010-09-25), - * which is subject to the new BSD license (http://framework.zend.com/license/new-bsd). - * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) - */ - switch ($locale) { - case 'az': - case 'bo': - case 'dz': - case 'id': - case 'ja': - case 'jv': - case 'ka': - case 'km': - case 'kn': - case 'ko': - case 'ms': - case 'th': - case 'tr': - case 'vi': - case 'zh': - return 0; - - case 'af': - case 'bn': - case 'bg': - case 'ca': - case 'da': - case 'de': - case 'el': - case 'en': - case 'eo': - case 'es': - case 'et': - case 'eu': - case 'fa': - case 'fi': - case 'fo': - case 'fur': - case 'fy': - case 'gl': - case 'gu': - case 'ha': - case 'he': - case 'hu': - case 'is': - case 'it': - case 'ku': - case 'lb': - case 'ml': - case 'mn': - case 'mr': - case 'nah': - case 'nb': - case 'ne': - case 'nl': - case 'nn': - case 'no': - case 'oc': - case 'om': - case 'or': - case 'pa': - case 'pap': - case 'ps': - case 'pt': - case 'so': - case 'sq': - case 'sv': - case 'sw': - case 'ta': - case 'te': - case 'tk': - case 'ur': - case 'zu': - return (1 == $number) ? 0 : 1; - - case 'am': - case 'bh': - case 'fil': - case 'fr': - case 'gun': - case 'hi': - case 'hy': - case 'ln': - case 'mg': - case 'nso': - case 'xbr': - case 'ti': - case 'wa': - return ((0 == $number) || (1 == $number)) ? 0 : 1; - - case 'be': - case 'bs': - case 'hr': - case 'ru': - case 'sh': - case 'sr': - case 'uk': - return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); - - case 'cs': - case 'sk': - return (1 == $number) ? 0 : ((($number >= 2) && ($number <= 4)) ? 1 : 2); - - case 'ga': - return (1 == $number) ? 0 : ((2 == $number) ? 1 : 2); - - case 'lt': - return ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); - - case 'sl': - return (1 == $number % 100) ? 0 : ((2 == $number % 100) ? 1 : (((3 == $number % 100) || (4 == $number % 100)) ? 2 : 3)); - - case 'mk': - return (1 == $number % 10) ? 0 : 1; - - case 'mt': - return (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 1) && ($number % 100 < 11))) ? 1 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 2 : 3)); - - case 'lv': - return (0 == $number) ? 0 : (((1 == $number % 10) && (11 != $number % 100)) ? 1 : 2); - - case 'pl': - return (1 == $number) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 1 : 2); - - case 'cy': - return (1 == $number) ? 0 : ((2 == $number) ? 1 : (((8 == $number) || (11 == $number)) ? 2 : 3)); - - case 'ro': - return (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 0) && ($number % 100 < 20))) ? 1 : 2); - - case 'ar': - return (0 == $number) ? 0 : ((1 == $number) ? 1 : ((2 == $number) ? 2 : ((($number % 100 >= 3) && ($number % 100 <= 10)) ? 3 : ((($number % 100 >= 11) && ($number % 100 <= 99)) ? 4 : 5)))); - - default: - return 0; - } - } - - /** - * Overrides the default plural rule for a given locale. - * - * @param callable $rule A PHP callable - * @param string $locale The locale - */ - public static function set(callable $rule, $locale) - { - @trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.2.', __CLASS__), E_USER_DEPRECATED); - - if ('pt_BR' === $locale) { - // temporary set a locale for brazilian - $locale = 'xbr'; - } - - if (\strlen($locale) > 3) { - $locale = substr($locale, 0, -\strlen(strrchr($locale, '_'))); - } - - self::$rules[$locale] = $rule; - } -} diff --git a/vendor/symfony/translation/README.md b/vendor/symfony/translation/README.md deleted file mode 100644 index f4f1706..0000000 --- a/vendor/symfony/translation/README.md +++ /dev/null @@ -1,31 +0,0 @@ -Translation Component -===================== - -The Translation component provides tools to internationalize your application. - -Getting Started ---------------- - -``` -$ composer require symfony/translation -``` - -```php -use Symfony\Component\Translation\Translator; - -$translator = new Translator('fr_FR'); -$translator->addResource('array', [ - 'Hello World!' => 'Bonjour !', -], 'fr_FR'); - -echo $translator->trans('Hello World!'); // outputs « Bonjour ! » -``` - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/translation.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/vendor/symfony/translation/Reader/TranslationReader.php b/vendor/symfony/translation/Reader/TranslationReader.php deleted file mode 100644 index 2b98345..0000000 --- a/vendor/symfony/translation/Reader/TranslationReader.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Reader; - -use Symfony\Component\Finder\Finder; -use Symfony\Component\Translation\Loader\LoaderInterface; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * TranslationReader reads translation messages from translation files. - * - * @author Michel Salib <michelsalib@hotmail.com> - */ -class TranslationReader implements TranslationReaderInterface -{ - /** - * Loaders used for import. - * - * @var array - */ - private $loaders = []; - - /** - * Adds a loader to the translation extractor. - * - * @param string $format The format of the loader - */ - public function addLoader($format, LoaderInterface $loader) - { - $this->loaders[$format] = $loader; - } - - /** - * {@inheritdoc} - */ - public function read($directory, MessageCatalogue $catalogue) - { - if (!is_dir($directory)) { - return; - } - - foreach ($this->loaders as $format => $loader) { - // load any existing translation files - $finder = new Finder(); - $extension = $catalogue->getLocale().'.'.$format; - $files = $finder->files()->name('*.'.$extension)->in($directory); - foreach ($files as $file) { - $domain = substr($file->getFilename(), 0, -1 * \strlen($extension) - 1); - $catalogue->addCatalogue($loader->load($file->getPathname(), $catalogue->getLocale(), $domain)); - } - } - } -} diff --git a/vendor/symfony/translation/Reader/TranslationReaderInterface.php b/vendor/symfony/translation/Reader/TranslationReaderInterface.php deleted file mode 100644 index 0b2ad33..0000000 --- a/vendor/symfony/translation/Reader/TranslationReaderInterface.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Reader; - -use Symfony\Component\Translation\MessageCatalogue; - -/** - * TranslationReader reads translation messages from translation files. - * - * @author Tobias Nyholm <tobias.nyholm@gmail.com> - */ -interface TranslationReaderInterface -{ - /** - * Reads translation messages from a directory to the catalogue. - * - * @param string $directory - */ - public function read($directory, MessageCatalogue $catalogue); -} diff --git a/vendor/symfony/translation/Resources/bin/translation-status.php b/vendor/symfony/translation/Resources/bin/translation-status.php deleted file mode 100644 index 44918c9..0000000 --- a/vendor/symfony/translation/Resources/bin/translation-status.php +++ /dev/null @@ -1,207 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -$usageInstructions = <<<END - - Usage instructions - ------------------------------------------------------------------------------- - - $ cd symfony-code-root-directory/ - - # show the translation status of all locales - $ php translation-status.php - - # show the translation status of all locales and all their missing translations - $ php translation-status.php -v - - # show the status of a single locale - $ php translation-status.php fr - - # show the status of a single locale and all its missing translations - $ php translation-status.php fr -v - -END; - -$config = [ - // if TRUE, the full list of missing translations is displayed - 'verbose_output' => false, - // NULL = analyze all locales - 'locale_to_analyze' => null, - // the reference files all the other translations are compared to - 'original_files' => [ - 'src/Symfony/Component/Form/Resources/translations/validators.en.xlf', - 'src/Symfony/Component/Security/Core/Resources/translations/security.en.xlf', - 'src/Symfony/Component/Validator/Resources/translations/validators.en.xlf', - ], -]; - -$argc = $_SERVER['argc']; -$argv = $_SERVER['argv']; - -if ($argc > 3) { - echo str_replace('translation-status.php', $argv[0], $usageInstructions); - exit(1); -} - -foreach (array_slice($argv, 1) as $argumentOrOption) { - if (0 === strpos($argumentOrOption, '-')) { - $config['verbose_output'] = true; - } else { - $config['locale_to_analyze'] = $argumentOrOption; - } -} - -foreach ($config['original_files'] as $originalFilePath) { - if (!file_exists($originalFilePath)) { - echo sprintf('The following file does not exist. Make sure that you execute this command at the root dir of the Symfony code repository.%s %s', PHP_EOL, $originalFilePath); - exit(1); - } -} - -$totalMissingTranslations = 0; - -foreach ($config['original_files'] as $originalFilePath) { - $translationFilePaths = findTranslationFiles($originalFilePath, $config['locale_to_analyze']); - $translationStatus = calculateTranslationStatus($originalFilePath, $translationFilePaths); - - $totalMissingTranslations += array_sum(array_map(function ($translation) { - return count($translation['missingKeys']); - }, array_values($translationStatus))); - - printTranslationStatus($originalFilePath, $translationStatus, $config['verbose_output']); -} - -exit($totalMissingTranslations > 0 ? 1 : 0); - -function findTranslationFiles($originalFilePath, $localeToAnalyze) -{ - $translations = []; - - $translationsDir = dirname($originalFilePath); - $originalFileName = basename($originalFilePath); - $translationFileNamePattern = str_replace('.en.', '.*.', $originalFileName); - - $translationFiles = glob($translationsDir.'/'.$translationFileNamePattern, GLOB_NOSORT); - sort($translationFiles); - foreach ($translationFiles as $filePath) { - $locale = extractLocaleFromFilePath($filePath); - - if (null !== $localeToAnalyze && $locale !== $localeToAnalyze) { - continue; - } - - $translations[$locale] = $filePath; - } - - return $translations; -} - -function calculateTranslationStatus($originalFilePath, $translationFilePaths) -{ - $translationStatus = []; - $allTranslationKeys = extractTranslationKeys($originalFilePath); - - foreach ($translationFilePaths as $locale => $translationPath) { - $translatedKeys = extractTranslationKeys($translationPath); - $missingKeys = array_diff_key($allTranslationKeys, $translatedKeys); - - $translationStatus[$locale] = [ - 'total' => count($allTranslationKeys), - 'translated' => count($translatedKeys), - 'missingKeys' => $missingKeys, - ]; - } - - return $translationStatus; -} - -function printTranslationStatus($originalFilePath, $translationStatus, $verboseOutput) -{ - printTitle($originalFilePath); - printTable($translationStatus, $verboseOutput); - echo PHP_EOL.PHP_EOL; -} - -function extractLocaleFromFilePath($filePath) -{ - $parts = explode('.', $filePath); - - return $parts[count($parts) - 2]; -} - -function extractTranslationKeys($filePath) -{ - $translationKeys = []; - $contents = new \SimpleXMLElement(file_get_contents($filePath)); - - foreach ($contents->file->body->{'trans-unit'} as $translationKey) { - $translationId = (string) $translationKey['id']; - $translationKey = (string) $translationKey->source; - - $translationKeys[$translationId] = $translationKey; - } - - return $translationKeys; -} - -function printTitle($title) -{ - echo $title.PHP_EOL; - echo str_repeat('=', strlen($title)).PHP_EOL.PHP_EOL; -} - -function printTable($translations, $verboseOutput) -{ - if (0 === count($translations)) { - echo 'No translations found'; - - return; - } - $longestLocaleNameLength = max(array_map('strlen', array_keys($translations))); - - foreach ($translations as $locale => $translation) { - if ($translation['translated'] > $translation['total']) { - textColorRed(); - } elseif ($translation['translated'] === $translation['total']) { - textColorGreen(); - } - - echo sprintf('| Locale: %-'.$longestLocaleNameLength.'s | Translated: %d/%d', $locale, $translation['translated'], $translation['total']).PHP_EOL; - - textColorNormal(); - - if (true === $verboseOutput && count($translation['missingKeys']) > 0) { - echo str_repeat('-', 80).PHP_EOL; - echo '| Missing Translations:'.PHP_EOL; - - foreach ($translation['missingKeys'] as $id => $content) { - echo sprintf('| (id=%s) %s', $id, $content).PHP_EOL; - } - - echo str_repeat('-', 80).PHP_EOL; - } - } -} - -function textColorGreen() -{ - echo "\033[32m"; -} - -function textColorRed() -{ - echo "\033[31m"; -} - -function textColorNormal() -{ - echo "\033[0m"; -} diff --git a/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd b/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd deleted file mode 100644 index dface62..0000000 --- a/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-strict.xsd +++ /dev/null @@ -1,2223 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -May-19-2004: -- Changed the <choice> for ElemType_header, moving minOccurs="0" maxOccurs="unbounded" from its elements -to <choice> itself. -- Added <choice> for ElemType_trans-unit to allow "any order" for <context-group>, <count-group>, <prop-group>, <note>, and -<alt-trans>. - -Oct-2005 -- updated version info to 1.2 -- equiv-trans attribute to <trans-unit> element -- merged-trans attribute for <group> element -- Add the <seg-source> element as optional in the <trans-unit> and <alt-trans> content models, at the same level as <source> -- Create a new value "seg" for the mtype attribute of the <mrk> element -- Add mid as an optional attribute for the <alt-trans> element - -Nov-14-2005 -- Changed name attribute for <context-group> from required to optional -- Added extension point at <xliff> - -Jan-9-2006 -- Added alttranstype type attribute to <alt-trans>, and values - -Jan-10-2006 -- Corrected error with overwritten purposeValueList -- Corrected name="AttrType_Version", attribute should have been "name" - ---> -<xsd:schema xmlns:xlf="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:oasis:names:tc:xliff:document:1.2" xml:lang="en"> - <!-- Import for xml:lang and xml:space --> - <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/> - <!-- Attributes Lists --> - <xsd:simpleType name="XTend"> - <xsd:restriction base="xsd:string"> - <xsd:pattern value="x-[^\s]+"/> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="context-typeValueList"> - <xsd:annotation> - <xsd:documentation>Values for the attribute 'context-type'.</xsd:documentation> - </xsd:annotation> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="database"> - <xsd:annotation> - <xsd:documentation>Indicates a database content.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="element"> - <xsd:annotation> - <xsd:documentation>Indicates the content of an element within an XML document.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="elementtitle"> - <xsd:annotation> - <xsd:documentation>Indicates the name of an element within an XML document.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="linenumber"> - <xsd:annotation> - <xsd:documentation>Indicates the line number from the sourcefile (see context-type="sourcefile") where the <source> is found.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="numparams"> - <xsd:annotation> - <xsd:documentation>Indicates a the number of parameters contained within the <source>.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="paramnotes"> - <xsd:annotation> - <xsd:documentation>Indicates notes pertaining to the parameters in the <source>.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="record"> - <xsd:annotation> - <xsd:documentation>Indicates the content of a record within a database.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="recordtitle"> - <xsd:annotation> - <xsd:documentation>Indicates the name of a record within a database.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="sourcefile"> - <xsd:annotation> - <xsd:documentation>Indicates the original source file in the case that multiple files are merged to form the original file from which the XLIFF file is created. This differs from the original <file> attribute in that this sourcefile is one of many that make up that file.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="count-typeValueList"> - <xsd:annotation> - <xsd:documentation>Values for the attribute 'count-type'.</xsd:documentation> - </xsd:annotation> - <xsd:restriction base="xsd:NMTOKEN"> - <xsd:enumeration value="num-usages"> - <xsd:annotation> - <xsd:documentation>Indicates the count units are items that are used X times in a certain context; example: this is a reusable text unit which is used 42 times in other texts.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="repetition"> - <xsd:annotation> - <xsd:documentation>Indicates the count units are translation units existing already in the same document.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="total"> - <xsd:annotation> - <xsd:documentation>Indicates a total count.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="InlineDelimitersValueList"> - <xsd:annotation> - <xsd:documentation>Values for the attribute 'ctype' when used other elements than <ph> or <x>.</xsd:documentation> - </xsd:annotation> - <xsd:restriction base="xsd:NMTOKEN"> - <xsd:enumeration value="bold"> - <xsd:annotation> - <xsd:documentation>Indicates a run of bolded text.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="italic"> - <xsd:annotation> - <xsd:documentation>Indicates a run of text in italics.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="underlined"> - <xsd:annotation> - <xsd:documentation>Indicates a run of underlined text.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="link"> - <xsd:annotation> - <xsd:documentation>Indicates a run of hyper-text.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="InlinePlaceholdersValueList"> - <xsd:annotation> - <xsd:documentation>Values for the attribute 'ctype' when used with <ph> or <x>.</xsd:documentation> - </xsd:annotation> - <xsd:restriction base="xsd:NMTOKEN"> - <xsd:enumeration value="image"> - <xsd:annotation> - <xsd:documentation>Indicates a inline image.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="pb"> - <xsd:annotation> - <xsd:documentation>Indicates a page break.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="lb"> - <xsd:annotation> - <xsd:documentation>Indicates a line break.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="mime-typeValueList"> - <xsd:restriction base="xsd:string"> - <xsd:pattern value="(text|multipart|message|application|image|audio|video|model)(/.+)*"/> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="datatypeValueList"> - <xsd:annotation> - <xsd:documentation>Values for the attribute 'datatype'.</xsd:documentation> - </xsd:annotation> - <xsd:restriction base="xsd:NMTOKEN"> - <xsd:enumeration value="asp"> - <xsd:annotation> - <xsd:documentation>Indicates Active Server Page data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="c"> - <xsd:annotation> - <xsd:documentation>Indicates C source file data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="cdf"> - <xsd:annotation> - <xsd:documentation>Indicates Channel Definition Format (CDF) data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="cfm"> - <xsd:annotation> - <xsd:documentation>Indicates ColdFusion data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="cpp"> - <xsd:annotation> - <xsd:documentation>Indicates C++ source file data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="csharp"> - <xsd:annotation> - <xsd:documentation>Indicates C-Sharp data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="cstring"> - <xsd:annotation> - <xsd:documentation>Indicates strings from C, ASM, and driver files data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="csv"> - <xsd:annotation> - <xsd:documentation>Indicates comma-separated values data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="database"> - <xsd:annotation> - <xsd:documentation>Indicates database data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="documentfooter"> - <xsd:annotation> - <xsd:documentation>Indicates portions of document that follows data and contains metadata.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="documentheader"> - <xsd:annotation> - <xsd:documentation>Indicates portions of document that precedes data and contains metadata.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="filedialog"> - <xsd:annotation> - <xsd:documentation>Indicates data from standard UI file operations dialogs (e.g., Open, Save, Save As, Export, Import).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="form"> - <xsd:annotation> - <xsd:documentation>Indicates standard user input screen data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="html"> - <xsd:annotation> - <xsd:documentation>Indicates HyperText Markup Language (HTML) data - document instance.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="htmlbody"> - <xsd:annotation> - <xsd:documentation>Indicates content within an HTML document’s <body> element.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="ini"> - <xsd:annotation> - <xsd:documentation>Indicates Windows INI file data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="interleaf"> - <xsd:annotation> - <xsd:documentation>Indicates Interleaf data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="javaclass"> - <xsd:annotation> - <xsd:documentation>Indicates Java source file data (extension '.java').</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="javapropertyresourcebundle"> - <xsd:annotation> - <xsd:documentation>Indicates Java property resource bundle data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="javalistresourcebundle"> - <xsd:annotation> - <xsd:documentation>Indicates Java list resource bundle data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="javascript"> - <xsd:annotation> - <xsd:documentation>Indicates JavaScript source file data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="jscript"> - <xsd:annotation> - <xsd:documentation>Indicates JScript source file data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="layout"> - <xsd:annotation> - <xsd:documentation>Indicates information relating to formatting.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="lisp"> - <xsd:annotation> - <xsd:documentation>Indicates LISP source file data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="margin"> - <xsd:annotation> - <xsd:documentation>Indicates information relating to margin formats.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="menufile"> - <xsd:annotation> - <xsd:documentation>Indicates a file containing menu.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="messagefile"> - <xsd:annotation> - <xsd:documentation>Indicates numerically identified string table.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="mif"> - <xsd:annotation> - <xsd:documentation>Indicates Maker Interchange Format (MIF) data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="mimetype"> - <xsd:annotation> - <xsd:documentation>Indicates that the datatype attribute value is a MIME Type value and is defined in the mime-type attribute.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="mo"> - <xsd:annotation> - <xsd:documentation>Indicates GNU Machine Object data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="msglib"> - <xsd:annotation> - <xsd:documentation>Indicates Message Librarian strings created by Novell's Message Librarian Tool.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="pagefooter"> - <xsd:annotation> - <xsd:documentation>Indicates information to be displayed at the bottom of each page of a document.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="pageheader"> - <xsd:annotation> - <xsd:documentation>Indicates information to be displayed at the top of each page of a document.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="parameters"> - <xsd:annotation> - <xsd:documentation>Indicates a list of property values (e.g., settings within INI files or preferences dialog).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="pascal"> - <xsd:annotation> - <xsd:documentation>Indicates Pascal source file data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="php"> - <xsd:annotation> - <xsd:documentation>Indicates Hypertext Preprocessor data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="plaintext"> - <xsd:annotation> - <xsd:documentation>Indicates plain text file (no formatting other than, possibly, wrapping).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="po"> - <xsd:annotation> - <xsd:documentation>Indicates GNU Portable Object file.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="report"> - <xsd:annotation> - <xsd:documentation>Indicates dynamically generated user defined document. e.g. Oracle Report, Crystal Report, etc.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="resources"> - <xsd:annotation> - <xsd:documentation>Indicates Windows .NET binary resources.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="resx"> - <xsd:annotation> - <xsd:documentation>Indicates Windows .NET Resources.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="rtf"> - <xsd:annotation> - <xsd:documentation>Indicates Rich Text Format (RTF) data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="sgml"> - <xsd:annotation> - <xsd:documentation>Indicates Standard Generalized Markup Language (SGML) data - document instance.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="sgmldtd"> - <xsd:annotation> - <xsd:documentation>Indicates Standard Generalized Markup Language (SGML) data - Document Type Definition (DTD).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="svg"> - <xsd:annotation> - <xsd:documentation>Indicates Scalable Vector Graphic (SVG) data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="vbscript"> - <xsd:annotation> - <xsd:documentation>Indicates VisualBasic Script source file.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="warning"> - <xsd:annotation> - <xsd:documentation>Indicates warning message.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="winres"> - <xsd:annotation> - <xsd:documentation>Indicates Windows (Win32) resources (i.e. resources extracted from an RC script, a message file, or a compiled file).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="xhtml"> - <xsd:annotation> - <xsd:documentation>Indicates Extensible HyperText Markup Language (XHTML) data - document instance.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="xml"> - <xsd:annotation> - <xsd:documentation>Indicates Extensible Markup Language (XML) data - document instance.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="xmldtd"> - <xsd:annotation> - <xsd:documentation>Indicates Extensible Markup Language (XML) data - Document Type Definition (DTD).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="xsl"> - <xsd:annotation> - <xsd:documentation>Indicates Extensible Stylesheet Language (XSL) data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="xul"> - <xsd:annotation> - <xsd:documentation>Indicates XUL elements.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="mtypeValueList"> - <xsd:annotation> - <xsd:documentation>Values for the attribute 'mtype'.</xsd:documentation> - </xsd:annotation> - <xsd:restriction base="xsd:NMTOKEN"> - <xsd:enumeration value="abbrev"> - <xsd:annotation> - <xsd:documentation>Indicates the marked text is an abbreviation.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="abbreviated-form"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.8: A term resulting from the omission of any part of the full term while designating the same concept.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="abbreviation"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.8.1: An abbreviated form of a simple term resulting from the omission of some of its letters (e.g. 'adj.' for 'adjective').</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="acronym"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.8.4: An abbreviated form of a term made up of letters from the full form of a multiword term strung together into a sequence pronounced only syllabically (e.g. 'radar' for 'radio detecting and ranging').</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="appellation"> - <xsd:annotation> - <xsd:documentation>ISO-12620: A proper-name term, such as the name of an agency or other proper entity.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="collocation"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.18.1: A recurrent word combination characterized by cohesion in that the components of the collocation must co-occur within an utterance or series of utterances, even though they do not necessarily have to maintain immediate proximity to one another.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="common-name"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.5: A synonym for an international scientific term that is used in general discourse in a given language.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="datetime"> - <xsd:annotation> - <xsd:documentation>Indicates the marked text is a date and/or time.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="equation"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.15: An expression used to represent a concept based on a statement that two mathematical expressions are, for instance, equal as identified by the equal sign (=), or assigned to one another by a similar sign.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="expanded-form"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.7: The complete representation of a term for which there is an abbreviated form.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="formula"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.14: Figures, symbols or the like used to express a concept briefly, such as a mathematical or chemical formula.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="head-term"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.1: The concept designation that has been chosen to head a terminological record.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="initialism"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.8.3: An abbreviated form of a term consisting of some of the initial letters of the words making up a multiword term or the term elements making up a compound term when these letters are pronounced individually (e.g. 'BSE' for 'bovine spongiform encephalopathy').</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="international-scientific-term"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.4: A term that is part of an international scientific nomenclature as adopted by an appropriate scientific body.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="internationalism"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.6: A term that has the same or nearly identical orthographic or phonemic form in many languages.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="logical-expression"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.16: An expression used to represent a concept based on mathematical or logical relations, such as statements of inequality, set relationships, Boolean operations, and the like.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="materials-management-unit"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.17: A unit to track object.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="name"> - <xsd:annotation> - <xsd:documentation>Indicates the marked text is a name.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="near-synonym"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.3: A term that represents the same or a very similar concept as another term in the same language, but for which interchangeability is limited to some contexts and inapplicable in others.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="part-number"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.17.2: A unique alphanumeric designation assigned to an object in a manufacturing system.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="phrase"> - <xsd:annotation> - <xsd:documentation>Indicates the marked text is a phrase.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="phraseological-unit"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.18: Any group of two or more words that form a unit, the meaning of which frequently cannot be deduced based on the combined sense of the words making up the phrase.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="protected"> - <xsd:annotation> - <xsd:documentation>Indicates the marked text should not be translated.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="romanized-form"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.12: A form of a term resulting from an operation whereby non-Latin writing systems are converted to the Latin alphabet.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="seg"> - <xsd:annotation> - <xsd:documentation>Indicates that the marked text represents a segment.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="set-phrase"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.18.2: A fixed, lexicalized phrase.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="short-form"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.8.2: A variant of a multiword term that includes fewer words than the full form of the term (e.g. 'Group of Twenty-four' for 'Intergovernmental Group of Twenty-four on International Monetary Affairs').</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="sku"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.17.1: Stock keeping unit, an inventory item identified by a unique alphanumeric designation assigned to an object in an inventory control system.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="standard-text"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.19: A fixed chunk of recurring text.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="symbol"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.13: A designation of a concept by letters, numerals, pictograms or any combination thereof.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="synonym"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.2: Any term that represents the same or a very similar concept as the main entry term in a term entry.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="synonymous-phrase"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.18.3: Phraseological unit in a language that expresses the same semantic content as another phrase in that same language.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="term"> - <xsd:annotation> - <xsd:documentation>Indicates the marked text is a term.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="transcribed-form"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.11: A form of a term resulting from an operation whereby the characters of one writing system are represented by characters from another writing system, taking into account the pronunciation of the characters converted.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="transliterated-form"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.10: A form of a term resulting from an operation whereby the characters of an alphabetic writing system are represented by characters from another alphabetic writing system.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="truncated-term"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.8.5: An abbreviated form of a term resulting from the omission of one or more term elements or syllables (e.g. 'flu' for 'influenza').</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="variant"> - <xsd:annotation> - <xsd:documentation>ISO-12620 2.1.9: One of the alternate forms of a term.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="restypeValueList"> - <xsd:annotation> - <xsd:documentation>Values for the attribute 'restype'.</xsd:documentation> - </xsd:annotation> - <xsd:restriction base="xsd:NMTOKEN"> - <xsd:enumeration value="auto3state"> - <xsd:annotation> - <xsd:documentation>Indicates a Windows RC AUTO3STATE control.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="autocheckbox"> - <xsd:annotation> - <xsd:documentation>Indicates a Windows RC AUTOCHECKBOX control.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="autoradiobutton"> - <xsd:annotation> - <xsd:documentation>Indicates a Windows RC AUTORADIOBUTTON control.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="bedit"> - <xsd:annotation> - <xsd:documentation>Indicates a Windows RC BEDIT control.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="bitmap"> - <xsd:annotation> - <xsd:documentation>Indicates a bitmap, for example a BITMAP resource in Windows.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="button"> - <xsd:annotation> - <xsd:documentation>Indicates a button object, for example a BUTTON control Windows.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="caption"> - <xsd:annotation> - <xsd:documentation>Indicates a caption, such as the caption of a dialog box.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="cell"> - <xsd:annotation> - <xsd:documentation>Indicates the cell in a table, for example the content of the <td> element in HTML.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="checkbox"> - <xsd:annotation> - <xsd:documentation>Indicates check box object, for example a CHECKBOX control in Windows.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="checkboxmenuitem"> - <xsd:annotation> - <xsd:documentation>Indicates a menu item with an associated checkbox.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="checkedlistbox"> - <xsd:annotation> - <xsd:documentation>Indicates a list box, but with a check-box for each item.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="colorchooser"> - <xsd:annotation> - <xsd:documentation>Indicates a color selection dialog.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="combobox"> - <xsd:annotation> - <xsd:documentation>Indicates a combination of edit box and listbox object, for example a COMBOBOX control in Windows.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="comboboxexitem"> - <xsd:annotation> - <xsd:documentation>Indicates an initialization entry of an extended combobox DLGINIT resource block. (code 0x1234).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="comboboxitem"> - <xsd:annotation> - <xsd:documentation>Indicates an initialization entry of a combobox DLGINIT resource block (code 0x0403).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="component"> - <xsd:annotation> - <xsd:documentation>Indicates a UI base class element that cannot be represented by any other element.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="contextmenu"> - <xsd:annotation> - <xsd:documentation>Indicates a context menu.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="ctext"> - <xsd:annotation> - <xsd:documentation>Indicates a Windows RC CTEXT control.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="cursor"> - <xsd:annotation> - <xsd:documentation>Indicates a cursor, for example a CURSOR resource in Windows.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="datetimepicker"> - <xsd:annotation> - <xsd:documentation>Indicates a date/time picker.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="defpushbutton"> - <xsd:annotation> - <xsd:documentation>Indicates a Windows RC DEFPUSHBUTTON control.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="dialog"> - <xsd:annotation> - <xsd:documentation>Indicates a dialog box.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="dlginit"> - <xsd:annotation> - <xsd:documentation>Indicates a Windows RC DLGINIT resource block.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="edit"> - <xsd:annotation> - <xsd:documentation>Indicates an edit box object, for example an EDIT control in Windows.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="file"> - <xsd:annotation> - <xsd:documentation>Indicates a filename.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="filechooser"> - <xsd:annotation> - <xsd:documentation>Indicates a file dialog.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="fn"> - <xsd:annotation> - <xsd:documentation>Indicates a footnote.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="font"> - <xsd:annotation> - <xsd:documentation>Indicates a font name.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="footer"> - <xsd:annotation> - <xsd:documentation>Indicates a footer.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="frame"> - <xsd:annotation> - <xsd:documentation>Indicates a frame object.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="grid"> - <xsd:annotation> - <xsd:documentation>Indicates a XUL grid element.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="groupbox"> - <xsd:annotation> - <xsd:documentation>Indicates a groupbox object, for example a GROUPBOX control in Windows.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="header"> - <xsd:annotation> - <xsd:documentation>Indicates a header item.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="heading"> - <xsd:annotation> - <xsd:documentation>Indicates a heading, such has the content of <h1>, <h2>, etc. in HTML.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="hedit"> - <xsd:annotation> - <xsd:documentation>Indicates a Windows RC HEDIT control.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="hscrollbar"> - <xsd:annotation> - <xsd:documentation>Indicates a horizontal scrollbar.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="icon"> - <xsd:annotation> - <xsd:documentation>Indicates an icon, for example an ICON resource in Windows.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="iedit"> - <xsd:annotation> - <xsd:documentation>Indicates a Windows RC IEDIT control.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="keywords"> - <xsd:annotation> - <xsd:documentation>Indicates keyword list, such as the content of the Keywords meta-data in HTML, or a K footnote in WinHelp RTF.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="label"> - <xsd:annotation> - <xsd:documentation>Indicates a label object.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="linklabel"> - <xsd:annotation> - <xsd:documentation>Indicates a label that is also a HTML link (not necessarily a URL).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="list"> - <xsd:annotation> - <xsd:documentation>Indicates a list (a group of list-items, for example an <ol> or <ul> element in HTML).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="listbox"> - <xsd:annotation> - <xsd:documentation>Indicates a listbox object, for example an LISTBOX control in Windows.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="listitem"> - <xsd:annotation> - <xsd:documentation>Indicates an list item (an entry in a list).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="ltext"> - <xsd:annotation> - <xsd:documentation>Indicates a Windows RC LTEXT control.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="menu"> - <xsd:annotation> - <xsd:documentation>Indicates a menu (a group of menu-items).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="menubar"> - <xsd:annotation> - <xsd:documentation>Indicates a toolbar containing one or more tope level menus.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="menuitem"> - <xsd:annotation> - <xsd:documentation>Indicates a menu item (an entry in a menu).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="menuseparator"> - <xsd:annotation> - <xsd:documentation>Indicates a XUL menuseparator element.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="message"> - <xsd:annotation> - <xsd:documentation>Indicates a message, for example an entry in a MESSAGETABLE resource in Windows.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="monthcalendar"> - <xsd:annotation> - <xsd:documentation>Indicates a calendar control.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="numericupdown"> - <xsd:annotation> - <xsd:documentation>Indicates an edit box beside a spin control.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="panel"> - <xsd:annotation> - <xsd:documentation>Indicates a catch all for rectangular areas.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="popupmenu"> - <xsd:annotation> - <xsd:documentation>Indicates a standalone menu not necessarily associated with a menubar.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="pushbox"> - <xsd:annotation> - <xsd:documentation>Indicates a pushbox object, for example a PUSHBOX control in Windows.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="pushbutton"> - <xsd:annotation> - <xsd:documentation>Indicates a Windows RC PUSHBUTTON control.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="radio"> - <xsd:annotation> - <xsd:documentation>Indicates a radio button object.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="radiobuttonmenuitem"> - <xsd:annotation> - <xsd:documentation>Indicates a menuitem with associated radio button.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="rcdata"> - <xsd:annotation> - <xsd:documentation>Indicates raw data resources for an application.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="row"> - <xsd:annotation> - <xsd:documentation>Indicates a row in a table.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="rtext"> - <xsd:annotation> - <xsd:documentation>Indicates a Windows RC RTEXT control.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="scrollpane"> - <xsd:annotation> - <xsd:documentation>Indicates a user navigable container used to show a portion of a document.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="separator"> - <xsd:annotation> - <xsd:documentation>Indicates a generic divider object (e.g. menu group separator).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="shortcut"> - <xsd:annotation> - <xsd:documentation>Windows accelerators, shortcuts in resource or property files.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="spinner"> - <xsd:annotation> - <xsd:documentation>Indicates a UI control to indicate process activity but not progress.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="splitter"> - <xsd:annotation> - <xsd:documentation>Indicates a splitter bar.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="state3"> - <xsd:annotation> - <xsd:documentation>Indicates a Windows RC STATE3 control.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="statusbar"> - <xsd:annotation> - <xsd:documentation>Indicates a window for providing feedback to the users, like 'read-only', etc.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="string"> - <xsd:annotation> - <xsd:documentation>Indicates a string, for example an entry in a STRINGTABLE resource in Windows.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="tabcontrol"> - <xsd:annotation> - <xsd:documentation>Indicates a layers of controls with a tab to select layers.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="table"> - <xsd:annotation> - <xsd:documentation>Indicates a display and edits regular two-dimensional tables of cells.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="textbox"> - <xsd:annotation> - <xsd:documentation>Indicates a XUL textbox element.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="togglebutton"> - <xsd:annotation> - <xsd:documentation>Indicates a UI button that can be toggled to on or off state.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="toolbar"> - <xsd:annotation> - <xsd:documentation>Indicates an array of controls, usually buttons.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="tooltip"> - <xsd:annotation> - <xsd:documentation>Indicates a pop up tool tip text.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="trackbar"> - <xsd:annotation> - <xsd:documentation>Indicates a bar with a pointer indicating a position within a certain range.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="tree"> - <xsd:annotation> - <xsd:documentation>Indicates a control that displays a set of hierarchical data.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="uri"> - <xsd:annotation> - <xsd:documentation>Indicates a URI (URN or URL).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="userbutton"> - <xsd:annotation> - <xsd:documentation>Indicates a Windows RC USERBUTTON control.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="usercontrol"> - <xsd:annotation> - <xsd:documentation>Indicates a user-defined control like CONTROL control in Windows.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="var"> - <xsd:annotation> - <xsd:documentation>Indicates the text of a variable.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="versioninfo"> - <xsd:annotation> - <xsd:documentation>Indicates version information about a resource like VERSIONINFO in Windows.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="vscrollbar"> - <xsd:annotation> - <xsd:documentation>Indicates a vertical scrollbar.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="window"> - <xsd:annotation> - <xsd:documentation>Indicates a graphical window.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="size-unitValueList"> - <xsd:annotation> - <xsd:documentation>Values for the attribute 'size-unit'.</xsd:documentation> - </xsd:annotation> - <xsd:restriction base="xsd:NMTOKEN"> - <xsd:enumeration value="byte"> - <xsd:annotation> - <xsd:documentation>Indicates a size in 8-bit bytes.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="char"> - <xsd:annotation> - <xsd:documentation>Indicates a size in Unicode characters.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="col"> - <xsd:annotation> - <xsd:documentation>Indicates a size in columns. Used for HTML text area.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="cm"> - <xsd:annotation> - <xsd:documentation>Indicates a size in centimeters.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="dlgunit"> - <xsd:annotation> - <xsd:documentation>Indicates a size in dialog units, as defined in Windows resources.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="em"> - <xsd:annotation> - <xsd:documentation>Indicates a size in 'font-size' units (as defined in CSS).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="ex"> - <xsd:annotation> - <xsd:documentation>Indicates a size in 'x-height' units (as defined in CSS).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="glyph"> - <xsd:annotation> - <xsd:documentation>Indicates a size in glyphs. A glyph is considered to be one or more combined Unicode characters that represent a single displayable text character. Sometimes referred to as a 'grapheme cluster'</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="in"> - <xsd:annotation> - <xsd:documentation>Indicates a size in inches.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="mm"> - <xsd:annotation> - <xsd:documentation>Indicates a size in millimeters.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="percent"> - <xsd:annotation> - <xsd:documentation>Indicates a size in percentage.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="pixel"> - <xsd:annotation> - <xsd:documentation>Indicates a size in pixels.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="point"> - <xsd:annotation> - <xsd:documentation>Indicates a size in point.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="row"> - <xsd:annotation> - <xsd:documentation>Indicates a size in rows. Used for HTML text area.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="stateValueList"> - <xsd:annotation> - <xsd:documentation>Values for the attribute 'state'.</xsd:documentation> - </xsd:annotation> - <xsd:restriction base="xsd:NMTOKEN"> - <xsd:enumeration value="final"> - <xsd:annotation> - <xsd:documentation>Indicates the terminating state.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="needs-adaptation"> - <xsd:annotation> - <xsd:documentation>Indicates only non-textual information needs adaptation.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="needs-l10n"> - <xsd:annotation> - <xsd:documentation>Indicates both text and non-textual information needs adaptation.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="needs-review-adaptation"> - <xsd:annotation> - <xsd:documentation>Indicates only non-textual information needs review.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="needs-review-l10n"> - <xsd:annotation> - <xsd:documentation>Indicates both text and non-textual information needs review.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="needs-review-translation"> - <xsd:annotation> - <xsd:documentation>Indicates that only the text of the item needs to be reviewed.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="needs-translation"> - <xsd:annotation> - <xsd:documentation>Indicates that the item needs to be translated.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="new"> - <xsd:annotation> - <xsd:documentation>Indicates that the item is new. For example, translation units that were not in a previous version of the document.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="signed-off"> - <xsd:annotation> - <xsd:documentation>Indicates that changes are reviewed and approved.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="translated"> - <xsd:annotation> - <xsd:documentation>Indicates that the item has been translated.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="state-qualifierValueList"> - <xsd:annotation> - <xsd:documentation>Values for the attribute 'state-qualifier'.</xsd:documentation> - </xsd:annotation> - <xsd:restriction base="xsd:NMTOKEN"> - <xsd:enumeration value="exact-match"> - <xsd:annotation> - <xsd:documentation>Indicates an exact match. An exact match occurs when a source text of a segment is exactly the same as the source text of a segment that was translated previously.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="fuzzy-match"> - <xsd:annotation> - <xsd:documentation>Indicates a fuzzy match. A fuzzy match occurs when a source text of a segment is very similar to the source text of a segment that was translated previously (e.g. when the difference is casing, a few changed words, white-space discripancy, etc.).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="id-match"> - <xsd:annotation> - <xsd:documentation>Indicates a match based on matching IDs (in addition to matching text).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="leveraged-glossary"> - <xsd:annotation> - <xsd:documentation>Indicates a translation derived from a glossary.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="leveraged-inherited"> - <xsd:annotation> - <xsd:documentation>Indicates a translation derived from existing translation.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="leveraged-mt"> - <xsd:annotation> - <xsd:documentation>Indicates a translation derived from machine translation.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="leveraged-repository"> - <xsd:annotation> - <xsd:documentation>Indicates a translation derived from a translation repository.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="leveraged-tm"> - <xsd:annotation> - <xsd:documentation>Indicates a translation derived from a translation memory.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="mt-suggestion"> - <xsd:annotation> - <xsd:documentation>Indicates the translation is suggested by machine translation.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="rejected-grammar"> - <xsd:annotation> - <xsd:documentation>Indicates that the item has been rejected because of incorrect grammar.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="rejected-inaccurate"> - <xsd:annotation> - <xsd:documentation>Indicates that the item has been rejected because it is incorrect.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="rejected-length"> - <xsd:annotation> - <xsd:documentation>Indicates that the item has been rejected because it is too long or too short.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="rejected-spelling"> - <xsd:annotation> - <xsd:documentation>Indicates that the item has been rejected because of incorrect spelling.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="tm-suggestion"> - <xsd:annotation> - <xsd:documentation>Indicates the translation is suggested by translation memory.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="unitValueList"> - <xsd:annotation> - <xsd:documentation>Values for the attribute 'unit'.</xsd:documentation> - </xsd:annotation> - <xsd:restriction base="xsd:NMTOKEN"> - <xsd:enumeration value="word"> - <xsd:annotation> - <xsd:documentation>Refers to words.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="page"> - <xsd:annotation> - <xsd:documentation>Refers to pages.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="trans-unit"> - <xsd:annotation> - <xsd:documentation>Refers to <trans-unit> elements.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="bin-unit"> - <xsd:annotation> - <xsd:documentation>Refers to <bin-unit> elements.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="glyph"> - <xsd:annotation> - <xsd:documentation>Refers to glyphs.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="item"> - <xsd:annotation> - <xsd:documentation>Refers to <trans-unit> and/or <bin-unit> elements.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="instance"> - <xsd:annotation> - <xsd:documentation>Refers to the occurrences of instances defined by the count-type value.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="character"> - <xsd:annotation> - <xsd:documentation>Refers to characters.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="line"> - <xsd:annotation> - <xsd:documentation>Refers to lines.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="sentence"> - <xsd:annotation> - <xsd:documentation>Refers to sentences.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="paragraph"> - <xsd:annotation> - <xsd:documentation>Refers to paragraphs.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="segment"> - <xsd:annotation> - <xsd:documentation>Refers to segments.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="placeable"> - <xsd:annotation> - <xsd:documentation>Refers to placeables (inline elements).</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="priorityValueList"> - <xsd:annotation> - <xsd:documentation>Values for the attribute 'priority'.</xsd:documentation> - </xsd:annotation> - <xsd:restriction base="xsd:positiveInteger"> - <xsd:enumeration value="1"> - <xsd:annotation> - <xsd:documentation>Highest priority.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="2"> - <xsd:annotation> - <xsd:documentation>High priority.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="3"> - <xsd:annotation> - <xsd:documentation>High priority, but not as important as 2.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="4"> - <xsd:annotation> - <xsd:documentation>High priority, but not as important as 3.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="5"> - <xsd:annotation> - <xsd:documentation>Medium priority, but more important than 6.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="6"> - <xsd:annotation> - <xsd:documentation>Medium priority, but less important than 5.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="7"> - <xsd:annotation> - <xsd:documentation>Low priority, but more important than 8.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="8"> - <xsd:annotation> - <xsd:documentation>Low priority, but more important than 9.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="9"> - <xsd:annotation> - <xsd:documentation>Low priority.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="10"> - <xsd:annotation> - <xsd:documentation>Lowest priority.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="reformatValueYesNo"> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="yes"> - <xsd:annotation> - <xsd:documentation>This value indicates that all properties can be reformatted. This value must be used alone.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="no"> - <xsd:annotation> - <xsd:documentation>This value indicates that no properties should be reformatted. This value must be used alone.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="reformatValueList"> - <xsd:list> - <xsd:simpleType> - <xsd:union memberTypes="xlf:XTend"> - <xsd:simpleType> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="coord"> - <xsd:annotation> - <xsd:documentation>This value indicates that all information in the coord attribute can be modified.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="coord-x"> - <xsd:annotation> - <xsd:documentation>This value indicates that the x information in the coord attribute can be modified.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="coord-y"> - <xsd:annotation> - <xsd:documentation>This value indicates that the y information in the coord attribute can be modified.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="coord-cx"> - <xsd:annotation> - <xsd:documentation>This value indicates that the cx information in the coord attribute can be modified.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="coord-cy"> - <xsd:annotation> - <xsd:documentation>This value indicates that the cy information in the coord attribute can be modified.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="font"> - <xsd:annotation> - <xsd:documentation>This value indicates that all the information in the font attribute can be modified.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="font-name"> - <xsd:annotation> - <xsd:documentation>This value indicates that the name information in the font attribute can be modified.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="font-size"> - <xsd:annotation> - <xsd:documentation>This value indicates that the size information in the font attribute can be modified.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="font-weight"> - <xsd:annotation> - <xsd:documentation>This value indicates that the weight information in the font attribute can be modified.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="css-style"> - <xsd:annotation> - <xsd:documentation>This value indicates that the information in the css-style attribute can be modified.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="style"> - <xsd:annotation> - <xsd:documentation>This value indicates that the information in the style attribute can be modified.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="ex-style"> - <xsd:annotation> - <xsd:documentation>This value indicates that the information in the exstyle attribute can be modified.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - </xsd:restriction> - </xsd:simpleType> - </xsd:union> - </xsd:simpleType> - </xsd:list> - </xsd:simpleType> - <xsd:simpleType name="purposeValueList"> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="information"> - <xsd:annotation> - <xsd:documentation>Indicates that the context is informational in nature, specifying for example, how a term should be translated. Thus, should be displayed to anyone editing the XLIFF document.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="location"> - <xsd:annotation> - <xsd:documentation>Indicates that the context-group is used to specify where the term was found in the translatable source. Thus, it is not displayed.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="match"> - <xsd:annotation> - <xsd:documentation>Indicates that the context information should be used during translation memory lookups. Thus, it is not displayed.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="alttranstypeValueList"> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="proposal"> - <xsd:annotation> - <xsd:documentation>Represents a translation proposal from a translation memory or other resource.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="previous-version"> - <xsd:annotation> - <xsd:documentation>Represents a previous version of the target element.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="rejected"> - <xsd:annotation> - <xsd:documentation>Represents a rejected version of the target element.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="reference"> - <xsd:annotation> - <xsd:documentation>Represents a translation to be used for reference purposes only, for example from a related product or a different language.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - <xsd:enumeration value="accepted"> - <xsd:annotation> - <xsd:documentation>Represents a proposed translation that was used for the translation of the trans-unit, possibly modified.</xsd:documentation> - </xsd:annotation> - </xsd:enumeration> - </xsd:restriction> - </xsd:simpleType> - <!-- Other Types --> - <xsd:complexType name="ElemType_ExternalReference"> - <xsd:choice> - <xsd:element ref="xlf:internal-file"/> - <xsd:element ref="xlf:external-file"/> - </xsd:choice> - </xsd:complexType> - <xsd:simpleType name="AttrType_purpose"> - <xsd:list> - <xsd:simpleType> - <xsd:union memberTypes="xlf:purposeValueList xlf:XTend"/> - </xsd:simpleType> - </xsd:list> - </xsd:simpleType> - <xsd:simpleType name="AttrType_datatype"> - <xsd:union memberTypes="xlf:datatypeValueList xlf:XTend"/> - </xsd:simpleType> - <xsd:simpleType name="AttrType_restype"> - <xsd:union memberTypes="xlf:restypeValueList xlf:XTend"/> - </xsd:simpleType> - <xsd:simpleType name="AttrType_alttranstype"> - <xsd:union memberTypes="xlf:alttranstypeValueList xlf:XTend"/> - </xsd:simpleType> - <xsd:simpleType name="AttrType_context-type"> - <xsd:union memberTypes="xlf:context-typeValueList xlf:XTend"/> - </xsd:simpleType> - <xsd:simpleType name="AttrType_state"> - <xsd:union memberTypes="xlf:stateValueList xlf:XTend"/> - </xsd:simpleType> - <xsd:simpleType name="AttrType_state-qualifier"> - <xsd:union memberTypes="xlf:state-qualifierValueList xlf:XTend"/> - </xsd:simpleType> - <xsd:simpleType name="AttrType_count-type"> - <xsd:union memberTypes="xlf:restypeValueList xlf:count-typeValueList xlf:datatypeValueList xlf:stateValueList xlf:state-qualifierValueList xlf:XTend"/> - </xsd:simpleType> - <xsd:simpleType name="AttrType_InlineDelimiters"> - <xsd:union memberTypes="xlf:InlineDelimitersValueList xlf:XTend"/> - </xsd:simpleType> - <xsd:simpleType name="AttrType_InlinePlaceholders"> - <xsd:union memberTypes="xlf:InlinePlaceholdersValueList xlf:XTend"/> - </xsd:simpleType> - <xsd:simpleType name="AttrType_size-unit"> - <xsd:union memberTypes="xlf:size-unitValueList xlf:XTend"/> - </xsd:simpleType> - <xsd:simpleType name="AttrType_mtype"> - <xsd:union memberTypes="xlf:mtypeValueList xlf:XTend"/> - </xsd:simpleType> - <xsd:simpleType name="AttrType_unit"> - <xsd:union memberTypes="xlf:unitValueList xlf:XTend"/> - </xsd:simpleType> - <xsd:simpleType name="AttrType_priority"> - <xsd:union memberTypes="xlf:priorityValueList"/> - </xsd:simpleType> - <xsd:simpleType name="AttrType_reformat"> - <xsd:union memberTypes="xlf:reformatValueYesNo xlf:reformatValueList"/> - </xsd:simpleType> - <xsd:simpleType name="AttrType_YesNo"> - <xsd:restriction base="xsd:NMTOKEN"> - <xsd:enumeration value="yes"/> - <xsd:enumeration value="no"/> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="AttrType_Position"> - <xsd:restriction base="xsd:NMTOKEN"> - <xsd:enumeration value="open"/> - <xsd:enumeration value="close"/> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="AttrType_assoc"> - <xsd:restriction base="xsd:NMTOKEN"> - <xsd:enumeration value="preceding"/> - <xsd:enumeration value="following"/> - <xsd:enumeration value="both"/> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="AttrType_annotates"> - <xsd:restriction base="xsd:NMTOKEN"> - <xsd:enumeration value="source"/> - <xsd:enumeration value="target"/> - <xsd:enumeration value="general"/> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="AttrType_Coordinates"> - <xsd:annotation> - <xsd:documentation>Values for the attribute 'coord'.</xsd:documentation> - </xsd:annotation> - <xsd:restriction base="xsd:string"> - <xsd:pattern value="(-?\d+|#);(-?\d+|#);(-?\d+|#);(-?\d+|#)"/> - </xsd:restriction> - </xsd:simpleType> - <xsd:simpleType name="AttrType_Version"> - <xsd:annotation> - <xsd:documentation>Version values: 1.0 and 1.1 are allowed for backward compatibility.</xsd:documentation> - </xsd:annotation> - <xsd:restriction base="xsd:string"> - <xsd:enumeration value="1.2"/> - <xsd:enumeration value="1.1"/> - <xsd:enumeration value="1.0"/> - </xsd:restriction> - </xsd:simpleType> - <!-- Groups --> - <xsd:group name="ElemGroup_TextContent"> - <xsd:choice> - <xsd:element ref="xlf:g"/> - <xsd:element ref="xlf:bpt"/> - <xsd:element ref="xlf:ept"/> - <xsd:element ref="xlf:ph"/> - <xsd:element ref="xlf:it"/> - <xsd:element ref="xlf:mrk"/> - <xsd:element ref="xlf:x"/> - <xsd:element ref="xlf:bx"/> - <xsd:element ref="xlf:ex"/> - </xsd:choice> - </xsd:group> - <xsd:attributeGroup name="AttrGroup_TextContent"> - <xsd:attribute name="id" type="xsd:string" use="required"/> - <xsd:attribute name="xid" type="xsd:string" use="optional"/> - <xsd:attribute name="equiv-text" type="xsd:string" use="optional"/> - <xsd:anyAttribute namespace="##other" processContents="strict"/> - </xsd:attributeGroup> - <!-- XLIFF Structure --> - <xsd:element name="xliff"> - <xsd:complexType> - <xsd:sequence maxOccurs="unbounded"> - <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/> - <xsd:element ref="xlf:file"/> - </xsd:sequence> - <xsd:attribute name="version" type="xlf:AttrType_Version" use="required"/> - <xsd:attribute ref="xml:lang" use="optional"/> - <xsd:anyAttribute namespace="##other" processContents="strict"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="file"> - <xsd:complexType> - <xsd:sequence> - <xsd:element minOccurs="0" ref="xlf:header"/> - <xsd:element ref="xlf:body"/> - </xsd:sequence> - <xsd:attribute name="original" type="xsd:string" use="required"/> - <xsd:attribute name="source-language" type="xsd:language" use="required"/> - <xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="required"/> - <xsd:attribute name="tool-id" type="xsd:string" use="optional"/> - <xsd:attribute name="date" type="xsd:dateTime" use="optional"/> - <xsd:attribute ref="xml:space" use="optional"/> - <xsd:attribute name="category" type="xsd:string" use="optional"/> - <xsd:attribute name="target-language" type="xsd:language" use="optional"/> - <xsd:attribute name="product-name" type="xsd:string" use="optional"/> - <xsd:attribute name="product-version" type="xsd:string" use="optional"/> - <xsd:attribute name="build-num" type="xsd:string" use="optional"/> - <xsd:anyAttribute namespace="##other" processContents="strict"/> - </xsd:complexType> - <xsd:unique name="U_group_id"> - <xsd:selector xpath=".//xlf:group"/> - <xsd:field xpath="@id"/> - </xsd:unique> - <xsd:key name="K_unit_id"> - <xsd:selector xpath=".//xlf:trans-unit|.//xlf:bin-unit"/> - <xsd:field xpath="@id"/> - </xsd:key> - <xsd:keyref name="KR_unit_id" refer="xlf:K_unit_id"> - <xsd:selector xpath=".//bpt|.//ept|.//it|.//ph|.//g|.//x|.//bx|.//ex|.//sub"/> - <xsd:field xpath="@xid"/> - </xsd:keyref> - <xsd:key name="K_tool-id"> - <xsd:selector xpath="xlf:header/xlf:tool"/> - <xsd:field xpath="@tool-id"/> - </xsd:key> - <xsd:keyref name="KR_file_tool-id" refer="xlf:K_tool-id"> - <xsd:selector xpath="."/> - <xsd:field xpath="@tool-id"/> - </xsd:keyref> - <xsd:keyref name="KR_phase_tool-id" refer="xlf:K_tool-id"> - <xsd:selector xpath="xlf:header/xlf:phase-group/xlf:phase"/> - <xsd:field xpath="@tool-id"/> - </xsd:keyref> - <xsd:keyref name="KR_alt-trans_tool-id" refer="xlf:K_tool-id"> - <xsd:selector xpath=".//xlf:trans-unit/xlf:alt-trans"/> - <xsd:field xpath="@tool-id"/> - </xsd:keyref> - <xsd:key name="K_count-group_name"> - <xsd:selector xpath=".//xlf:count-group"/> - <xsd:field xpath="@name"/> - </xsd:key> - <xsd:unique name="U_context-group_name"> - <xsd:selector xpath=".//xlf:context-group"/> - <xsd:field xpath="@name"/> - </xsd:unique> - <xsd:key name="K_phase-name"> - <xsd:selector xpath="xlf:header/xlf:phase-group/xlf:phase"/> - <xsd:field xpath="@phase-name"/> - </xsd:key> - <xsd:keyref name="KR_phase-name" refer="xlf:K_phase-name"> - <xsd:selector xpath=".//xlf:count|.//xlf:trans-unit|.//xlf:target|.//bin-unit|.//bin-target"/> - <xsd:field xpath="@phase-name"/> - </xsd:keyref> - <xsd:unique name="U_uid"> - <xsd:selector xpath=".//xlf:external-file"/> - <xsd:field xpath="@uid"/> - </xsd:unique> - </xsd:element> - <xsd:element name="header"> - <xsd:complexType> - <xsd:sequence> - <xsd:element minOccurs="0" name="skl" type="xlf:ElemType_ExternalReference"/> - <xsd:element minOccurs="0" ref="xlf:phase-group"/> - <xsd:choice maxOccurs="unbounded" minOccurs="0"> - <xsd:element name="glossary" type="xlf:ElemType_ExternalReference"/> - <xsd:element name="reference" type="xlf:ElemType_ExternalReference"/> - <xsd:element ref="xlf:count-group"/> - <xsd:element ref="xlf:note"/> - <xsd:element ref="xlf:tool"/> - </xsd:choice> - <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="internal-file"> - <xsd:complexType> - <xsd:simpleContent> - <xsd:extension base="xsd:string"> - <xsd:attribute name="form" type="xsd:string"/> - <xsd:attribute name="crc" type="xsd:NMTOKEN"/> - </xsd:extension> - </xsd:simpleContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="external-file"> - <xsd:complexType> - <xsd:attribute name="href" type="xsd:string" use="required"/> - <xsd:attribute name="crc" type="xsd:NMTOKEN"/> - <xsd:attribute name="uid" type="xsd:NMTOKEN"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="note"> - <xsd:complexType> - <xsd:simpleContent> - <xsd:extension base="xsd:string"> - <xsd:attribute ref="xml:lang" use="optional"/> - <xsd:attribute default="1" name="priority" type="xlf:AttrType_priority" use="optional"/> - <xsd:attribute name="from" type="xsd:string" use="optional"/> - <xsd:attribute default="general" name="annotates" type="xlf:AttrType_annotates" use="optional"/> - </xsd:extension> - </xsd:simpleContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="phase-group"> - <xsd:complexType> - <xsd:sequence maxOccurs="unbounded"> - <xsd:element ref="xlf:phase"/> - </xsd:sequence> - </xsd:complexType> - </xsd:element> - <xsd:element name="phase"> - <xsd:complexType> - <xsd:sequence maxOccurs="unbounded" minOccurs="0"> - <xsd:element ref="xlf:note"/> - </xsd:sequence> - <xsd:attribute name="phase-name" type="xsd:string" use="required"/> - <xsd:attribute name="process-name" type="xsd:string" use="required"/> - <xsd:attribute name="company-name" type="xsd:string" use="optional"/> - <xsd:attribute name="tool-id" type="xsd:string" use="optional"/> - <xsd:attribute name="date" type="xsd:dateTime" use="optional"/> - <xsd:attribute name="job-id" type="xsd:string" use="optional"/> - <xsd:attribute name="contact-name" type="xsd:string" use="optional"/> - <xsd:attribute name="contact-email" type="xsd:string" use="optional"/> - <xsd:attribute name="contact-phone" type="xsd:string" use="optional"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="count-group"> - <xsd:complexType> - <xsd:sequence maxOccurs="unbounded" minOccurs="0"> - <xsd:element ref="xlf:count"/> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="count"> - <xsd:complexType> - <xsd:simpleContent> - <xsd:extension base="xsd:string"> - <xsd:attribute name="count-type" type="xlf:AttrType_count-type" use="optional"/> - <xsd:attribute name="phase-name" type="xsd:string" use="optional"/> - <xsd:attribute default="word" name="unit" type="xlf:AttrType_unit" use="optional"/> - </xsd:extension> - </xsd:simpleContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="context-group"> - <xsd:complexType> - <xsd:sequence maxOccurs="unbounded"> - <xsd:element ref="xlf:context"/> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="optional"/> - <xsd:attribute name="crc" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="purpose" type="xlf:AttrType_purpose" use="optional"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="context"> - <xsd:complexType> - <xsd:simpleContent> - <xsd:extension base="xsd:string"> - <xsd:attribute name="context-type" type="xlf:AttrType_context-type" use="required"/> - <xsd:attribute default="no" name="match-mandatory" type="xlf:AttrType_YesNo" use="optional"/> - <xsd:attribute name="crc" type="xsd:NMTOKEN" use="optional"/> - </xsd:extension> - </xsd:simpleContent> - </xsd:complexType> - </xsd:element> - <xsd:element name="tool"> - <xsd:complexType mixed="true"> - <xsd:sequence> - <xsd:any namespace="##any" processContents="strict" minOccurs="0" maxOccurs="unbounded"/> - </xsd:sequence> - <xsd:attribute name="tool-id" type="xsd:string" use="required"/> - <xsd:attribute name="tool-name" type="xsd:string" use="required"/> - <xsd:attribute name="tool-version" type="xsd:string" use="optional"/> - <xsd:attribute name="tool-company" type="xsd:string" use="optional"/> - <xsd:anyAttribute namespace="##other" processContents="strict"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="body"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded" minOccurs="0"> - <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:group"/> - <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:trans-unit"/> - <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:bin-unit"/> - </xsd:choice> - </xsd:complexType> - </xsd:element> - <xsd:element name="group"> - <xsd:complexType> - <xsd:sequence> - <xsd:sequence> - <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:context-group"/> - <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:count-group"/> - <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:note"/> - <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/> - </xsd:sequence> - <xsd:choice maxOccurs="unbounded"> - <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:group"/> - <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:trans-unit"/> - <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:bin-unit"/> - </xsd:choice> - </xsd:sequence> - <xsd:attribute name="id" type="xsd:string" use="optional"/> - <xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="optional"/> - <xsd:attribute default="default" ref="xml:space" use="optional"/> - <xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/> - <xsd:attribute name="resname" type="xsd:string" use="optional"/> - <xsd:attribute name="extradata" type="xsd:string" use="optional"/> - <xsd:attribute name="extype" type="xsd:string" use="optional"/> - <xsd:attribute name="help-id" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="menu" type="xsd:string" use="optional"/> - <xsd:attribute name="menu-option" type="xsd:string" use="optional"/> - <xsd:attribute name="menu-name" type="xsd:string" use="optional"/> - <xsd:attribute name="coord" type="xlf:AttrType_Coordinates" use="optional"/> - <xsd:attribute name="font" type="xsd:string" use="optional"/> - <xsd:attribute name="css-style" type="xsd:string" use="optional"/> - <xsd:attribute name="style" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="exstyle" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute default="yes" name="translate" type="xlf:AttrType_YesNo" use="optional"/> - <xsd:attribute default="yes" name="reformat" type="xlf:AttrType_reformat" use="optional"/> - <xsd:attribute default="pixel" name="size-unit" type="xlf:AttrType_size-unit" use="optional"/> - <xsd:attribute name="maxwidth" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="minwidth" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="maxheight" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="minheight" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="maxbytes" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="minbytes" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="charclass" type="xsd:string" use="optional"/> - <xsd:attribute default="no" name="merged-trans" type="xlf:AttrType_YesNo" use="optional"/> - <xsd:anyAttribute namespace="##other" processContents="strict"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="trans-unit"> - <xsd:complexType> - <xsd:sequence> - <xsd:element ref="xlf:source"/> - <xsd:element minOccurs="0" ref="xlf:seg-source"/> - <xsd:element minOccurs="0" ref="xlf:target"/> - <xsd:choice maxOccurs="unbounded" minOccurs="0"> - <xsd:element ref="xlf:context-group"/> - <xsd:element ref="xlf:count-group"/> - <xsd:element ref="xlf:note"/> - <xsd:element ref="xlf:alt-trans"/> - </xsd:choice> - <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/> - </xsd:sequence> - <xsd:attribute name="id" type="xsd:string" use="required"/> - <xsd:attribute name="approved" type="xlf:AttrType_YesNo" use="optional"/> - <xsd:attribute default="yes" name="translate" type="xlf:AttrType_YesNo" use="optional"/> - <xsd:attribute default="yes" name="reformat" type="xlf:AttrType_reformat" use="optional"/> - <xsd:attribute default="default" ref="xml:space" use="optional"/> - <xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="optional"/> - <xsd:attribute name="phase-name" type="xsd:string" use="optional"/> - <xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/> - <xsd:attribute name="resname" type="xsd:string" use="optional"/> - <xsd:attribute name="extradata" type="xsd:string" use="optional"/> - <xsd:attribute name="extype" type="xsd:string" use="optional"/> - <xsd:attribute name="help-id" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="menu" type="xsd:string" use="optional"/> - <xsd:attribute name="menu-option" type="xsd:string" use="optional"/> - <xsd:attribute name="menu-name" type="xsd:string" use="optional"/> - <xsd:attribute name="coord" type="xlf:AttrType_Coordinates" use="optional"/> - <xsd:attribute name="font" type="xsd:string" use="optional"/> - <xsd:attribute name="css-style" type="xsd:string" use="optional"/> - <xsd:attribute name="style" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="exstyle" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute default="pixel" name="size-unit" type="xlf:AttrType_size-unit" use="optional"/> - <xsd:attribute name="maxwidth" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="minwidth" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="maxheight" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="minheight" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="maxbytes" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="minbytes" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="charclass" type="xsd:string" use="optional"/> - <xsd:attribute default="yes" name="merged-trans" type="xlf:AttrType_YesNo" use="optional"/> - <xsd:anyAttribute namespace="##other" processContents="strict"/> - </xsd:complexType> - <xsd:unique name="U_tu_segsrc_mid"> - <xsd:selector xpath="./xlf:seg-source/xlf:mrk"/> - <xsd:field xpath="@mid"/> - </xsd:unique> - <xsd:keyref name="KR_tu_segsrc_mid" refer="xlf:U_tu_segsrc_mid"> - <xsd:selector xpath="./xlf:target/xlf:mrk|./xlf:alt-trans"/> - <xsd:field xpath="@mid"/> - </xsd:keyref> - </xsd:element> - <xsd:element name="source"> - <xsd:complexType mixed="true"> - <xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/> - <xsd:attribute ref="xml:lang" use="optional"/> - <xsd:anyAttribute namespace="##other" processContents="strict"/> - </xsd:complexType> - <xsd:unique name="U_source_bpt_rid"> - <xsd:selector xpath=".//xlf:bpt"/> - <xsd:field xpath="@rid"/> - </xsd:unique> - <xsd:keyref name="KR_source_ept_rid" refer="xlf:U_source_bpt_rid"> - <xsd:selector xpath=".//xlf:ept"/> - <xsd:field xpath="@rid"/> - </xsd:keyref> - <xsd:unique name="U_source_bx_rid"> - <xsd:selector xpath=".//xlf:bx"/> - <xsd:field xpath="@rid"/> - </xsd:unique> - <xsd:keyref name="KR_source_ex_rid" refer="xlf:U_source_bx_rid"> - <xsd:selector xpath=".//xlf:ex"/> - <xsd:field xpath="@rid"/> - </xsd:keyref> - </xsd:element> - <xsd:element name="seg-source"> - <xsd:complexType mixed="true"> - <xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/> - <xsd:attribute ref="xml:lang" use="optional"/> - <xsd:anyAttribute namespace="##other" processContents="strict"/> - </xsd:complexType> - <xsd:unique name="U_segsrc_bpt_rid"> - <xsd:selector xpath=".//xlf:bpt"/> - <xsd:field xpath="@rid"/> - </xsd:unique> - <xsd:keyref name="KR_segsrc_ept_rid" refer="xlf:U_segsrc_bpt_rid"> - <xsd:selector xpath=".//xlf:ept"/> - <xsd:field xpath="@rid"/> - </xsd:keyref> - <xsd:unique name="U_segsrc_bx_rid"> - <xsd:selector xpath=".//xlf:bx"/> - <xsd:field xpath="@rid"/> - </xsd:unique> - <xsd:keyref name="KR_segsrc_ex_rid" refer="xlf:U_segsrc_bx_rid"> - <xsd:selector xpath=".//xlf:ex"/> - <xsd:field xpath="@rid"/> - </xsd:keyref> - </xsd:element> - <xsd:element name="target"> - <xsd:complexType mixed="true"> - <xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/> - <xsd:attribute name="state" type="xlf:AttrType_state" use="optional"/> - <xsd:attribute name="state-qualifier" type="xlf:AttrType_state-qualifier" use="optional"/> - <xsd:attribute name="phase-name" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute ref="xml:lang" use="optional"/> - <xsd:attribute name="resname" type="xsd:string" use="optional"/> - <xsd:attribute name="coord" type="xlf:AttrType_Coordinates" use="optional"/> - <xsd:attribute name="font" type="xsd:string" use="optional"/> - <xsd:attribute name="css-style" type="xsd:string" use="optional"/> - <xsd:attribute name="style" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="exstyle" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute default="yes" name="equiv-trans" type="xlf:AttrType_YesNo" use="optional"/> - <xsd:anyAttribute namespace="##other" processContents="strict"/> - </xsd:complexType> - <xsd:unique name="U_target_bpt_rid"> - <xsd:selector xpath=".//xlf:bpt"/> - <xsd:field xpath="@rid"/> - </xsd:unique> - <xsd:keyref name="KR_target_ept_rid" refer="xlf:U_target_bpt_rid"> - <xsd:selector xpath=".//xlf:ept"/> - <xsd:field xpath="@rid"/> - </xsd:keyref> - <xsd:unique name="U_target_bx_rid"> - <xsd:selector xpath=".//xlf:bx"/> - <xsd:field xpath="@rid"/> - </xsd:unique> - <xsd:keyref name="KR_target_ex_rid" refer="xlf:U_target_bx_rid"> - <xsd:selector xpath=".//xlf:ex"/> - <xsd:field xpath="@rid"/> - </xsd:keyref> - </xsd:element> - <xsd:element name="alt-trans"> - <xsd:complexType> - <xsd:sequence> - <xsd:element minOccurs="0" ref="xlf:source"/> - <xsd:element minOccurs="0" ref="xlf:seg-source"/> - <xsd:element maxOccurs="1" ref="xlf:target"/> - <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:context-group"/> - <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:note"/> - <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/> - </xsd:sequence> - <xsd:attribute name="match-quality" type="xsd:string" use="optional"/> - <xsd:attribute name="tool-id" type="xsd:string" use="optional"/> - <xsd:attribute name="crc" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute ref="xml:lang" use="optional"/> - <xsd:attribute name="origin" type="xsd:string" use="optional"/> - <xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="optional"/> - <xsd:attribute default="default" ref="xml:space" use="optional"/> - <xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/> - <xsd:attribute name="resname" type="xsd:string" use="optional"/> - <xsd:attribute name="extradata" type="xsd:string" use="optional"/> - <xsd:attribute name="extype" type="xsd:string" use="optional"/> - <xsd:attribute name="help-id" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="menu" type="xsd:string" use="optional"/> - <xsd:attribute name="menu-option" type="xsd:string" use="optional"/> - <xsd:attribute name="menu-name" type="xsd:string" use="optional"/> - <xsd:attribute name="mid" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="coord" type="xlf:AttrType_Coordinates" use="optional"/> - <xsd:attribute name="font" type="xsd:string" use="optional"/> - <xsd:attribute name="css-style" type="xsd:string" use="optional"/> - <xsd:attribute name="style" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="exstyle" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="phase-name" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute default="proposal" name="alttranstype" type="xlf:AttrType_alttranstype" use="optional"/> - <xsd:anyAttribute namespace="##other" processContents="strict"/> - </xsd:complexType> - <xsd:unique name="U_at_segsrc_mid"> - <xsd:selector xpath="./xlf:seg-source/xlf:mrk"/> - <xsd:field xpath="@mid"/> - </xsd:unique> - <xsd:keyref name="KR_at_segsrc_mid" refer="xlf:U_at_segsrc_mid"> - <xsd:selector xpath="./xlf:target/xlf:mrk"/> - <xsd:field xpath="@mid"/> - </xsd:keyref> - </xsd:element> - <xsd:element name="bin-unit"> - <xsd:complexType> - <xsd:sequence> - <xsd:element ref="xlf:bin-source"/> - <xsd:element minOccurs="0" ref="xlf:bin-target"/> - <xsd:choice maxOccurs="unbounded" minOccurs="0"> - <xsd:element ref="xlf:context-group"/> - <xsd:element ref="xlf:count-group"/> - <xsd:element ref="xlf:note"/> - <xsd:element ref="xlf:trans-unit"/> - </xsd:choice> - <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/> - </xsd:sequence> - <xsd:attribute name="id" type="xsd:string" use="required"/> - <xsd:attribute name="mime-type" type="xlf:mime-typeValueList" use="required"/> - <xsd:attribute name="approved" type="xlf:AttrType_YesNo" use="optional"/> - <xsd:attribute default="yes" name="translate" type="xlf:AttrType_YesNo" use="optional"/> - <xsd:attribute default="yes" name="reformat" type="xlf:AttrType_reformat" use="optional"/> - <xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/> - <xsd:attribute name="resname" type="xsd:string" use="optional"/> - <xsd:attribute name="phase-name" type="xsd:string" use="optional"/> - <xsd:anyAttribute namespace="##other" processContents="strict"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="bin-source"> - <xsd:complexType> - <xsd:choice> - <xsd:element ref="xlf:internal-file"/> - <xsd:element ref="xlf:external-file"/> - </xsd:choice> - <xsd:anyAttribute namespace="##other" processContents="strict"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="bin-target"> - <xsd:complexType> - <xsd:choice> - <xsd:element ref="xlf:internal-file"/> - <xsd:element ref="xlf:external-file"/> - </xsd:choice> - <xsd:attribute name="mime-type" type="xlf:mime-typeValueList" use="optional"/> - <xsd:attribute name="state" type="xlf:AttrType_state" use="optional"/> - <xsd:attribute name="state-qualifier" type="xlf:AttrType_state-qualifier" use="optional"/> - <xsd:attribute name="phase-name" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/> - <xsd:attribute name="resname" type="xsd:string" use="optional"/> - <xsd:anyAttribute namespace="##other" processContents="strict"/> - </xsd:complexType> - </xsd:element> - <!-- Element for inline codes --> - <xsd:element name="g"> - <xsd:complexType mixed="true"> - <xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/> - <xsd:attribute name="ctype" type="xlf:AttrType_InlineDelimiters" use="optional"/> - <xsd:attribute default="yes" name="clone" type="xlf:AttrType_YesNo" use="optional"/> - <xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="x"> - <xsd:complexType> - <xsd:attribute name="ctype" type="xlf:AttrType_InlinePlaceholders" use="optional"/> - <xsd:attribute default="yes" name="clone" type="xlf:AttrType_YesNo" use="optional"/> - <xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="bx"> - <xsd:complexType> - <xsd:attribute name="rid" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="ctype" type="xlf:AttrType_InlineDelimiters" use="optional"/> - <xsd:attribute default="yes" name="clone" type="xlf:AttrType_YesNo" use="optional"/> - <xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="ex"> - <xsd:complexType> - <xsd:attribute name="rid" type="xsd:NMTOKEN" use="optional"/> - <xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="ph"> - <xsd:complexType mixed="true"> - <xsd:sequence maxOccurs="unbounded" minOccurs="0"> - <xsd:element ref="xlf:sub"/> - </xsd:sequence> - <xsd:attribute name="ctype" type="xlf:AttrType_InlinePlaceholders" use="optional"/> - <xsd:attribute name="crc" type="xsd:string" use="optional"/> - <xsd:attribute name="assoc" type="xlf:AttrType_assoc" use="optional"/> - <xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="bpt"> - <xsd:complexType mixed="true"> - <xsd:sequence maxOccurs="unbounded" minOccurs="0"> - <xsd:element ref="xlf:sub"/> - </xsd:sequence> - <xsd:attribute name="rid" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="ctype" type="xlf:AttrType_InlineDelimiters" use="optional"/> - <xsd:attribute name="crc" type="xsd:string" use="optional"/> - <xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="ept"> - <xsd:complexType mixed="true"> - <xsd:sequence maxOccurs="unbounded" minOccurs="0"> - <xsd:element ref="xlf:sub"/> - </xsd:sequence> - <xsd:attribute name="rid" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="crc" type="xsd:string" use="optional"/> - <xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="it"> - <xsd:complexType mixed="true"> - <xsd:sequence maxOccurs="unbounded" minOccurs="0"> - <xsd:element ref="xlf:sub"/> - </xsd:sequence> - <xsd:attribute name="pos" type="xlf:AttrType_Position" use="required"/> - <xsd:attribute name="rid" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="ctype" type="xlf:AttrType_InlineDelimiters" use="optional"/> - <xsd:attribute name="crc" type="xsd:string" use="optional"/> - <xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="sub"> - <xsd:complexType mixed="true"> - <xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/> - <xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="optional"/> - <xsd:attribute name="ctype" type="xlf:AttrType_InlineDelimiters" use="optional"/> - <xsd:attribute name="xid" type="xsd:string" use="optional"/> - </xsd:complexType> - </xsd:element> - <xsd:element name="mrk"> - <xsd:complexType mixed="true"> - <xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/> - <xsd:attribute name="mtype" type="xlf:AttrType_mtype" use="required"/> - <xsd:attribute name="mid" type="xsd:NMTOKEN" use="optional"/> - <xsd:attribute name="comment" type="xsd:string" use="optional"/> - <xsd:anyAttribute namespace="##other" processContents="strict"/> - </xsd:complexType> - </xsd:element> -</xsd:schema> diff --git a/vendor/symfony/translation/Translator.php b/vendor/symfony/translation/Translator.php deleted file mode 100644 index 9876051..0000000 --- a/vendor/symfony/translation/Translator.php +++ /dev/null @@ -1,540 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -use Symfony\Component\Config\ConfigCacheFactory; -use Symfony\Component\Config\ConfigCacheFactoryInterface; -use Symfony\Component\Config\ConfigCacheInterface; -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\Exception\LogicException; -use Symfony\Component\Translation\Exception\NotFoundResourceException; -use Symfony\Component\Translation\Exception\RuntimeException; -use Symfony\Component\Translation\Formatter\ChoiceMessageFormatterInterface; -use Symfony\Component\Translation\Formatter\IntlFormatterInterface; -use Symfony\Component\Translation\Formatter\MessageFormatter; -use Symfony\Component\Translation\Formatter\MessageFormatterInterface; -use Symfony\Component\Translation\Loader\LoaderInterface; -use Symfony\Component\Translation\TranslatorInterface as LegacyTranslatorInterface; -use Symfony\Contracts\Translation\TranslatorInterface; - -/** - * @author Fabien Potencier <fabien@symfony.com> - */ -class Translator implements LegacyTranslatorInterface, TranslatorInterface, TranslatorBagInterface -{ - /** - * @var MessageCatalogueInterface[] - */ - protected $catalogues = []; - - /** - * @var string - */ - private $locale; - - /** - * @var array - */ - private $fallbackLocales = []; - - /** - * @var LoaderInterface[] - */ - private $loaders = []; - - /** - * @var array - */ - private $resources = []; - - /** - * @var MessageFormatterInterface - */ - private $formatter; - - /** - * @var string - */ - private $cacheDir; - - /** - * @var bool - */ - private $debug; - - private $cacheVary; - - /** - * @var ConfigCacheFactoryInterface|null - */ - private $configCacheFactory; - - /** - * @var array|null - */ - private $parentLocales; - - private $hasIntlFormatter; - - /** - * @throws InvalidArgumentException If a locale contains invalid characters - */ - public function __construct(?string $locale, MessageFormatterInterface $formatter = null, string $cacheDir = null, bool $debug = false, array $cacheVary = []) - { - if (null === $locale) { - @trigger_error(sprintf('Passing "null" as the $locale argument to %s() is deprecated since Symfony 4.4.', __METHOD__), E_USER_DEPRECATED); - } - - $this->setLocale($locale, false); - - if (null === $formatter) { - $formatter = new MessageFormatter(); - } - - $this->formatter = $formatter; - $this->cacheDir = $cacheDir; - $this->debug = $debug; - $this->cacheVary = $cacheVary; - $this->hasIntlFormatter = $formatter instanceof IntlFormatterInterface; - } - - public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory) - { - $this->configCacheFactory = $configCacheFactory; - } - - /** - * Adds a Loader. - * - * @param string $format The name of the loader (@see addResource()) - */ - public function addLoader($format, LoaderInterface $loader) - { - $this->loaders[$format] = $loader; - } - - /** - * Adds a Resource. - * - * @param string $format The name of the loader (@see addLoader()) - * @param mixed $resource The resource name - * @param string $locale The locale - * @param string $domain The domain - * - * @throws InvalidArgumentException If the locale contains invalid characters - */ - public function addResource($format, $resource, $locale, $domain = null) - { - if (null === $domain) { - $domain = 'messages'; - } - - if (null === $locale) { - @trigger_error(sprintf('Passing "null" to the third argument of the "%s" method has been deprecated since Symfony 4.4 and will throw an error in 5.0.', __METHOD__), E_USER_DEPRECATED); - } - - $this->assertValidLocale($locale); - - $this->resources[$locale][] = [$format, $resource, $domain]; - - if (\in_array($locale, $this->fallbackLocales)) { - $this->catalogues = []; - } else { - unset($this->catalogues[$locale]); - } - } - - /** - * {@inheritdoc} - */ - public function setLocale($locale) - { - if (null === $locale && (2 > \func_num_args() || func_get_arg(1))) { - @trigger_error(sprintf('Passing "null" as the $locale argument to %s() is deprecated since Symfony 4.4.', __METHOD__), E_USER_DEPRECATED); - } - - $this->assertValidLocale($locale); - $this->locale = $locale; - } - - /** - * {@inheritdoc} - */ - public function getLocale() - { - return $this->locale; - } - - /** - * Sets the fallback locales. - * - * @param array $locales The fallback locales - * - * @throws InvalidArgumentException If a locale contains invalid characters - */ - public function setFallbackLocales(array $locales) - { - // needed as the fallback locales are linked to the already loaded catalogues - $this->catalogues = []; - - foreach ($locales as $locale) { - if (null === $locale) { - @trigger_error(sprintf('Passing "null" as the $locale argument to %s() is deprecated since Symfony 4.4.', __METHOD__), E_USER_DEPRECATED); - } - $this->assertValidLocale($locale); - } - - $this->fallbackLocales = $this->cacheVary['fallback_locales'] = $locales; - } - - /** - * Gets the fallback locales. - * - * @internal since Symfony 4.2 - * - * @return array The fallback locales - */ - public function getFallbackLocales() - { - return $this->fallbackLocales; - } - - /** - * {@inheritdoc} - */ - public function trans($id, array $parameters = [], $domain = null, $locale = null) - { - if ('' === $id = (string) $id) { - return ''; - } - - if (null === $domain) { - $domain = 'messages'; - } - - $catalogue = $this->getCatalogue($locale); - $locale = $catalogue->getLocale(); - while (!$catalogue->defines($id, $domain)) { - if ($cat = $catalogue->getFallbackCatalogue()) { - $catalogue = $cat; - $locale = $catalogue->getLocale(); - } else { - break; - } - } - - if ($this->hasIntlFormatter && $catalogue->defines($id, $domain.MessageCatalogue::INTL_DOMAIN_SUFFIX)) { - return $this->formatter->formatIntl($catalogue->get($id, $domain), $locale, $parameters); - } - - return $this->formatter->format($catalogue->get($id, $domain), $locale, $parameters); - } - - /** - * {@inheritdoc} - * - * @deprecated since Symfony 4.2, use the trans() method instead with a %count% parameter - */ - public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null) - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the trans() one instead with a "%%count%%" parameter.', __METHOD__), E_USER_DEPRECATED); - - if ('' === $id = (string) $id) { - return ''; - } - - if (!$this->formatter instanceof ChoiceMessageFormatterInterface) { - throw new LogicException(sprintf('The formatter "%s" does not support plural translations.', \get_class($this->formatter))); - } - - if (null === $domain) { - $domain = 'messages'; - } - - $catalogue = $this->getCatalogue($locale); - $locale = $catalogue->getLocale(); - while (!$catalogue->defines($id, $domain)) { - if ($cat = $catalogue->getFallbackCatalogue()) { - $catalogue = $cat; - $locale = $catalogue->getLocale(); - } else { - break; - } - } - - if ($this->hasIntlFormatter && $catalogue->defines($id, $domain.MessageCatalogue::INTL_DOMAIN_SUFFIX)) { - return $this->formatter->formatIntl($catalogue->get($id, $domain), $locale, ['%count%' => $number] + $parameters); - } - - return $this->formatter->choiceFormat($catalogue->get($id, $domain), $number, $locale, $parameters); - } - - /** - * {@inheritdoc} - */ - public function getCatalogue($locale = null) - { - if (null === $locale) { - $locale = $this->getLocale(); - } else { - $this->assertValidLocale($locale); - } - - if (!isset($this->catalogues[$locale])) { - $this->loadCatalogue($locale); - } - - return $this->catalogues[$locale]; - } - - /** - * Gets the loaders. - * - * @return array LoaderInterface[] - */ - protected function getLoaders() - { - return $this->loaders; - } - - /** - * @param string $locale - */ - protected function loadCatalogue($locale) - { - if (null === $this->cacheDir) { - $this->initializeCatalogue($locale); - } else { - $this->initializeCacheCatalogue($locale); - } - } - - /** - * @param string $locale - */ - protected function initializeCatalogue($locale) - { - $this->assertValidLocale($locale); - - try { - $this->doLoadCatalogue($locale); - } catch (NotFoundResourceException $e) { - if (!$this->computeFallbackLocales($locale)) { - throw $e; - } - } - $this->loadFallbackCatalogues($locale); - } - - private function initializeCacheCatalogue(string $locale): void - { - if (isset($this->catalogues[$locale])) { - /* Catalogue already initialized. */ - return; - } - - $this->assertValidLocale($locale); - $cache = $this->getConfigCacheFactory()->cache($this->getCatalogueCachePath($locale), - function (ConfigCacheInterface $cache) use ($locale) { - $this->dumpCatalogue($locale, $cache); - } - ); - - if (isset($this->catalogues[$locale])) { - /* Catalogue has been initialized as it was written out to cache. */ - return; - } - - /* Read catalogue from cache. */ - $this->catalogues[$locale] = include $cache->getPath(); - } - - private function dumpCatalogue(string $locale, ConfigCacheInterface $cache): void - { - $this->initializeCatalogue($locale); - $fallbackContent = $this->getFallbackContent($this->catalogues[$locale]); - - $content = sprintf(<<<EOF -<?php - -use Symfony\Component\Translation\MessageCatalogue; - -\$catalogue = new MessageCatalogue('%s', %s); - -%s -return \$catalogue; - -EOF - , - $locale, - var_export($this->getAllMessages($this->catalogues[$locale]), true), - $fallbackContent - ); - - $cache->write($content, $this->catalogues[$locale]->getResources()); - } - - private function getFallbackContent(MessageCatalogue $catalogue): string - { - $fallbackContent = ''; - $current = ''; - $replacementPattern = '/[^a-z0-9_]/i'; - $fallbackCatalogue = $catalogue->getFallbackCatalogue(); - while ($fallbackCatalogue) { - $fallback = $fallbackCatalogue->getLocale(); - $fallbackSuffix = ucfirst(preg_replace($replacementPattern, '_', $fallback)); - $currentSuffix = ucfirst(preg_replace($replacementPattern, '_', $current)); - - $fallbackContent .= sprintf(<<<'EOF' -$catalogue%s = new MessageCatalogue('%s', %s); -$catalogue%s->addFallbackCatalogue($catalogue%s); - -EOF - , - $fallbackSuffix, - $fallback, - var_export($this->getAllMessages($fallbackCatalogue), true), - $currentSuffix, - $fallbackSuffix - ); - $current = $fallbackCatalogue->getLocale(); - $fallbackCatalogue = $fallbackCatalogue->getFallbackCatalogue(); - } - - return $fallbackContent; - } - - private function getCatalogueCachePath(string $locale): string - { - return $this->cacheDir.'/catalogue.'.$locale.'.'.strtr(substr(base64_encode(hash('sha256', serialize($this->cacheVary), true)), 0, 7), '/', '_').'.php'; - } - - /** - * @internal - */ - protected function doLoadCatalogue(string $locale): void - { - $this->catalogues[$locale] = new MessageCatalogue($locale); - - if (isset($this->resources[$locale])) { - foreach ($this->resources[$locale] as $resource) { - if (!isset($this->loaders[$resource[0]])) { - throw new RuntimeException(sprintf('The "%s" translation loader is not registered.', $resource[0])); - } - $this->catalogues[$locale]->addCatalogue($this->loaders[$resource[0]]->load($resource[1], $locale, $resource[2])); - } - } - } - - private function loadFallbackCatalogues(string $locale): void - { - $current = $this->catalogues[$locale]; - - foreach ($this->computeFallbackLocales($locale) as $fallback) { - if (!isset($this->catalogues[$fallback])) { - $this->initializeCatalogue($fallback); - } - - $fallbackCatalogue = new MessageCatalogue($fallback, $this->getAllMessages($this->catalogues[$fallback])); - foreach ($this->catalogues[$fallback]->getResources() as $resource) { - $fallbackCatalogue->addResource($resource); - } - $current->addFallbackCatalogue($fallbackCatalogue); - $current = $fallbackCatalogue; - } - } - - protected function computeFallbackLocales($locale) - { - if (null === $this->parentLocales) { - $parentLocales = json_decode(file_get_contents(__DIR__.'/Resources/data/parents.json'), true); - } - - $locales = []; - foreach ($this->fallbackLocales as $fallback) { - if ($fallback === $locale) { - continue; - } - - $locales[] = $fallback; - } - - while ($locale) { - $parent = $parentLocales[$locale] ?? null; - - if ($parent) { - $locale = 'root' !== $parent ? $parent : null; - } elseif (\function_exists('locale_parse')) { - $localeSubTags = locale_parse($locale); - $locale = null; - if (1 < \count($localeSubTags)) { - array_pop($localeSubTags); - $locale = locale_compose($localeSubTags) ?: null; - } - } elseif ($i = strrpos($locale, '_') ?: strrpos($locale, '-')) { - $locale = substr($locale, 0, $i); - } else { - $locale = null; - } - - if (null !== $locale) { - array_unshift($locales, $locale); - } - } - - return array_unique($locales); - } - - /** - * Asserts that the locale is valid, throws an Exception if not. - * - * @param string $locale Locale to tests - * - * @throws InvalidArgumentException If the locale contains invalid characters - */ - protected function assertValidLocale($locale) - { - if (1 !== preg_match('/^[a-z0-9@_\\.\\-]*$/i', $locale)) { - throw new InvalidArgumentException(sprintf('Invalid "%s" locale.', $locale)); - } - } - - /** - * Provides the ConfigCache factory implementation, falling back to a - * default implementation if necessary. - */ - private function getConfigCacheFactory(): ConfigCacheFactoryInterface - { - if (!$this->configCacheFactory) { - $this->configCacheFactory = new ConfigCacheFactory($this->debug); - } - - return $this->configCacheFactory; - } - - private function getAllMessages(MessageCatalogueInterface $catalogue): array - { - $allMessages = []; - - foreach ($catalogue->all() as $domain => $messages) { - if ($intlMessages = $catalogue->all($domain.MessageCatalogue::INTL_DOMAIN_SUFFIX)) { - $allMessages[$domain.MessageCatalogue::INTL_DOMAIN_SUFFIX] = $intlMessages; - $messages = array_diff_key($messages, $intlMessages); - } - if ($messages) { - $allMessages[$domain] = $messages; - } - } - - return $allMessages; - } -} diff --git a/vendor/symfony/translation/TranslatorBagInterface.php b/vendor/symfony/translation/TranslatorBagInterface.php deleted file mode 100644 index 5e49e2d..0000000 --- a/vendor/symfony/translation/TranslatorBagInterface.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; - -/** - * TranslatorBagInterface. - * - * @author Abdellatif Ait boudad <a.aitboudad@gmail.com> - */ -interface TranslatorBagInterface -{ - /** - * Gets the catalogue by locale. - * - * @param string|null $locale The locale or null to use the default - * - * @return MessageCatalogueInterface - * - * @throws InvalidArgumentException If the locale contains invalid characters - */ - public function getCatalogue($locale = null); -} diff --git a/vendor/symfony/translation/TranslatorInterface.php b/vendor/symfony/translation/TranslatorInterface.php deleted file mode 100644 index f677d24..0000000 --- a/vendor/symfony/translation/TranslatorInterface.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Contracts\Translation\LocaleAwareInterface; - -/** - * TranslatorInterface. - * - * @author Fabien Potencier <fabien@symfony.com> - * - * @deprecated since Symfony 4.2, use Symfony\Contracts\Translation\TranslatorInterface instead - */ -interface TranslatorInterface extends LocaleAwareInterface -{ - /** - * Translates the given message. - * - * @param string $id The message id (may also be an object that can be cast to string) - * @param array $parameters An array of parameters for the message - * @param string|null $domain The domain for the message or null to use the default - * @param string|null $locale The locale or null to use the default - * - * @return string The translated string - * - * @throws InvalidArgumentException If the locale contains invalid characters - */ - public function trans($id, array $parameters = [], $domain = null, $locale = null); - - /** - * Translates the given choice message by choosing a translation according to a number. - * - * @param string $id The message id (may also be an object that can be cast to string) - * @param int $number The number to use to find the index of the message - * @param array $parameters An array of parameters for the message - * @param string|null $domain The domain for the message or null to use the default - * @param string|null $locale The locale or null to use the default - * - * @return string The translated string - * - * @throws InvalidArgumentException If the locale contains invalid characters - */ - public function transChoice($id, $number, array $parameters = [], $domain = null, $locale = null); - - /** - * Sets the current locale. - * - * @param string $locale The locale - * - * @throws InvalidArgumentException If the locale contains invalid characters - */ - public function setLocale($locale); - - /** - * Returns the current locale. - * - * @return string The locale - */ - public function getLocale(); -} diff --git a/vendor/symfony/translation/Util/ArrayConverter.php b/vendor/symfony/translation/Util/ArrayConverter.php deleted file mode 100644 index 22c602e..0000000 --- a/vendor/symfony/translation/Util/ArrayConverter.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Util; - -/** - * ArrayConverter generates tree like structure from a message catalogue. - * e.g. this - * 'foo.bar1' => 'test1', - * 'foo.bar2' => 'test2' - * converts to follows: - * foo: - * bar1: test1 - * bar2: test2. - * - * @author Gennady Telegin <gtelegin@gmail.com> - */ -class ArrayConverter -{ - /** - * Converts linear messages array to tree-like array. - * For example this array('foo.bar' => 'value') will be converted to ['foo' => ['bar' => 'value']]. - * - * @param array $messages Linear messages array - * - * @return array Tree-like messages array - */ - public static function expandToTree(array $messages) - { - $tree = []; - - foreach ($messages as $id => $value) { - $referenceToElement = &self::getElementByPath($tree, explode('.', $id)); - - $referenceToElement = $value; - - unset($referenceToElement); - } - - return $tree; - } - - private static function &getElementByPath(array &$tree, array $parts) - { - $elem = &$tree; - $parentOfElem = null; - - foreach ($parts as $i => $part) { - if (isset($elem[$part]) && \is_string($elem[$part])) { - /* Process next case: - * 'foo': 'test1', - * 'foo.bar': 'test2' - * - * $tree['foo'] was string before we found array {bar: test2}. - * Treat new element as string too, e.g. add $tree['foo.bar'] = 'test2'; - */ - $elem = &$elem[implode('.', \array_slice($parts, $i))]; - break; - } - $parentOfElem = &$elem; - $elem = &$elem[$part]; - } - - if ($elem && \is_array($elem) && $parentOfElem) { - /* Process next case: - * 'foo.bar': 'test1' - * 'foo': 'test2' - * - * $tree['foo'] was array = {bar: 'test1'} before we found string constant `foo`. - * Cancel treating $tree['foo'] as array and cancel back it expansion, - * e.g. make it $tree['foo.bar'] = 'test1' again. - */ - self::cancelExpand($parentOfElem, $part, $elem); - } - - return $elem; - } - - private static function cancelExpand(array &$tree, $prefix, array $node) - { - $prefix .= '.'; - - foreach ($node as $id => $value) { - if (\is_string($value)) { - $tree[$prefix.$id] = $value; - } else { - self::cancelExpand($tree, $prefix.$id, $value); - } - } - } -} diff --git a/vendor/symfony/translation/Writer/TranslationWriter.php b/vendor/symfony/translation/Writer/TranslationWriter.php deleted file mode 100644 index d402443..0000000 --- a/vendor/symfony/translation/Writer/TranslationWriter.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Writer; - -use Symfony\Component\Translation\Dumper\DumperInterface; -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\Exception\RuntimeException; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * TranslationWriter writes translation messages. - * - * @author Michel Salib <michelsalib@hotmail.com> - */ -class TranslationWriter implements TranslationWriterInterface -{ - private $dumpers = []; - - /** - * Adds a dumper to the writer. - * - * @param string $format The format of the dumper - */ - public function addDumper($format, DumperInterface $dumper) - { - $this->dumpers[$format] = $dumper; - } - - /** - * Disables dumper backup. - * - * @deprecated since Symfony 4.1 - */ - public function disableBackup() - { - @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1.', __METHOD__), E_USER_DEPRECATED); - - foreach ($this->dumpers as $dumper) { - if (method_exists($dumper, 'setBackup')) { - $dumper->setBackup(false); - } - } - } - - /** - * Obtains the list of supported formats. - * - * @return array - */ - public function getFormats() - { - return array_keys($this->dumpers); - } - - /** - * Writes translation from the catalogue according to the selected format. - * - * @param string $format The format to use to dump the messages - * @param array $options Options that are passed to the dumper - * - * @throws InvalidArgumentException - */ - public function write(MessageCatalogue $catalogue, $format, $options = []) - { - if (!isset($this->dumpers[$format])) { - throw new InvalidArgumentException(sprintf('There is no dumper associated with format "%s".', $format)); - } - - // get the right dumper - $dumper = $this->dumpers[$format]; - - if (isset($options['path']) && !is_dir($options['path']) && !@mkdir($options['path'], 0777, true) && !is_dir($options['path'])) { - throw new RuntimeException(sprintf('Translation Writer was not able to create directory "%s"', $options['path'])); - } - - // save - $dumper->dump($catalogue, $options); - } -} diff --git a/vendor/symfony/translation/Writer/TranslationWriterInterface.php b/vendor/symfony/translation/Writer/TranslationWriterInterface.php deleted file mode 100644 index f7c56be..0000000 --- a/vendor/symfony/translation/Writer/TranslationWriterInterface.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php - -/* - * This file is part of the Symfony package. - * - * (c) Fabien Potencier <fabien@symfony.com> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Translation\Writer; - -use Symfony\Component\Translation\Exception\InvalidArgumentException; -use Symfony\Component\Translation\MessageCatalogue; - -/** - * TranslationWriter writes translation messages. - * - * @author Michel Salib <michelsalib@hotmail.com> - */ -interface TranslationWriterInterface -{ - /** - * Writes translation from the catalogue according to the selected format. - * - * @param string $format The format to use to dump the messages - * @param array $options Options that are passed to the dumper - * - * @throws InvalidArgumentException - */ - public function write(MessageCatalogue $catalogue, $format, $options = []); -} diff --git a/vendor/symfony/translation/composer.json b/vendor/symfony/translation/composer.json deleted file mode 100644 index 5b01b6d..0000000 --- a/vendor/symfony/translation/composer.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "symfony/translation", - "type": "library", - "description": "Symfony Translation 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": "^7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^1.1.6|^2" - }, - "require-dev": { - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/console": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/http-kernel": "^4.4", - "symfony/intl": "^3.4|^4.0|^5.0", - "symfony/service-contracts": "^1.1.2|^2", - "symfony/yaml": "^3.4|^4.0|^5.0", - "symfony/finder": "~2.8|~3.0|~4.0|^5.0", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/config": "<3.4", - "symfony/dependency-injection": "<3.4", - "symfony/http-kernel": "<4.4", - "symfony/yaml": "<3.4" - }, - "provide": { - "symfony/translation-implementation": "1.0" - }, - "suggest": { - "symfony/config": "", - "symfony/yaml": "", - "psr/log-implementation": "To use logging capability in translator" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Translation\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - } -} -- GitLab